From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/53841 Path: main.gmane.org!not-for-mail From: Reiner Steib <4.uce.03.r.s@nurfuerspam.de> Newsgroups: gmane.emacs.gnus.general Subject: Re: gnus-url-mailto broken on foo+bar@somewhere.invalid Date: Wed, 27 Aug 2003 15:22:28 +0200 Organization: Dept. of Theoretical Physics, University of Ulm Sender: ding-owner@lists.math.uh.edu Message-ID: References: Reply-To: reiner.steib@gmx.de NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1061991044 12129 80.91.224.253 (27 Aug 2003 13:30:44 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 27 Aug 2003 13:30:44 +0000 (UTC) Original-X-From: ding-owner+M2381@lists.math.uh.edu Wed Aug 27 15:30:42 2003 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19s0Nm-00054D-00 for ; Wed, 27 Aug 2003 15:30:42 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 19s0NL-0006y5-00; Wed, 27 Aug 2003 08:30:15 -0500 Original-Received: from sclp3.sclp.com ([64.157.176.121]) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 19s0ND-0006xz-00 for ding@lists.math.uh.edu; Wed, 27 Aug 2003 08:30:07 -0500 Original-Received: (qmail 69046 invoked by alias); 27 Aug 2003 13:30:07 -0000 Original-Received: (qmail 69041 invoked from network); 27 Aug 2003 13:30:07 -0000 Original-Received: from main.gmane.org (80.91.224.249) by sclp3.sclp.com with SMTP; 27 Aug 2003 13:30:07 -0000 Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 19s0Nw-0001Zl-00 for ; Wed, 27 Aug 2003 15:30:52 +0200 Mail-Followup-To: ding@gnus.org X-Injected-Via-Gmane: http://gmane.org/ Original-To: ding@gnus.org Original-Received: from sea.gmane.org ([80.91.224.252]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19s0Nv-0001Zd-00 for ; Wed, 27 Aug 2003 15:30:51 +0200 Original-Received: from news by sea.gmane.org with local (Exim 3.35 #1 (Debian)) id 19s0NA-00037f-00 for ; Wed, 27 Aug 2003 15:30:04 +0200 Original-Lines: 103 Original-X-Complaints-To: usenet@sea.gmane.org X-Face: mtjf/D:es1T0wHO:&CJ'ZXe"l;3C--rw\z!{`eFwL){|]RpI+4{u25L=5C /0>KuGeTsk<~<&NE-AKV1560e!+RJeyWmSskkrJm?[vUV#66{T_m|Ae<||Ku#Mk5`y&O`n~z2;n8eP J5#2h@2eQgV@E70IY_0WlEx!"&giy{+\%h1LJox$zv@/l%ZmU4^tZA>xQpnkUBVC5.jpg#0'(+2?Rs )NAr:>3<=WxHE$ktbLysDIM5TbmHu*3 ;; Fixme: Do it like QP. > (defun gnus-url-unhex-string (str &optional allow-newlines) > "Remove %XX, embedded spaces, etc in a url. > If optional second argument ALLOW-NEWLINES is non-nil, then allow the > decoding of carriage returns and line feeds in the string, which is normally > forbidden in URL encoding." JFTR: Beside in `gnus-url-mailto' and in `gnus-url-parse-query-string' (that is only used in `gnus-url-mailto'), `gnus-url-unhex-string' is only used for info and customize URLs. It's never used for http URLs. Ah, there's one occurance in `nnwfm.el'[2], which is not mentioned in the manual. > (setq str (or (mm-subst-char-in-string ?+ ? str) "")) ; why `or'? > > Two questions? > (a) What's meant with the comment? ShengHuo[1] changed the line like this: - (setq str (or str "")) + (setq str (or (mm-subst-char-in-string ?+ ? str) "")) Wild guess: No error if `str' is nil? The comment was added later; I couldn't find a ChangeLog entry for it. > (b) What is the substitution good for? The reason AFAICS are info URLs like . It has been introduced along with this ChangeLog entry (see patch below[1]): ,----[ 1 ] | 2001-08-17 22:00:00 ShengHuo ZHU | | * gnus.el (gnus-info-find-node): Take an argument. | | * gnus-art.el (gnus-button-handle-info): New function. | (gnus-url-unhex-string): Replace "+" with " ". `---- Bye, Reiner. [1] --8<---------------cut here---------------start------------->8--- --- gnus-art.el.~6.103~ Tue Aug 26 21:12:16 2003 +++ gnus-art.el.~6.104~ Tue Aug 26 21:07:59 2003 @@ -4697,7 +4697,7 @@ ;;; Internal Variables: -(defcustom gnus-button-url-regexp "[...]mailto\\):[...]" +(defcustom gnus-button-url-regexp "[...]mailto\\|info\\):[...]" "Regular expression that matches URLs." :group 'gnus-article-buttons :type 'regexp) @@ -4716,6 +4716,9 @@ ("\\( \n\t]+\\)>" 0 t gnus-url-mailto 2) ("mailto:\\([-a-zA-Z.@_+0-9%=?]+\\)" 0 t gnus-url-mailto 1) ("\\bmailto:\\([^ \n\t]+\\)" 0 t gnus-url-mailto 1) + ;; This is info + ("\\binfo:\\(//\\)?\\([^'\">\n\t ]+\\)" 0 t + gnus-button-handle-info 2) ;; This is how URLs _should_ be embedded in text... ("]*\\)>" 0 t gnus-button-embedded-url 1) ;; Raw URLs. @@ -5086,6 +5089,18 @@ (group (gnus-button-fetch-group url))))) +(defun gnus-button-handle-info (url) + "Fetch an info URL." + (if (string-match + "^\\([^:/]+\\)?/\\(.*\\)" + url) + (gnus-info-find-node + (concat "(" (or (gnus-url-unhex-string (match-string 1 url)) + "Gnus") + ")" + (gnus-url-unhex-string (match-string 2 url)))) + (error "Can't parse %s" url))) + (defun gnus-button-message-id (message-id) "Fetch MESSAGE-ID." (save-excursion @@ -5142,7 +5157,7 @@ If optional second argument ALLOW-NEWLINES is non-nil, then allow the decoding of carriage returns and line feeds in the string, which is normally forbidden in URL encoding." - (setq str (or str "")) + (setq str (or (mm-subst-char-in-string ?+ ? str) "")) (let ((tmp "") (case-fold-search t)) (while (string-match "%[0-9a-f][0-9a-f]" str) --8<---------------cut here---------------end--------------->8--- [2] ;;; nnwfm.el --- interfacing with a web forum -- ,,, (o o) ---ooO-(_)-Ooo--- PGP key available via WWW http://rsteib.home.pages.de/