]> git.notmuchmail.org Git - notmuch/blobdiff - emacs/notmuch.el
configure: Fix installation of library to work with alternate --prefix
[notmuch] / emacs / notmuch.el
index 904272dfd9cc36b89b22d58df348eeff71cee3a4..439303a77d3a6d3b7de679f2facb7c9b97aefe59 100644 (file)
@@ -1213,7 +1213,7 @@ matching this search term are shown if non-nil. "
          (notmuch-show-next-open-message))
       )))
 
-(defvar notmuch-search-authors-width 40
+(defvar notmuch-search-authors-width 20
   "Number of columns to use to display authors in a notmuch-search buffer.")
 
 (defvar notmuch-search-mode-map
@@ -1482,7 +1482,7 @@ This function advances the next thread when finished."
                            (insert (format " (process returned %d)" exit-status)))
                        (insert "\n")
                        (if (and atbob
-                                notmuch-search-target-thread)
+                                (not (string= notmuch-search-target-thread "found")))
                            (set 'never-found-target-thread t))))))
              (if (and never-found-target-thread
                       notmuch-search-target-line)
@@ -1507,19 +1507,19 @@ This function advances the next thread when finished."
                           (authors-length (length authors))
                           (subject (match-string 5 string))
                           (tags (match-string 6 string)))
-                     (if (> authors-length 40)
-                         (set 'authors (concat (substring authors 0 (- 40 3)) "...")))
+                     (if (> authors-length notmuch-search-authors-width)
+                         (set 'authors (concat (substring authors 0 (- notmuch-search-authors-width 3)) "...")))
                      (goto-char (point-max))
-                     (let ((beg (point-marker)))
-                       (insert (format "%s %-7s %-40s %s (%s)\n" date count authors subject tags))
+                     (let ((beg (point-marker))
+                           (format-string (format "%%s %%-7s %%-%ds %%s (%%s)\n" notmuch-search-authors-width)))
+                       (insert (format format-string date count authors subject tags))
                        (put-text-property beg (point-marker) 'notmuch-search-thread-id thread-id)
                        (put-text-property beg (point-marker) 'notmuch-search-authors authors)
                        (put-text-property beg (point-marker) 'notmuch-search-subject subject)
-                       (if (and notmuch-search-target-thread
-                                (string= thread-id notmuch-search-target-thread))
+                       (if (string= thread-id notmuch-search-target-thread)
                            (progn
                              (set 'found-target beg)
-                             (set 'notmuch-search-target-thread nil))))
+                             (set 'notmuch-search-target-thread "found"))))
                      (set 'line (match-end 0)))
                  (set 'more nil)))))
          (if found-target