[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#17871: 24.4.50; (elisp) `Core Advising Primitives': interactive spec
From: |
Lars Ingebrigtsen |
Subject: |
bug#17871: 24.4.50; (elisp) `Core Advising Primitives': interactive spec as function? |
Date: |
Sun, 18 Aug 2019 16:06:27 -0700 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
Štěpán Němec <stepnem@gmail.com> writes:
> Well, the closest I see in my init is this (in fact I have been doing it
> differently and more uglily, but now I see this is simpler):
>
> (defun my-compose-mail-advice (orig &rest args)
> "Read From: address interactively."
> (interactive (lambda (spec)
> (let* ((user-mail-address
> (completing-read "From: " '("one.address@example.net"
>
> "alternative.address@example.net")))
> (from (message-make-from user-full-name
> user-mail-address))
> (spec (advice-eval-interactive-spec spec)))
> ;; notmuch doesn't understand "From", it has to be a symbol
> (push (cons 'From from) (nth 2 spec))
> spec)))
> (apply orig args))
>
> (advice-add 'compose-mail :around #'my-compose-mail-advice)
That's a good example. I've now added it to the trunk with some slight
modifications.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
- bug#17871: 24.4.50; (elisp) `Core Advising Primitives': interactive spec as function?, Lars Ingebrigtsen, 2019/08/04
- bug#17871: 24.4.50; (elisp) `Core Advising Primitives': interactive spec as function?, Michael Heerdegen, 2019/08/04
- bug#17871: 24.4.50; (elisp) `Core Advising Primitives': interactive spec as function?, Lars Ingebrigtsen, 2019/08/04
- bug#17871: 24.4.50; (elisp) `Core Advising Primitives': interactive spec as function?, Štěpán Němec, 2019/08/04
- bug#17871: 24.4.50; (elisp) `Core Advising Primitives': interactive spec as function?, Michael Heerdegen, 2019/08/05
- bug#17871: 24.4.50; (elisp) `Core Advising Primitives': interactive spec as function?, Štěpán Němec, 2019/08/05
- bug#17871: 24.4.50; (elisp) `Core Advising Primitives': interactive spec as function?, Lars Ingebrigtsen, 2019/08/05
- bug#17871: 24.4.50; (elisp) `Core Advising Primitives': interactive spec as function?, Michael Heerdegen, 2019/08/18
- bug#17871: 24.4.50; (elisp) `Core Advising Primitives': interactive spec as function?, Štěpán Němec, 2019/08/18
- bug#17871: 24.4.50; (elisp) `Core Advising Primitives': interactive spec as function?,
Lars Ingebrigtsen <=
- bug#17871: 24.4.50; (elisp) `Core Advising Primitives': interactive spec as function?, Štěpán Němec, 2019/08/18
- bug#17871: 24.4.50; (elisp) `Core Advising Primitives': interactive spec as function?, Drew Adams, 2019/08/18
- bug#17871: 24.4.50; (elisp) `Core Advising Primitives': interactive spec as function?, Juri Linkov, 2019/08/20
- bug#17871: 24.4.50; (elisp) `Core Advising Primitives': interactive spec as function?, Štěpán Němec, 2019/08/20
- bug#17871: 24.4.50; (elisp) `Core Advising Primitives': interactive spec as function?, Stefan Monnier, 2019/08/21
- bug#17871: 24.4.50; (elisp) `Core Advising Primitives': interactive spec as function?, Štěpán Němec, 2019/08/21
- bug#17871: 24.4.50; (elisp) `Core Advising Primitives': interactive spec as function?, Stefan Monnier, 2019/08/25