unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* nxml-mode autoload?
@ 2005-10-30  2:40 Arturius mac Aidan
  2005-10-30  8:12 ` Edward O'Connor
  2005-10-30 11:55 ` Jean Magnan de Bornier
  0 siblings, 2 replies; 7+ messages in thread
From: Arturius mac Aidan @ 2005-10-30  2:40 UTC (permalink / raw)


These entries are in my .emacs
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; autoinsert.el
;;http://www.linuxgazette.com/issue39/marsden.html

(setq auto-mode-alist
      (append '(("\\.h$" . c++-mode)
                ("\\.cpp\\'" . c++-mode)
                ("\\.moc\\'" . c++-mode))
              auto-mode-alist))

(add-hook 'find-file-hooks 'auto-insert)
(setq-default auto-insert-query nil)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; www.thaiopensource.com/nxml-mode
;; per the ~/.emacs.d/lisp/nxml-mode-20041004/README
(load "~/.emacs.d/lisp/nxml-mode-20041004/rng-auto.el")
(setq auto-mode-alist
      (append '(("\\.xml\\'" . nxml-mode)
                ("\\.xsl\\'" . nxml-mode)
                ("\\.rng\\'" . nxml-mode)
                ("\\.xhtml\\'" . nxml-mode))
              auto-mode-alist))
;;;;;;;;;;;;;;;;;EOF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


The first auto-mode-alist entries (for c++) work as expected.  the ones for
nxml-mode do not work.  I can, however, start the mode with `M-x
nxml-mode<ret>'. Does anybody know why this is not working?


M-x version<ret>
GNU Emacs 22.0.50.2 (i686-pc-linux-gnu, X toolkit, Xaw3d scroll bars) of
2005-10-18 on ljosalfr
-- 
.

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

* Re: nxml-mode autoload?
  2005-10-30  2:40 nxml-mode autoload? Arturius mac Aidan
@ 2005-10-30  8:12 ` Edward O'Connor
  2005-10-30 11:55 ` Jean Magnan de Bornier
  1 sibling, 0 replies; 7+ messages in thread
From: Edward O'Connor @ 2005-10-30  8:12 UTC (permalink / raw)


Arturius mac Aidan wrote:

> The first auto-mode-alist entries (for c++) work as expected. the ones
> for nxml-mode do not work. I can, however, start the mode with `M-x
> nxml-mode<ret>'. Does anybody know why this is not working?

You probably want to frob `magic-mode-alist', which see.


Ted

-- 
Edward O'Connor
hober0@gmail.com

Ense petit placidam sub libertate quietem.

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

* Re: nxml-mode autoload?
  2005-10-30  2:40 nxml-mode autoload? Arturius mac Aidan
  2005-10-30  8:12 ` Edward O'Connor
@ 2005-10-30 11:55 ` Jean Magnan de Bornier
  2005-10-30 14:38   ` Lennart Borgman
  2005-10-31  5:48   ` Arturius mac Aidan
  1 sibling, 2 replies; 7+ messages in thread
From: Jean Magnan de Bornier @ 2005-10-30 11:55 UTC (permalink / raw)


Arturius mac Aidan <abysmal@waters.loch> wrote :

> These entries are in my .emacs
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> ;; autoinsert.el
> ;;http://www.linuxgazette.com/issue39/marsden.html
>
> (setq auto-mode-alist
>       (append '(("\\.h$" . c++-mode)
>                 ("\\.cpp\\'" . c++-mode)
>                 ("\\.moc\\'" . c++-mode))
>               auto-mode-alist))
>
> (add-hook 'find-file-hooks 'auto-insert)
> (setq-default auto-insert-query nil)
>
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> ;; www.thaiopensource.com/nxml-mode
> ;; per the ~/.emacs.d/lisp/nxml-mode-20041004/README
> (load "~/.emacs.d/lisp/nxml-mode-20041004/rng-auto.el")
> (setq auto-mode-alist
>       (append '(("\\.xml\\'" . nxml-mode)
>                 ("\\.xsl\\'" . nxml-mode)
>                 ("\\.rng\\'" . nxml-mode)
>                 ("\\.xhtml\\'" . nxml-mode))
>               auto-mode-alist))
> ;;;;;;;;;;;;;;;;;EOF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
>
>
> The first auto-mode-alist entries (for c++) work as expected.  the ones for
> nxml-mode do not work.  I can, however, start the mode with `M-x
> nxml-mode<ret>'. Does anybody know why this is not working?
>
On emacs-wiki you can find this solution:

 (fset 'xml-mode 'nxml-mode)

