[Top][All Lists]

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

[emacs-wiki-discuss] Re: a emacs-wiki but no planner.el question

From: Sacha Chua
Subject: [emacs-wiki-discuss] Re: a emacs-wiki but no planner.el question
Date: Sun, 24 Oct 2004 22:33:46 +0900
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux)

Gregor Zattler <address@hidden> writes:

>>     Here is a link to [[subdir/SubFile][SubFile]]
>> <a href="subdir/SubFile">SubFile</a>
>> when it really should be:
>> <a href="subdir/SubFile.html">SubFile</a>
> This is still the case (and a problem) even with subdir being one
> element of the emacs-wiki-directory list:

I think the following patch fixes the problem by checking the file
list for absolute filenames and using that to determine whether or not
a file is part of the wiki. If we want to prevent images and whatnot
from being considered, then, we will need to filter
emacs-wiki-file-alist accordingly. Anyway, this seems to work over
here. =)

--- orig/emacs-wiki-publish.el
+++ mod/emacs-wiki-publish.el
@@ -1567,23 +1567,20 @@
   "Resolve the given WIKI-LINK into its ultimate URL form."
   (let ((link (emacs-wiki-wiki-link-target wiki-link)))
-        (if (or (emacs-wiki-wiki-url-p link)
-                (string-match emacs-wiki-image-regexp link)
-                (string-match emacs-wiki-file-regexp link))
-            link
-          (if (assoc (emacs-wiki-wiki-base link)
-                     (emacs-wiki-file-alist))
-              (if (string-match "#" link)
-                  (concat
-                   (emacs-wiki-escape-url
-                    (emacs-wiki-published-name
-                     (substring link 0 (match-beginning 0))
-                     (emacs-wiki-page-name)))
-                   "#"
-                   (substring link (match-end 0)))
-                (emacs-wiki-escape-url
-                 (emacs-wiki-published-name link
-                                            (emacs-wiki-page-name)))))))))
+        (if (rassoc (expand-file-name link)
+                    (emacs-wiki-file-alist))
+            (if (string-match "#" link)
+                (concat
+                 (emacs-wiki-escape-url
+                  (emacs-wiki-published-name
+                   (substring link 0 (match-beginning 0))
+                   (emacs-wiki-page-name)))
+                 "#"
+                 (substring link (match-end 0)))
+              (emacs-wiki-escape-url
+               (emacs-wiki-published-name link
+                                          (emacs-wiki-page-name))))
+            link))))
 (defsubst emacs-wiki-link-href (url name)
   "Return an href string for URL and NAME."

Sacha Chua <address@hidden> - open source geekette
interests: emacs, gnu/linux, making computer science education fun
wearable computing, personal information management
http://sacha.free.net.ph/ - PGP Key ID: 0xE7FDF77C

reply via email to

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