[Top][All Lists]

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

lisp/mail/supercite.el: sc-select-attribution logic is broken (patch inc

From: Davide G. M. Salvetti
Subject: lisp/mail/supercite.el: sc-select-attribution logic is broken (patch included)
Date: Mon, 09 May 2005 13:58:58 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

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"
         ((".*" . (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

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!"

In GNU Emacs (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' 

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]
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...
Making completion list...
Loading emacsbug...done

reply via email to

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