[Top][All Lists]

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

Re: patch to include EasyPG to Emacs

From: Stefan Monnier
Subject: Re: patch to include EasyPG to Emacs
Date: Sun, 10 Feb 2008 10:44:58 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux)

> - provide epa-*-enable/disable commands for several "intrusive" features for
>   other modes (dired, mail-mode, menu-bars),

Please define them as (global) minor modes instead,

Oh and (memq 'epa-mail-mode mail-mode-hook) is not a good test because
mail-mode-hook may be buffer-local and epa-mail-mode would be only be on
the global part of it.  You can fix the test, but I recommend you don't:
just do the `remove-hook' without checking whether it's done redundantly
or not.


  (define-minor-mode epa-mail-mode
    "Minor mode to hook EasyPG into Mail mode."
    :global t
    (remove-hook 'mail-mode-hook 'epa-mail-mode)
    (if epa-mail-mode
        (add-hook 'mail-mode-hook 'epa-mail-mode)))

-- Stefan

reply via email to

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