summaryrefslogtreecommitdiff
path: root/lisp/mail/mailabbrev.el
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1992-04-07 21:48:04 +0000
committerRoland McGrath <roland@gnu.org>1992-04-07 21:48:04 +0000
commit41263a11c1e1fd4f3edaaae2605c47eefc08c067 (patch)
tree158aa5836ed5cd393c8b172c97cd9392de9ea561 /lisp/mail/mailabbrev.el
parenta8e597295ff2c7f597a2785d6ed83c8af88f40ab (diff)
downloademacs-41263a11c1e1fd4f3edaaae2605c47eefc08c067.tar.gz
*** empty log message ***
Diffstat (limited to 'lisp/mail/mailabbrev.el')
-rw-r--r--lisp/mail/mailabbrev.el48
1 files changed, 26 insertions, 22 deletions
diff --git a/lisp/mail/mailabbrev.el b/lisp/mail/mailabbrev.el
index 40e8374c22e..29d89c5a12a 100644
--- a/lisp/mail/mailabbrev.el
+++ b/lisp/mail/mailabbrev.el
@@ -1,7 +1,7 @@
;;; Abbrev-expansion of mail aliases.
;;; Copyright (C) 1985, 1986, 1987, 1992 Free Software Foundation, Inc.
;;; Created: 19 oct 90, Jamie Zawinski <jwz@lucid.com>
-;;; Last change 24-mar-92. jwz
+;;; Last change 5-apr-92 by roland@gnu.ai.mit.edu.
;;; This file is part of GNU Emacs.
@@ -303,32 +303,36 @@ If DEFINITION contains multiple addresses, seperate them with commas."
(symbol-value sym))
-(defun mail-abbrev-expand-hook ()
+(defun mail-abbrev-expand-hook-v19 ()
"For use as the fourth arg to define-abbrev.
- After expanding a mail-abbrev, if fill-mode is on and we're past the
+After expanding a mail-abbrev, if fill-mode is on and we're past the
fill-column, break the line at the previous comma, and indent the next
line."
- (let (p bol)
+ (save-excursion
+ (let ((p (point))
+ bol comma fp)
+ (beginning-of-line)
+ (setq bol (point))
+ (goto-char p)
(while (and auto-fill-function
- (>= (current-column) fill-column))
+ (>= (current-column) fill-column)
+ (search-backward "," bol t))
+ (setq comma (point))
+ (forward-char 1) ; Now we are just past the comma.
+ (insert "\n")
+ (delete-horizontal-space)
(setq p (point))
- (save-excursion
- (let (fp)
- (beginning-of-line)
- (setq bol (point))
- (goto-char p)
- (while (and (>= (current-column) fill-column)
- (search-backward "," bol t)))
- (save-excursion
- (forward-char 1)
- (insert "\n")
- (delete-horizontal-space)
- (setq p (point))
- (indent-relative)
- (setq fp (buffer-substring p (point))))
- (if (> (current-column) fill-column)
- (let ((fill-prefix (or fp "\t")))
- (do-auto-fill))))))))
+ (indent-relative)
+ (setq fp (buffer-substring p (point)))
+ ;; Go to the end of the new line.
+ (end-of-line)
+ (if (> (current-column) fill-column)
+ ;; It's still too long; do normal auto-fill.
+ (let ((fill-prefix (or fp "\t")))
+ (do-auto-fill)))
+ ;; Resume the search.
+ (goto-char comma)
+ ))))
;;; Syntax tables and abbrev-expansion