GNU bug report logs -
#78658
30.1; [PATCH] Dired feature suggestion: dired-on-marked-files-in-all-buffers
Previous Next
Full log
Message #44 received at 78658 <at> debbugs.gnu.org (full text, mbox):
Drew Adams via "Bug reports for GNU Emacs, the Swiss army knife of text
editors" <bug-gnu-emacs <at> gnu.org> writes:
>> > > (let ((common (try-completion "" files)))
>> >
>> > My brain had failed to make the connection between "completion"
>> > and programmatically obtaining a common prefix from list of
>> > strings. It makes perfect sense in hindsight, but I'd simply
>> > never thought about completion in non-interactive terms, and was
>> > surprised when I hadn't found a documented function for doing
>> > this (but I wasn't looking under Completion at all).
>> >
>> > Eli, I reckon this is worth either documenting somewhere under
>> > (info "(elisp) Strings and Characters") or else creating a
>> > slightly more string-centric wrapper, something like:
>>
>> Feel free to suggest patches for the documentation, but please
>> remember that results of calling completion functions can depend on
>> the completion styles in effect, so if we want to advertise this as a
>> way of producing the largest common prefix, we should probably bind
>> completion-styles to something specific around this call.
>
> That may be a good point. In a way it's too bad that
> `completion-styles' affects `try-completion'.
Note that the `completion-styles' only affect
`completion-try-completion' and `completion-all-completions', but not
the primitive `try-completion', which always computes the common prefix.
This bug report was last modified 68 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.