Other accepted forms are a cons cell of the form (NAME . QUERY)
or a list of the form (NAME QUERY COUNT-QUERY)."
-;; The saved-search format is also used by the all-tags notmuch-hello
-;; section. This section generates its own saved-search list in one of
-;; the latter two forms.
+ ;; The saved-search format is also used by the all-tags notmuch-hello
+ ;; section. This section generates its own saved-search list in one of
+ ;; the latter two forms.
:get 'notmuch-hello--saved-searches-to-plist
:type '(repeat notmuch-saved-search-plist)
:tag "List of Saved Searches"
(setq n (/ n 1000)))
(setq result (or result '(0)))
(apply #'concat
- (number-to-string (car result))
- (mapcar (lambda (elem)
- (format "%s%03d" notmuch-hello-thousands-separator elem))
- (cdr result)))))
+ (number-to-string (car result))
+ (mapcar (lambda (elem)
+ (format "%s%03d" notmuch-hello-thousands-separator elem))
+ (cdr result)))))
(defun notmuch-hello-trim (search)
"Trim whitespace."
(notmuch-hello-filtered-query count-query
(or (plist-get options :filter-count)
(plist-get options :filter))))
- "\n")))
+ "\n")))
(unless (= (call-process-region (point-min) (point-max) notmuch-command
t t nil "count" "--batch") 0)
(notmuch-logged-error
(mapc (lambda (elem)
;; (not elem) indicates an empty slot in the matrix.
(when elem
- (if (> column-indent 0)
- (widget-insert (make-string column-indent ? )))
+ (when (> column-indent 0)
+ (widget-insert (make-string column-indent ? )))
(let* ((name (plist-get elem :name))
(query (plist-get elem :query))
(oldest-first (cl-case (plist-get elem :sort-order)
name)
(setq column-indent
(1+ (max 0 (- column-width (length name)))))))
- (setq count (1+ count))
+ (cl-incf count)
(when (eq (% count tags-per-line) 0)
(setq column-indent 0)
(widget-insert "\n")))
(dolist (window (window-list))
(let ((last-buf (window-parameter window 'notmuch-hello-last-buffer))
(cur-buf (window-buffer window)))
- (when (not (eq last-buf cur-buf))
+ (unless (eq last-buf cur-buf)
;; This window changed or is new. Update recorded buffer
;; for next time.
(set-window-parameter window 'notmuch-hello-last-buffer cur-buf)
;; 24, we can't do it right here because something in this
;; hook's call stack overrides hello's point placement.
(run-at-time nil nil #'notmuch-hello t))
- (when (null hello-buf)
+ (unless hello-buf
;; Clean up hook
(remove-hook 'window-configuration-change-hook
#'notmuch-hello-window-configuration-change))))
(define-key map (kbd "<C-tab>") 'widget-backward)
map)
"Keymap for \"notmuch hello\" buffers.")
-(fset 'notmuch-hello-mode-map notmuch-hello-mode-map)
(define-derived-mode notmuch-hello-mode fundamental-mode "notmuch-hello"
- "Major mode for convenient notmuch navigation. This is your entry portal into notmuch.
+ "Major mode for convenient notmuch navigation. This is your entry portal into notmuch.
Saved searches are \"bookmarks\" for arbitrary queries. Hit RET
or click on a saved search to view matching threads. Edit saved
Complete list of currently available key bindings:
\\{notmuch-hello-mode-map}"
- (setq notmuch-buffer-refresh-function #'notmuch-hello-update)
- ;;(setq buffer-read-only t)
-)
+ (setq notmuch-buffer-refresh-function #'notmuch-hello-update)
+ ;;(setq buffer-read-only t)
+ )
(defun notmuch-hello-generate-tag-alist (&optional hide-tags)
"Return an alist from tags to queries to display in the all-tags section."
the same values as :filter. If :filter and :filter-count are specified, this
will be used instead of :filter, not in conjunction with it."
(widget-insert title ": ")
- (if (and notmuch-hello-first-run (plist-get options :initially-hidden))
- (add-to-list 'notmuch-hello-hidden-sections title))
+ (when (and notmuch-hello-first-run (plist-get options :initially-hidden))
+ (add-to-list 'notmuch-hello-hidden-sections title))
(let ((is-hidden (member title notmuch-hello-hidden-sections))
(start (point)))
(if is-hidden
(notmuch-hello-update))
"hide"))
(widget-insert "\n")
- (when (not is-hidden)
+ (unless is-hidden
(let ((searches (apply 'notmuch-hello-query-counts query-list options)))
(when (or (not (plist-get options :hide-if-empty))
searches)