[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Local values of PC-word-delimiters.
From: |
Kevin Rodgers |
Subject: |
Re: Local values of PC-word-delimiters. |
Date: |
Mon, 17 Apr 2006 10:22:10 -0600 |
User-agent: |
Mozilla Thunderbird 0.9 (X11/20041105) |
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.
>
> Easy you say ? Thought so ;-)
>
> I first tried
>
> (add-hook 'gnus-group-mode
> (lambda ()
> (set (make-local-variable 'PC-word-delimiters) ":")))
>
> But it was no use since we're in the minibuffer when
> PC-word-delimiters is read.
>
> I then tried
>
> (defadvice gnus-group-jump-to-group (around dummy-name activate)
> (let ((PC-word-delimiters ":"))
> ad-do-it))
>
> But since `gnus-group-jump-to-group' uses completing-read in its
> `interactive' part, the advice is executed AFTER it.
>
> Do you have any clean solution ?
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)))))
--
Kevin Rodgers