[SLE] Message refilling [was: Re: [SLE] Infamous pppd died unexpectedlly]
Warrl <warrl@blarg.net> writes:
* please keep your lines under 79 columns when using email.
Standard quoting will lengthen the line by 1 character for each level of quoting. Thoughtful consideration to those who might want to reply to your message, and possible ensuing discussion, suggests that you should keep your new lines under 75 characters.
I often see 76, and sometimes, even 70. 79 is really a maximum. Note that if quoting a message many times has the eventual effect of going over 79 columns, best is to refill the quote within limits, before sending. For most good editors, this requires no effort, and this is polite. By the way, I just shared with a few friends the following piece of Emacs LISP, maybe it might be useful to some of you as well. The idea is that the `M-q' command, in Emacs, refills a paragraph by considering one line at a time, and this does not yield very satisfying results. The GNU `fmt' program, contributed by Ross Paterson, does much better, and relies on techniques published by Donald Knuth, in which the whole paragraph is taken under consideration to make the right ragging less apparent, as well as the fact that lines are better cut after some punctuation, and such things. `fmt' uses a (Dreyfus) dynamic programming engine if I remember well. So I managed to substitute the `M-q' processing with a connection to that external program. In my `.bash_login' file, there is something like `export FMT=/usr/bin/fmt'. If that variable is not set, `M-q' keeps its old behaviour. `C-u M-q' also keeps the old behaviour. (The default `C-u M-q' does simultaneous left-right justification, which is considered _real bad_ with fixed width fonts, so it did not annoy me at all to get rid of that heresy :-). Here is the code from my `.emacs' file. For those who read Emacs LISP, one difficulty was to restore point within the paragraph after having filtered it through `fmt', but I hope I got it right for most cases. (setq EMACS20 t) (when (getenv "FMT") (defun fp-fill-paragraph (arg) (interactive "P") (if arg (if EMACS20 (let (fill-paragraph-function) (fill-paragraph nil)) (real-fill-paragraph nil)) (let* ((here (point)) (end (progn (forward-paragraph) (point))) (start (progn (backward-paragraph) (point))) (count 0)) (goto-char start) (skip-chars-forward " \t\n" here) (while (< (point) here) (forward-char 1) (setq count (1+ count)) (skip-chars-forward " \t\n" here)) (goto-char start) (shell-command-on-region start end (concat (format "%s -u -w%d" (getenv "FMT") fill-column) (if fill-prefix (format " -p '%s'" fill-prefix) "")) t) (goto-char start) (skip-chars-forward " \t\n" here) (while (> count 0) (forward-char 1) (setq count (1- count)) (skip-chars-forward " \t\n" here)))) t) (if EMACS20 (setq-default fill-paragraph-function 'fp-fill-paragraph) (unless (fboundp 'real-fill-paragraph) (fset 'real-fill-paragraph (symbol-function 'fill-paragraph))) (defun fill-paragraph (arg) (interactive "P") (fp-fill-paragraph arg)))) -- François Pinard http://www.iro.umontreal.ca/~pinard -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/
Hi, On Thu, Mar 30 2000 at 21:44 -0500, François Pinard wrote:
By the way, I just shared with a few friends the following piece of Emacs LISP, maybe it might be useful to some of you as well. The idea is that the `M-q' command, in Emacs, refills a paragraph by considering one line at a time, and this does not yield very satisfying results. The GNU `fmt' program, contributed by Ross Paterson, does much better, and relies on techniques published by Donald Knuth, in which the whole paragraph is taken under consideration to make the right ragging less apparent, as well as the fact that lines are better cut after some punctuation, and such things. `fmt' uses a (Dreyfus) dynamic programming engine if I remember well. So I managed to substitute the `M-q' processing with a connection to that external program.
Another possibility is to turn mail-mode on. Ciao, Stefan -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/
participants (2)
-
pinard@iro.umontreal.ca
-
stefan.troeger@wirtschaft.tu-chemnitz.de