]> git.notmuchmail.org Git - notmuch/blobdiff - emacs/notmuch.el
emacs: Fix "free variable" warning for notmuch-folder-show-empty.
[notmuch] / emacs / notmuch.el
index 117a365803ff76f423dc869afb9b612bb9f9798f..f887916cb4d14ec227bcc713dea483b717210031 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
@@ -1359,7 +1359,7 @@ Complete list of currently available key bindings:
   (setq buffer-read-only t)
   (if (not notmuch-tag-face-alist)
       (add-to-list 'notmuch-search-font-lock-keywords (list
-               "(\\([^)]*\\))$" '(1  'notmuch-tag-face)))
+               "(\\([^()]*\\))$" '(1  'notmuch-tag-face)))
     (let ((notmuch-search-tags (mapcar 'car notmuch-tag-face-alist)))
       (loop for notmuch-search-tag  in notmuch-search-tags
            do (add-to-list 'notmuch-search-font-lock-keywords (list
@@ -1507,11 +1507,12 @@ 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)
@@ -1732,7 +1733,8 @@ Currently available key bindings:
 (defun notmuch-folder-count (search)
   (car (process-lines notmuch-command "count" search)))
 
-(setq notmuch-folder-show-empty t)
+(defvar notmuch-folder-show-empty t
+  "Whether `notmuch-folder-mode' should display empty folders.")
 
 (defun notmuch-folder-show-empty-toggle ()
   "Toggle the listing of empty folders"