X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=emacs%2Fnotmuch-jump.el;h=963253c972656e2fe67e44b424e2397e69048da8;hp=05bbce5eaeadb8d8866749059c90b13b9d76e867;hb=6a833a6e83865f6999707cc30768d07e1351c2cb;hpb=3c1ad5bfa0039191f1202b0542eb3af7afd16c5c diff --git a/emacs/notmuch-jump.el b/emacs/notmuch-jump.el index 05bbce5e..963253c9 100644 --- a/emacs/notmuch-jump.el +++ b/emacs/notmuch-jump.el @@ -1,4 +1,4 @@ -;; notmuch-jump.el --- User-friendly shortcut keys +;;; notmuch-jump.el --- User-friendly shortcut keys ;; ;; Copyright © Austin Clements ;; @@ -15,16 +15,23 @@ ;; General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License -;; along with Notmuch. If not, see . +;; along with Notmuch. If not, see . ;; ;; Authors: Austin Clements ;; David Edmondson +;;; Code: + (eval-when-compile (require 'cl)) (require 'notmuch-lib) (require 'notmuch-hello) +(eval-and-compile + (unless (fboundp 'window-body-width) + ;; Compatibility for Emacs pre-24 + (defalias 'window-body-width 'window-width))) + ;;;###autoload (defun notmuch-jump-search () "Jump to a saved search by shortcut key. @@ -47,9 +54,11 @@ fast way to jump to a saved search from anywhere in Notmuch." (case (plist-get saved-search :sort-order) (newest-first nil) (oldest-first t) - (otherwise (default-value notmuch-search-oldest-first))))) + (otherwise (default-value 'notmuch-search-oldest-first))))) (push (list key name - `(lambda () (notmuch-search ',query ',oldest-first))) + (if (eq (plist-get saved-search :search-type) 'tree) + `(lambda () (notmuch-tree ',query)) + `(lambda () (notmuch-search ',query ',oldest-first)))) action-map))))) (setq action-map (nreverse action-map)) @@ -166,8 +175,8 @@ buffer." (exit-minibuffer)))) map)) -(unless (fboundp 'window-body-width) - ;; Compatibility for Emacs pre-24 - (defun window-body-width (&optional window) - (let ((edges (window-inside-edges window))) - (- (caddr edges) (car edges))))) +;; + +(provide 'notmuch-jump) + +;;; notmuch-jump.el ends here