help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Local values of PC-word-delimiters.


From: Michaël Cadilhac
Subject: Re: Local values of PC-word-delimiters.
Date: Mon, 17 Apr 2006 19:03:54 +0200
User-agent: Gnus/5.110005 (No Gnus v0.5) Emacs/22.0.50 (gnu/linux)

Kevin Rodgers <ihs_4664@yahoo.com> writes:

> Michaël Cadilhac wrote:
>>   I've a problem I can't solve in a clean way, here.
>>
>>   I   want  that  when   `gnus-group-jump-to-group'  is   called,  its
>>   completing-read (PC enabled) uses `:' as PC-word-delimiters.
>>
>
> Does this work?
>
> (defadvice gnus-group-jump-to-group (before PC-word-delimiters activate)
>   "Temporarily bind  `PC-word-delimiters' while reading GROUP."
>   (interactive
>    (let ((PC-word-delimiters ":"))
>      (call-interactively
>       `(lambda (&rest args)
>          ,(interactive-form 'gnus-group-jump-to-group)
>          args)))))

  Nice try :-)

  Well, it doesn't. It complains about infinite recursion. I think it's
  due to infinite evaluation of the advice on the « interactive-form ».

  However, with a « before » advice, I think jump-to-group would have
  been called twice.

  But you made the thing : just use (interactive) to make the call.
  Arg. The following works :

(defadvice gnus-group-jump-to-group (around PC-word-delimiters activate)
  "Temporarily bind  `PC-word-delimiters' while reading GROUP."
  (interactive
   (let ((PC-word-delimiters ":"))
     (ad-deactivate 'gnus-group-jump-to-group)
     (call-interactively 'gnus-group-jump-to-group)
     (ad-activate 'gnus-group-jump-to-group))))
  
  It seems that ad-do-it can't be used in the interactive part, however.

  Not so clean, but it works at least :-)

-- 
 |      Michaël `Micha' Cadilhac   |   Would someone please DTRT with this  |
 |         Epita/LRDE Promo 2007   |         then ACK?                      |
 | http://www.lrde.org/~cadilh_m   |           -- Richard Stallman          |
 `--  -   JID: micha@amessage.be --'                                   -  --'

Attachment: pgpxXxzCAMNPP.pgp
Description: PGP signature


reply via email to

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