(goto-char (1+ end))
(save-excursion
(goto-char beg)
- (if prefix
- (insert-before-markers prefix))
+ (when prefix
+ (insert-before-markers prefix))
(let ((button-beg (point)))
(insert-before-markers (notmuch-wash-button-label overlay) "\n")
(let ((button (make-button button-beg (1- (point))
"Excerpt citations and up to one signature."
(goto-char (point-min))
(beginning-of-line)
- (if (and (< (point) (point-max))
- (re-search-forward notmuch-wash-original-regexp nil t))
- (let* ((msg-start (match-beginning 0))
- (msg-end (point-max))
- (msg-lines (count-lines msg-start msg-end)))
- (notmuch-wash-region-to-button
- msg msg-start msg-end "original")))
+ (when (and (< (point) (point-max))
+ (re-search-forward notmuch-wash-original-regexp nil t))
+ (let* ((msg-start (match-beginning 0))
+ (msg-end (point-max))
+ (msg-lines (count-lines msg-start msg-end)))
+ (notmuch-wash-region-to-button
+ msg msg-start msg-end "original")))
(while (and (< (point) (point-max))
(re-search-forward notmuch-wash-citation-regexp nil t))
(let* ((cite-start (match-beginning 0))
(notmuch-wash-region-to-button
msg hidden-start (point-marker)
"citation")))))
- (if (and (not (eobp))
- (re-search-forward notmuch-wash-signature-regexp nil t))
- (let* ((sig-start (match-beginning 0))
- (sig-end (match-end 0))
- (sig-lines (count-lines sig-start (point-max))))
- (if (<= sig-lines notmuch-wash-signature-lines-max)
- (let ((sig-start-marker (make-marker))
- (sig-end-marker (make-marker)))
- (set-marker sig-start-marker sig-start)
- (set-marker sig-end-marker (point-max))
- (overlay-put (make-overlay sig-start-marker sig-end-marker)
- 'face 'message-cited-text)
- (notmuch-wash-region-to-button
- msg sig-start-marker sig-end-marker
- "signature"))))))
+ (when (and (not (eobp))
+ (re-search-forward notmuch-wash-signature-regexp nil t))
+ (let* ((sig-start (match-beginning 0))
+ (sig-end (match-end 0))
+ (sig-lines (count-lines sig-start (point-max))))
+ (when (<= sig-lines notmuch-wash-signature-lines-max)
+ (let ((sig-start-marker (make-marker))
+ (sig-end-marker (make-marker)))
+ (set-marker sig-start-marker sig-start)
+ (set-marker sig-end-marker (point-max))
+ (overlay-put (make-overlay sig-start-marker sig-end-marker)
+ 'face 'message-cited-text)
+ (notmuch-wash-region-to-button
+ msg sig-start-marker sig-end-marker
+ "signature"))))))
;;
(delete-region (match-beginning 1) (match-end 1)))
;; Remove a leading blank line.
(goto-char (point-min))
- (if (looking-at "\n")
- (delete-region (match-beginning 0) (match-end 0)))
+ (when (looking-at "\n")
+ (delete-region (match-beginning 0) (match-end 0)))
;; Remove a trailing blank line.
(goto-char (point-max))
- (if (looking-at "\n")
- (delete-region (match-beginning 0) (match-end 0))))
+ (when (looking-at "\n")
+ (delete-region (match-beginning 0) (match-end 0))))
;;
(patch-end (point-max))
part)
(goto-char patch-start)
- (if (or
- ;; Patch ends with signature.
- (re-search-forward notmuch-wash-signature-regexp nil t)
- ;; Patch ends with bugtraq comment.
- (re-search-forward "^\\*\\*\\* " nil t))
- (setq patch-end (match-beginning 0)))
+ (when (or
+ ;; Patch ends with signature.
+ (re-search-forward notmuch-wash-signature-regexp nil t)
+ ;; Patch ends with bugtraq comment.
+ (re-search-forward "^\\*\\*\\* " nil t))
+ (setq patch-end (match-beginning 0)))
(save-restriction
(narrow-to-region patch-start patch-end)
(setq part (plist-put part :content-type "inline patch"))