mirror of https://github.com/djcb/mu.git
mu4e: support hiding bookmarks from main-screen/bookmarks
Using the :hide t property on a bookmark plist. The bookmark is still available throught the completion mechanism.
This commit is contained in:
parent
c95cd3c1aa
commit
1631d98b9e
10
NEWS.org
10
NEWS.org
|
@ -63,6 +63,16 @@
|
||||||
- Add message-id's to messages when saving drafts, so we can find them even
|
- Add message-id's to messages when saving drafts, so we can find them even
|
||||||
with ~mu4e-headers-skip-duplicates~.
|
with ~mu4e-headers-skip-duplicates~.
|
||||||
|
|
||||||
|
- Bookmarks (as in ~mu4e-bookmarks~) are now simple plists (instead of cl
|
||||||
|
structs). ~make-mu4e-bookmark~ has been updated to produce such plists (for
|
||||||
|
backward compatibility). A bookmark now looks like a list of e.g.
|
||||||
|
~(:name "My bookmark" :query "banana OR pear" :key ?f)~
|
||||||
|
this format is a bit easier extensible.
|
||||||
|
|
||||||
|
- For instance, we now recognize an attribute ~:hide t~, which will hide the
|
||||||
|
bookmark item from the main-screen (and speedbar), but keep it avilable
|
||||||
|
through the completion UI.
|
||||||
|
|
||||||
*** toys
|
*** toys
|
||||||
|
|
||||||
- Updated the ~mug~ toy UI to use Webkit2/GTK+. Note that this is just a toy
|
- Updated the ~mug~ toy UI to use Webkit2/GTK+. Note that this is just a toy
|
||||||
|
|
|
@ -142,10 +142,11 @@ clicked."
|
||||||
;; TODO: it's a bit uncool to hard-code the "b" shortcut...
|
;; TODO: it's a bit uncool to hard-code the "b" shortcut...
|
||||||
(mapconcat
|
(mapconcat
|
||||||
(lambda (bm)
|
(lambda (bm)
|
||||||
(mu4e~main-action-str
|
(unless (plist-get bm :hide)
|
||||||
(concat "\t* [b" (make-string 1 (plist-get bm :key)) "] "
|
(mu4e~main-action-str
|
||||||
(plist-get bm :name))
|
(concat "\t* [b" (make-string 1 (plist-get bm :key)) "] "
|
||||||
(concat "b" (make-string 1 (plist-get bm :key)))))
|
(plist-get bm :name))
|
||||||
|
(concat "b" (make-string 1 (plist-get bm :key))))))
|
||||||
(mu4e-bookmarks) "\n")
|
(mu4e-bookmarks) "\n")
|
||||||
"\n\n"
|
"\n\n"
|
||||||
(propertize " Misc\n\n" 'face 'mu4e-title-face)
|
(propertize " Misc\n\n" 'face 'mu4e-title-face)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
;;; mu4e-speedbar --- Speedbar support for mu4e -*- lexical-binding: t -*-
|
;;; mu4e-speedbar --- Speedbar support for mu4e -*- lexical-binding: t -*-
|
||||||
|
|
||||||
;; Copyright (C) 2012-2018 Antono Vasiljev, Dirk-Jan C. Binnema
|
;; Copyright (C) 2012-2020 Antono Vasiljev, Dirk-Jan C. Binnema
|
||||||
;;
|
;;
|
||||||
;; Author: Antono Vasiljev <self@antono.info>
|
;; Author: Antono Vasiljev <self@antono.info>
|
||||||
;; Version: 0.1
|
;; Version: 0.1
|
||||||
|
@ -56,10 +56,10 @@
|
||||||
"Install those variables used by speedbar to enhance mu4e."
|
"Install those variables used by speedbar to enhance mu4e."
|
||||||
(add-hook 'mu4e-context-changed-hook
|
(add-hook 'mu4e-context-changed-hook
|
||||||
(lambda()
|
(lambda()
|
||||||
(when (buffer-live-p speedbar-buffer)
|
(when (buffer-live-p speedbar-buffer)
|
||||||
(with-current-buffer speedbar-buffer
|
(with-current-buffer speedbar-buffer
|
||||||
(let ((inhibit-read-only t))
|
(let ((inhibit-read-only t))
|
||||||
(mu4e-speedbar-buttons))))))
|
(mu4e-speedbar-buttons))))))
|
||||||
(dolist (keymap
|
(dolist (keymap
|
||||||
'( mu4e-main-speedbar-key-map
|
'( mu4e-main-speedbar-key-map
|
||||||
mu4e-headers-speedbar-key-map
|
mu4e-headers-speedbar-key-map
|
||||||
|
@ -80,13 +80,13 @@
|
||||||
(when (buffer-live-p speedbar-buffer)
|
(when (buffer-live-p speedbar-buffer)
|
||||||
(with-current-buffer speedbar-buffer
|
(with-current-buffer speedbar-buffer
|
||||||
(mapcar (lambda (maildir-name)
|
(mapcar (lambda (maildir-name)
|
||||||
(speedbar-insert-button
|
(speedbar-insert-button
|
||||||
(concat " " maildir-name)
|
(concat " " maildir-name)
|
||||||
'mu4e-highlight-face
|
'mu4e-highlight-face
|
||||||
'highlight
|
'highlight
|
||||||
'mu4e~speedbar-maildir
|
'mu4e~speedbar-maildir
|
||||||
maildir-name))
|
maildir-name))
|
||||||
(mu4e-get-maildirs)))))
|
(mu4e-get-maildirs)))))
|
||||||
|
|
||||||
(defun mu4e~speedbar-maildir (&optional _text token _ident)
|
(defun mu4e~speedbar-maildir (&optional _text token _ident)
|
||||||
"Jump to maildir TOKEN. TEXT and INDENT are not used."
|
"Jump to maildir TOKEN. TEXT and INDENT are not used."
|
||||||
|
@ -98,12 +98,13 @@
|
||||||
"Insert the list of bookmarks in the speedbar"
|
"Insert the list of bookmarks in the speedbar"
|
||||||
(interactive)
|
(interactive)
|
||||||
(mapcar (lambda (bookmark)
|
(mapcar (lambda (bookmark)
|
||||||
(speedbar-insert-button
|
(unless (plist-get bookmark :hide)
|
||||||
(concat " " (plist-get bookmark :name))
|
(speedbar-insert-button
|
||||||
'mu4e-highlight-face
|
(concat " " (plist-get bookmark :name))
|
||||||
'highlight
|
'mu4e-highlight-face
|
||||||
'mu4e~speedbar-bookmark
|
'highlight
|
||||||
(plist-get bookmark :query)))
|
'mu4e~speedbar-bookmark
|
||||||
|
(plist-get bookmark :query))))
|
||||||
(mu4e-bookmarks)))
|
(mu4e-bookmarks)))
|
||||||
|
|
||||||
(defun mu4e~speedbar-bookmark (&optional _text token _ident)
|
(defun mu4e~speedbar-bookmark (&optional _text token _ident)
|
||||||
|
|
|
@ -209,6 +209,8 @@ If the string exceeds this limit, it will be truncated to fit."
|
||||||
- `query': the query for this bookmark. Either a literal string or a function
|
- `query': the query for this bookmark. Either a literal string or a function
|
||||||
that evaluates to a string."
|
that evaluates to a string."
|
||||||
`(:name ,name :query ,query :key ,key))
|
`(:name ,name :query ,query :key ,key))
|
||||||
|
(make-obsolete 'make-mu4e-bookmark "`unneeded; `mu4e-bookmarks'
|
||||||
|
are plists" "1.3.7")
|
||||||
|
|
||||||
(defcustom mu4e-bookmarks
|
(defcustom mu4e-bookmarks
|
||||||
'(( :name "Unread messages"
|
'(( :name "Unread messages"
|
||||||
|
@ -225,14 +227,15 @@ If the string exceeds this limit, it will be truncated to fit."
|
||||||
:key ?p))
|
:key ?p))
|
||||||
"List of pre-defined queries that are shown on the main screen.
|
"List of pre-defined queries that are shown on the main screen.
|
||||||
|
|
||||||
Each of the list elements is a plist with
|
Each of the list elements is a plist with at least:
|
||||||
three-element list of the
|
:name - the name of the queryt
|
||||||
form (QUERY DESCRIPTION KEY), where QUERY is a string with a mu
|
:query - the query expression
|
||||||
query, DESCRIPTION is a short description of the query (this will
|
:key - the shortcut key.
|
||||||
show up in the UI), and KEY is a shortcut key for the query."
|
|
||||||
:type '(repeat (plist (string :tag "Query")
|
Optionally, you add the following:
|
||||||
(string :tag "Description")
|
:hide - if t, bookmark is hdden from the main-view and speedbar.
|
||||||
character))
|
"
|
||||||
|
:type '(repeat (plist))
|
||||||
:group 'mu4e)
|
:group 'mu4e)
|
||||||
|
|
||||||
(defcustom mu4e-split-view 'horizontal
|
(defcustom mu4e-split-view 'horizontal
|
||||||
|
|
Loading…
Reference in New Issue