emacs: use string-empty-p

This commit is contained in:
Jonas Bernoulli 2021-01-10 15:01:09 +01:00 committed by David Bremner
parent f3d6fa2e40
commit 371f481d93
5 changed files with 7 additions and 7 deletions

View file

@ -285,7 +285,7 @@ depending on the value of `notmuch-poll-script'."
(interactive) (interactive)
(message "Polling mail...") (message "Polling mail...")
(if (stringp notmuch-poll-script) (if (stringp notmuch-poll-script)
(unless (string= notmuch-poll-script "") (unless (string-empty-p notmuch-poll-script)
(unless (equal (call-process notmuch-poll-script nil nil) 0) (unless (equal (call-process notmuch-poll-script nil nil) 0)
(error "Notmuch: poll script `%s' failed!" notmuch-poll-script))) (error "Notmuch: poll script `%s' failed!" notmuch-poll-script)))
(notmuch-call-notmuch-process "new")) (notmuch-call-notmuch-process "new"))

View file

@ -388,7 +388,7 @@ instead of `message-mode' and SWITCH-FUNCTION is mandatory."
(interactive) (interactive)
(when notmuch-mua-user-agent-function (when notmuch-mua-user-agent-function
(let ((user-agent (funcall notmuch-mua-user-agent-function))) (let ((user-agent (funcall notmuch-mua-user-agent-function)))
(unless (string= "" user-agent) (unless (string-empty-p user-agent)
(push (cons 'User-Agent user-agent) other-headers)))) (push (cons 'User-Agent user-agent) other-headers))))
(unless (assq 'From other-headers) (unless (assq 'From other-headers)
(push (cons 'From (message-make-from (push (cons 'From (message-make-from

View file

@ -333,7 +333,7 @@ operation on the contents of the current buffer."
(header (concat (header (concat
"Subject: " subject "\n" "Subject: " subject "\n"
"To: " to "\n" "To: " to "\n"
(if (not (string= cc "")) (if (not (string-empty-p cc))
(concat "Cc: " cc "\n") (concat "Cc: " cc "\n")
"") "")
"From: " from "\n" "From: " from "\n"
@ -1790,7 +1790,7 @@ user decision and we should not override it."
Reshows the current thread with matches defined by the new query-string." Reshows the current thread with matches defined by the new query-string."
(interactive (list (notmuch-read-query "Filter thread: "))) (interactive (list (notmuch-read-query "Filter thread: ")))
(let ((msg-id (notmuch-show-get-message-id))) (let ((msg-id (notmuch-show-get-message-id)))
(setq notmuch-show-query-context (if (string= query "") nil query)) (setq notmuch-show-query-context (if (string-empty-p query) nil query))
(notmuch-show-refresh-view t) (notmuch-show-refresh-view t)
(notmuch-show-goto-message msg-id))) (notmuch-show-goto-message msg-id)))

View file

@ -452,7 +452,7 @@ present or a \"-\" to indicate that the tag should be removed
from TAGS if present." from TAGS if present."
(let ((result-tags (copy-sequence tags))) (let ((result-tags (copy-sequence tags)))
(dolist (tag-change tag-changes) (dolist (tag-change tag-changes)
(let ((tag (and (not (string= tag-change "")) (let ((tag (and (not (string-empty-p tag-change))
(substring tag-change 1)))) (substring tag-change 1))))
(cl-case (aref tag-change 0) (cl-case (aref tag-change 0)
(?+ (unless (member tag result-tags) (?+ (unless (member tag result-tags)

View file

@ -814,13 +814,13 @@ non-authors is found, assume that all of the authors match."
(setq invisible-string (notmuch-search-author-propertize invisible-string))) (setq invisible-string (notmuch-search-author-propertize invisible-string)))
;; If there is any invisible text, add it as a tooltip to the ;; If there is any invisible text, add it as a tooltip to the
;; visible text. ;; visible text.
(unless (string= invisible-string "") (unless (string-empty-p invisible-string)
(setq visible-string (setq visible-string
(propertize visible-string (propertize visible-string
'help-echo (concat "..." invisible-string)))) 'help-echo (concat "..." invisible-string))))
;; Insert the visible and, if present, invisible author strings. ;; Insert the visible and, if present, invisible author strings.
(insert visible-string) (insert visible-string)
(unless (string= invisible-string "") (unless (string-empty-p invisible-string)
(let ((start (point)) (let ((start (point))
overlay) overlay)
(insert invisible-string) (insert invisible-string)