unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* AW: Re: [Emacs-diffs] master d3233b4: Make filecache use extended completion
@ 2017-11-07 14:03 Andreas Politz
  2017-11-07 17:19 ` Stefan Monnier
  0 siblings, 1 reply; 2+ messages in thread
From: Andreas Politz @ 2017-11-07 14:03 UTC (permalink / raw)
  To: Stefan Monnier, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1665 bytes --]

You seem pretty sure, that it isn't. 

Ap

<div>-------- Ursprüngliche Nachricht --------</div><div>Von: Stefan Monnier <monnier@IRO.UMontreal.CA> </div><div>Datum:05.11.2017  16:05  (GMT+01:00) </div><div>An: emacs-devel@gnu.org </div><div>Cc: Andreas Politz <politza@hochschule-trier.de> </div><div>Betreff: Re: [Emacs-diffs] master d3233b4: Make filecache use extended completion </div><div>
</div>> +          (let* ((completion-list (completion-all-completions
> +                                   newstring file-cache-alist nil newpoint))
> +                 (base-size       (cdr (last completion-list))))
> +            (when base-size
> +              (setcdr (last completion-list) nil))
> +            (if (> (length completion-list) 1)
> +                (progn
> +                  (delete-region (- (point-max) (length string)) (point-max))
> +                  (save-excursion (insert newstring))
> +                  (forward-char newpoint)
> +                  ;; Add our own setup function to the Completions Buffer
> +                  (let ((completion-setup-hook
> +                         (append completion-setup-hook
> +                                 (list 'file-cache-completion-setup-function))))
> +                    (with-output-to-temp-buffer file-cache-completions-buffer
> +                      (display-completion-list
> +                       (completion-hilit-commonality completion-list newpoint)))))

IIRC completion-all-completions already returns hilited strings (and
done with more care than what completion-hilit-commonality can do).
So is this completion-hilit-commonality call still beneficial?


        Stefan


[-- Attachment #2: Type: text/html, Size: 3556 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: AW: Re: [Emacs-diffs] master d3233b4: Make filecache use extended completion
  2017-11-07 14:03 AW: Re: [Emacs-diffs] master d3233b4: Make filecache use extended completion Andreas Politz
@ 2017-11-07 17:19 ` Stefan Monnier
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Monnier @ 2017-11-07 17:19 UTC (permalink / raw)
  To: emacs-devel

> You seem pretty sure, that it isn't. 

Well, I wasn't.  So, I just setup file-cache and did a few tests to confirm.
I pushed a corresponding patch to master.


        Stefan


> <div>-------- Ursprüngliche Nachricht --------</div><div>Von: Stefan Monnier
> <monnier@IRO.UMontreal.CA> </div><div>Datum:05.11.2017  16:05  (GMT+01:00)
> </div><div>An: emacs-devel@gnu.org </div><div>Cc: Andreas Politz
> <politza@hochschule-trier.de> </div><div>Betreff: Re: [Emacs-diffs] master
> d3233b4: Make filecache use extended completion </div><div>
> </div>> +          (let* ((completion-list (completion-all-completions
>> +                                   newstring file-cache-alist nil newpoint))
>> +                 (base-size       (cdr (last completion-list))))
>> +            (when base-size
>> +              (setcdr (last completion-list) nil))
>> +            (if (> (length completion-list) 1)
>> +                (progn
>> +                  (delete-region (- (point-max) (length string)) (point-max))
>> +                  (save-excursion (insert newstring))
>> +                  (forward-char newpoint)
>> +                  ;; Add our own setup function to the Completions Buffer
>> +                  (let ((completion-setup-hook
>> +                         (append completion-setup-hook
>> +                                 (list 'file-cache-completion-setup-function))))
>> +                    (with-output-to-temp-buffer file-cache-completions-buffer
>> +                      (display-completion-list
>> +                       (completion-hilit-commonality completion-list newpoint)))))

> IIRC completion-all-completions already returns hilited strings (and
> done with more care than what completion-hilit-commonality can do).
> So is this completion-hilit-commonality call still beneficial?


>         Stefan





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-11-07 17:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-07 14:03 AW: Re: [Emacs-diffs] master d3233b4: Make filecache use extended completion Andreas Politz
2017-11-07 17:19 ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).