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

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

RE: [emacs-wiki-discuss] Re: Some more protocols


From: Phillip Lord
Subject: RE: [emacs-wiki-discuss] Re: Some more protocols
Date: Sat, 11 Mar 2006 17:30:00 -0000

Michael Olson wrote:
> "Phillip Lord" <address@hidden> writes:
> 
>> Incidentally, has anyone else had strange problems with protocols
>> when running emacs in batch? I've found that when changing
>> muse-url-protocols in a normal, interactive, emacs muse-url-regexp
>> gets updated correctly (even though I don't use custom to do this).
>> But in batch, it doesn't update.
>> 
>> I was going to suggest deleting muse-url-regexp and replacing it with
>> a function for use instead (of course, there is nothing to stop the
>> function from storing the regexp it calculates, and then checking
>> each time to make sure that muse-url-protocols hasn't changed). This
>> way, muse would not be relying on a side-effect of custom setting
>> muse-url-protocol to keep things up to date.
> 
> Add the following to your configuration, after setting
> muse-url-protocols. 
> 
> (muse-update-url-regexp 'muse-url-protocols
>                         muse-url-protocols)

Okay, this is a bit neater. I'd just stolen the setq from 
muse-update-url-regexp. I'll move this over. Thanks!

> 
> One potential solution to this mess is to make a hook that gets
> called just before publishing (or in muse-mode, for displaying Muse
> files), and add all of these extra code snippets to it.  I think I'll
> go with that.   

Makes sense. It caused a bery obscure bug which was pretty painful 
to track down (because it only occurred when running in batch). 

 
>>      (defun phil-muse-resolve-url-doi (url)
>>        "Return the URL through doi proxy server"
>>        (when (string-match "\\`doi:\\(.+\\)" url)
>>          (concat "http://dx.doi.org/";
>>                  (match-string 1 url))))
>> 
>>      (defun phil-muse-browse-url-doi (url)
>>        (let ((doi-url (phil-muse-resolve-url-doi url)))         
>>            (when doi-url (browse-url doi-url))))
> 
> I've added this, since you say it is fairly standard.

Good, stuff. 

 
>>      ;; interwiki protocol handling. This enables non wiki word type
>>      ;; interwiki support, with a different local resolve.
>>      ;; (adelete 'muse-url-protocols "iw:")
>>      (add-to-list 'muse-url-protocols
>>                   '("iw:" phil-muse-browse-url-iw
>> phil-muse-resolve-url-iw))
> 
> Haven't taken a look at this yet.  I will do so next week.


Okay. The implementation is straight forward enough. 

Cheers

Phil






reply via email to

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