diff options
| author | Richard M. Stallman | 1996-08-30 16:59:20 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-08-30 16:59:20 +0000 |
| commit | a31ca314db28056b6d68b03c79794e3fea161ab8 (patch) | |
| tree | f6663536515a0bcc84561006894d368c2dbdb033 | |
| parent | 4b45b44f74958ed844b0755ab3ae5aa2138fca80 (diff) | |
| download | emacs-a31ca314db28056b6d68b03c79794e3fea161ab8.tar.gz emacs-a31ca314db28056b6d68b03c79794e3fea161ab8.zip | |
(do-auto-fill): Do break after one word as last resort
even if there is a fill prefix.
(mail-user-agent, define-mail-user-agent):
Definitions moved here from reporter.el.
(sendmail-user-agent, mh-e-user-agent): Definitions moved here
| -rw-r--r-- | lisp/simple.el | 64 |
1 files changed, 62 insertions, 2 deletions
diff --git a/lisp/simple.el b/lisp/simple.el index a237712ce2f..f44ed221449 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -2378,8 +2378,14 @@ Setting this variable automatically makes it local to the current buffer.") | |||
| 2378 | (let ((fill-point | 2378 | (let ((fill-point |
| 2379 | (let ((opoint (point)) | 2379 | (let ((opoint (point)) |
| 2380 | bounce | 2380 | bounce |
| 2381 | (first t)) | 2381 | (first t) |
| 2382 | after-prefix) | ||
| 2382 | (save-excursion | 2383 | (save-excursion |
| 2384 | (beginning-of-line) | ||
| 2385 | (setq after-prefix (point)) | ||
| 2386 | (and fill-prefix | ||
| 2387 | (looking-at (regexp-quote fill-prefix)) | ||
| 2388 | (setq after-prefix (match-end 0))) | ||
| 2383 | (move-to-column (1+ fc)) | 2389 | (move-to-column (1+ fc)) |
| 2384 | ;; Move back to a word boundary. | 2390 | ;; Move back to a word boundary. |
| 2385 | (while (or first | 2391 | (while (or first |
| @@ -2398,7 +2404,7 @@ Setting this variable automatically makes it local to the current buffer.") | |||
| 2398 | ;; If we find nowhere on the line to break it, | 2404 | ;; If we find nowhere on the line to break it, |
| 2399 | ;; break after one word. Set bounce to t | 2405 | ;; break after one word. Set bounce to t |
| 2400 | ;; so we will not keep going in this while loop. | 2406 | ;; so we will not keep going in this while loop. |
| 2401 | (if (bolp) | 2407 | (if (<= (point) after-prefix) |
| 2402 | (progn | 2408 | (progn |
| 2403 | (re-search-forward "[ \t]" opoint t) | 2409 | (re-search-forward "[ \t]" opoint t) |
| 2404 | (setq bounce t))) | 2410 | (setq bounce t))) |
| @@ -2793,6 +2799,60 @@ or go back to just one window (by deleting all but the selected window)." | |||
| 2793 | 2799 | ||
| 2794 | (define-key global-map "\e\e\e" 'keyboard-escape-quit) | 2800 | (define-key global-map "\e\e\e" 'keyboard-escape-quit) |
| 2795 | 2801 | ||
| 2802 | (defvar mail-user-agent 'sendmail-user-agent | ||
| 2803 | "*Your preference for a mail composition package. | ||
| 2804 | Various Emacs Lisp packages (e.g. reporter) require you to compose an | ||
| 2805 | outgoing email message. This variable lets you specify which | ||
| 2806 | mail-sending package you prefer. | ||
| 2807 | |||
| 2808 | Valid values include: | ||
| 2809 | |||
| 2810 | 'sendmail-user-agent -- use Emacs built-in Mail package | ||
| 2811 | 'mh-e-user-agent -- use the Emacs interface to the MH mail system | ||
| 2812 | |||
| 2813 | Additional valid symbols may be available; check with the author of | ||
| 2814 | your package for details.") | ||
| 2815 | |||
| 2816 | (defun define-mail-user-agent (symbol composefunc sendfunc | ||
| 2817 | &optional abortfunc hookvar) | ||
| 2818 | "Define a symbol to identify a mail-sending package for `mail-user-agent'. | ||
| 2819 | |||
| 2820 | SYMBOL can be any Lisp symbol. Its function definition and/or | ||
| 2821 | value as a variable do not matter for this usage; we use only certain | ||
| 2822 | properties on its property list, to encode the rest of the arguments. | ||
| 2823 | |||
| 2824 | COMPOSEFUNC is program callable function that composes an outgoing | ||
| 2825 | mail message buffer. This function should set up the basics of the | ||
| 2826 | buffer without requiring user interaction. It should populate the | ||
| 2827 | standard mail headers, leaving the `to:' and `subject:' headers blank. | ||
| 2828 | |||
| 2829 | SENDFUNC is the command a user would type to send the message. | ||
| 2830 | |||
| 2831 | Optional ABORTFUNC is the command a user would type to abort the | ||
| 2832 | message. For mail packages that don't have a separate abort function, | ||
| 2833 | this can be `kill-buffer' (the equivalent of omitting this argument). | ||
| 2834 | |||
| 2835 | Optional HOOKVAR is a hook variable that gets run before the message | ||
| 2836 | is actually sent. Reporter will install `reporter-bug-hook' onto this | ||
| 2837 | hook so that empty bug reports can be suppressed by raising an error. | ||
| 2838 | If not supplied, `mail-send-hook' will be used. | ||
| 2839 | |||
| 2840 | The properties used on SYMBOL are `composefunc', `sendfunc', | ||
| 2841 | `abortfunc', and `hookvar'." | ||
| 2842 | (put symbol 'composefunc composefunc) | ||
| 2843 | (put symbol 'sendfunc sendfunc) | ||
| 2844 | (put symbol 'abortfunc (or abortfunc 'kill-buffer)) | ||
| 2845 | (put symbol 'hookvar (or hookvar 'mail-send-hook))) | ||
| 2846 | |||
| 2847 | (define-mail-user-agent 'sendmail-user-agent | ||
| 2848 | '(lambda (&rest args) (or (apply 'mail args) | ||
| 2849 | (error "Message aborted"))) | ||
| 2850 | 'mail-send-and-exit) | ||
| 2851 | |||
| 2852 | (define-mail-user-agent 'mh-e-user-agent | ||
| 2853 | 'mh-smail-batch 'mh-send-letter 'mh-fully-kill-draft | ||
| 2854 | 'mh-before-send-letter-hook) | ||
| 2855 | |||
| 2796 | (defun set-variable (var val) | 2856 | (defun set-variable (var val) |
| 2797 | "Set VARIABLE to VALUE. VALUE is a Lisp object. | 2857 | "Set VARIABLE to VALUE. VALUE is a Lisp object. |
| 2798 | When using this interactively, supply a Lisp expression for VALUE. | 2858 | When using this interactively, supply a Lisp expression for VALUE. |