(defun notmuch-sort-saved-searches (alist)
"Generate an alphabetically sorted saved searches alist."
- (sort alist (lambda (a b) (string< (car a) (car b)))))
+ (sort (copy-sequence alist) (lambda (a b) (string< (car a) (car b)))))
(defcustom notmuch-saved-search-sort-function nil
"Function used to sort the saved searches for the notmuch-hello view.
;; just insert `(- widest (length name))' spaces - the
;; column separator is included in the button if
;; `(equal widest (length name)'.
- (widget-insert (make-string (max 1
+ (widget-insert (make-string (max 0
(- widest (length name)))
? )))))
(setq count (1+ count))
(notmuch-hello-update))
"hide"))
(widget-insert "\n")
- (let (target-pos
- (searches (apply 'notmuch-hello-query-counts query-alist options)))
- (when (and (not is-hidden)
- (or (not (plist-get options :hide-if-empty))
- searches))
- (widget-insert "\n")
- (setq target-pos
- (notmuch-hello-insert-buttons searches))
- (indent-rigidly start (point) notmuch-hello-indent)
- target-pos))))
+ (let (target-pos)
+ (when (not is-hidden)
+ (let ((searches (apply 'notmuch-hello-query-counts query-alist options)))
+ (when (or (not (plist-get options :hide-if-empty))
+ searches)
+ (widget-insert "\n")
+ (setq target-pos
+ (notmuch-hello-insert-buttons searches))
+ (indent-rigidly start (point) notmuch-hello-indent))))
+ target-pos)))
(defun notmuch-hello-insert-tags-section (&optional title &rest options)
"Insert a section displaying all tags with message counts.