all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "Juri Linkov" <juri@jurta.org>
Cc: emacs-devel@gnu.org
Subject: RE: completing-read-multiple and read-face-name are not in Elisp manual
Date: Tue, 19 Jun 2007 15:47:57 -0700	[thread overview]
Message-ID: <EIENLHALHGIMHGDOLMIMIEMCDCAA.drew.adams@oracle.com> (raw)
In-Reply-To: <87ir9j4mfl.fsf@jurta.org>

> > I find nothing about this behavior described anywhere in the
> > Emacs manual or the Elisp manual. How will users understand
> > the UI? How will programmers understand how these functions
> > work (without examining the code in detail)?
>
> This is an optional feature

What is? Do you mean completing multiple face names? My question was more
general. `completing-read-multiple' is presumably not tied to face-name
completion - it too should be documented, IMO.

> that users can encounter only when running
> `describe-face' on the face name in the `defface' definition
> (where one face gets picked from the face name, and another
> from the face used to highlight
> it by font-lock mode - font-lock-variable-name).
>
> However, this feature could be documented and developed further to e.g.
> allowing selecting multiple faces from the *Completions* buffer, inserting
> them into the minibuffer separated by a comma, and calling a multi-command
> on them.

Not sure I understand you well, but I think there is no need to insert the
selected faces in the minibuffer all at once separated by commas. When you
say "calling a multi-command on them", do you mean calling it on each of
them individually or acting on the set of them collectively?

If you're talking about an Icicles multi-command that would act on multiple
faces individually, the way to do that is to define an Icicles
(multi-)command that acts on a single face.

(icicle-define-command my-cmd
  "Do `something' to one or more faces"
  something
  "Choose a face: "
  (mapcar #'icicle-make-face-candidate (face-list))
  (not (wholenump icicle-WYSIWYG-Completions-flag)))

Function `something' is the action function here. Users can apply it to any
number of faces during completion, using `C-RET'.

Or, if you mean to act on a set of chosen faces collectively (as a set, not
individually), then you would call `icicle-face-list' in some function and
act on the list of faces that the user chose:

(icicle-define-command icicle-face-list
  "Choose a list of face names.  The list of names is returned."
  (lambda (name) (push name face-names))
  "Choose face (`RET' when done): "
  (mapcar #'icicle-make-face-candidate (face-list))
  nil t nil 'face-name-history
  nil nil
  ((face-names nil)                     ; Additional bindings
   (icicle-use-candidates-only-once-flag t))
  nil nil                               ; First code, undo code
  (prog1 (setq face-names (delete "" face-names)) ; Return list
   (when (interactive-p) (message "Faces: %S" face-names))))

Commands such as `icicle-face-list' are handy to use as functions in, say,
the interactive spec of other commands. You can, for instance, define a
command that lets users pick a list of faces to act on, and then does
something with that combination (e.g. merge or whatever). Other commands
that return a list of items that a user picks include: `icicle-buffer-list'
and `icicle-file-list'.

  reply	other threads:[~2007-06-19 22:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-19 18:48 completing-read-multiple and read-face-name are not in Elisp manual Drew Adams
2007-06-19 22:09 ` Juri Linkov
2007-06-19 22:47   ` Drew Adams [this message]
2007-06-20 14:07     ` Juri Linkov
2007-06-20 13:28 ` Richard Stallman
2007-06-20 13:41   ` Drew Adams

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=EIENLHALHGIMHGDOLMIMIEMCDCAA.drew.adams@oracle.com \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=juri@jurta.org \
    /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.