From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Maus Subject: IMPORTANT Modified link escaping in Org mode Date: Thu, 17 Feb 2011 20:57:09 +0100 Message-ID: <87k4gysacq.wl%dmaus@ictsoc.de> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: multipart/mixed; boundary="===============0777122245==" Return-path: Received: from [140.186.70.92] (port=39966 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pq9yZ-0003yF-6V for emacs-orgmode@gnu.org; Thu, 17 Feb 2011 14:57:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pq9yW-0001yl-SW for emacs-orgmode@gnu.org; Thu, 17 Feb 2011 14:57:19 -0500 Received: from mail.app1.xlhost.de ([213.202.242.114]:47403 helo=mysql1.xlhost.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pq9yW-0001yH-JU for emacs-orgmode@gnu.org; Thu, 17 Feb 2011 14:57:16 -0500 Received: from x60s.ictsoc.de.ictsoc.de (p5485C684.dip.t-dialin.net [84.133.198.132]) (Authenticated sender: dmaus@ictsoc.de) by mysql1.xlhost.de (Postfix) with ESMTPSA id 9D3158A for ; Thu, 17 Feb 2011 20:57:12 +0100 (CET) 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 --===============0777122245== Content-Type: multipart/signed; boundary="pgp-sign-Multipart_Thu_Feb_17_20:57:09_2011-2"; micalg=pgp-sha256; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit --pgp-sign-Multipart_Thu_Feb_17_20:57:09_2011-2 Content-Type: multipart/mixed; boundary="Multipart_Thu_Feb_17_20:57:09_2011-1" Content-Transfer-Encoding: 7bit --Multipart_Thu_Feb_17_20:57:09_2011-1 Content-Type: text/plain; charset=US-ASCII Hello everybody, I've just pushed a series of commits to current master that modifies Org modes link escaping functions. Percent escaping is used in Org mode to escape certain characters in links that would either break the parser (e.g. square brackets in link target oder description) or are not allowed to appear in a particular link type (e.g. non-ascii characters in a http: link). With this change in place Org will apply percent escaping and unescaping more consistently especially for non-ascii characters. Additionally some of the outstanding bugs or glitches concerning percent escaped links are solved. However, this change has the potential to break existing links in your documents in at least one case: Links that contain a literal percent sign followed by two characters in [0-9a-fA-f] might break if this sequence of characters is /not/ a percent escape. E.g. a link to a directory literally called "foo%45bar" will break because the new unescaping function will happily interpret the "%45" as a percent encoded letter "E". To detect at least some of such problematic links you can run the attached command `dmaus/org-check-percent-escapes' in a Org mode buffer. It will scan all links in the buffer and issue a warning for each link that contains a sequence that matches aformentioned pattern and is not one of the escape sequences used by Org up to know. If you experience any problems with this change please don't forget to Cc: me so the complaints will end up in my main mailbox. Best, -- David -- OpenPGP... 0x99ADB83B5A4478E6 Jabber.... dmjena@jabber.org Email..... dmaus@ictsoc.de --Multipart_Thu_Feb_17_20:57:09_2011-1 Content-Type: application/octet-stream; type=emacs-lisp Content-Disposition: attachment; filename="dmaus-org-check-percent-escapes.el" Content-Transfer-Encoding: 7bit (defun dmaus/org-check-percent-escapes () "*Check buffer for possibly problematic old link escapes." (interactive) (when (eq major-mode 'org-mode) (let ((old-escapes '("%20" "%5B" "%5D" "%E0" "%E2" "%E7" "%E8" "%E9" "%EA" "%EE" "%F4" "%F9" "%FB" "%3B" "%3D" "%2B"))) (unless (boundp 'warning-suppress-types) (setq warning-suppress-types nil)) (widen) (show-all) (goto-char (point-min)) (while (re-search-forward org-any-link-re nil t) (let ((end (match-end 0))) (goto-char (match-beginning 0)) (while (re-search-forward "%[0-9a-zA-Z]\\{2\\}" end t) (let ((escape (match-string-no-properties 0))) (unless (member (upcase escape) old-escapes) (warn "Found unknown percent escape sequence %s at buffer %s, position %d" escape (buffer-name) (- (point) 3)))))))))) --Multipart_Thu_Feb_17_20:57:09_2011-1-- --pgp-sign-Multipart_Thu_Feb_17_20:57:09_2011-2 Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iF4EAREIAAYFAk1dfZUACgkQma24O1pEeObHbgEA7SLUhOK3Dm387aFfbu9EjbN6 XexrK5W3C6KwPSkUDxwA/i7ovRBxc6u6UTqBY0gcaoUHwedbp2CS1E3/eBCz3xXN =sgia -----END PGP SIGNATURE----- --pgp-sign-Multipart_Thu_Feb_17_20:57:09_2011-2-- --===============0777122245== 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 --===============0777122245==--