emacs-wiki-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[emacs-wiki-discuss] [[spaces in link names]]


From: Joe Corneli
Subject: [emacs-wiki-discuss] [[spaces in link names]]
Date: Mon, 29 Mar 2004 02:05:15 -0600

I found it helpful to include set `emacs-wiki-publishing-transforms' to 
replace " " by "-space-".  I.e., this is in my custom-set-variables:

 '(emacs-wiki-publishing-transforms (quote ((" " . "-space-"))))

This makes it so that the pages work when served up by Apache (and
the user never has to see the weird file or link names).

So that was no big deal - but if spaces are going to be allowed in
link names by default, something like this should also become the
default.

It was also necessary to redefine `emacs-wiki-transform-name' as
follows:

(defsubst emacs-wiki-transform-name (name)
  "Transform NAME as per `emacs-wiki-publishing-transforms', returning NAME"
  (save-match-data
    (mapc (function
           (lambda (elt)
             (let ((reg (car elt))
                   (rep (cdr elt)))
                 (setq name (replace-regexp-in-string reg rep name nil t)))))
          emacs-wiki-publishing-transforms)
    name))

If you look at the documentation for `replace-match' (it was used
here as of 2004.03.24-19.31), you'll see that it only replaces the
_first_ match.

By contrast, `replace-regexp-in-string' replaces all matches.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]