emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

address@hidden: lisp/mail/supercite.el: sc-select-attribution logic is b


From: Richard Stallman
Subject: address@hidden: lisp/mail/supercite.el: sc-select-attribution logic is broken (patch included)]
Date: Wed, 25 May 2005 11:02:19 -0400

[I sent this message two weeks ago but did not get a response.
Would someone please look at this?]

Is there someone here who can evaluate this proposed patch?
I don't use supercite.

------- Start of forwarded message -------
To: address@hidden
From: "Davide G. M. Salvetti" <address@hidden>
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: address@hidden
Subject: lisp/mail/supercite.el: sc-select-attribution logic is broken
        (patch included)
Sender: address@hidden
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 address@hidden 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 <backspace> m a c s - b u <tab> 
<backspace> <backspace> <tab> C-g M-x g <backspace> 
b u g <tab> <tab> C-a C-k r e p o <tab> t <tab> <backspace> 
r <tab> <return>

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
address@hidden
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
------- End of forwarded message -------





reply via email to

[Prev in Thread] Current Thread [Next in Thread]