[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: mixing argument types
From: |
Stefan Monnier |
Subject: |
Re: mixing argument types |
Date: |
Sun, 26 Aug 2018 16:23:11 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
> (defun do-a-on-b (a b &optional start stop)
> (interactive
> ;; check (use-region-p)
> (list
> ;; ask for a
> ;; ask for b
> start
> stop)
> ;; ...
> )
The interactive spec can't use `start` and `stop` like you did, since
it (the interactive spec) is what is used to find the arguments to pass
to the function (i.e. to find `start`, `stop, `a`, and `b`).
So you'd write:
(defun do-a-on-b (a b &optional start stop)
(interactive
(list
(completing-read "Give me A: " '("foo" "bar"))
(read-file-name "Give me B:")
(region-beginning)
(region-end)))
...)
-- Stefan
- Re: replace-regexp from A to B?, Emanuel Berg, 2018/08/26
- Re: replace-regexp from A to B?, Rodolfo Medina, 2018/08/26
- Message not available
- Re: replace-regexp from A to B?, Emanuel Berg, 2018/08/26
- mixing argument types (was: Re: replace-regexp from A to B?), Emanuel Berg, 2018/08/26
- Re: mixing argument types,
Stefan Monnier <=
- Message not available
- Re: mixing argument types, Emanuel Berg, 2018/08/26
- Re: mixing argument types, Rodolfo Medina, 2018/08/27
- Message not available
- Re: mixing argument types, Emanuel Berg, 2018/08/27
- Message not available
- Re: mixing argument types, Emanuel Berg, 2018/08/27
- Re: mixing argument types, Rodolfo Medina, 2018/08/28