[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Typo in 'org-without-partial-completion'
From: |
David Maus |
Subject: |
Re: [O] Typo in 'org-without-partial-completion' |
Date: |
Sat, 02 Jul 2011 16:55:56 +0200 |
User-agent: |
Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (Gojō) APEL/10.8 Emacs/23.2 (i486-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) |
At Sat, 02 Jul 2011 10:40:31 -0400,
Nick Dokos wrote:
>
> David Maus <address@hidden> wrote:
>
>
> > #+begin_src emacs-lisp
> > (defmacro org-without-partial-completion (&rest body)
> > `(when (and (boundp 'partial-completion-mode)
> > (fboundp 'partial-completion-mode))
> > (unwind-protect
> > (progn
> > (partial-completion-mode -1)
> > ,@body)
> > (partial-completion-mode 1))))
> > #+end_src
> >
> > This avoids leaking if 'body happens to uses a symbol 'pc-mode-p in a
> > different context.
> >
>
> Won't this turn on the mode even if it was off before the macro ws called?
> And if so, isn't that a problem?
Yes and yes.
(and (boundp 'partial-completion-mode)
partial-completion-mode
(fboundp 'partial-completion-mode))
Is the right condition. Bound, non-nil and callable.
@Bastien: Pushed fix for this to master.
Best,
-- David
--
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... address@hidden
Email..... address@hidden
pgpqKPwysMhJ3.pgp
Description: PGP signature