GNU bug report logs - #6776
24.0.50; nxml mode binds completion to c-return

Previous Next

Package: emacs;

Reported by: joakim <at> verona.se

Date: Mon, 2 Aug 2010 07:53:01 UTC

Severity: minor

Merged with 11086

Found in versions 24.0.50, 24.0.94

Done: Chong Yidong <cyd <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 6776 <at> debbugs.gnu.org (full text, mbox):

From: joakim <at> verona.se
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 6776 <at> debbugs.gnu.org
Subject: Re: bug#6776: 24.0.50; nxml mode binds completion to c-return
Date: Tue, 03 Aug 2010 00:42:52 +0200
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

>> nxml mode does this:
>>   (define-key map [C-return] 'nxml-complete)
>> which isnt exactly a bug, but its annoying.
>
> Agreed.  It should add to completion-at-point-functions instead.
>
>> Its annoying because mode
>> specific completions should go somewhere consistent, such as M-tab, a
>
> Actually, I just noticed that completion-at-point is globally bound to M-tab.
>
>
>         Stefan

So, maybe something like this then?

=== modified file 'lisp/nxml/nxml-mode.el'
*** lisp/nxml/nxml-mode.el	2010-06-14 01:43:11 +0000
--- lisp/nxml/nxml-mode.el	2010-08-02 22:37:47 +0000
***************
*** 415,423 ****
      (define-key map "\C-c\C-o" nxml-outline-prefix-map)
      (define-key map [S-mouse-2] 'nxml-mouse-hide-direct-text-content)
      (define-key map "/" 'nxml-electric-slash)
-     (define-key map [C-return] 'nxml-complete)
-     (when nxml-bind-meta-tab-to-complete-flag
-       (define-key map "\M-\t" 'nxml-complete))
      map)
    "Keymap for nxml-mode.")
  
--- 415,420 ----
***************
*** 525,531 ****
  	  (nxml-scan-prolog)))))
    (add-hook 'after-change-functions 'nxml-after-change nil t)
    (add-hook 'change-major-mode-hook 'nxml-cleanup nil t)
! 
    ;; Emacs 23 handles the encoding attribute on the xml declaration
    ;; transparently to nxml-mode, so there is no longer a need for the below
    ;; hook. The hook also had the drawback of overriding explicit user
--- 522,528 ----
  	  (nxml-scan-prolog)))))
    (add-hook 'after-change-functions 'nxml-after-change nil t)
    (add-hook 'change-major-mode-hook 'nxml-cleanup nil t)
!   (add-hook 'completion-at-point-functions  'nxml-complete nil 'local)
    ;; Emacs 23 handles the encoding attribute on the xml declaration
    ;; transparently to nxml-mode, so there is no longer a need for the below
    ;; hook. The hook also had the drawback of overriding explicit user


-- 
Joakim Verona




This bug report was last modified 13 years and 60 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.