From 0cbafd8ac1786238242dd66313e7278b4e2e4aea Mon Sep 17 00:00:00 2001 From: Jesper Harder Date: Mon, 5 Jan 2004 17:03:24 +0000 Subject: [PATCH] * spam.el (spam-point-at-eol): Replace with point-at-eol. * smime.el (smime-point-at-eol): Replace with point-at-eol. * rfc2047.el (rfc2047-point-at-bol, rfc2047-point-at-eol): Replace with point-at-{eol,bol}. * netrc.el (netrc-point-at-eol): Replace with point-at-eol. * imap.el (imap-point-at-eol): Replace with point-at-eol. * flow-fill.el (fill-flowed-point-at-bol, fill-flowed-point-at-eol): Replace with point-at-{eol,bol}. --- lisp/ChangeLog | 14 ++++++++++++++ lisp/flow-fill.el | 15 ++------------- lisp/imap.el | 12 ++---------- lisp/netrc.el | 8 +------- lisp/rfc2047.el | 30 +++++++++--------------------- lisp/smime.el | 7 ------- lisp/spam.el | 9 ++------- 7 files changed, 30 insertions(+), 65 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 01ba6b97d..7dce9b505 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,19 @@ 2004-01-05 Jesper Harder + * spam.el (spam-point-at-eol): Replace with point-at-eol. + + * smime.el (smime-point-at-eol): Replace with point-at-eol. + + * rfc2047.el (rfc2047-point-at-bol, rfc2047-point-at-eol): Replace + with point-at-{eol,bol}. + + * netrc.el (netrc-point-at-eol): Replace with point-at-eol. + + * imap.el (imap-point-at-eol): Replace with point-at-eol. + + * flow-fill.el (fill-flowed-point-at-bol, + fill-flowed-point-at-eol): Replace with point-at-{eol,bol}. + * gnus-util.el (gnus-point-at-bol, gnus-point-at-eol): Remove. Replace with point-at-{eol,bol} throughout all files. diff --git a/lisp/flow-fill.el b/lisp/flow-fill.el index cec77391c..db24c4e94 100644 --- a/lisp/flow-fill.el +++ b/lisp/flow-fill.el @@ -70,17 +70,6 @@ RFC 2646 suggests 66 characters for readability." (sexp) (integer))) -(eval-and-compile - (defalias 'fill-flowed-point-at-bol - (if (fboundp 'point-at-bol) - 'point-at-bol - 'line-beginning-position)) - - (defalias 'fill-flowed-point-at-eol - (if (fboundp 'point-at-eol) - 'point-at-eol - 'line-end-position))) - ;;;###autoload (defun fill-flowed-encode (&optional buffer) (with-current-buffer (or buffer (current-buffer)) @@ -142,8 +131,8 @@ RFC 2646 suggests 66 characters for readability." (let ((fill-prefix (when quote (concat quote " "))) (fill-column (eval fill-flowed-display-column)) filladapt-mode) - (fill-region (fill-flowed-point-at-bol) - (min (1+ (fill-flowed-point-at-eol)) + (fill-region (point-at-bol) + (min (1+ (point-at-eol)) (point-max)) 'left 'nosqueeze)) (error diff --git a/lisp/imap.el b/lisp/imap.el index 485c9039c..7e0c9b974 100644 --- a/lisp/imap.el +++ b/lisp/imap.el @@ -153,15 +153,7 @@ (autoload 'utf7-decode "utf7") (autoload 'format-spec "format-spec") (autoload 'format-spec-make "format-spec") - (autoload 'open-tls-stream "tls") - ;; Avoid use gnus-point-at-eol so we're independent of Gnus. These - ;; days we have point-at-eol anyhow. - (if (fboundp 'point-at-eol) - (defalias 'imap-point-at-eol 'point-at-eol) - (defun imap-point-at-eol () - (save-excursion - (end-of-line) - (point))))) + (autoload 'open-tls-stream "tls")) ;; User variables. @@ -2452,7 +2444,7 @@ Return nil if no complete line has arrived." ;; next line for Courier IMAP bug. (skip-chars-forward " ") (point))) - (> (skip-chars-forward "^ )" (imap-point-at-eol)) 0)) + (> (skip-chars-forward "^ )" (point-at-eol)) 0)) (push (buffer-substring start (point)) flag-list)) (assert (eq (char-after) ?\)) t "In imap-parse-flag-list") (imap-forward) diff --git a/lisp/netrc.el b/lisp/netrc.el index 3bfc76d90..184128ea4 100644 --- a/lisp/netrc.el +++ b/lisp/netrc.el @@ -34,12 +34,6 @@ ;;; .netrc and .authinforc parsing ;;; -(eval-and-compile - (defalias 'netrc-point-at-eol - (if (fboundp 'point-at-eol) - 'point-at-eol - 'line-end-position))) - (defun netrc-parse (file) "Parse FILE and return an list of all entries in the file." (when (file-exists-p file) @@ -52,7 +46,7 @@ (goto-char (point-min)) ;; Go through the file, line by line. (while (not (eobp)) - (narrow-to-region (point) (netrc-point-at-eol)) + (narrow-to-region (point) (point-at-eol)) ;; For each line, get the tokens and values. (while (not (eobp)) (skip-chars-forward "\t ") diff --git a/lisp/rfc2047.el b/lisp/rfc2047.el index d4d6e9611..cc8f52fea 100644 --- a/lisp/rfc2047.el +++ b/lisp/rfc2047.el @@ -55,18 +55,6 @@ Value is what BODY returns." (require 'base64) (autoload 'mm-body-7-or-8 "mm-bodies") -(eval-and-compile - ;; Avoid gnus-util for mm- code. - (defalias 'rfc2047-point-at-bol - (if (fboundp 'point-at-bol) - 'point-at-bol - 'line-beginning-position)) - - (defalias 'rfc2047-point-at-eol - (if (fboundp 'point-at-eol) - 'point-at-eol - 'line-end-position))) - (defvar rfc2047-header-encoding-alist '(("Newsgroups" . nil) ("Followup-To" . nil) @@ -134,7 +122,7 @@ quoted-printable and base64 respectively.") (progn (forward-line 1) (if (re-search-forward "^[^ \n\t]" nil t) - (rfc2047-point-at-bol) + (point-at-bol) (point-max)))) (goto-char (point-min))) @@ -424,7 +412,7 @@ By default, the region is treated as containing addresses (see (t 8))) (pre (- b (save-restriction (widen) - (rfc2047-point-at-bol)))) + (point-at-bol)))) ;; encoded-words must not be longer than 75 characters, ;; including charset, encoding etc. This leaves us with ;; 75 - (length start) - 2 - 2 characters. The last 2 is for @@ -483,7 +471,7 @@ By default, the region is treated as containing addresses (see (first t) (bol (save-restriction (widen) - (rfc2047-point-at-bol)))) + (point-at-bol)))) (while (not (eobp)) (when (and (or break qword-break) (> (- (point) bol) 76)) @@ -554,18 +542,18 @@ By default, the region is treated as containing addresses (see (goto-char (point-min)) (let ((bol (save-restriction (widen) - (rfc2047-point-at-bol))) - (eol (rfc2047-point-at-eol))) + (point-at-bol))) + (eol (point-at-eol))) (forward-line 1) (while (not (eobp)) (if (and (looking-at "[ \t]") - (< (- (rfc2047-point-at-eol) bol) 76)) + (< (- (point-at-eol) bol) 76)) (delete-region eol (progn (goto-char eol) (skip-chars-forward "\r\n") (point))) - (setq bol (rfc2047-point-at-bol))) - (setq eol (rfc2047-point-at-eol)) + (setq bol (point-at-bol))) + (setq eol (point-at-eol)) (forward-line 1))))) (defun rfc2047-b-encode-region (b e) @@ -585,7 +573,7 @@ By default, the region is treated as containing addresses (see (narrow-to-region (goto-char b) e) (let ((bol (save-restriction (widen) - (rfc2047-point-at-bol)))) + (point-at-bol)))) (quoted-printable-encode-region b e nil ;; = (\075), _ (\137), ? (\077) are used in the encoded word. diff --git a/lisp/smime.el b/lisp/smime.el index af7f95597..33a14ea03 100644 --- a/lisp/smime.el +++ b/lisp/smime.el @@ -512,13 +512,6 @@ A string or a list of strings is returned." (caddr curkey) (smime-get-certfiles keyfile otherkeys))))) -;; Use mm-util? -(eval-and-compile - (defalias 'smime-point-at-eol - (if (fboundp 'point-at-eol) - 'point-at-eol - 'line-end-position))) - (defun smime-buffer-as-string-region (b e) "Return each line in region between B and E as a list of strings." (save-excursion diff --git a/lisp/spam.el b/lisp/spam.el index 130fcd828..737d5843a 100644 --- a/lisp/spam.el +++ b/lisp/spam.el @@ -763,11 +763,6 @@ spam-use-* variable.") (apply 'spam-ham-move-routine (car groups)) (spam-ham-copy-or-move-routine nil groups))) -(eval-and-compile - (defalias 'spam-point-at-eol (if (fboundp 'point-at-eol) - 'point-at-eol - 'line-end-position))) - (defun spam-get-article-as-string (article) (let ((article-buffer (spam-get-article-as-buffer article)) article-string) @@ -1368,7 +1363,7 @@ functions") ;; check the return now (we're back in the temp buffer) (goto-char (point-min)) (if (not (eobp)) - (setq category (buffer-substring (point) (spam-point-at-eol)))) + (setq category (buffer-substring (point) (point-at-eol)))) (when (not (zerop (length category))) ; we need a category here (if spam-ifile-all-categories (setq return category) @@ -1556,7 +1551,7 @@ REMOVE not nil, remove the ADDRESSES." (with-temp-buffer (insert-file-contents file) (while (not (eobp)) - (setq address (buffer-substring (point) (spam-point-at-eol))) + (setq address (buffer-substring (point) (point-at-eol))) (forward-line 1) ;; insert the e-mail address if detected, otherwise the raw data (unless (zerop (length address)) -- 2.34.1