From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/21066 Path: main.gmane.org!not-for-mail From: Russ Allbery Newsgroups: gmane.emacs.gnus.general Subject: Re: More charset things Date: 08 Feb 1999 21:29:02 -0800 Sender: owner-ding@hpc.uh.edu Message-ID: References: <87d83qkyjf.fsf@pc-hrvoje.srce.hr> <87ognahyoh.fsf@pc-hrvoje.srce.hr> NNTP-Posting-Host: coloc-standby.netfonds.no X-Trace: main.gmane.org 1035159243 21068 80.91.224.250 (21 Oct 2002 00:14:03 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 00:14:03 +0000 (UTC) Return-Path: Original-Received: from spinoza.math.uh.edu (spinoza.math.uh.edu [129.7.128.18]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id AAA14155 for ; Tue, 9 Feb 1999 00:30:32 -0500 (EST) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by spinoza.math.uh.edu (8.9.1/8.9.1) with ESMTP id XAB10258; Mon, 8 Feb 1999 23:29:34 -0600 (CST) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Mon, 08 Feb 1999 23:29:46 -0600 (CST) Original-Received: from sclp3.sclp.com (root@sclp3.sclp.com [204.252.123.139]) by sina.hpc.uh.edu (8.7.3/8.7.3) with ESMTP id XAA01341 for ; Mon, 8 Feb 1999 23:29:38 -0600 (CST) Original-Received: from windlord.stanford.edu (windlord.Stanford.EDU [171.64.12.23]) by sclp3.sclp.com (8.8.5/8.8.5) with SMTP id AAA14123 for ; Tue, 9 Feb 1999 00:29:31 -0500 (EST) Original-Received: (qmail 20769 invoked by uid 50); 9 Feb 1999 05:29:03 -0000 Original-To: ding@gnus.org In-Reply-To: "James H. Cloos Jr."'s message of "08 Feb 1999 16:03:48 -0600" Original-Lines: 75 X-Mailer: Gnus v5.4.66/Emacs 19.34 Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:21066 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:21066 James H Cloos writes: >>>>>> "SSR" == Stainless Steel Rat 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)