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

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

Re: [emacs-wiki-discuss] Re: Publishing my plan pages


From: Jim Crossley
Subject: Re: [emacs-wiki-discuss] Re: Publishing my plan pages
Date: Thu, 22 Sep 2005 11:47:32 -0400
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.3 (gnu/linux)

Hi...

Michael Olson <address@hidden> writes:

> Jim Crossley <address@hidden> writes:
>
>> John Sullivan <address@hidden> writes:
>>
>>> Jim Crossley <address@hidden> writes:
>>>
>>>> Is there some way I can apply a regexp to replace those "pos" tags
>>>> with HTML anchors in the output?
>
> Adding this to your .emacs might work.
>
> (defun planner-resolve-position-url (id)
>   (save-match-data
>     (when (string-match "^pos://\\(.+\\)/\\([^/]+\\)#\\([0-9]+\\)" id)
>       (concat "http://myurl.com/depot/"; (match-string 2 id)
>               "#" (match-string 3 id)))))

You da man!  I had to tweak it a bit, though...

(defun planner-resolve-position-url (id)
  (save-match-data
    (when (string-match "^pos:///home/jim\\(/depot.+\\)%23\\([0-9]+\\)" id)
      (concat "http://myurl.com/"; (match-string 1 id) "?ac=22"))))

It seems the id comes in "url encoded", so I had to replace the '#'
with %23 to achieve a match.  The rest of the gunk (ac=22) is specific
to p4web.  

Thanks again!
Jim




reply via email to

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