From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/40310 Path: main.gmane.org!not-for-mail From: Simon Josefsson Newsgroups: gmane.emacs.gnus.general Subject: Support "Importance:" header Date: Thu, 15 Nov 2001 23:21:55 +0100 Sender: owner-ding@hpc.uh.edu Message-ID: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035175881 32704 80.91.224.250 (21 Oct 2002 04:51:21 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 04:51:21 +0000 (UTC) Return-Path: Original-Received: (qmail 23718 invoked from network); 15 Nov 2001 22:29:10 -0000 Original-Received: from malifon.math.uh.edu (129.7.128.13) by mastaler.com with SMTP; 15 Nov 2001 22:29:10 -0000 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 164Uv5-0006jH-00; Thu, 15 Nov 2001 16:23:39 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Thu, 15 Nov 2001 16:23:21 -0600 (CST) Original-Received: from sclp3.sclp.com (qmailr@sclp3.sclp.com [209.196.61.66]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id QAA04343 for ; Thu, 15 Nov 2001 16:23:00 -0600 (CST) Original-Received: (qmail 23663 invoked by alias); 15 Nov 2001 22:23:05 -0000 Original-Received: (qmail 23656 invoked from network); 15 Nov 2001 22:23:04 -0000 Original-Received: from unknown (HELO dolk.extundo.com) (195.42.214.242) by gnus.org with SMTP; 15 Nov 2001 22:23:04 -0000 Original-Received: from dhcp128.extundo.com (slipsten.extundo.com [195.42.214.241]) (authenticated bits=0) by dolk.extundo.com (8.12.1/8.12.1) with ESMTP id fAFMMbmb023568; Thu, 15 Nov 2001 23:22:38 +0100 Original-To: ding@gnus.org, bugs@gnus.org Mail-Followup-To: ding@gnus.org Importance: high Original-Lines: 487 User-Agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.1 (i686-pc-linux-gnu) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:40310 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:40310 The following adds support for those pesky Outlookish-but-really-X.400 Importance: headers (and fixes various bugs found in the process of writing it). If there are artists out there that can make the icons less ugly that would be a good thing. I stole the C-c C-p binding in the *Message* buffer, hopefully noone uses it? I'll commit this now, if someone objects I can remove it. 2001-11-15 Simon Josefsson * etc/gnus/unimportant.xpm, etc/gnus/important.xpm: New files. 2001-11-15 Simon Josefsson * message.texi (Insertion): Add C-c C-p, message-insert-importance-{low,high}. (Various Commands): Fix typo. (Insertion Variables): New section, all variables moved from Commands->Insertion into this node, Variables->Insertion Variables. 2001-11-15 Simon Josefsson Support "Importance:" header in Message. * message.el (message-mode-map): Bind C-c C-p to `message-insert-or-toggle-importance' (message-mode-menu): Add message-insert-importance-{high,low}. (message-insert-importance-high, message-insert-importance-low) (message-insert-or-toggle-importance): New functions. (message-tool-bar-map): Add {un,}important. (message-mode): Doc fix. 2001-11-15 Simon Josefsson * message.el (message-tool-bar-map): Fix attach toolbar tooltip. * mml.el (mml-menu): Fix toolbar tooltip. --- GNUS-NEWS.~6.12.~ Tue Nov 13 20:32:54 2001 +++ GNUS-NEWS Thu Nov 15 23:18:18 2001 @@ -8,6 +8,10 @@ * Changes in Oort Gnus +** Message supports the Importance: header. + +In the message buffer, C-c C-p cycles through the valid values. + ** Gnus supports Cancel Locks in News. This means a header "Cancel-Lock" is inserted in news posting. It is --- /dev/null Thu Aug 30 22:30:55 2001 +++ etc/gnus/important.xpm Thu Nov 15 22:44:49 2001 @@ -0,0 +1,32 @@ +/* XPM */ +static char *magick[] = { +/* columns rows colors chars-per-pixel */ +"24 24 2 1", +"! c red", +"w c Gray75", +/* pixels */ +"wwwwwwwwwwwwwwwwwwwwwwww", +"wwwwwwwwwwwwwwwwwwwwwwww", +"wwwwwwwww!!wwwwwwwwwwwww", +"wwwwwwwww!!!wwwwwwwwwwww", +"wwwwwwww!!!!!wwwwwwwwwww", +"wwwwwwww!!!!!wwwwwwwwwww", +"wwwwwwww!!!!wwwwwwwwwwww", +"wwwwwww!!!!!wwwwwwwwwwww", +"wwwwwww!!!!!wwwwwwwwwwww", +"wwwwwww!!!!!wwwwwwwwwwww", +"wwwwwww!!!!!wwwwwwwwwwww", +"wwwwwww!!!!!wwwwwwwwwwww", +"wwwwwww!!!!!wwwwwwwwwwww", +"wwwwwwww!!!!wwwwwwwwwwww", +"wwwwwwww!!!!wwwwwwwwwwww", +"wwwwwwww!!!!!wwwwwwwwwww", +"wwwwwwwww!!!!wwwwwwwwwww", +"wwwwwwwwwwwwwwwwwwwwwwww", +"wwwwwwwww!!!wwwwwwwwwwww", +"wwwwwwww!!!!!wwwwwwwwwww", +"wwwwwwww!!!!!wwwwwwwwwww", +"wwwwwwwww!!!wwwwwwwwwwww", +"wwwwwwwwwwwwwwwwwwwwwwww", +"wwwwwwwwwwwwwwwwwwwwwwww" +}; --- /dev/null Thu Aug 30 22:30:55 2001 +++ etc/gnus/unimportant.xpm Thu Nov 15 22:43:07 2001 @@ -0,0 +1,32 @@ +/* XPM */ +static char *magick[] = { +/* columns rows colors chars-per-pixel */ +"24 24 2 1", +"! c blue", +"w c Gray75", +/* pixels */ +"wwwwwwwwwwwwwwwwwwwwwwww", +"wwwwwwwwwwwwwwwwwwwwwwww", +"wwwwwwwwww!!wwwwwwwwwwww", +"wwwwwwwwww!!wwwwwwwwwwww", +"wwwwwwwwww!!wwwwwwwwwwww", +"wwwwwwwwww!!wwwwwwwwwwww", +"wwwwwwwwww!!wwwwwwwwwwww", +"wwwwwwwwww!!wwwwwwwwwwww", +"wwwwwwwwww!!wwwwwwwwwwww", +"wwwwwwwwww!!wwwwwwwwwwww", +"wwwwwwwwww!!wwwwwwwwwwww", +"wwwwwwwwww!!wwwwwwwwwwww", +"wwwwwwwwww!!wwwwwwwwwwww", +"wwwwwwwwww!!wwwwwwwwwwww", +"wwwwwwwwww!!wwwwwwwwwwww", +"ww!!wwwwww!!wwwwww!!wwww", +"www!!wwwww!!wwwww!!wwwww", +"wwww!!wwww!!wwww!!wwwwww", +"wwwww!!www!!www!!wwwwwww", +"wwwwww!!ww!!ww!!wwwwwwww", +"wwwwwww!!w!!w!!wwwwwwwww", +"wwwwwwww!!!!!!wwwwwwwwww", +"wwwwwwwww!!!!wwwwwwwwwww", +"wwwwwwwwww!!wwwwwwwwwwww" +}; --- message.el.~6.155.~ Sun Nov 11 11:28:38 2001 +++ message.el Thu Nov 15 22:59:28 2001 @@ -1509,6 +1509,7 @@ (define-key message-mode-map "\C-c\C-t" 'message-insert-to) (define-key message-mode-map "\C-c\C-n" 'message-insert-newsgroups) + (define-key message-mode-map "\C-c\C-p" 'message-insert-or-toggle-importance) (define-key message-mode-map "\C-c\C-y" 'message-yank-original) (define-key message-mode-map "\C-c\M-\C-y" 'message-yank-buffer) @@ -1551,6 +1552,12 @@ ["Kill To Signature" message-kill-to-signature t] ["Newline and Reformat" message-newline-and-reformat t] ["Rename buffer" message-rename-buffer t] + ["Flag as important" message-insert-importance-high + ,@(if (featurep 'xemacs) '(t) + '(:help "Mark this message as important"))] + ["Flag as unimportant" message-insert-importance-low + ,@(if (featurep 'xemacs) '(t) + '(:help "Mark this message as unimportant"))] ["Spellcheck" ispell-message ,@(if (featurep 'xemacs) '(t) '(:help "Spellcheck this message"))] @@ -1646,6 +1653,7 @@ C-c C-z `message-kill-to-signature' (kill the text up to the signature). C-c C-r `message-caesar-buffer-body' (rot13 the message body). C-c C-a `mml-attach-file' (attach a file as MIME). +C-c C-p `message-insert-or-toggle-importance' (insert or cycle importance) M-RET `message-newline-and-reformat' (break the line and reformat)." (set (make-local-variable 'message-reply-buffer) nil) (make-local-variable 'message-send-actions) @@ -2061,6 +2069,40 @@ (goto-char (point-max)) (or (bolp) (insert "\n"))))) +(defun message-insert-importance-high () + "Insert header to mark message as important." + (interactive) + (message-remove-header "Importance") + (message-goto-eoh) + (insert "Importance: high\n")) + +(defun message-insert-importance-low () + "Insert header to mark message as unimportant." + (interactive) + (message-remove-header "Importance") + (message-goto-eoh) + (insert "Importance: low\n")) + +(defun message-insert-or-toggle-importance () + "Insert a \"Importance: high\" header, or cycle through the header values. +The three allowed values according to RFC 1327 are `high', `normal' +and `low'." + (interactive) + (save-excursion + (let ((valid '("high" "normal" "low")) + (new "high") + cur) + (when (setq cur (message-fetch-field "Importance")) + (message-remove-header "Importance") + (setq new (cond ((string= cur "high") + "low") + ((string= cur "low") + "normal") + (t + "high")))) + (message-goto-eoh) + (insert (format "Importance: %s\n" new))))) + (defun message-elide-region (b e) "Elide the text in the region. An ellipsis (from `message-elide-ellipsis') will be inserted where the @@ -5064,9 +5106,15 @@ (tool-bar-add-item-from-menu 'message-dont-send "cancel" message-mode-map) (tool-bar-add-item-from-menu - 'mml-attach-file "attach" message-mode-map) + 'mml-attach-file "attach" mml-mode-map) (tool-bar-add-item-from-menu 'ispell-message "spell" message-mode-map) + (tool-bar-add-item-from-menu + 'message-insert-importance-high "important" + message-mode-map) + (tool-bar-add-item-from-menu + 'message-insert-importance-low "unimportant" + message-mode-map) tool-bar-map))))) ;;; Group name completion. --- mml.el.~6.40.~ Mon Nov 12 20:17:39 2001 +++ mml.el Thu Nov 15 22:10:39 2001 @@ -728,8 +728,10 @@ (easy-menu-define mml-menu mml-mode-map "" - '("Attachments" - ["Attach File" mml-attach-file t] + `("Attachments" + ["Attach File" mml-attach-file + ,@(if (featurep 'xemacs) '(t) + '(:help "Attach a file at point"))] ["Attach Buffer" mml-attach-buffer t] ["Attach External" mml-attach-external t] ["Insert Part" mml-insert-part t] --- message.texi.~6.26.~ Thu Nov 15 19:11:25 2001 +++ message.texi Thu Nov 15 23:14:10 2001 @@ -481,109 +481,29 @@ @findex message-insert-headers Insert the message headers (@code{message-insert-headers}). -@end table - -@table @code -@item message-ignored-cited-headers -@vindex message-ignored-cited-headers -All headers that match this regexp will be removed from yanked -messages. The default is @samp{.}, which means that all headers will be -removed. - -@item message-cite-prefix-regexp -@vindex message-cite-prefix-regexp -Regexp matching the longest possible citation prefix on a line. - -@item message-citation-line-function -@vindex message-citation-line-function -@cindex attribution line -Function called to insert the citation line. The default is -@code{message-insert-citation-line}, which will lead to citation lines -that look like: - -@example -Hallvard B Furuseth writes: -@end example - -Point will be at the beginning of the body of the message when this -function is called. - -Note that Gnus provides a feature where clicking on `writes:' hides the -cited text. If you change the citation line too much, readers of your -messages will have to adjust their Gnus, too. See the variable -@code{gnus-cite-attribution-suffix}. @xref{Article Highlighting, , -Article Highlighting, gnus}, for details. - -@item message-yank-prefix -@vindex message-yank-prefix -@cindex yanking -@cindex quoting -When you are replying to or following up an article, you normally want -to quote the person you are answering. Inserting quoted text is done -by @dfn{yanking}, and each line you yank will have -@code{message-yank-prefix} prepended to it (except for quoted and -empty lines which uses @code{message-yank-cited-prefix}). The default -is @samp{> }. - -@item message-yank-cited-prefix -@vindex message-yank-cited-prefix -@cindex yanking -@cindex cited -@cindex quoting -When yanking text from a article which contains no text or already -cited text, each line will be prefixed with the contents of this -variable. The default is @samp{>}. See also -@code{message-yank-prefix}. - -@item message-indentation-spaces -@vindex message-indentation-spaces -Number of spaces to indent yanked messages. - -@item message-cite-function -@vindex message-cite-function -@findex message-cite-original -@findex sc-cite-original -@findex message-cite-original-without-signature -@cindex Supercite -Function for citing an original message. The default is -@code{message-cite-original}, which simply inserts the original message -and prepends @samp{> } to each line. -@code{message-cite-original-without-signature} does the same, but elides -the signature. You can also set it to @code{sc-cite-original} to use -Supercite. - -@item message-indent-citation-function -@vindex message-indent-citation-function -Function for modifying a citation just inserted in the mail buffer. -This can also be a list of functions. Each function can find the -citation between @code{(point)} and @code{(mark t)}. And each function -should leave point and mark around the citation text as modified. - -@item message-signature -@vindex message-signature -String to be inserted at the end of the message buffer. If @code{t} -(which is the default), the @code{message-signature-file} file will be -inserted instead. If a function, the result from the function will be -used instead. If a form, the result from the form will be used instead. -If this variable is @code{nil}, no signature will be inserted at all. - -@item message-signature-file -@vindex message-signature-file -File containing the signature to be inserted at the end of the buffer. -The default is @samp{~/.signature}. +@item C-c C-p +@kindex C-c C-p +@findex message-insert-or-toggle-importance +This inserts the @samp{Importance:} header with a value of +@samp{high}. This header is used to signal the importance of the +message to the receiver. If the header is already present in the +buffer, it cycles between the three valid values according to RFC +1376: @samp{low}, @samp{normal} and @samp{high}. + +@item M-x message-insert-importance-high +@kindex M-x message-insert-importance-high +@findex message-insert-importance-high +Insert a @samp{Importance:} header with a value of @samp{high}, +deleting headers if necessary. + +@item M-x message-insert-importance-low +@kindex M-x message-insert-importance-low +@findex message-insert-importance-low +Insert a @samp{Importance:} header with a value of @samp{low}, +deleting headers if necessary. @end table -Note that RFC1036bis says that a signature should be preceded by the three -characters @samp{-- } on a line by themselves. This is to make it -easier for the recipient to automatically recognize and process the -signature. So don't remove those characters, even though you might feel -that they ruin your beautiful design, like, totally. - -Also note that no signature should be more than four lines long. -Including ASCII graphics is an efficient way to get everybody to believe -that you are silly and have nothing important to say. - @node MIME @section MIME @@ -786,7 +706,7 @@ @item M-RET @kindex M-RET -@kindex message-newline-and-reformat +@findex message-newline-and-reformat Insert four newlines, and then reformat if inside quoted text. Here's an example: @@ -941,6 +861,7 @@ * Mail Variables:: Other mail variables. * News Headers:: Customizing news headers. * News Variables:: Other news variables. +* Insertion Variables:: Customizing how things are inserted. * Various Message Variables:: Other message variables. * Sending Variables:: Variables for sending. * Message Buffers:: How Message names its buffers. @@ -1284,6 +1205,111 @@ @end table +@node Insertion Variables +@section Insertion Variables + +@table @code +@item message-ignored-cited-headers +@vindex message-ignored-cited-headers +All headers that match this regexp will be removed from yanked +messages. The default is @samp{.}, which means that all headers will be +removed. + +@item message-cite-prefix-regexp +@vindex message-cite-prefix-regexp +Regexp matching the longest possible citation prefix on a line. + +@item message-citation-line-function +@vindex message-citation-line-function +@cindex attribution line +Function called to insert the citation line. The default is +@code{message-insert-citation-line}, which will lead to citation lines +that look like: + +@example +Hallvard B Furuseth writes: +@end example + +Point will be at the beginning of the body of the message when this +function is called. + +Note that Gnus provides a feature where clicking on `writes:' hides the +cited text. If you change the citation line too much, readers of your +messages will have to adjust their Gnus, too. See the variable +@code{gnus-cite-attribution-suffix}. @xref{Article Highlighting, , +Article Highlighting, gnus}, for details. + +@item message-yank-prefix +@vindex message-yank-prefix +@cindex yanking +@cindex quoting +When you are replying to or following up an article, you normally want +to quote the person you are answering. Inserting quoted text is done +by @dfn{yanking}, and each line you yank will have +@code{message-yank-prefix} prepended to it (except for quoted and +empty lines which uses @code{message-yank-cited-prefix}). The default +is @samp{> }. + +@item message-yank-cited-prefix +@vindex message-yank-cited-prefix +@cindex yanking +@cindex cited +@cindex quoting +When yanking text from a article which contains no text or already +cited text, each line will be prefixed with the contents of this +variable. The default is @samp{>}. See also +@code{message-yank-prefix}. + +@item message-indentation-spaces +@vindex message-indentation-spaces +Number of spaces to indent yanked messages. + +@item message-cite-function +@vindex message-cite-function +@findex message-cite-original +@findex sc-cite-original +@findex message-cite-original-without-signature +@cindex Supercite +Function for citing an original message. The default is +@code{message-cite-original}, which simply inserts the original message +and prepends @samp{> } to each line. +@code{message-cite-original-without-signature} does the same, but elides +the signature. You can also set it to @code{sc-cite-original} to use +Supercite. + +@item message-indent-citation-function +@vindex message-indent-citation-function +Function for modifying a citation just inserted in the mail buffer. +This can also be a list of functions. Each function can find the +citation between @code{(point)} and @code{(mark t)}. And each function +should leave point and mark around the citation text as modified. + +@item message-signature +@vindex message-signature +String to be inserted at the end of the message buffer. If @code{t} +(which is the default), the @code{message-signature-file} file will be +inserted instead. If a function, the result from the function will be +used instead. If a form, the result from the form will be used instead. +If this variable is @code{nil}, no signature will be inserted at all. + +@item message-signature-file +@vindex message-signature-file +File containing the signature to be inserted at the end of the buffer. +The default is @samp{~/.signature}. + +@end table + +Note that RFC1036bis says that a signature should be preceded by the three +characters @samp{-- } on a line by themselves. This is to make it +easier for the recipient to automatically recognize and process the +signature. So don't remove those characters, even though you might feel +that they ruin your beautiful design, like, totally. + +Also note that no signature should be more than four lines long. +Including ASCII graphics is an efficient way to get everybody to believe +that you are silly and have nothing important to say. + + @node Various Message Variables @section Various Message Variables