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

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

[emacs-wiki-discuss] Re: Report on emacs-wiki interwiki breakage


From: Michael Olson
Subject: [emacs-wiki-discuss] Re: Report on emacs-wiki interwiki breakage
Date: Tue, 24 Aug 2004 19:27:02 -0500
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3.50 (gnu/linux)

Thanks, Mark!  The patch really helps a lot.  Now interwiki links are
highlighted correctly and hitting <RET> on them works as expected
(there is one slight non-related quirk, but I will address that
later).

There is one more issue that I'm experiencing now: the use of an
undefined variable called `emacs-wiki-url-server-regexp' in
`emacs-wiki-relative-link-maybe', which causes publishing to bomb.

The variable appears to come from Gary Vaughan's branch, so I've
included a patch that defines this variable the way he does currently.
This variable doesn't appear in any of the changelogs, so I assume
that this is another issue that came from patch-50.  The patch I've
submitted is against patch-63 and includes Mark's patch, BTW.  My
first patch isn't needed anymore, apparently, as Mark's fixes the
problem better.  You could call this the `patch-64-pre3' patch, I
suppose, lol.  For brevity's sake, I ran diff with the `-b' and `-w'
options when making the patch.

After taking care of that, now there is yet *another* problem that
surfaces :^( .  An error of some sort halts the publication process.
To see it:

- Open emacs-wiki.el and do a M-C-x on the
  `emacs-wiki-wiki-link-target' function.

- Make a file in one of your wiki directories that contains an
  interwiki link.  Perhaps using only one interwiki link will make
  things easier to debug since I've noticed that having many links can
  cause edebug sessions to interrupt each other sometimes.

- Do a C-c C-p to attempt publishing.

- Hit `g' when edebug comes up.

- Note that `name' is set to nil, and the code

      (if (string-match "^\\[\\[\\([^]]+\\)\\]" name)
          (setq name (match-string 1 name)))

  triggers the error.

I will do some further investigation on this tomorrow, since my brain
is fried from tracing this problem :^) .

--- orig/emacs-wiki.el  2004-08-24 19:12:11.000000000 -0500
+++ mod/emacs-wiki.el   2004-08-24 19:16:56.000000000 -0500
@@ -326,7 +326,14 @@
           (concat "\\<\\("
                   (mapconcat 'car emacs-wiki-url-protocols "\\|")
                   "\\):"
-                  "[^]  \n \"'()<>[^`{}]*[^]    \n \"'()<>[^`{}.,;]+")))
+                  "[^]  \n \"'()<>[^`{}]*[^]    \n \"'()<>[^`{}.,;]+")
+          emacs-wiki-url-server-regexp
+          (concat "\\<\\("
+                  (mapconcat 'car emacs-wiki-url-protocols "\\|")
+                  "\\):"
+                  "\\([^:@address@hidden:]+\\)?"
+                  "\\([^]      \n \"'()<>[^`{},;/]+\\)"
+                  "\\(/.*\\|$\\)")))
   (setq emacs-wiki-url-or-name-regexp
         (concat "\\("
                 (if (eq sym 'emacs-wiki-name-regexp)
@@ -380,6 +387,11 @@
   "A regexp used to match URLs within a Wiki buffer.
 Dynamically calculated from `emacs-wiki-url-protocols'.")
 
+(defvar emacs-wiki-url-server-regexp
+  nil
+  "A regexp used to match server URLs from `emacs-wiki-project-server-prefix'.
+Dynamically calculated from `emacs-wiki-url-protocols'.")
+
 (defcustom emacs-wiki-grep-command
   "find %D -type f ! -name '*~' | xargs egrep -n -e \"\\<%W\\>\""
   "The name of the program to use when grepping for backlinks.
@@ -4067,13 +4079,13 @@
          (file-relative-name dest src))))
 
 (defun emacs-wiki-project-interwiki-link (project tag)
+  (with-emacs-wiki-project project
+    (if emacs-wiki-publishing-p
   (let ((page-publishing-directory
          (file-name-directory
           (concat emacs-wiki-project-server-prefix
-                  (emacs-wiki-link-url (emacs-wiki-page-name))))))
-    (with-emacs-wiki-project project
-      (if emacs-wiki-publishing-p
-          (let ((url (emacs-wiki-link-url (or tag emacs-wiki-home-page))))
+                        (emacs-wiki-link-url (emacs-wiki-page-name)))))
+              ((url (emacs-wiki-link-url (or tag emacs-wiki-home-page)))))
             (cond
              ;; bad link, no prefix will be added
              ((null url) "")
@@ -4090,7 +4102,7 @@
         (or (emacs-wiki-page-file (or tag emacs-wiki-home-page))
             ;; doesn't yet exist, so we don't qualify the name, causing it
             ;; to be rendered as a bad link
-            tag)))))
+          tag))))
 
 ;; URLs
 
Mark Triggs <address@hidden> writes:
>
> I've attached a patch against emacs-wiki--dev--1.0--patch-63 that
> fixes that problem (at least, for me ;o).  It looks like the problem
> was introduced in emacs-wiki--dev--patch-50.
>
> Take care,
>
> Mark
>

reply via email to

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