From: Russ Allbery <rra@stanford.edu>
Subject: Re: More charset things
Date: 08 Feb 1999 21:29:02 -0800 [thread overview]
Message-ID: <ylk8xsno0x.fsf@windlord.stanford.edu> (raw)
In-Reply-To: "James H. Cloos Jr."'s message of "08 Feb 1999 16:03:48 -0600"
James H Cloos <cloos@jhcloos.com> writes:
>>>>>> "SSR" == Stainless Steel Rat <ratinox@peorth.gweep.net> writes:
> SSR> And wow! I just noticed how badly Supercite failed to deal with
> SSR> your mailbox. Probably because you have 8-bit data in a field
> SSR> that specifically calls for ASCII and only ASCII. This one isn't
> SSR> a MULE bug, because there is no MULE in my XEmacs.
> Odd. Works for me in GNU Emacs 20.3.1, with supercite.el revision:
> 3.54. (Which says it was last modified 1993/09/22 18:58:46, FWIW.)
supercite.el has a lot of major annoyances in what it's willing to
recognize as valid characters for names and for e-mail addresses. I use
the following, which fixes it a little at lesat for me:
;; Override sc-get-address with something that's less picky about what it's
;; willing to consider an address (supercite's default truncates the address
;; at the first odd-looking character).
(defun sc-get-address (from author)
"Get the full email address path from FROM.
AUTHOR is the author's name (which is removed from the address)."
(let ((eos (length from)))
(if (string-match (concat "\\(^\\|^\"\\)" (regexp-quote author)
"\\(\\s +\\|\"\\s +\\)") from 0)
(let ((address (substring from (match-end 0) eos)))
(if (and (= (aref address 0) ?<)
(= (aref address (1- (length address))) ?>))
(substring address 1 (1- (length address)))
address))
(if (string-match
"[ ]*<?\\([^ (>]+@[^ (>]+\\)" from 0)
(sc-submatch 1 from)
""))))
;; Override sc-attribs-extract-namestring so that it will correctly cope
;; with From headers that contain no address (which is becoming more common
;; with munging, even if it's technically illegal).
(defun sc-attribs-extract-namestring (from)
"Extract the name string from FROM.
This should be the author's full name minus an optional title."
(let ((namestring
(or
;; If there is a <...> in the name,
;; treat everything before that as the full name.
;; Even if it contains parens, use the whole thing.
;; On the other hand, we do look for quotes in the usual way.
(and (string-match " *<.*>" from 0)
(let ((before-angles
(sc-name-substring from 0 (match-beginning 0) 0)))
(if (string-match "\".*\"" before-angles 0)
(sc-name-substring
before-angles (match-beginning 0) (match-end 0) 1)
before-angles)))
(sc-name-substring
from (string-match "(.*)" from 0) (match-end 0) 1)
(sc-name-substring
from (string-match "\".*\"" from 0) (match-end 0) 1)
(sc-name-substring
from (string-match "\\([-.a-zA-Z0-9_]+\\s *\\)+" from 0)
(match-end 0) 0)
(sc-attribs-emailname from))))
;; strip off any leading or trailing whitespace
(if namestring
(let ((bos 0)
(eos (1- (length namestring))))
(while (and (<= bos eos)
(memq (aref namestring bos) '(32 ?\t)))
(setq bos (1+ bos)))
(while (and (> eos bos)
(memq (aref namestring eos) '(32 ?\t)))
(setq eos (1- eos)))
(substring namestring bos (1+ eos))))))
--
Russ Allbery (rra@stanford.edu) <URL:http://www.eyrie.org/~eagle/>
next prev parent reply other threads:[~1999-02-09 5:29 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-02-03 18:09 Lars Magne Ingebrigtsen
1999-02-04 14:56 ` Hrvoje Niksic
1999-02-04 17:08 ` Lars Magne Ingebrigtsen
1999-02-04 17:21 ` Hrvoje Niksic
1999-02-04 17:49 ` Lars Magne Ingebrigtsen
1999-02-05 0:47 ` Stephen J. Turnbull
1999-02-05 2:43 ` Hrvoje Niksic
[not found] ` <m3hft163aa.fsf@peorth.gweep.net>
1999-02-05 19:06 ` Vladimir Volovich
[not found] ` <m3sockqqjx.fsf@peorth.gweep.net>
1999-02-06 15:55 ` Lars Magne Ingebrigtsen
[not found] ` <m3lnia5922.fsf@peorth.gweep.net>
1999-02-07 21:02 ` Hrvoje Niksic
1999-02-09 15:56 ` Lars Magne Ingebrigtsen
1999-02-09 17:21 ` Hrvoje Niksic
1999-02-09 17:31 ` Alan Shutko
1999-02-09 17:37 ` Lars Magne Ingebrigtsen
1999-02-09 18:06 ` Hrvoje Niksic
1999-02-08 16:04 ` Bill White
1999-02-09 16:04 ` Lars Magne Ingebrigtsen
1999-02-06 8:17 ` Lars Magne Ingebrigtsen
1999-02-09 10:27 ` Displayed [ 0: Stephen J. Turnbull ] but it had lots of lines Alf-Ivar Holm
1999-02-09 16:14 ` Lars Magne Ingebrigtsen
1999-02-09 22:07 ` More charset things Jan Vroonhof
[not found] ` <m3hft163aa.fsf@p <byu2wv6xkb.fsf@bolzano.math.ethz.ch>
1999-02-09 22:13 ` Hrvoje Niksic
1999-02-07 20:43 ` François Pinard
1999-02-08 2:09 ` Martin Buchholz
1999-02-22 15:52 ` François Pinard
1999-02-08 14:49 ` Robert Bihlmeyer
[not found] ` <m37lttydo2.fsf@peorth.gweep.net>
1999-02-08 9:55 ` Kai.Grossjohann
1999-02-08 15:52 ` François Pinard
[not found] ` <m3n22ou09w.fsf@peorth.gweep.net>
1999-02-08 23:19 ` François Pinard
1999-02-09 8:05 ` Steinar Bang
1999-02-14 18:10 ` UTF-8 (Was: More charset things) Steinar Bang
1999-02-09 16:03 ` More charset things Lars Magne Ingebrigtsen
1999-02-08 17:29 ` Karl Eichwalder
1999-02-08 22:03 ` James H. Cloos Jr.
1999-02-09 5:29 ` Russ Allbery [this message]
1999-02-09 7:33 ` James H. Cloos Jr.
1999-02-10 2:13 ` Stephen Zander
1999-02-11 10:09 ` Jan Vroonhof
1999-02-07 19:37 ` François Pinard
1999-02-08 0:06 ` Kenichi Handa
1999-02-07 19:35 ` François Pinard
1999-02-08 13:37 ` Simon Josefsson
1999-02-08 23:43 ` Kenichi Handa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ylk8xsno0x.fsf@windlord.stanford.edu \
--to=rra@stanford.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).