From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?iso-8859-1?Q?Vincent_Bela=EFche?= Subject: Re: %20 in file://... URL Date: Sat, 13 Nov 2010 07:18:42 +0100 Message-ID: <80hbfl4ugt.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from [140.186.70.92] (port=44211 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PH9Ro-0007DE-0d for emacs-orgmode@gnu.org; Sat, 13 Nov 2010 01:18:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PH9Rm-0005EP-Qc for emacs-orgmode@gnu.org; Sat, 13 Nov 2010 01:18:47 -0500 Received: from smtp09.smtpout.orange.fr ([80.12.242.131]:54160 helo=smtp.smtpout.orange.fr) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PH9Rm-0005E0-G9 for emacs-orgmode@gnu.org; Sat, 13 Nov 2010 01:18:46 -0500 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Org mode , giovanni.ridolfi@yahoo.it Cc: =?iso-8859-1?Q?Vincent_Bela=EFche?= --=-=-= [...] > >Please, do! :-) > >Giovanni > Herein attached follows my patch. Please feel free for brickbats... Vincent. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=org.el.diff Content-Description: %xx decode *** org.el.old Fri Nov 5 19:16:29 2010 --- org.el Sat Nov 13 05:50:54 2010 *************** *** 9639,9647 **** opened in Emacs, unless an entry from org-file-apps that makes use of groups in a regexp matches. If the file does not exist, an error is thrown." ! (let* ((file (if (equal path "") buffer-file-name ! (substitute-in-file-name (expand-file-name path)))) (file-apps (append org-file-apps (org-default-apps))) (apps (org-remove-if 'org-file-apps-entry-match-against-dlink-p file-apps)) --- 9639,9666 ---- opened in Emacs, unless an entry from org-file-apps that makes use of groups in a regexp matches. If the file does not exist, an error is thrown." ! (let* ((%xx-decoded-path ! (let ((pos 0) (%xx-decoded-path path)) ! (setq %xx-decoded-path path) ! (while (setq pos (string-match "%\\([0-9A-F]\\)\\([0-9A-F]\\)" %xx-decoded-path pos)) ! (setq pos (1+ pos) ! %xx-decoded-path (replace-match ! (string (let ((code 0) digit) ! (dotimes (i 2) ! (setq ! digit (aref (match-string (1+ i) %xx-decoded-path) 0) ! code (+ (if (<= digit ?9) ! (- digit ?0) ! (- digit 55)) ! (* 16 code)))) code)) ! t t %xx-decoded-path))) ! ;; remove //localhost/ prefix if any ! (and (string-match "\\`//localhost/" %xx-decoded-path) ! (setq %xx-decoded-path (substring %xx-decoded-path 12))) ! %xx-decoded-path)) ! (file (if (equal path "") buffer-file-name ! (substitute-in-file-name (expand-file-name %xx-decoded-path)))) (file-apps (append org-file-apps (org-default-apps))) (apps (org-remove-if 'org-file-apps-entry-match-against-dlink-p file-apps)) --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline; filename=ChangeLog Content-Transfer-Encoding: quoted-printable Content-Description: Change log 2010-11-13 Vincent Bela=EFche * org.el (org-open-file): Decode %XX escapes in URL with file type, so that applications other than browsers are not confused with the f= ilename. --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --=-=-=--