From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: [salve@debian.org: lisp/mail/supercite.el: sc-select-attribution logic is broken (patch included)] Date: Wed, 11 May 2005 12:25:22 -0400 Message-ID: Reply-To: rms@gnu.org NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1115828723 24861 80.91.229.2 (11 May 2005 16:25:23 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 11 May 2005 16:25:23 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 11 18:25:18 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DVtzk-0003p1-6k for ged-emacs-devel@m.gmane.org; Wed, 11 May 2005 18:23:36 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DVu8V-0006Sb-PA for ged-emacs-devel@m.gmane.org; Wed, 11 May 2005 12:32:39 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DVu6J-0005Wz-68 for emacs-devel@gnu.org; Wed, 11 May 2005 12:30:23 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DVu6G-0005VN-6q for emacs-devel@gnu.org; Wed, 11 May 2005 12:30:20 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DVu6F-0005UJ-Me for emacs-devel@gnu.org; Wed, 11 May 2005 12:30:19 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DVu91-00087N-BH for emacs-devel@gnu.org; Wed, 11 May 2005 12:33:11 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1DVu1S-0003Rt-L2; Wed, 11 May 2005 12:25:22 -0400 Original-To: emacs-devel@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:36978 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:36978 Is there someone here who can evaluate this proposed patch? I don't use supercite. ------- Start of forwarded message ------- To: emacs-pretest-bug@gnu.org From: "Davide G. M. Salvetti" Organization: Quis ut Deus? X-PGP-Fingerprint: D3B2 A3F5 E9EB BDE6 A245 AA4A 212B 306C 9396 865D X-PGP-Affinity: Will accept encrypted messages for GNU Privacy Guard X-Accept-Language: en, it, de, es Date: Mon, 09 May 2005 13:58:58 +0200 X-ASICTP-MailScanner-Information: Please see http://www.ictp.trieste.it/antispam.html X-ASICTP-MailScanner: Found to be clean X-ASICTP-MailScanner-SpamCheck: not spam (whitelisted), SpamAssassin (score=-2.82, required 5, ALL_TRUSTED -2.82) X-MailScanner-From: salve@hal.linux.it Subject: lisp/mail/supercite.el: sc-select-attribution logic is broken (patch included) Sender: emacs-pretest-bug-bounces+rms=gnu.org@gnu.org X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on monty-python X-Spam-Level: X-Spam-Status: No, hits=0.0 required=5.0 tests=none autolearn=no version=2.63 This bug report will be sent to the Free Software Foundation, not to your local site managers! Please write in English if possible, because the Emacs maintainers usually do not have translators to read other languages for them. Your bug report will be posted to the emacs-pretest-bug@gnu.org mailing list. Please describe exactly what actions triggered the bug and the precise symptoms of the bug: Premise: a very short patch is included. I don't think you need signed papers for it, but otherwise I'm willing to sign them (I did it already for AUCTeX contributions). I added "sc-consult" to sc-preferred-attribution-list and the suggested form to sc-attrib-selection-list in order to have the BBDB consulted when choosing an attribution to quote citations from a message being replied to (as per bbdb.info, node: Supercite Prep): ======================================================================== (setq sc-preferred-attribution-list '("sc-lastchoice" "x-attribution" "sc-consult" "initials" "firstname" "lastname") sc-attrib-selection-list '(("sc-from-address" ((".*" . (bbdb/sc-consult-attr (sc-mail-field "sc-from-address"))))))) ======================================================================== However, contrary to what I expected, SuperCite ended with the "firstname" citation style whenever the BBDB had no suggestion, rather than with "initials". By inspecting the code (lisp/mail/supercite.el), I found that the logic of the function sc-select-attribution is (I believe) broken: it stops scanning sc-preferred-attribution-list even if bbdb/sc-consult-attr returns nil. Therefore, the backup attribution selection code controlled by sc-use-only-preference-p is executed and "firstname" get selected, even if I expected "initials" (look at my sc-preferred-attribution-list). The very simple patch included below checks to see if bbdb/sc-consult-attr returns a not nil value and doesn't stop to scan sc-preferred-attribution-list otherwise (I believe this should be the intended behavior). Please, apply it to lisp/mail/supercite.el. ======================================================================== - --- lisp/mail/supercite.el 2005-04-04 11:19:51.000000000 +0200 +++ lisp/mail/supercite-dgms.el 2005-05-09 13:30:56.000000000 +0200 @@ -1174,8 +1174,9 @@ (setq attribution attrib attriblist nil)) ((listp attrib) - - (setq attribution (eval attrib) - - attriblist nil)) + (setq attribution (eval attrib)) + (when attribution + (setq attriblist nil)) (t (error "%s did not evaluate to a string or list!" "sc-attrib-selection-list")) ))) ======================================================================== In GNU Emacs 22.0.50.1 (i386-pc-linux-gnu, GTK+ Version 2.6.4) of 2005-05-09 on rino, modified by Debian Distributor `The X.Org Foundation', version 11.0.60801099 configured using `configure '--build' 'i386-linux-gnu' '--host' 'i386-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--with-gif' '--with-x=yes' '--with-x-toolkit=gtk' 'CFLAGS=-DDEBIAN -g -O2' 'build_alias=i386-linux-gnu' 'host_alias=i386-linux-gnu'' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: nil locale-coding-system: nil default-enable-multibyte-characters: t Major mode: Emacs-Lisp Minor modes in effect: eldoc-mode: t checkdoc-minor-mode: t whitespace-global-mode: t auto-image-file-mode: t show-paren-mode: t mouse-wheel-mode: t tooltip-mode: t auto-compression-mode: t global-font-lock-mode: t font-lock-mode: t unify-8859-on-encoding-mode: t utf-translate-cjk-mode: t column-number-mode: t line-number-mode: t next-error-follow-minor-mode: Fol Recent input: C-b C-b C-b u t i o n C-e C-j ( i f SPC a t t r i b u t i o n M-b M-b M-d w h e n C-e C-b C-j ( s e t q SPC a t t r i b l i s t SPC n i l C-f C-f C-f C-M-k C-k C-k C-x C-s M-x e b m a c s - b u C-g M-x g b u g C-a C-k r e p o t r Recent messages: Mark saved where search started Undo! [3 times] Auto-saving... Saving file /home/salve/+wd/emacs/lisp/mail/supercite-dgms.el... Whitespaces: [i] in /home/salve/+wd/emacs/lisp/mail/supercite-dgms.el Wrote /home/salve/+wd/emacs/lisp/mail/supercite-dgms.el Making completion list... Quit Making completion list... Loading emacsbug...done _______________________________________________ Emacs-pretest-bug mailing list Emacs-pretest-bug@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug ------- End of forwarded message -------