all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* completion-lisp-mode-hook not used for Emacs-Lisp-mode
@ 2013-06-23 14:12 Alan
  2013-06-23 18:37 ` Michael Heerdegen
       [not found] ` <mailman.2260.1372012661.22516.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 3+ messages in thread
From: Alan @ 2013-06-23 14:12 UTC (permalink / raw)
  To: help-gnu-emacs

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


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

* Re: completion-lisp-mode-hook not used for Emacs-Lisp-mode
  2013-06-23 14:12 completion-lisp-mode-hook not used for Emacs-Lisp-mode Alan
@ 2013-06-23 18:37 ` Michael Heerdegen
       [not found] ` <mailman.2260.1372012661.22516.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Heerdegen @ 2013-06-23 18:37 UTC (permalink / raw)
  To: help-gnu-emacs

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.




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

* Re: completion-lisp-mode-hook not used for Emacs-Lisp-mode
       [not found] ` <mailman.2260.1372012661.22516.help-gnu-emacs@gnu.org>
@ 2013-06-24 11:32   ` Alan
  0 siblings, 0 replies; 3+ messages in thread
From: Alan @ 2013-06-24 11:32 UTC (permalink / raw)
  To: help-gnu-emacs

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.


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

end of thread, other threads:[~2013-06-24 11:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-23 14:12 completion-lisp-mode-hook not used for Emacs-Lisp-mode Alan
2013-06-23 18:37 ` Michael Heerdegen
     [not found] ` <mailman.2260.1372012661.22516.help-gnu-emacs@gnu.org>
2013-06-24 11:32   ` Alan

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.