unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Jean Louis <bugs@gnu.support>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Sean Whitton <spwhitton@spwhitton.name>,
	Lars Ingebrigtsen <larsi@gnus.org>,
	emacs-devel@gnu.org
Subject: Re: master 8ee21db4af: Add new function `read-string-from-buffer'.
Date: Wed, 18 May 2022 08:17:44 +0300	[thread overview]
Message-ID: <YoSBeMHOT8Nl7fs3@protected.localdomain> (raw)
In-Reply-To: <jwv1qxgf1aj.fsf-monnier+emacs@gnu.org>

* 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	other threads:[~2022-05-18  5:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <165080616575.16300.17375829044466066664@vcs2.savannah.gnu.org>
     [not found] ` <20220424131606.1E4FEC009A8@vcs2.savannah.gnu.org>
2022-04-24 14:03   ` master 8ee21db4af: Add new function `read-string-from-buffer' Sean Whitton
2022-04-24 14:07     ` Lars Ingebrigtsen
2022-04-29  9:44     ` Jean Louis
2022-04-29 12:20       ` Stefan Monnier
2022-04-29 13:18         ` Jean Louis
2022-04-29 13:52           ` Stefan Monnier
2022-05-18  5:17             ` Jean Louis [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YoSBeMHOT8Nl7fs3@protected.localdomain \
    --to=bugs@gnu.support \
    --cc=emacs-devel@gnu.org \
    --cc=larsi@gnus.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=spwhitton@spwhitton.name \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).