From: David Maus <dmaus@ictsoc.de>
To: Michael Brand <michael.ch.brand@gmail.com>
Cc: David Maus <dmaus@ictsoc.de>, org-mode <emacs-orgmode@gnu.org>
Subject: Re: IMPORTANT Modified link escaping in Org mode
Date: Sun, 13 Mar 2011 17:04:48 +0100 [thread overview]
Message-ID: <87hbb70zxb.wl%dmaus@ictsoc.de> (raw)
In-Reply-To: <AANLkTi=GW7Uo1HsV08OT6oK8ZD83qLerYMeLJw0NbDF-@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1735 bytes --]
At Sun, 13 Mar 2011 14:37:05 +0100,
Michael Brand wrote:
>
> Hi David
>
> The current version of dmaus/org-check-percent-escapes from Worg
> http://orgmode.org/worg/org-hacks.html#check-old-link-escapes
> loops forever in the outer while when used on a one line Org buffer
> containing just [[http://www.orgmode.org]] except I hack something
> like (goto-char end) behind the inner while. What am I doing wrong?
> Did anybody else have this issue?
Sorry, my fault. Forgot to move point forward after matching a link.
I pushed this fixed version to Worg:
#+begin_src emacs-lisp
(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)))))
(goto-char end))))))
#+end_src
Best,
-- David
--
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... dmjena@jabber.org
Email..... dmaus@ictsoc.de
[-- Attachment #2: Type: application/pgp-signature, Size: 230 bytes --]
prev parent reply other threads:[~2011-03-13 16:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-17 19:57 IMPORTANT Modified link escaping in Org mode David Maus
2011-02-19 11:11 ` Bastien
2011-02-20 10:34 ` David Maus
2011-02-22 11:21 ` Bastien
2011-03-13 13:37 ` Michael Brand
2011-03-13 16:04 ` David Maus [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87hbb70zxb.wl%dmaus@ictsoc.de \
--to=dmaus@ictsoc.de \
--cc=emacs-orgmode@gnu.org \
--cc=michael.ch.brand@gmail.com \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.