From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/13660 Path: main.gmane.org!not-for-mail From: Kim-Minh Kaplan Newsgroups: gmane.emacs.gnus.general Subject: Re: PATCH: Don't quote signature (was: Re: GNKSA and Gnus) Date: 18 Jan 1998 14:16:17 +0100 Sender: owner-ding@hpc.uh.edu Message-ID: References: <199712280107.UAA02498@mail.interpath.net> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 (generated by SEMI MIME-Edit 0.91 - "Hinomiko") Content-Type: multipart/mixed; boundary="Multipart_Sun_Jan_18_14:16:17_1998-1" Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1035152983 10383 80.91.224.250 (20 Oct 2002 22:29:43 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 22:29:43 +0000 (UTC) Return-Path: Original-Received: from xemacs.org (xemacs.cs.uiuc.edu [128.174.252.16]) by altair.xemacs.org (8.8.8/8.8.8) with ESMTP id FAA01304 for ; Sun, 18 Jan 1998 05:30:16 -0800 Original-Received: from gizmo.hpc.uh.edu (gizmo.hpc.uh.edu [129.7.102.31]) by xemacs.org (8.8.5/8.8.5) with ESMTP id HAA08822 for ; Sun, 18 Jan 1998 07:28:24 -0600 (CST) Original-Received: from sina.hpc.uh.edu (sina.hpc.uh.edu [129.7.3.5]) by gizmo.hpc.uh.edu (8.7.6/8.7.3) with ESMTP id IAN15078; Sun, 18 Jan 1998 08:05:09 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Sun, 18 Jan 1998 07:25:54 -0600 (CST) Original-Received: from claymore.vcinet.com (claymore.vcinet.com [208.205.12.23]) by sina.hpc.uh.edu (8.7.3/8.7.3) with SMTP id HAA10658 for ; Sun, 18 Jan 1998 07:25:42 -0600 (CST) Original-Received: (qmail 17177 invoked by uid 504); 18 Jan 1998 13:25:29 -0000 Original-Received: (qmail 17174 invoked from network); 18 Jan 1998 13:25:27 -0000 Original-Received: from lombric.s-ip.eunet.fr (193.107.197.179) by claymore.vcinet.com with SMTP; 18 Jan 1998 13:25:26 -0000 Original-Received: (from kaplan@localhost) by lombric.s-ip.eunet.fr (8.8.5/8.8.5) id OAA00485; Sun, 18 Jan 1998 14:16:17 +0100 Original-To: ding@gnus.org X-Face: C!5Mk_!qB]35}VpD|H>GN/@fk%~7:*/x8&~\]|r|)/zV?rJ){uX4Nh`a$L/z__Kx4Gt!mDU 3kZlj)F2]Ds$?l';SO9]v^|[i2nY`pZ+mu+HT%5ITkuP#e]@8F4@Hc.=]oN1+d\M@Rl>-$C?h$yntf -JVx)3L2}VzG.!bQEy]~I_3fup`HtZ^t/Iz.|Vh$~o`^g\ Original-Lines: 90 X-Mailer: Quassia Gnus v0.22/XEmacs 20.3 - "Vatican City" X-Emacs: 20.3 "Vatican City" XEmacs Lucid without mule Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:13660 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:13660 --Multipart_Sun_Jan_18_14:16:17_1998-1 Content-Type: text/plain; charset=US-ASCII Hrvoje Niksic writes: > Kim-Minh Kaplan writes: > > > Gnus can put the quoted signature in the kill ring. > > I don't think it's a good idea to push things to the kill ring without > user being aware of them. Hmm, I get your point. But if we don't do something, to cite a signature one has to do: C-x b * A r t i c l e * RET M-> C-u C-r ^ - - SPC RET C-> M-w C-x b RET C-y C-x C-x C-x r t > SPC RET Ugly ! And it may be even worse if you have a different citation leader. The attached code will provide `message-yank-cited-signatures' to fetch the quoted signature. > "Beware of bugs in the above code; I have only proved it correct, > not tried it." -- Donald Knuth Well... Beware of features in the code below: I have only tried it :-) Kim-Minh. --Multipart_Sun_Jan_18_14:16:17_1998-1 Content-Type: text/plain; charset=US-ASCII --- /usr/local/lib/xemacs/gnus/lisp/message.el Tue Jan 6 07:48:40 1998 +++ /usr/tmp/message.el Sun Jan 18 14:01:10 1998 @@ -814,6 +814,7 @@ (defvar message-this-is-news nil) (defvar message-this-is-mail nil) (defvar message-draft-article nil) +(defvar message-cite-signatures nil) ;; Byte-compiler warning (defvar gnus-active-hashtb) @@ -1170,6 +1171,7 @@ (define-key message-mode-map "\C-c\C-n" 'message-insert-newsgroups) (define-key message-mode-map "\C-c\C-y" 'message-yank-original) + (define-key message-mode-map "\C-cy" 'message-yank-cited-signatures) (define-key message-mode-map "\C-c\C-q" 'message-fill-yanked-message) (define-key message-mode-map "\C-c\C-w" 'message-insert-signature) (define-key message-mode-map "\C-c\C-r" 'message-caesar-buffer-body) @@ -1689,24 +1691,43 @@ (defun message-cite-original () "Cite function in the standard Message manner." + (unless (local-variable-p 'message-cite-signatures (current-buffer)) + (make-local-variable 'message-cite-signatures) + (setq message-cite-signatures nil)) (let ((start (point)) + (end (mark t)) + sig-start (functions (when message-indent-citation-function (if (listp message-indent-citation-function) message-indent-citation-function (list message-indent-citation-function))))) + (goto-char end) + (when (re-search-backward "^-- $" start t) + (setq sig-start (point-marker))) (goto-char start) (while functions (funcall (pop functions))) (when message-citation-line-function (unless (bolp) (insert "\n")) - (funcall message-citation-line-function)))) + (funcall message-citation-line-function)) + (when sig-start + (setq message-cite-signatures + (append message-cite-signatures + (list (buffer-substring sig-start (mark t))))) + (delete-region sig-start (mark t)) + (set-marker sig-start nil)))) (defun message-insert-citation-line () "Function that inserts a simple citation line." (when message-reply-headers (insert (mail-header-from message-reply-headers) " writes:\n\n"))) + +(defun message-yank-cited-signatures () + "Insert quoted signatures that where elided by the citation function." + (interactive) + (mapc 'insert message-cite-signatures)) (defun message-position-on-field (header &rest afters) (let ((case-fold-search t)) --Multipart_Sun_Jan_18_14:16:17_1998-1--