mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-31 17:30:54 -08:00
(rfc822-address-start): Declare variable.
Renamed from address-start. All uses changed.
This commit is contained in:
parent
9d133481d6
commit
d6b4d749d0
1 changed files with 13 additions and 11 deletions
|
|
@ -30,11 +30,13 @@
|
||||||
|
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
;; uses address-start free, throws to address
|
(defvar rfc822-address-start)
|
||||||
|
|
||||||
|
;; uses rfc822-address-start free, throws to address
|
||||||
(defun rfc822-bad-address (reason)
|
(defun rfc822-bad-address (reason)
|
||||||
(save-restriction
|
(save-restriction
|
||||||
(insert "_^_")
|
(insert "_^_")
|
||||||
(narrow-to-region address-start
|
(narrow-to-region rfc822-address-start
|
||||||
(if (re-search-forward "[,;]" nil t)
|
(if (re-search-forward "[,;]" nil t)
|
||||||
(max (point-min) (1- (point)))
|
(max (point-min) (1- (point)))
|
||||||
(point-max)))
|
(point-max)))
|
||||||
|
|
@ -52,7 +54,7 @@
|
||||||
": \"")
|
": \"")
|
||||||
(goto-char (point-max)) (insert "\")"))
|
(goto-char (point-max)) (insert "\")"))
|
||||||
(rfc822-nuke-whitespace)
|
(rfc822-nuke-whitespace)
|
||||||
(throw 'address (buffer-substring address-start (point))))
|
(throw 'address (buffer-substring rfc822-address-start (point))))
|
||||||
|
|
||||||
(defun rfc822-nuke-whitespace (&optional leave-space)
|
(defun rfc822-nuke-whitespace (&optional leave-space)
|
||||||
(let (ch)
|
(let (ch)
|
||||||
|
|
@ -179,7 +181,7 @@
|
||||||
;; domain-literal is "[" *(dtext | quoted-pair) "]"
|
;; domain-literal is "[" *(dtext | quoted-pair) "]"
|
||||||
;; dtext is "[^][\\n"
|
;; dtext is "[^][\\n"
|
||||||
;; domain-ref is atom
|
;; domain-ref is atom
|
||||||
(let ((address-start (point))
|
(let ((rfc822-address-start (point))
|
||||||
(n 0))
|
(n 0))
|
||||||
(catch 'address
|
(catch 'address
|
||||||
;; optimize common cases:
|
;; optimize common cases:
|
||||||
|
|
@ -198,14 +200,14 @@
|
||||||
(or (bobp) (/= (preceding-char) ?\ ) (delete-char -1))
|
(or (bobp) (/= (preceding-char) ?\ ) (delete-char -1))
|
||||||
;; relying on the fact that rfc822-looking-at <char>
|
;; relying on the fact that rfc822-looking-at <char>
|
||||||
;; doesn't mung match-data
|
;; doesn't mung match-data
|
||||||
(throw 'address (buffer-substring address-start (match-end 0)))))
|
(throw 'address (buffer-substring rfc822-address-start (match-end 0)))))
|
||||||
(goto-char address-start)
|
(goto-char rfc822-address-start)
|
||||||
(while t
|
(while t
|
||||||
(cond ((and (= n 1) (rfc822-looking-at ?@))
|
(cond ((and (= n 1) (rfc822-looking-at ?@))
|
||||||
;; local-part@domain
|
;; local-part@domain
|
||||||
(rfc822-snarf-domain)
|
(rfc822-snarf-domain)
|
||||||
(throw 'address
|
(throw 'address
|
||||||
(buffer-substring address-start (point))))
|
(buffer-substring rfc822-address-start (point))))
|
||||||
((rfc822-looking-at ?:)
|
((rfc822-looking-at ?:)
|
||||||
(cond ((not allow-groups)
|
(cond ((not allow-groups)
|
||||||
(rfc822-bad-address "A group name may not appear here"))
|
(rfc822-bad-address "A group name may not appear here"))
|
||||||
|
|
@ -261,7 +263,7 @@
|
||||||
(throw 'address nil))
|
(throw 'address nil))
|
||||||
((= n 1) ; allow "foo" (losing unix seems to do this)
|
((= n 1) ; allow "foo" (losing unix seems to do this)
|
||||||
(throw 'address
|
(throw 'address
|
||||||
(buffer-substring address-start (point))))
|
(buffer-substring rfc822-address-start (point))))
|
||||||
((> n 1)
|
((> n 1)
|
||||||
(rfc822-bad-address "Missing comma between addresses or badly-formatted address"))
|
(rfc822-bad-address "Missing comma between addresses or badly-formatted address"))
|
||||||
((or (eobp) (= (following-char) ?,))
|
((or (eobp) (= (following-char) ?,))
|
||||||
|
|
@ -289,12 +291,12 @@
|
||||||
(replace-match "\\1 " t))
|
(replace-match "\\1 " t))
|
||||||
|
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
(rfc822-nuke-whitespace)
|
|
||||||
(let ((list ())
|
(let ((list ())
|
||||||
tem
|
tem
|
||||||
address-start); this is for rfc822-bad-address
|
rfc822-address-start); this is for rfc822-bad-address
|
||||||
|
(rfc822-nuke-whitespace)
|
||||||
(while (not (eobp))
|
(while (not (eobp))
|
||||||
(setq address-start (point))
|
(setq rfc822-address-start (point))
|
||||||
(setq tem
|
(setq tem
|
||||||
(catch 'address ; this is for rfc822-bad-address
|
(catch 'address ; this is for rfc822-bad-address
|
||||||
(cond ((rfc822-looking-at ?\,)
|
(cond ((rfc822-looking-at ?\,)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue