unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* seemingly superfluous completions from code in completion.el
@ 2011-04-04  4:11 Alan
  0 siblings, 0 replies; only message in thread
From: Alan @ 2011-04-04  4:11 UTC (permalink / raw)
  To: help-gnu-emacs

This is a post seeking enlightenment on the behavior of completion
functions as provided by the code in "completion.el".  I initialize
this by the lines

(require 'completion)
(dynamic-completion-mode)

in my initialization file.  I am using GNU Emacs 23.3.1 (i386-mingw-
nt5.1.2600) of 2011-03-10 on 3249CTO.

In the *scratch* buffer I type the following

01234567890123456789

I then type the line

012

and use the function "complete" five times, which offers me the typed-
in string shortened by one character each time after the first.  If I
then use function "save-completions-to-file" and examine the result, I
see

("0123456789012345" . 361635)
("01234567890123456" . 361635)
("012345678901234567" . 361635)
("0123456789012345678" . 361635)
("01234567890123456789" . 361635)

as the saved completions.  Four of these seem superfluous and not of
interest.

I can avoid these superfluous completions by making a change that
affects what the function "completion-before-command" does.  It is
present in the hook:

 "pre-command-hook" is "(completion-before-command tooltip-hide)"

The original definition is

(defun completion-before-command ()
  (funcall (or (and (symbolp this-command)
		    (get this-command 'completion-function))
	       'use-completion-under-or-before-point)))

One way to make the change is to add to the property list of "self-
insert-command" the pair "completion-function (lambda ())", so that
'use-completion-under-or-before-point never gets used ahead of "self-
insert-command".

The enlightenment I seek is an explanation of what utility these
seemingly superfluous completions might have.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-04-04  4:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-04  4:11 seemingly superfluous completions from code in completion.el Alan

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).