emacs-devel
[Top][All Lists]
Advanced

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

RE: propose adding Icicles to Emacs


From: Drew Adams
Subject: RE: propose adding Icicles to Emacs
Date: Thu, 21 Jun 2007 17:20:57 -0700

> > In Icicles, you do not enter a regexp (with RET) at all.
> > You type some input and then complete it. One of the
> > completion possibilities is to use regexp matching instead
> > of prefix matching.
>
> We're talking about entering a regexp for (a more powerful version of)
> `customize-apropos-faces'.  The result of your call to `completing-read'
> is a regexp, which you then pass to the original c-a-f.  The
> "completions", however, are not regexps, and so look very odd in the
> context of completing the user's input -- of a regexp.  That's all I'm
> saying.

I think I understand you now. Does the following description help?

1. In the Icicles version, the prompt does not say "Customize regexp: " as
it does in vanilla Emacs. It says "Customize faces (regexp): ". IMO, the
original prompt is misleading - you are customizing faces, not a regexp
(whatever that would mean). You are entering a regexp in order to customize
the faces whose names match it - in both Icicles and vanilla Emacs.

2. At the prompt, you can type text that matches any number of face names.
You can enter this text, with `RET', just as for the current `c-a-f', and
the result will be identical to what happens today with `c-a-f': the faces
whose names match the text you entered will be customized together, in the
same Customize buffer. The text you enter is matched as a regexp against the
names of available faces (by vanilla `c-a-f'). With this usage, there is
zero difference from what happens in vanilla Emacs (except for the clearer
prompt in the Icicles case).

3. Alternatively, in Icicles you can type the same regexp but not hit RET
(yet). If you hit S-TAB, then the matching faces are available as completion
candidates. Yes, you are completing against face names, not against regexps
(whatever that might mean). If you then hit RET, then this is identical to
#2 - you simply had the advantage of previewing the faces that match.

If all of the faces have a common substring, then you will need to hit `C-l'
before `RET', to retrieve your regexp in the minibuffer. By default, Icicles
replaces your regexp in the minibuffer with the longest substring common to
all matches (this behavior is optional).

4. If the preview of the matching faces is not what you expect, you can edit
the regexp in the minibuffer - *Completions* is updated to reflect that
edit. Again, if you hit `RET', then go to #2 - you get the same behavior as
for `c-a-f'.

5. If, after hitting S-TAB, you want to customize only some of the matching
faces, you can use `C-RET' or `C-mouse-2' to choose those you want. (You can
use `next' and `prior' to cycle among the candidates, to be able to choose
some with `C-RET'.) There are additional ways that you can narrow down your
choice to a smaller set of face names, including these: (a) type additional
regexps that face names must also match, (b) exclude some names by typing
additional regexps and complementing their matches. You can use `RET' (go to
#2) to customize those that still match after narrowing the choices.

6. You need not ever use `RET' to end the `completing-read' call (and the
command), however. If you have already used `C-RET' with `S-TAB' to open
Customize buffers for all of the faces that you want to customize, then you
can just use `C-g' to end the command. (Or use `RET' with a regexp, such as
`uuuuuuuu', that matches no face names.)

HTH. Let me know if something is still not clear. Also, you might just give
it a try; it's easier (and more fun) to use than to read about.

Also, please see my followup message the same day, where I explained that
there is in fact not much need for such a command(!), whether the vanilla or
the Icicles version. I showed that the simple Icicles command
`icicle-customize-face' is about as good:

(defun icicle-customize-face (face)
  "Customize face FACE."
  (interactive
    (list (let ((icicle-candidate-action-fn 'customize-face))
            (read-face-name "Customize face: "))))
  (customize-face face))

The only disadvantage is that you cannot use this command to customize all
matching faces in the same Customize buffer - you get a different Customize
buffer for each face. On the other hand, two advantages are that (1) the
display of matching faces can be WYSIWYG (because it uses
`read-face-name') - a much better preview, and (2) you can get help about
individual faces while you are choosing them, in case you have a doubt about
the meanings (uses) of some of them.

Besides these differences, the reason for mentioning this command is to
illustrate how easy it is to define (vs the definition of vanilla `c-a-f').
And with Richard's proposed implementation of `call-interactively', even the
above definition would presumably be superfluous: `customize-face' would
work for any number of faces. (That assumes Icicles regexp matching with
S-TAB.)







reply via email to

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