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: Mon, 11 Jun 2007 10:29:39 -0700

>     Icicles does not use advice. Well, there is one tiny
>     exception, which could  be replaced:
>
>     (defadvice next-history-element
>
> What job does this advice do?

I explained that a few lines further, which you quoted below.

>     If Icicles were integrated with Emacs, either
>     `next-history-element' itself could be patched to be
>     Icicles-aware or, if that is a no-no, Icicles could
>     redefine `next-history-element' for `icicle-mode' use only.
>
> Redefining such a function is almost as bad as advising it.
> The goal is to avoid both such methods.

I share the goal of avoiding redefining and advice. When you are working
outside the Emacs sources, you are sometimes forced to do one or the other.

>       All this code does, BTW, is preselect part of the current
>     candidate in the minibuffer, for easy manipulation or
>     deletion. This preselection is optional.
>
> I don't understand "preselect" in this context.  Can you explain?

User option `icicle-init-value-flag', if non-nil, copies the default value
for completion to the minibuffer as an initial value. In that case, the
option also determines whether the initial value is preselected (region)
and, if so, where point and mark should be positioned.

People have different preferences. This has an importance especially if you
use delete-selection mode, where you can simply type to replace or delete
the active region.

These are the values for the option:

(choice
 (const :tag "Do not insert default value as initial value"
        nil)
 (const :tag "Insert (and leave cursor at end)"
        insert)
 (const :tag "Insert, preselect, and leave cursor at beginning"
        preselect-start)
 (const :tag "Insert, preselect, and leave cursor at end"
        preselect-end))

The default value of the option is nil. I personally use the value `insert',
which does not preselect any text.

BTW - a related feature exists for the current candidate, which is inserted
in the minibuffer during cycling. You can act on that candidate or edit its
text.

Two user options determine where to place point and mark wrt that minibuffer
input. Again, this has an importance especially for delete-selection mode.

These are the values for the mark position. Similarly for point.

(choice
 (const :tag "Leave mark at the beginning of the minibuffer input"
        input-start)
 (const :tag "Leave mark at the end of the minibuffer input"
        input-end)
 (const :tag "Leave mark at the beginning of the completion root"
        root-start)
 (const :tag "Leave mark at the end of the completion root"
        root-end))

"Root" refers to the common substring for all currently matching candidates.
"Input" refers to the complete minibuffer input. You can place point or mark
at the beginning or end of the root being completed or you can place point
or mark at the beginning or end of the entire minibuffer input.

You can thus make the region include all of the input, only the root, from
beginning to root, or from root to end.  You can put the cursor at either
end of the region.  You can make the region empty, by making point and mark
coincide (at any of the possible positions). These possibilities exist
because different people can have different preferences for minibuffer
input.

Icicles selects part of the minibuffer input according to these options.
Vanilla emacs does not provide candidate cycling, where the current
candidate becomes the entire minibuffer input. So vanilla Emacs cannot use
such a text-selection feature.







reply via email to

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