X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=emacs%2Fnotmuch-hello.el;h=333d4c1ea633749cabb7dcf0e31f78241b1eadd2;hb=8392a7cc54c4c08c0abbf2cc2707774f504ec33f;hp=45cda2ec750617cd941a773bf199f882ef4d5093;hpb=e3260d025389c2e98dbda58cff1c214497813bc2;p=notmuch diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el index 45cda2ec..333d4c1e 100644 --- a/emacs/notmuch-hello.el +++ b/emacs/notmuch-hello.el @@ -86,8 +86,9 @@ Finally this can be a function that will be called for each tag and should return a filter for that tag, or nil to hide the tag." :type '(choice (const :tag "All messages" nil) (const :tag "Unread messages" "tag:unread") - (const :tag "Custom filter" string) - (const :tag "Custom filter function" function)) + (string :tag "Custom filter" + :value "tag:unread") + (function :tag "Custom filter function")) :group 'notmuch) (defcustom notmuch-hello-hide-tags nil @@ -131,10 +132,12 @@ So: (integer :tag "Number of characters") (float :tag "Fraction of window"))) -(defcustom notmuch-decimal-separator "," - "The string used as a decimal separator. +(defcustom notmuch-hello-thousands-separator " " + "The string used as a thousands separator. -Typically \",\" in the US and UK and \".\" in Europe." +Typically \",\" in the US and UK and \".\" or \" \" in Europe. +The latter is recommended in the SI/ISO 31-0 standard and by the +International Bureau of Weights and Measures." :group 'notmuch :type 'string) @@ -143,14 +146,20 @@ Typically \",\" in the US and UK and \".\" in Europe." :group 'notmuch :type 'hook) +(defcustom notmuch-hello-refresh-hook nil + "Functions called after updating a `notmuch-hello' buffer." + :type 'hook + :group 'notmuch) + (defvar notmuch-hello-url "http://notmuchmail.org" "The `notmuch' web site.") (defvar notmuch-hello-recent-searches nil) (defun notmuch-hello-remember-search (search) - (if (not (member search notmuch-hello-recent-searches)) - (push search notmuch-hello-recent-searches)) + (setq notmuch-hello-recent-searches + (delete search notmuch-hello-recent-searches)) + (push search notmuch-hello-recent-searches) (if (> (length notmuch-hello-recent-searches) notmuch-recent-searches-max) (setq notmuch-hello-recent-searches (butlast notmuch-hello-recent-searches)))) @@ -164,7 +173,7 @@ Typically \",\" in the US and UK and \".\" in Europe." (apply #'concat (number-to-string (car result)) (mapcar (lambda (elem) - (format "%s%03d" notmuch-decimal-separator elem)) + (format "%s%03d" notmuch-hello-thousands-separator elem)) (cdr result))))) (defun notmuch-hello-trim (search) @@ -590,7 +599,9 @@ Complete list of currently available key bindings: (widget-forward 1))) (unless (widget-at) - (notmuch-hello-goto-search))))) + (notmuch-hello-goto-search)))) + + (run-hooks 'notmuch-hello-refresh-hook)) (defun notmuch-folder () "Deprecated function for invoking notmuch---calling `notmuch' is preferred now."