unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* editing mode: .ml files
@ 2006-06-17 20:17 r.stiltskin
  0 siblings, 0 replies; 10+ messages in thread
From: r.stiltskin @ 2006-06-17 20:17 UTC (permalink / raw)



When I open a file with a .ml extension the mode line says "(Lisp Slime
[??])"  (when I haven't loaded slime.)

Where's the connection between .ml and Slime?   What can I do to change
this?


--
View this message in context: http://www.nabble.com/editing-mode%3A-.ml-files-t1804515.html#a4917903
Sent from the Emacs - Help forum at Nabble.com.

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

* Re: editing mode: .ml files
       [not found] <mailman.2987.1150575886.9609.help-gnu-emacs@gnu.org>
@ 2006-06-18  2:20 ` Tim X
  2006-06-18 10:34 ` Johan Bockgård
  1 sibling, 0 replies; 10+ messages in thread
From: Tim X @ 2006-06-18  2:20 UTC (permalink / raw)


"r.stiltskin" <jkammet@yahoo.com> writes:

> When I open a file with a .ml extension the mode line says "(Lisp Slime
> [??])"  (when I haven't loaded slime.)
>
> Where's the connection between .ml and Slime?   What can I do to change
> this?
>
>
> --
> View this message in context: http://www.nabble.com/editing-mode%3A-.ml-files-t1804515.html#a4917903
> Sent from the Emacs - Help forum at Nabble.com.
>
>

I suspect the slime package has set an association between .ml 
in the auto-mode-alist 

,----
| auto-mode-alist is a variable defined in `files.el'.
| Its value is shown below.
| 
| Documentation:
| Alist of filename patterns vs corresponding major mode functions.
| Each element looks like (REGEXP . FUNCTION) or (REGEXP FUNCTION NON-NIL).
| (NON-NIL stands for anything that is not nil; the value does not matter.)
| Visiting a file whose name matches REGEXP specifies FUNCTION as the
| mode function to use.  FUNCTION will be called, unless it is nil.
| 
| If the element has the form (REGEXP FUNCTION NON-NIL), then after
| calling FUNCTION (if it's not nil), we delete the suffix that matched
| REGEXP and search the list again for another match.
| 
| If the file name matches `inhibit-first-line-modes-regexps',
| then `auto-mode-alist' is not processed.
| 
| The extensions whose FUNCTION is `archive-mode' should also
| appear in `auto-coding-alist' with `no-conversion' coding system.
| 
| See also `interpreter-mode-alist', which detects executable script modes
| based on the interpreters they specify to run,
| and `magic-mode-alist', which determines modes based on file contents.
| 
`----

If the association exists in auto-mode-alist, you will need to find
the slime setup code which creates that association and remove it. On
many Linux distros, this can be found in /etc/emacs/site-lisp.d or
somewhere similar. 

Tim

-- 
tcross (at) rapttech dot com dot au

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

* Re: editing mode: .ml files
       [not found] <mailman.2987.1150575886.9609.help-gnu-emacs@gnu.org>
  2006-06-18  2:20 ` editing mode: .ml files Tim X
@ 2006-06-18 10:34 ` Johan Bockgård
  2006-06-18 14:39   ` r.stiltskin
       [not found]   ` <mailman.3001.1150641574.9609.help-gnu-emacs@gnu.org>
  1 sibling, 2 replies; 10+ messages in thread
From: Johan Bockgård @ 2006-06-18 10:34 UTC (permalink / raw)


"r.stiltskin" <jkammet@yahoo.com> writes:

> When I open a file with a .ml extension the mode line says "(Lisp Slime
> [??])"  (when I haven't loaded slime.)
>
> Where's the connection between .ml and Slime?

The connection is between .ml and Lisp (.ml might be Mocklisp). It's
defined by default.

> What can I do to change this?

Define an entry in `auto-mode-list'. If you are coding ML you probably
want to install an ML editing mode.

-- 
Johan Bockgård

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

