]> git.notmuchmail.org Git - notmuch/blobdiff - emacs/notmuch-jump.el
Use https instead of http where possible
[notmuch] / emacs / notmuch-jump.el
index 5eb0949be0c3757f2e26c84ad6bb3c42b978062b..963253c972656e2fe67e44b424e2397e69048da8 100644 (file)
@@ -1,4 +1,4 @@
-;; notmuch-jump.el --- User-friendly shortcut keys
+;;; notmuch-jump.el --- User-friendly shortcut keys
 ;;
 ;; Copyright © Austin Clements
 ;;
 ;; General Public License for more details.
 ;;
 ;; You should have received a copy of the GNU General Public License
-;; along with Notmuch.  If not, see <http://www.gnu.org/licenses/>.
+;; along with Notmuch.  If not, see <https://www.gnu.org/licenses/>.
 ;;
 ;; Authors: Austin Clements <aclements@csail.mit.edu>
 ;;          David Edmondson <dme@dme.org>
 
+;;; Code:
+
 (eval-when-compile (require 'cl))
 
 (require 'notmuch-lib)
 (require 'notmuch-hello)
 
-(unless (fboundp 'window-body-width)
-  ;; Compatibility for Emacs pre-24
-  (defalias 'window-body-width 'window-width))
+(eval-and-compile
+  (unless (fboundp 'window-body-width)
+    ;; Compatibility for Emacs pre-24
+    (defalias 'window-body-width 'window-width)))
 
 ;;;###autoload
 (defun notmuch-jump-search ()
@@ -51,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))
 
@@ -169,3 +174,9 @@ buffer."
           (setq notmuch-jump--action ',(third action))
           (exit-minibuffer))))
     map))
+
+;;
+
+(provide 'notmuch-jump)
+
+;;; notmuch-jump.el ends here