;; If the last line was not full (and hence did not include a
;; carriage return), insert one now.
- (if (not (eq (% count tags-per-line) 0))
- (widget-insert "\n"))
+ (unless (eq (% count tags-per-line) 0)
+ (widget-insert "\n"))
found-target-pos))
(defun notmuch-hello-goto-search ()
"Run notmuch and display saved searches, known tags, etc."
(interactive)
- ; Jump through a hoop to get this value from the deprecated variable
- ; name (`notmuch-folders') or from the default value.
- (if (not notmuch-saved-searches)
+ ;; Jump through a hoop to get this value from the deprecated variable
+ ;; name (`notmuch-folders') or from the default value.
+ (unless notmuch-saved-searches
(setq notmuch-saved-searches (notmuch-saved-searches)))
(if no-display
(length "Search: ")))
:action (lambda (widget &rest ignore)
(notmuch-hello-search (widget-value widget))))
- ;; add an invisible space to make `widget-end-of-line' ignore
- ;; trailine spaces in the search widget field
- (widget-insert " ")
+ ;; Add an invisible dot to make `widget-end-of-line' ignore
+ ;; trailing spaces in the search widget field. A dot is used
+ ;; instead of a space to make `show-trailing-whitespace'
+ ;; happy, i.e. avoid it marking the whole line as trailing
+ ;; spaces.
+ (widget-insert ".")
(put-text-property (1- (point)) (point) 'invisible t)
(widget-insert "\n")
(widget-insert "\n\n")
(let ((start (point)))
(setq found-target-pos (notmuch-hello-insert-tags alltags-alist widest target))
- (if (not final-target-pos)
- (setq final-target-pos found-target-pos))
+ (unless final-target-pos
+ (setq final-target-pos found-target-pos))
(indent-rigidly start (point) notmuch-hello-indent)))
(widget-insert "\n")
- (if (not notmuch-show-all-tags-list)
- (widget-create 'push-button
- :notify (lambda (widget &rest ignore)
- (setq notmuch-show-all-tags-list t)
- (notmuch-hello-update))
- "Show all tags")))
+ (unless notmuch-show-all-tags-list
+ (widget-create 'push-button
+ :notify (lambda (widget &rest ignore)
+ (setq notmuch-show-all-tags-list t)
+ (notmuch-hello-update))
+ "Show all tags")))
(let ((start (point)))
(widget-insert "\n\n")