* Re: editing mode: .ml files
  2006-06-18 10:34 ` Johan Bockgård
@ 2006-06-18 14:39   ` r.stiltskin
  2006-06-19 20:20     ` Kevin Rodgers
       [not found]     ` <mailman.3037.1150748521.9609.help-gnu-emacs@gnu.org>
       [not found]   ` <mailman.3001.1150641574.9609.help-gnu-emacs@gnu.org>
  1 sibling, 2 replies; 10+ messages in thread
From: r.stiltskin @ 2006-06-18 14:39 UTC (permalink / raw)



Yes, I haven't gotten around to installing an ml-mode yet, but I'd like to
get rid of the lisp association.  I see that it appears in files.el in the
section:
(defvar auto-mode-alist
  (mapc
   (lambda (elt)
     (cons (purecopy (car elt)) (cdr elt)))
     '...
     ("\\.ml\\'" . lisp-mode)
     ...'
but deleting the .ml line from files.el doesn't seem to have any effect --
emacs still comes up with ("\\.ml\\'" . lisp-mode) included in
auto-mode-alist.

How can I get rid of it?
--
View this message in context: http://www.nabble.com/editing-mode%3A-.ml-files-t1804515.html#a4924006
Sent from the Emacs - Help forum at Nabble.com.

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

* Re: editing mode: .ml files
       [not found]   ` <mailman.3001.1150641574.9609.help-gnu-emacs@gnu.org>
@ 2006-06-19  7:45     ` Tim X
  2006-06-19  8:00     ` Johan Bockgård
  1 sibling, 0 replies; 10+ messages in thread
From: Tim X @ 2006-06-19  7:45 UTC (permalink / raw)


"r.stiltskin" <jkammet@yahoo.com> writes:

