emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Vincent Belaïche" <vincent.b.1@hotmail.fr>
To: Org mode <emacs-orgmode@gnu.org>, giovanni.ridolfi@yahoo.it
Cc: "Vincent Belaïche" <vincent.b.1@hotmail.fr>
Subject: Re: %20 in file://... URL
Date: Sat, 13 Nov 2010 07:18:42 +0100	[thread overview]
Message-ID: <80hbfl4ugt.fsf@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 124 bytes --]


[...]

>
>Please, do! :-)
>
>Giovanni
>

Herein attached follows my patch. Please feel free for brickbats...

   Vincent.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: %xx decode --]
[-- Type: text/x-patch, Size: 1738 bytes --]

*** 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))

[-- Attachment #3: Change log --]
[-- Type: text/plain, Size: 218 bytes --]

2010-11-13  Vincent Belaïche  <vincentb1@users.sourceforge.net>

	* org.el (org-open-file): Decode %XX escapes in URL with file
	type, so that applications other than browsers are not confused with the filename.


[-- Attachment #4: Type: text/plain, Size: 201 bytes --]

_______________________________________________
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

             reply	other threads:[~2010-11-13  6:18 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-13  6:18 Vincent Belaïche [this message]
2010-11-13  6:28 ` %20 in file://... URL Vincent Belaïche
2010-11-14 17:30 ` David Maus
2010-11-17 20:43 ` David Maus
2010-11-17 20:43 ` David Maus
  -- strict thread matches above, loose matches on Subject: below --
2010-12-30  5:29 Vincent Belaïche
2010-11-23  5:25 Vincent Belaïche
2010-11-24 20:57 ` David Maus
2011-02-12 14:36   ` Bastien
     [not found] ` <BLU104-W15A3F7F6097ED8F6D95CEB84210@phx.gbl>
2010-11-29 20:03   ` David Maus
2010-11-22 15:46 Vincent Belaïche
2010-11-22 18:16 ` David Maus
2011-02-12 15:02   ` Bastien
2010-11-22 15:46 Vincent Belaïche
2010-11-05  6:42 Vincent Belaïche
2010-11-05  8:39 ` Giovanni Ridolfi
2010-10-27 21:19 Vincent Belaïche
2010-10-26  5:15 Vincent Belaïche
2010-10-26 15:39 ` Giovanni Ridolfi
2010-10-24 20:49 Vincent Belaïche
2010-10-24 21:02 ` David Maus

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

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=80hbfl4ugt.fsf@gmail.com \
    --to=vincent.b.1@hotmail.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=giovanni.ridolfi@yahoo.it \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).