[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: completion-lisp-mode-hook not used for Emacs-Lisp-mode
From: |
Alan |
Subject: |
Re: completion-lisp-mode-hook not used for Emacs-Lisp-mode |
Date: |
Mon, 24 Jun 2013 04:32:55 -0700 (PDT) |
User-agent: |
G2/1.0 |
On Sunday, June 23, 2013 1:37:18 PM UTC-5, Michael Heerdegen wrote:
> Hi Alan,
>
>
>
> > File "completion.el" recommends putting "(dynamic-completion-mode)" in
>
> > .emacs, for using completions. Doing so has the result that function
>
> > "completion-lisp-mode-hook" is added to the hook variable
>
> > "lisp-mode-hook". But for Emacs lisp code the mode is
>
> > "Emacs-Lisp-mode", which has hook variable "emacs-lisp-mode-hook", so
>
> > function "completion-lisp-mode-hook" isn't run when one edits Emacs
>
> > lisp. There seems to be a disconnect here.
>
> >
>
> > I am using
>
> >
>
> > GNU Emacs 24.2.1 (i386-mingw-nt5.1.2600) of 2012-08-28 on MARVIN
>
>
>
> Sounds like a bug. Please make a bug report with M-x report-emacs-bug
>
> when what is described in the file doesn't work for you.
>
>
>
>
>
> Michael.
I made the post and later deleted it. I wasn't having a specific problem due
to what I observed. I was trying to get rid of completions that had the
character "\" at the end of them. These came from editing Emacs Lisp and using
constructs like "(insert (format "The value of \"variable\" is %s" variable))".
After using such a construct, the completion entry would be variable\. To
correct this I changed the syntax of "\" from "_" to "w", in the table
'completion-standard-syntax-table and I changed the key table entry for "\" to
be 'completion-separator-self-insert-command" (using a lambda function in
'emacs-lisp-mode-hook).
At first I thought I would need to change the syntax of "\" in
"completion-lisp-syntax-table", but then I realized that wasn't the case (due
to my observation that 'completion-lisp-mode-hook isn't run when one edits
Emacs Lisp). As for the changes that would be made if
'completion-lisp-mode-hook were used, I'll be on the lookout for when those
changes might be desired.
One curiosity that I didn't explore further was that if I used the syntax "\"
for "\", then the completion was not added at all (i.e. use of the 'complete
function would not list it when its prefix was entered).
My reasoning for deleting my post was that it occurred to me that the authors
of completion.el might really have made a deliberate distinction between Emacs
Lisp and other Lisps.