all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Jean Louis <bugs@gnu.support>, Yuri Khan <yuri.v.khan@gmail.com>
Cc: "carlmarcos@tutanota.com" <carlmarcos@tutanota.com>,
	Help Gnu Emacs <help-gnu-emacs@gnu.org>
Subject: RE: [External] : Re: result of completing-read contradicting require-match
Date: Sun, 10 Jul 2022 14:36:04 +0000	[thread overview]
Message-ID: <SJ0PR10MB548822896FC10800159E7414F3849@SJ0PR10MB5488.namprd10.prod.outlook.com> (raw)
In-Reply-To: <YsmABRQCono2OY6X@protected.localdomain>

> I would like to merge these two functions and use each of them
> sometimes singly. The third merged one would check for both values.

I'm not following this thread.  Just happened to
read your initial statement, which sounds like
you want to repeat invoking a function until it
returns nil or non-nil.

If so, Emacs already gives you that:
`run-hook-with-args-until-failure'
(`*-success' is similar).

https://www.gnu.org/software/emacs/manual/html_node/elisp/Running-Hooks.html


_____ And `C-h v' tells you this ____

run-hook-with-args-until-failure is a built-in function in ‘C source
code’.

(run-hook-with-args-until-failure HOOK &rest ARGS)

Run HOOK with the specified arguments ARGS.
HOOK should be a symbol, a hook variable.  The value of HOOK
may be nil, a function, or a list of functions.  Call each
function in order with arguments ARGS, stopping at the first
one that returns nil, and return nil.  Otherwise (if all functions
return non-nil, or if there are no functions to call), return non-nil
(do not rely on the precise return value in this case).

Do not use `make-local-variable' to make a hook variable buffer-local.
Instead, use `add-hook' and specify t for the LOCAL argument.

  reply	other threads:[~2022-07-10 14:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-02 18:58 result of completing-read contradicting require-match carlmarcos--- via Users list for the GNU Emacs text editor
2022-07-02 19:20 ` Jean Louis
2022-07-02 19:54   ` Yuri Khan
2022-07-02 20:07     ` Jean Louis
2022-07-02 20:38       ` Yuri Khan
2022-07-02 21:58         ` Jean Louis
2022-07-09 13:17     ` Jean Louis
2022-07-10 14:36       ` Drew Adams [this message]
2022-07-10 17:56         ` [External] : " Jean Louis
2022-07-02 21:13   ` carlmarcos--- via Users list for the GNU Emacs text editor

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

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

  git send-email \
    --in-reply-to=SJ0PR10MB548822896FC10800159E7414F3849@SJ0PR10MB5488.namprd10.prod.outlook.com \
    --to=drew.adams@oracle.com \
    --cc=bugs@gnu.support \
    --cc=carlmarcos@tutanota.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=yuri.v.khan@gmail.com \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.