> Yes, I haven't gotten around to installing an ml-mode yet, but I'd like to
> get rid of the lisp association.  I see that it appears in files.el in the
> section:
> (defvar auto-mode-alist
>   (mapc
>    (lambda (elt)
>      (cons (purecopy (car elt)) (cdr elt)))
>      '...
>      ("\\.ml\\'" . lisp-mode)
>      ...'
> but deleting the .ml line from files.el doesn't seem to have any effect --
> emacs still comes up with ("\\.ml\\'" . lisp-mode) included in
> auto-mode-alist.
>
> How can I get rid of it?
> --
> View this message in context: http://www.nabble.com/editing-mode%3A-.ml-files-t1804515.html#a4924006
> Sent from the Emacs - Help forum at Nabble.com.
>
>
>

I just checked my system auto-mode-alist. It doesn't have an entry for
slime-mode, but it does have one for lisp-mode associated with the .ml
suffix. 

If yours is associated with slime-mode, then I would suspect it is
being added by some initialisation code that sets up slime. finding
where this code is depends on your distribution. Under Debian, it is
in /etc/emacs/site-lisp.d

If you only have the association between .ml and lisp-mode, you need
to either find the bit of code which adds the entry to the association
list and remove it (assuming its a bit of setup code and not part of
the core emacs code). 

The other thing you could try doing is re-setting the variable in your
.emacs file. alternatively, install one of the ML modes and see if
that association overrides the lisp one. One final possible solution
is to use either a mode line at the top of your file or file variables
at the bottom to force the mode you want. 

Tim
-- 
tcross (at) rapttech dot com dot au

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

* Re: editing mode: .ml files
       [not found]   ` <mailman.3001.1150641574.9609.help-gnu-emacs@gnu.org>
  2006-06-19  7:45     ` Tim X
@ 2006-06-19  8:00     ` Johan Bockgård
  2006-06-22  4:51       ` r.stiltskin
  1 sibling, 1 reply; 10+ messages in thread
From: Johan Bockgård @ 2006-06-19  8:00 UTC (permalink / raw)


"r.stiltskin" <jkammet@yahoo.com> writes:

> but deleting the .ml line from files.el doesn't seem to have any effect

Don't do that! Changing the source code directly is usually a bad idea
and rarely necessary.

> -- emacs still comes up with ("\\.ml\\'" . lisp-mode) included in
> auto-mode-alist.
>
> How can I get rid of it?

auto-mode-alist is searched from beginning to end. Push an overriding
definition for .ml on the list (or delete the existing entry).

-- 
Johan Bockgård

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

* Re: editing mode: .ml files
  2006-06-18 14:39   ` r.stiltskin
@ 2006-06-19 20:20     ` Kevin Rodgers
       [not found]     ` <mailman.3037.1150748521.9609.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 10+ messages in thread
From: Kevin Rodgers @ 2006-06-19 20:20 UTC (permalink / raw)


r.stiltskin wrote:
> Yes, I haven't gotten around to installing an ml-mode yet, but I'd like to
> get rid of the lisp association.  I see that it appears in files.el in the
> section:
> (defvar auto-mode-alist
>   (mapc
>    (lambda (elt)
>      (cons (purecopy (car elt)) (cdr elt)))
>      '...
>      ("\\.ml\\'" . lisp-mode)
>      ...'
> but deleting the .ml line from files.el doesn't seem to have any effect --
> emacs still comes up with ("\\.ml\\'" . lisp-mode) included in
> auto-mode-alist.
> 
> How can I get rid of it?

Put this in your ~/.emacs file:

(setq auto-mode-alist
       (cons "\\.ml\\'" . fundamental-mode) auto-mode-alist))

-- 
Kevin

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

* Re: editing mode: .ml files
       [not found]     ` <mailman.3037.1150748521.9609.help-gnu-emacs@gnu.org>
@ 2006-06-20  9:35       ` Mathias Dahl
  2006-06-22  5:05         ` r.stiltskin
  0 siblings, 1 reply; 10+ messages in thread
From: Mathias Dahl @ 2006-06-20  9:35 UTC (permalink / raw)


Kevin Rodgers <ihs_4664@yahoo.com> writes:

> Put this in your ~/.emacs file:
>
> (setq auto-mode-alist
>       (cons "\\.ml\\'" . fundamental-mode) auto-mode-alist))
>

Please don't. :)

What Kevin meant was this

(setq auto-mode-alist
      (cons '("\\.ml\\'" . fundamental-mode) auto-mode-alist))

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

* Re: editing mode: .ml files
  2006-06-19  8:00     ` Johan Bockgård
@ 2006-06-22  4:51       ` r.stiltskin
  0 siblings, 0 replies; 10+ messages in thread
From: r.stiltskin @ 2006-06-22  4:51 UTC (permalink / raw)



Yes, thanks, I should have realized this even with my slight knowledge of
lisp.  Trouble is I know almost nothing about how emacs works.


--
View this message in context: http://www.nabble.com/editing-mode%3A-.ml-files-t1804515.html#a4987094
Sent from the Emacs - Help forum at Nabble.com.

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

* Re: editing mode: .ml files
  2006-06-20  9:35       ` Mathias Dahl
@ 2006-06-22  5:05         ` r.stiltskin
  0 siblings, 0 replies; 10+ messages in thread
From: r.stiltskin @ 2006-06-22  5:05 UTC (permalink / raw)



Thanks, all.  I finally bit the bullet & installed sml-mode.

Since the Makefile doesn't quite do everything, and the INSTALL file doesn't
quite tell everything, here's what I put in my .emacs file.  Maybe it will
save someone else some time:

;this I want to add to the front of auto-mode-alist to override the default
association of .ml files to lisp-mode, as Johan explained:
(setq auto-mode-alist
  (cons '("\\.ml$"  . sml-mode) auto-mode-alist))

;these two lines are for starting up sml-mode:
(setq load-path (cons "/usr/share/emacs/site-lisp/sml-mode" load-path))
(autoload 'sml-mode "sml-mode" "Major mode for editing SML." t)

;the rest of the sml-mode file associations can be appended to the end of
auto-mode-alist:
(setq auto-mode-alist
  (append '(("\\.sml$" . sml-mode)
            ("\\.sig$" . sml-mode)
            ("\\.ML$"  . sml-mode)) auto-mode-alist))

I see I now have a command M-x sml-mode-info so I'll have to read through
that to see how it works.


--
View this message in context: http://www.nabble.com/editing-mode%3A-.ml-files-t1804515.html#a4987195
Sent from the Emacs - Help forum at Nabble.com.

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

end of thread, other threads:[~2006-06-22  5:05 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.2987.1150575886.9609.help-gnu-emacs@gnu.org>
2006-06-18  2:20 ` editing mode: .ml files Tim X
2006-06-18 10:34 ` Johan Bockgård
2006-06-18 14:39   ` r.stiltskin
2006-06-19 20:20     ` Kevin Rodgers
     [not found]     ` <mailman.3037.1150748521.9609.help-gnu-emacs@gnu.org>
2006-06-20  9:35       ` Mathias Dahl
2006-06-22  5:05         ` r.stiltskin
     [not found]   ` <mailman.3001.1150641574.9609.help-gnu-emacs@gnu.org>
2006-06-19  7:45     ` Tim X
2006-06-19  8:00     ` Johan Bockgård
2006-06-22  4:51       ` r.stiltskin
2006-06-17 20:17 r.stiltskin

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