Commit a31ca314 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(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
parent 4b45b44f
......@@ -2378,8 +2378,14 @@ Setting this variable automatically makes it local to the current buffer.")
(let ((fill-point
(let ((opoint (point))
(first t))
(first t)
(setq after-prefix (point))
(and fill-prefix
(looking-at (regexp-quote fill-prefix))
(setq after-prefix (match-end 0)))
(move-to-column (1+ fc))
;; Move back to a word boundary.
(while (or first
......@@ -2398,7 +2404,7 @@ Setting this variable automatically makes it local to the current buffer.")
;; If we find nowhere on the line to break it,
;; break after one word. Set bounce to t
;; so we will not keep going in this while loop.
(if (bolp)
(if (<= (point) after-prefix)
(re-search-forward "[ \t]" opoint t)
(setq bounce t)))
......@@ -2793,6 +2799,60 @@ or go back to just one window (by deleting all but the selected window)."
(define-key global-map "\e\e\e" 'keyboard-escape-quit)
(defvar mail-user-agent 'sendmail-user-agent
"*Your preference for a mail composition package.
Various Emacs Lisp packages (e.g. reporter) require you to compose an
outgoing email message. This variable lets you specify which
mail-sending package you prefer.
Valid values include:
'sendmail-user-agent -- use Emacs built-in Mail package
'mh-e-user-agent -- use the Emacs interface to the MH mail system
Additional valid symbols may be available; check with the author of
your package for details.")
(defun define-mail-user-agent (symbol composefunc sendfunc
&optional abortfunc hookvar)
"Define a symbol to identify a mail-sending package for `mail-user-agent'.
SYMBOL can be any Lisp symbol. Its function definition and/or
value as a variable do not matter for this usage; we use only certain
properties on its property list, to encode the rest of the arguments.
COMPOSEFUNC is program callable function that composes an outgoing
mail message buffer. This function should set up the basics of the
buffer without requiring user interaction. It should populate the
standard mail headers, leaving the `to:' and `subject:' headers blank.
SENDFUNC is the command a user would type to send the message.
Optional ABORTFUNC is the command a user would type to abort the
message. For mail packages that don't have a separate abort function,
this can be `kill-buffer' (the equivalent of omitting this argument).
Optional HOOKVAR is a hook variable that gets run before the message
is actually sent. Reporter will install `reporter-bug-hook' onto this
hook so that empty bug reports can be suppressed by raising an error.
If not supplied, `mail-send-hook' will be used.
The properties used on SYMBOL are `composefunc', `sendfunc',
`abortfunc', and `hookvar'."
(put symbol 'composefunc composefunc)
(put symbol 'sendfunc sendfunc)
(put symbol 'abortfunc (or abortfunc 'kill-buffer))
(put symbol 'hookvar (or hookvar 'mail-send-hook)))
(define-mail-user-agent 'sendmail-user-agent
'(lambda (&rest args) (or (apply 'mail args)
(error "Message aborted")))
(define-mail-user-agent 'mh-e-user-agent
'mh-smail-batch 'mh-send-letter 'mh-fully-kill-draft
(defun set-variable (var val)
"Set VARIABLE to VALUE. VALUE is a Lisp object.
When using this interactively, supply a Lisp expression for VALUE.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment