emacs-pretest-bug
[Top][All Lists]
Advanced

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

supercite sets initials to "" if name can't be determined


From: Klaus Zeitler
Subject: supercite sets initials to "" if name can't be determined
Date: Mon, 30 Aug 2004 11:38:29 +0200 (MEST)

Symptoms:

I noticed that the function sc-select-attribution behaves differently when I
have "initials" in the sc-preferred-attribution-list and supercite isn't able
to determine a name. If no name ca't be determined, the function
sc-select-attribution provides a 2nd method to determine an attribution.
See this code snippet:
--- snip ---

    ;; still couldn't find an attribution. we're now limited to using
    ;; the default attribution, but we'll force a query when this happens
    (if (not attribution)
        (setq attribution sc-default-attribution
              query-p t))

--- snip ---

Unfortunately if sc-preferred-attribution-list contains "initials", the first
algorithm determines "" as attribution. I think this should be nil. Otherwise
the 2nd algorithm wont be used.

If no name can't be determined, sc-attributions contains something like:
(("sc-lastchoice" . "Anon")
 ("firstname")
 ("lastname")
 ("emailname" . "some email address")
 ("initials . ""))

I fixed this behavior by changing the function sc-attribs-strip-initials to
return nil if namelist is nil:
(defun sc-attribs-strip-initials (namelist)
  "Extract the author's initials from the NAMELIST."
  (and namelist
       (mapconcat
        (function
         (lambda (name)
           (if (< 0 (length name))
               (substring name 0 1))))
        namelist "")))
 

Local in buffer *

In GNU Emacs 21.3.50.6 (sparc-sun-solaris2.8, Motif Version 2.1.0)
 of 2004-08-26 on sfsws4
configured using `configure '--with-gcc' 
'--prefix=/vol/freeware/SunOS-5.8/emacs/cvs' 
'--sharedstatedir=/vol/freeware/SunOS-5.8/emacs/cvs/share' 
'--with-x-toolkit=motif' 
'--x-includes=/usr/openwin/include:/usr/local/gnu/include' 
'--x-libraries=/usr/openwin/lib:/usr/local/gnu/lib' '--with-pop' 'CC=gcc''

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: C
  locale-coding-system: nil
  default-enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  tool-bar-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  unify-8859-on-encoding-mode: t
  utf-translate-cjk-mode: t
  line-number-mode: t

Recent input:
<next> <help-echo> <help-echo> <help-echo> <help-echo> 
<menu-bar> <help-menu> <report-emacs-bug>

Recent messages:
Loading mwheel...done
(/usr/local/gnu/cvs/head/bin/emacs -q --no-site-file)
Loading tool-bar...done
Loading image...done
Loading tooltip...done
For information about the GNU Project and its goals, type C-h C-p.
call-interactively: End of buffer
Loading emacsbug...done




reply via email to

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