;; select which header lines is to remain visible in the
;; article buffer.
(goto-char (point-min))
- (while (memq (char-after) '(?\t ?\ ))
- (forward-line 1))
- (while (not (eobp))
+ (while (re-search-forward "^[^ \t]*:" nil t)
+ (beginning-of-line)
;; Mark the rank of the header.
(put-text-property
(point) (1+ (point)) 'message-rank
(not (looking-at ignored))))
(gnus-article-header-rank)
(+ 2 max)))
- (forward-line 1)
- (while (memq (char-after) '(?\t ?\ ))
- (forward-line 1)))
+ (forward-line 1))
(message-sort-headers-1)
(when (setq beg (text-property-any
(point-min) (point-max) 'message-rank (+ 2 max)))
(while (re-search-forward "^[^:]+:[ \t]*\n[^ \t]" nil t)
(forward-line -1)
(gnus-article-hide-text-type
- (point)
+ (progn (beginning-of-line) (point))
(progn
- (while (and (zerop (forward-line 1))
- (memq (char-after) '(?\t ?\ ))))
- (point))
+ (end-of-line)
+ (if (re-search-forward "^[^ \t]" nil t)
+ (match-beginning 0)
+ (point-max)))
'boring-headers)))
;; Hide boring Newsgroups header.
((eq elem 'newsgroups)
(gnus-article-hide-text-type
(progn (beginning-of-line) (point))
(progn
- (while (and (zerop (forward-line 1))
- (memq (char-after) '(?\t ?\ ))))
- (point))
+ (end-of-line)
+ (if (re-search-forward "^[^ \t]" nil t)
+ (match-beginning 0)
+ (point-max)))
'boring-headers))))
(defun article-treat-dumbquotes ()
(adaptive-fill-mode t))
(while (not (eobp))
(and (>= (current-column) (min fill-column (window-width)))
- (not (eq (preceding-char) ?:))
+ (not (eq (char-before) ?:))
(fill-paragraph nil))
(end-of-line 2))))))
"Exit the article editing without updating."
(interactive)
;; We remove all text props from the article buffer.
- (let ((buf (format "%s" (buffer-substring (point-min) (point-max))))
+ (let ((buf (format "%s" (buffer-string)))
(curbuf (current-buffer))
(p (point))
(window-start (window-start)))
(setq font-lock-defaults nil)
(font-lock-mode 0))
;; We remove all text props from the article buffer.
- (setq buf (format "%s" (buffer-substring (point-min) (point-max))))
+ (setq buf (format "%s" (buffer-string)))
(set-buffer (get-buffer-create gnus-original-article-buffer))
(erase-buffer)
(insert buf)
(when (and field-face
(not (memq (setq from (point)) fpoints)))
(push from fpoints)
- (while (and (zerop (forward-line 1))
- (memq (char-after) '(?\t ?\ ))))
- (unless (eobp)
- ;; Go to the end of the previous line.
- (end-of-line 0))
+ (if (re-search-forward "^[^ \t]" nil t)
+ (forward-char -2)
+ (goto-char (point-max)))
(gnus-put-text-property from (point) 'face field-face))))))))
(defun gnus-article-highlight-signature ()
(while (re-search-forward (car entry) nil t)
;; Each header matching the entry.
(setq beg (match-beginning 0))
- (while (and (zerop (forward-line 1))
- (memq (char-after) '(?\t ?\ ))))
- (setq end (point))
+ (setq end (or (and (re-search-forward "^[^ \t]" nil t)
+ (match-beginning 0))
+ (point-max)))
(goto-char beg)
(while (re-search-forward (nth 1 entry) end t)
;; Each match within a header.