]> git.notmuchmail.org Git - notmuch/blobdiff - emacs/notmuch.el
emacs: Remove excess empty lines
[notmuch] / emacs / notmuch.el
index dd18f2e13666bca5ad50d796586296209691cb08..04334c7647ce625d245ff9fb77c2b030d239e614 100644 (file)
@@ -516,7 +516,9 @@ thread."
                      (current-buffer)
                      notmuch-search-query-string
                      ;; Name the buffer based on the subject.
-                     (concat "*" (truncate-string-to-width subject 30 nil nil t) "*"))
+                     (concat "*"
+                             (truncate-string-to-width subject 30 nil nil t)
+                             "*"))
       (message "End of search results."))))
 
 (defun notmuch-tree-from-search-current-query ()
@@ -753,7 +755,6 @@ non-authors is found, assume that all of the authors match."
           (visible-string formatted-authors)
           (invisible-string "")
           (padding ""))
-
       ;; Truncate the author string to fit the specification.
       (if (> (length formatted-authors)
             (length formatted-sample))
@@ -780,7 +781,6 @@ non-authors is found, assume that all of the authors match."
                                          (length visible-string)
                                          (length "..."))
                                       ? ))))
-
       ;; Use different faces to show matching and non-matching authors.
       (if (string-match "\\(.*\\)|\\(.*\\)" visible-string)
          ;; The visible string contains both matching and
@@ -796,12 +796,12 @@ non-authors is found, assume that all of the authors match."
              ;; The invisible string may contain both matching and
              ;; non-matching authors.
              invisible-string (notmuch-search-author-propertize invisible-string)))
-
       ;; If there is any invisible text, add it as a tooltip to the
       ;; visible text.
       (when (not (string= invisible-string ""))
-       (setq visible-string (propertize visible-string 'help-echo (concat "..." invisible-string))))
-
+       (setq visible-string
+             (propertize visible-string
+                         'help-echo (concat "..." invisible-string))))
       ;; Insert the visible and, if present, invisible author strings.
       (insert visible-string)
       (when (not (string= invisible-string ""))
@@ -827,11 +827,9 @@ non-authors is found, assume that all of the authors match."
     (insert (propertize (format format-string
                                (notmuch-sanitize (plist-get result :subject)))
                        'face 'notmuch-search-subject)))
-
    ((string-equal field "authors")
     (notmuch-search-insert-authors
      format-string (notmuch-sanitize (plist-get result :authors))))
-
    ((string-equal field "tags")
     (let ((tags (plist-get result :tags))
          (orig-tags (plist-get result :orig-tags)))
@@ -892,7 +890,8 @@ See `notmuch-tag' for information on the format of TAG-CHANGES."
                (longest-length 0))
            (cl-loop for tuple in notmuch-saved-searches
                     if (let ((quoted-query
-                              (regexp-quote (notmuch-saved-search-get tuple :query))))
+                              (regexp-quote
+                               (notmuch-saved-search-get tuple :query))))
                          (and (string-match (concat "^" quoted-query) query)
                               (> (length (match-string 0 query))
                                  longest-length)))
@@ -905,9 +904,10 @@ See `notmuch-tag' for information on the format of TAG-CHANGES."
           (concat "*notmuch-saved-search-" saved-search-name "*"))
          (saved-search
           (concat "*notmuch-search-"
-                  (replace-regexp-in-string (concat "^" (regexp-quote saved-search-query))
-                                            (concat "[ " saved-search-name " ]")
-                                            query)
+                  (replace-regexp-in-string
+                   (concat "^" (regexp-quote saved-search-query))
+                   (concat "[ " saved-search-name " ]")
+                   query)
                   "*"))
          (t
           (concat "*notmuch-search-" query "*"))
@@ -926,7 +926,8 @@ PROMPT is the string to prompt with."
                       "subject:" "attachment:")
                 (mapcar (lambda (tag) (concat "tag:" tag)) all-tags)
                 (mapcar (lambda (tag) (concat "is:" tag)) all-tags)
-                (mapcar (lambda (mimetype) (concat "mimetype:" mimetype)) (mailcap-mime-types)))))
+                (mapcar (lambda (mimetype) (concat "mimetype:" mimetype))
+                        (mailcap-mime-types)))))
     (let ((keymap (copy-keymap minibuffer-local-map))
          (current-query (cl-case major-mode
                           (notmuch-search-mode (notmuch-search-get-query))
@@ -987,7 +988,11 @@ the configured default sort order."
     (if no-display
        (set-buffer buffer)
       (switch-to-buffer buffer))
-    (notmuch-search-mode)
+    ;; avoid wiping out third party buffer-local variables in the case
+    ;; where we're just refreshing or changing the sort order of an
+    ;; existing search results buffer
+    (unless (eq major-mode 'notmuch-search-mode)
+      (notmuch-search-mode))
     ;; Don't track undo information for this buffer
     (set 'buffer-undo-list t)
     (set 'notmuch-search-query-string query)
@@ -1074,8 +1079,10 @@ current search results AND the additional query string provided."
 Runs a new search matching only messages that match both the
 current search results AND that are tagged with the given tag."
   (interactive
-   (list (notmuch-select-tag-with-completion "Filter by tag: " notmuch-search-query-string)))
-  (notmuch-search (concat notmuch-search-query-string " and tag:" tag) notmuch-search-oldest-first))
+   (list (notmuch-select-tag-with-completion "Filter by tag: "
+                                            notmuch-search-query-string)))
+  (notmuch-search (concat notmuch-search-query-string " and tag:" tag)
+                 notmuch-search-oldest-first))
 
 (defun notmuch-search-by-tag (tag)
   "Display threads matching TAG in a notmuch-search buffer."
@@ -1105,7 +1112,6 @@ current search results AND that are tagged with the given tag."
 If the current buffer is the only notmuch buffer, bury it. If no
 notmuch buffers exist, run `notmuch'."
   (interactive)
-
   (let (start first)
     ;; If the current buffer is a notmuch buffer, remember it and then
     ;; bury it.