(with-temp-buffer
(let ((standard-output (current-buffer)))
(Custom-make-dependencies "."))
- (message (buffer-string)))
+ (message (buffer-substring (point-min) (point-max))))
(require 'cus-load)
(byte-compile-file "custom-load.el")
;; select which header lines is to remain visible in the
;; article buffer.
(goto-char (point-min))
- (while (re-search-forward "^[^ \t]*:" nil t)
- (beginning-of-line)
+ (while (memq (char-after) '(?\t ?\ ))
+ (forward-line 1))
+ (while (not (eobp))
;; 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))
+ (forward-line 1)
+ (while (memq (char-after) '(?\t ?\ ))
+ (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
- (progn (beginning-of-line) (point))
+ (point)
(progn
- (end-of-line)
- (if (re-search-forward "^[^ \t]" nil t)
- (match-beginning 0)
- (point-max)))
+ (while (and (zerop (forward-line 1))
+ (memq (char-after) '(?\t ?\ ))))
+ (point))
'boring-headers)))
;; Hide boring Newsgroups header.
((eq elem 'newsgroups)
(gnus-article-hide-text-type
(progn (beginning-of-line) (point))
(progn
- (end-of-line)
- (if (re-search-forward "^[^ \t]" nil t)
- (match-beginning 0)
- (point-max)))
+ (while (and (zerop (forward-line 1))
+ (memq (char-after) '(?\t ?\ ))))
+ (point))
'boring-headers))))
(defun article-treat-dumbquotes ()
(adaptive-fill-mode t))
(while (not (eobp))
(and (>= (current-column) (min fill-column (window-width)))
- (not (eq (char-before) ?:))
+ (not (eq (preceding-char) ?:))
(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-string)))
+ (let ((buf (format "%s" (buffer-substring (point-min) (point-max))))
(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-string)))
+ (setq buf (format "%s" (buffer-substring (point-min) (point-max))))
(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)
- (if (re-search-forward "^[^ \t]" nil t)
- (forward-char -2)
- (goto-char (point-max)))
+ (while (and (zerop (forward-line 1))
+ (memq (char-after) '(?\t ?\ ))))
+ (unless (eobp)
+ ;; Go to the end of the previous line.
+ (end-of-line 0))
(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))
- (setq end (or (and (re-search-forward "^[^ \t]" nil t)
- (match-beginning 0))
- (point-max)))
+ (while (and (zerop (forward-line 1))
+ (memq (char-after) '(?\t ?\ ))))
+ (setq end (point))
(goto-char beg)
(while (re-search-forward (nth 1 entry) end t)
;; Each match within a header.
(if (and gnus-current-kill-article
(get-buffer gnus-summary-buffer))
;; Assume newsgroup is selected.
- (gnus-kill-file-apply-string (buffer-string))
+ (gnus-kill-file-apply-string (buffer-substring (point-min) (point-max)))
(ding) (gnus-message 2 "No newsgroup is selected.")))
(defun gnus-kill-file-apply-string (string)
(set-buffer errbuf)
(if (zerop (buffer-size))
(message "Article saved in folder: %s" folder)
- (message "%s" (buffer-string)))
+ (message "%s" (buffer-substring (point-min) (point-max))))
(kill-buffer errbuf))))
(setq gnus-newsgroup-last-folder folder)))
(gnus-remove-text-with-property 'gnus-next)
(insert
(prog1
- (format "%s" (buffer-string))
+ (format "%s" (buffer-substring (point-min) (point-max)))
(erase-buffer)))
;; Find the original headers.
(set-buffer gnus-original-article-buffer)
nil 'quiet)
(prog1 (make-glyph (vector 'xbm :file fname))
(delete-file fname))))
- (t (make-glyph (vector type :data (buffer-string))))))
+ (t (make-glyph
+ (vector type :data
+ (buffer-substring (point-min) (point-max)))))))
;;; Parsing of piconsearch result page.
(push (vector (gnus-soup-field)
(gnus-soup-field)
(gnus-soup-field)
- (and (eq (char-before) ?\t)
+ (and (eq (preceding-char) ?\t)
(gnus-soup-field))
- (and (eq (char-before) ?\t)
+ (and (eq (preceding-char) ?\t)
(string-to-int (gnus-soup-field))))
areas)
- (when (eq (char-before) ?\t)
+ (when (eq (preceding-char) ?\t)
(beginning-of-line 2)))
(kill-buffer (current-buffer))))
areas))
(push (vector (gnus-soup-field) (gnus-soup-field)
(gnus-soup-field))
replies)
- (when (eq (char-before) ?\t)
+ (when (eq (preceding-char) ?\t)
(beginning-of-line 2)))
(kill-buffer (current-buffer)))
replies))
(push el flist)))
(insert elem-type)
(push (car elem) flist))))
- (setq fstring (buffer-string)))
+ (setq fstring (buffer-substring (point-min) (point-max))))
;; Do some postprocessing to increase efficiency.
(setq
(setq subject (substring subject (match-end 0))))
(insert subject)
(inline (gnus-simplify-buffer-fuzzy))
- (buffer-string))))
+ (buffer-substring (point-min) (point-max)))))
(defsubst gnus-simplify-subject-fully (subject)
"Simplify a subject string according to gnus-summary-gather-subject-limit."
(save-excursion
(save-restriction
(message-narrow-to-head)
- (let ((head (buffer-string))
+ (let ((head (buffer-substring (point-min) (point-max)))
header)
(nnheader-temp-write nil
(insert (format "211 %d Article retrieved.\n"
(let (gnus-mark-article-hook)
(gnus-summary-select-article t t nil current-article))
(set-buffer gnus-original-article-buffer)
- (let ((buf (format "%s" (buffer-string))))
+ (let ((buf (format "%s" (buffer-substring (point-min) (point-max)))))
(nnheader-temp-write nil
(insert buf)
(goto-char (point-min))
(if (re-search-forward "^References: " nil t)
(progn
(re-search-forward "^[^ \t]" nil t)
- (forward-line -1)
- (end-of-line)
+ (end-of-line 0) ;; Go to the end of the previous line.
(insert " " message-id))
(insert "References: " message-id "\n"))
(unless (gnus-request-replace-article
(goto-char (point-min))
(while (search-forward "%" nil t)
(insert "%"))
- (buffer-string)))
+ (buffer-substring (point-min) (point-max))))
;; Make a hash table (default and minimum size is 256).
;; Optional argument HASHSIZE specifies the table size.
(gnus-xmas-call-region "icontopbm")
(gnus-xmas-call-region "ppmtoxpm")
(make-glyph
- (vector 'xpm :data (buffer-string))))))
+ (vector 'xpm :data
+ (buffer-substring (point-min) (point-max)))))))
(t
(make-glyph [nothing]))))
(ext (make-extent (progn
(set-buffer (gnus-get-buffer-create " *gnus nntp*"))
(buffer-disable-undo (current-buffer))
(insert-file-contents gnus-nntpserver-file)
- (let ((name (buffer-string)))
+ (let ((name (buffer-substring (point-min) (point-max))))
(prog1
(if (string-match "^[ \t\n]*$" name)
nil
(if (<= (point-max) md5-maximum-internal-length)
(mapconcat
(function (lambda (node) (format "%02x" node)))
- (md5-encode (buffer-string))
+ (md5-encode (buffer-substring (point-min) (point-max)))
"")
(call-process-region (point-min) (point-max)
(or shell-file-name "/bin/sh")
;; There might be a continuation header, so we have to search
;; until we find a new non-continuation line.
(progn
- (forward-line 1)
- (if (re-search-forward "^[^ \t]" nil t)
- (goto-char (match-beginning 0))
- (point-max)))))
- (forward-line 1)
- (if (re-search-forward "^[^ \t]" nil t)
- (goto-char (match-beginning 0))
- (point-max))))
+ (while (and (zerop (forward-line 1))
+ (memq (char-after) '(?\t ?\ ))))
+ (point))))
+ (while (and (zerop (forward-line 1))
+ (memq (char-after) '(?\t ?\ ))))))
number))
(defun message-narrow-to-headers ()
(defun message-next-header ()
"Go to the beginning of the next header."
- (beginning-of-line)
- (or (eobp) (forward-char 1))
- (not (if (re-search-forward "^[^ \t]" nil t)
- (beginning-of-line)
- (goto-char (point-max)))))
+ (while (and (zerop (forward-line 1))
+ (memq (char-after) '(?\t ?\ ))))
+ (not (eobp)))
(defun message-sort-headers-1 ()
"Sort the buffer as headers using `message-rank' text props."
(message-remove-header message-ignored-mail-headers t))
(goto-char (point-max))
;; require one newline at the end.
- (or (eq (char-before) ?\n)
+ (or (bolp)
(insert ?\n))
(when (and news
(or (message-fetch-field "cc")
(re-search-forward
(concat "^" (regexp-quote mail-header-separator) "\n"))
(replace-match "\n")
- (backward-char 1)
+ (forward-char -1)
(setq delimline (point-marker))
(run-hooks 'message-send-mail-hook)
;; Insert an extra newline if we need it to work around
(re-search-forward
(concat "^" (regexp-quote mail-header-separator) "\n"))
(replace-match "\n")
- (backward-char 1)
+ (forward-char -1)
(run-hooks 'message-send-mail-hook)
(if recipients
(let ((result (smtp-via-smtp user-mail-address
(message-remove-header message-ignored-news-headers t))
(goto-char (point-max))
;; require one newline at the end.
- (or (eq (char-before) ?\n)
+ (or (bolp)
(insert ?\n))
(setq result (message-maybe-split-and-send-news method)))
(kill-buffer tembuf))
(re-search-forward
(concat "^" (regexp-quote mail-header-separator) "\n"))
(replace-match "\n")
- (backward-char 1)
+ (forward-char -11)
(run-hooks 'message-send-news-hook)
;;(require (car method))
;;(funcall (intern (format "%s-open-server" (car method)))
(while (re-search-forward "[\t\n]+" nil t)
(replace-match "" t t))
(unless (zerop (buffer-size))
- (buffer-string)))))
+ (buffer-substring (point-min) (point-max))))))
(defun message-make-lines ()
"Count the number of lines and return numeric string."
(replace-match "\\1(\\3)" t)
(goto-char fullname-start)))
(insert ")")))
- (buffer-string))))
+ (buffer-substring (point-min) (point-max)))))
(defun message-make-sender ()
"Return the \"real\" user address.
(while (re-search-forward "[ \t]+" nil t)
(replace-match " " t t))
;; Remove addresses that match `rmail-dont-reply-to-names'.
- (insert (prog1 (rmail-dont-reply-to (buffer-string))
+ (insert (prog1 (rmail-dont-reply-to (buffer-substring
+ (point-min) (point-max)))
(erase-buffer)))
(goto-char (point-min))
;; Perhaps Mail-Copies-To: never removed the only address?
(mapcar
(lambda (addr)
(cons (mail-strip-quoted-names addr) addr))
- (message-tokenize-header (buffer-string))))
+ (message-tokenize-header (buffer-substring
+ (point-min) (point-max)))))
(let ((s ccalist))
(while s
(setq ccalist (delq (assoc (car (pop s)) s) ccalist)))))
(while (re-search-backward "[ \t]+$" nil t)
(replace-match ""))
- (buffer-string)))
+ (buffer-substring (point-min) (point-max))))
;;; Forwarding messages.
(nntp-send-buffer "^[23].*\n"))
(set-buffer nntp-server-buffer)
- (setq msg (buffer-string (point-min) (point-max)))
+ (setq msg (buffer-substring (point-min) (point-max)))
(or (string-match "^\\([0-9]+\\)" msg)
(error "nndb: %s" msg))
(setq art (substring msg (match-beginning 1) (match-end 1)))
(deffoo nndb-status-message (&optional server)
"Return server status as a string."
(set-buffer nntp-server-buffer)
- (buffer-string (point-min) (point-max)))
+ (buffer-substring (point-min) (point-max)))
;; Import stuff from nntp
;; Return the buffer contents.
((eq ,temp-file t)
(set-buffer ,temp-buffer)
- (buffer-string))
+ (buffer-substring (point-min) (point-max)))
;; Save a file.
(t
(set-buffer ,temp-buffer)
(delete-region (point-min) (match-end 0)))
(unless (yes-or-no-p
(format "movemail: %s (%d return). Continue? "
- (buffer-string) result))
- (error "%s" (buffer-string)))
+ (buffer-substring
+ (point-min) (point-max))
+ result))
+ (error "%s" (buffer-substring (point-min) (point-max))))
(setq tofile nil)))))))
(nnheader-message 5 "Getting mail from %s...done" inbox)
(and errors
;; Narrow to the status.
(narrow-to-region
(point)
- (if (re-search-forward "^[^ \t]" nil t)
- (1- (point))
- (point-max)))
+ (progn
+ (while (and (zerop (forward-line 1))
+ (memq (char-after) '(?\t ?\ ))))
+ (point)))
;; Go through all elements and add them to the list.
(goto-char (point-min))
(while (re-search-forward "[^ \t=]+" nil t)
(message-remove-header message-ignored-mail-headers t))
(goto-char (point-max))
;; require one newline at the end.
- (or (eq (char-before) ?\n)
+ (or (bolp)
(insert ?\n))
(let ((case-fold-search t))
;; Change header-delimiter to be what sendmail expects.
(re-search-forward
(concat "^" (regexp-quote real-header-separator) "\n"))
(replace-match "\n")
- (backward-char 1)
+ (forward-char -1)
(setq delimline (point-marker))
;; Insert an extra newline if we need it to work around
;; Sun's bug that swallows newlines.
;; Make status message by folding lines.
(while (re-search-forward "[ \t\n]+" nil t)
(replace-match " " t t))
- (nnheader-report 'nnspool "%s" (buffer-string))
+ (nnheader-report 'nnspool "%s" (buffer-substring
+ (point-min) (point-max)))
(nnheader-message 5 "nnspool: %s" nnspool-status-string)
(ding)
(run-hooks 'nnspool-rejected-article-hook))))
(defun nntp-read-server-type ()
"Find out what the name of the server we have connected to is."
;; Wait for the status string to arrive.
- (setq nntp-server-type (buffer-string))
+ (setq nntp-server-type (buffer-substring (point-min) (point-max)))
(let ((alist nntp-server-action-alist)
(case-fold-search t)
entry)
(defun nntp-snarf-error-message ()
"Save the error message in the current buffer."
- (let ((message (buffer-string)))
+ (let ((message (buffer-substring (point-min) (point-max))))
(while (string-match "[\r\n]+" message)
(setq message (replace-match " " t t message)))
(nnheader-report 'nntp message)
pop3-fma-movemail-program)
nil movemail-output-buffer nil
pop3-fma-commandline-arguments)
- (let ((string (buffer-string)))
+ (let ((string (buffer-substring (point-min) (point-max))))
(if (> (length string) 0)
(progn
(if (y-or-n-p