logo       

Re: Change in emacs-wiki that affects Planner pages: msg#00138

emacs.wiki.general

Subject: Re: Change in emacs-wiki that affects Planner pages

Michael Olson <mwolson@xxxxxxxxxxxxxx> writes:

> Due to a change in `emacs-wiki-link-(un)escape', the second part of
> any old extended links with spaces in them will show "%20" in place
> of a space.

I didn't want to change my old files, so I unescape %20 in the second
part of links. escape and unescape don't have to be perfectly
symmetrical. =)

Here's the workaround for people who are similarly lazy:

(defadvice emacs-wiki-link-unescape (around sacha activate)
"Unescape dangerous characters in TEXT.

If FURTHER is set to t, which indicates link description,
unescape brackets and #. If FURTHER is unspecified or nil, which
indicates link destination, unescape brackets and spaces."
(setq ad-return-value
(when text
(save-match-data
(emacs-wiki-replace-regexp-in-string
"%5B" "["
(emacs-wiki-replace-regexp-in-string
"%5D" "]"
(if further
(emacs-wiki-replace-regexp-in-string
"%23" "#"
(emacs-wiki-replace-regexp-in-string
"%20" " " text))
text)))))))

--
Sacha Chua <sacha@xxxxxxxxxxx> - open source geekette
http://sacha.free.net.ph/ - PGP Key ID: 0xE7FDF77C
interests: emacs, gnu/linux, personal information management, CS ed
applying as a Debian new maintainer | looking for a grad school


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise