comparison lisp/mail/mailabbrev.el @ 608:615cdef1368d

*** empty log message ***
author Roland McGrath <roland@gnu.org>
date Tue, 07 Apr 1992 21:48:04 +0000
parents d9428f32691a
children 59b674ceaf31
comparison
equal deleted inserted replaced
607:e0ce539246b8 608:615cdef1368d
1 ;;; Abbrev-expansion of mail aliases. 1 ;;; Abbrev-expansion of mail aliases.
2 ;;; Copyright (C) 1985, 1986, 1987, 1992 Free Software Foundation, Inc. 2 ;;; Copyright (C) 1985, 1986, 1987, 1992 Free Software Foundation, Inc.
3 ;;; Created: 19 oct 90, Jamie Zawinski <jwz@lucid.com> 3 ;;; Created: 19 oct 90, Jamie Zawinski <jwz@lucid.com>
4 ;;; Last change 24-mar-92. jwz 4 ;;; Last change 5-apr-92 by roland@gnu.ai.mit.edu.
5 5
6 ;;; This file is part of GNU Emacs. 6 ;;; This file is part of GNU Emacs.
7 7
8 ;;; GNU Emacs is free software; you can redistribute it and/or modify 8 ;;; GNU Emacs is free software; you can redistribute it and/or modify
9 ;;; it under the terms of the GNU General Public License as published by 9 ;;; it under the terms of the GNU General Public License as published by
301 mail-alias-seperator-string)) 301 mail-alias-seperator-string))
302 (set sym definition)))) 302 (set sym definition))))
303 (symbol-value sym)) 303 (symbol-value sym))
304 304
305 305
306 (defun mail-abbrev-expand-hook () 306 (defun mail-abbrev-expand-hook-v19 ()
307 "For use as the fourth arg to define-abbrev. 307 "For use as the fourth arg to define-abbrev.
308 After expanding a mail-abbrev, if fill-mode is on and we're past the 308 After expanding a mail-abbrev, if fill-mode is on and we're past the
309 fill-column, break the line at the previous comma, and indent the next 309 fill-column, break the line at the previous comma, and indent the next
310 line." 310 line."
311 (let (p bol) 311 (save-excursion
312 (let ((p (point))
313 bol comma fp)
314 (beginning-of-line)
315 (setq bol (point))
316 (goto-char p)
312 (while (and auto-fill-function 317 (while (and auto-fill-function
313 (>= (current-column) fill-column)) 318 (>= (current-column) fill-column)
319 (search-backward "," bol t))
320 (setq comma (point))
321 (forward-char 1) ; Now we are just past the comma.
322 (insert "\n")
323 (delete-horizontal-space)
314 (setq p (point)) 324 (setq p (point))
315 (save-excursion 325 (indent-relative)
316 (let (fp) 326 (setq fp (buffer-substring p (point)))
317 (beginning-of-line) 327 ;; Go to the end of the new line.
318 (setq bol (point)) 328 (end-of-line)
319 (goto-char p) 329 (if (> (current-column) fill-column)
320 (while (and (>= (current-column) fill-column) 330 ;; It's still too long; do normal auto-fill.
321 (search-backward "," bol t))) 331 (let ((fill-prefix (or fp "\t")))
322 (save-excursion 332 (do-auto-fill)))
323 (forward-char 1) 333 ;; Resume the search.
324 (insert "\n") 334 (goto-char comma)
325 (delete-horizontal-space) 335 ))))
326 (setq p (point))
327 (indent-relative)
328 (setq fp (buffer-substring p (point))))
329 (if (> (current-column) fill-column)
330 (let ((fill-prefix (or fp "\t")))
331 (do-auto-fill))))))))
332 336
333 337
334 ;;; Syntax tables and abbrev-expansion 338 ;;; Syntax tables and abbrev-expansion
335 339
336 (defvar mail-abbrev-mode-regexp "^\\(Resent-\\)?\\(To\\|From\\|CC\\|BCC\\):" 340 (defvar mail-abbrev-mode-regexp "^\\(Resent-\\)?\\(To\\|From\\|CC\\|BCC\\):"