[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: master 8ee21db4af: Add new function `read-string-from-buffer'.
From: |
Stefan Monnier |
Subject: |
Re: master 8ee21db4af: Add new function `read-string-from-buffer'. |
Date: |
Fri, 29 Apr 2022 09:52:28 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
Jean Louis [2022-04-29 16:18:48] wrote:
> * Stefan Monnier <monnier@iro.umontreal.ca> [2022-04-29 15:21]:
>> Jean Louis [2022-04-29 12:44:41] wrote:
>> > (defun read-from-buffer (&optional value buffer-name mode title keymap
>> > place
>> > highlight-list minor-modes)
>>
>> I'd collapse those "mode title keymap place highlight-list minor-modes"
>> into a singe `setup-function` argument.
>
> Is there example of that to help me understand it?
>
> Do you mean `setup-function` should be a list or hash, or similar data
> type which is then parsed by function?
No, I mean a formal argument called `setup-function` which
`read-from-buffer` would call (probably with 0 arguments) in the buffer.
So instead of:
(read-from-buffer "My prompt: " "*The Buffer*"
#'foo-mode nil foo-map nil nil (list #'bar-minor-mode))
you'd write:
(read-from-buffer "My prompt: " "*The Buffer*"
(lambda ()
(foo-mode)
(use-local-map foo-map)
(bar-minor-mode 1)))
-- Stefan