summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
f117d80)
Simply ensure that some subtractions never result in a negative
number, (since emacs complains when asked to create a string with a
negative length).
;; after the name.
(+ 9 1 widest)))))))
;; after the name.
(+ 9 1 widest)))))))
- (cons tags-per-line (/ (- (window-width) notmuch-hello-indent
- ;; Count is 9 wide (8 digits plus
- ;; space), 1 for the space after the
- ;; name.
- (* tags-per-line (+ 9 1)))
+ (cons tags-per-line (/ (max 1
+ (- (window-width) notmuch-hello-indent
+ ;; Count is 9 wide (8 digits plus
+ ;; space), 1 for the space after the
+ ;; name.
+ (* tags-per-line (+ 9 1))))
tags-per-line))))
(defun notmuch-hello-insert-tags (tag-alist widest target)
tags-per-line))))
(defun notmuch-hello-insert-tags (tag-alist widest target)
;; can just insert `(- widest (length name))' spaces -
;; the column separator is included in the button if
;; `(equal widest (length name)'.
;; can just insert `(- widest (length name))' spaces -
;; the column separator is included in the button if
;; `(equal widest (length name)'.
- (widget-insert (make-string (- widest (length name)) ? ))))
+ (widget-insert (make-string (max 1
+ (- widest (length name)))
+ ? ))))
(setq count (1+ count))
(if (eq (% count tags-per-line) 0)
(widget-insert "\n")))
(setq count (1+ count))
(if (eq (% count tags-per-line) 0)
(widget-insert "\n")))