emacs-devel
[Top][All Lists]
Advanced

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

Re: master 8ee21db4af: Add new function `read-string-from-buffer'.


From: Jean Louis
Subject: Re: master 8ee21db4af: Add new function `read-string-from-buffer'.
Date: Wed, 18 May 2022 08:17:44 +0300
User-agent: Mutt/2.2.0 (2022-02-12)

* Stefan Monnier <monnier@iro.umontreal.ca> [2022-04-29 16:54]:
> 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)))
> 

I got that, thank you. That is generally good idea for some functions
that require more arguments.


-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



reply via email to

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