There was a recent discussion on the french emacs group, somebody argued
this solution was lame, and proposed the following:

    (defcustom drkm-misc:magic-modes-to-delete
        '(html-mode sgml-mode xml-mode)
      "List of mode symbols whose entries to delete in
       `magic-mode-alist'."
      :type  '(repeat symbol)
      :group 'drkm)

    (when (boundp 'magic-mode-alist)
      (setq magic-mode-alist
            (delete-if (lambda (cell)
                         (memq (cdr cell)
                               drkm-misc:magic-modes-to-delete))
                       magic-mode-alist)))

    (push '("\\`<\\?xml" . nxml-mode) magic-mode-alist)

This works well, provided you load cl (before these commands) if it is not
 already loaded: 

(require 'cl)

I cannot explain these lines but they have to do with the
"magic-mode-alist" interfering in some way with "auto-mode-alist".

hth,
-- 
  Jean Magnan de Bornier             |        Cours Victor Hugo
  e-mots: jean at bornier.net        |        13980 Alleins   France
  T 08 70 39 34 03                   |        P 06 09 17 35 87

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

* Re: nxml-mode autoload?
  2005-10-30 11:55 ` Jean Magnan de Bornier
@ 2005-10-30 14:38   ` Lennart Borgman
  2005-10-31  5:48   ` Arturius mac Aidan
  1 sibling, 0 replies; 7+ messages in thread
From: Lennart Borgman @ 2005-10-30 14:38 UTC (permalink / raw)
  Cc: help-gnu-emacs

Jean Magnan de Bornier wrote:

>Arturius mac Aidan <abysmal@waters.loch> wrote :
>
>  
>
>>These entries are in my .emacs
>>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
>>;; autoinsert.el
>>;;http://www.linuxgazette.com/issue39/marsden.html
>>
>>(setq auto-mode-alist
>>      (append '(("\\.h$" . c++-mode)
>>                ("\\.cpp\\'" . c++-mode)
>>                ("\\.moc\\'" . c++-mode))
>>              auto-mode-alist))
>>
>>(add-hook 'find-file-hooks 'auto-insert)
>>(setq-default auto-insert-query nil)
>>
>>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
>>;; www.thaiopensource.com/nxml-mode
>>;; per the ~/.emacs.d/lisp/nxml-mode-20041004/README
>>(load "~/.emacs.d/lisp/nxml-mode-20041004/rng-auto.el")
>>(setq auto-mode-alist
>>      (append '(("\\.xml\\'" . nxml-mode)
>>                ("\\.xsl\\'" . nxml-mode)
>>                ("\\.rng\\'" . nxml-mode)
>>                ("\\.xhtml\\'" . nxml-mode))
>>              auto-mode-alist))
>>;;;;;;;;;;;;;;;;;EOF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
>>
>>
>>The first auto-mode-alist entries (for c++) work as expected.  the ones for
>>nxml-mode do not work.  I can, however, start the mode with `M-x
>>nxml-mode<ret>'. Does anybody know why this is not working?
>>
>>    
>>
>On emacs-wiki you can find this solution:
>
> (fset 'xml-mode 'nxml-mode)
>  
>
On the page http://www.emacswiki.org/cgi-bin/wiki/NxmlMode where you can 
find the solution above you can also find fmode.el which will change the 
relevant variables for mode selection.

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

* Re: nxml-mode autoload?
  2005-10-30 11:55 ` Jean Magnan de Bornier
  2005-10-30 14:38   ` Lennart Borgman
@ 2005-10-31  5:48   ` Arturius mac Aidan
  2005-10-31  7:57     ` Lennart Borgman
  2005-10-31 17:21     ` Edward O'Connor
  1 sibling, 2 replies; 7+ messages in thread
From: Arturius mac Aidan @ 2005-10-31  5:48 UTC (permalink / raw)


Jean Magnan de Bornier wrote:

> Arturius mac Aidan <abysmal@waters.loch> wrote :
> 
>> These entries are in my .emacs
>> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
>> ;; autoinsert.el
>> ;;http://www.linuxgazette.com/issue39/marsden.html
>>
>> (setq auto-mode-alist
>>       (append '(("\\.h$" . c++-mode)
>>                 ("\\.cpp\\'" . c++-mode)
>>                 ("\\.moc\\'" . c++-mode))
>>               auto-mode-alist))
>>
>> (add-hook 'find-file-hooks 'auto-insert)
>> (setq-default auto-insert-query nil)
>>
>> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
>> ;; www.thaiopensource.com/nxml-mode
>> ;; per the ~/.emacs.d/lisp/nxml-mode-20041004/README
>> (load "~/.emacs.d/lisp/nxml-mode-20041004/rng-auto.el")
>> (setq auto-mode-alist
>>       (append '(("\\.xml\\'" . nxml-mode)
>>                 ("\\.xsl\\'" . nxml-mode)
>>                 ("\\.rng\\'" . nxml-mode)
>>                 ("\\.xhtml\\'" . nxml-mode))
>>               auto-mode-alist))
>> ;;;;;;;;;;;;;;;;;EOF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
>>
>>
>> The first auto-mode-alist entries (for c++) work as expected.  the ones
>> for
>> nxml-mode do not work.  I can, however, start the mode with `M-x
>> nxml-mode<ret>'. Does anybody know why this is not working?
>>
> On emacs-wiki you can find this solution:
> 
>  (fset 'xml-mode 'nxml-mode)
> 
> There was a recent discussion on the french emacs group, somebody argued
> this solution was lame, 

If it works, it works. At least for now.

> and proposed the following: 
> 
>     (defcustom drkm-misc:magic-modes-to-delete
>         '(html-mode sgml-mode xml-mode)
>       "List of mode symbols whose entries to delete in
>        `magic-mode-alist'."
>       :type  '(repeat symbol)
>       :group 'drkm)
> 
>     (when (boundp 'magic-mode-alist)
>       (setq magic-mode-alist
>             (delete-if (lambda (cell)
>                          (memq (cdr cell)
>                                drkm-misc:magic-modes-to-delete))
>                        magic-mode-alist)))
> 
>     (push '("\\`<\\?xml" . nxml-mode) magic-mode-alist)
> 
> This works well, provided you load cl (before these commands) if it is not
>  already loaded:
> 
> (require 'cl)
> 
> I cannot explain these lines but they have to do with the
> "magic-mode-alist" interfering in some way with "auto-mode-alist".
> 
> hth,

To whom shall I report the bug, James Clark, or the Emacs developers?
-- 
.

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

* Re: nxml-mode autoload?
  2005-10-31  5:48   ` Arturius mac Aidan
@ 2005-10-31  7:57     ` Lennart Borgman
  2005-10-31 17:21     ` Edward O'Connor
  1 sibling, 0 replies; 7+ messages in thread
From: Lennart Borgman @ 2005-10-31  7:57 UTC (permalink / raw)
  Cc: help-gnu-emacs

Arturius mac Aidan wrote:

>>and proposed the following: 
>>
>>    (defcustom drkm-misc:magic-modes-to-delete
>>        '(html-mode sgml-mode xml-mode)
>>      "List of mode symbols whose entries to delete in
>>       `magic-mode-alist'."
>>      :type  '(repeat symbol)
>>      :group 'drkm)
>>
>>    (when (boundp 'magic-mode-alist)
>>      (setq magic-mode-alist
>>            (delete-if (lambda (cell)
>>                         (memq (cdr cell)
>>                               drkm-misc:magic-modes-to-delete))
>>                       magic-mode-alist)))
>>
>>    (push '("\\`<\\?xml" . nxml-mode) magic-mode-alist)
>>
>>This works well, provided you load cl (before these commands) if it is not
>> already loaded:
>>
>>(require 'cl)
>>
>>I cannot explain these lines but they have to do with the
>>"magic-mode-alist" interfering in some way with "auto-mode-alist".
>>
>>hth,
>>    
>>
>
>To whom shall I report the bug, James Clark, or the Emacs developers?
>  
>
Can you tell what C-h push RET shows before and after loading cl?

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

* Re: nxml-mode autoload?
  2005-10-31  5:48   ` Arturius mac Aidan
  2005-10-31  7:57     ` Lennart Borgman
@ 2005-10-31 17:21     ` Edward O'Connor
  1 sibling, 0 replies; 7+ messages in thread
From: Edward O'Connor @ 2005-10-31 17:21 UTC (permalink / raw)


> To whom shall I report the bug, James Clark, or the Emacs developers?

What bug?

-- 
Edward O'Connor
hober0@gmail.com

Ense petit placidam sub libertate quietem.

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

end of thread, other threads:[~2005-10-31 17:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-30  2:40 nxml-mode autoload? Arturius mac Aidan
2005-10-30  8:12 ` Edward O'Connor
2005-10-30 11:55 ` Jean Magnan de Bornier
2005-10-30 14:38   ` Lennart Borgman
2005-10-31  5:48   ` Arturius mac Aidan
2005-10-31  7:57     ` Lennart Borgman
2005-10-31 17:21     ` Edward O'Connor

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