[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: new buffer - should its mode reflect its name when the name matches
From: |
Juri Linkov |
Subject: |
Re: new buffer - should its mode reflect its name when the name matches auto-mode-alist? |
Date: |
Fri, 25 Sep 2009 12:04:05 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (x86_64-pc-linux-gnu) |
> I'm not opposed to such a change but I think it would need to come
> together with a cleanup of the "default-major-mode" thingy: currently,
> the major-mode of a buffer is either set (in set-buffer-major-mode) as
> (default-value 'major-mode) or (if that's nil) is inherited from the
> major-mode of the current-buffer (unless that major-mode has the
> `mode-class' property set to `special').
>
> In practice, for 99% of the users, (default-value 'major-mode) is
> fundamental-mode, so the rest is very rarely used, which can lead to
> corner-case bugs, of course.
Using (setq-default major-mode 'normal-mode) would be a good default.
Currently this runs into an infinite recursion. However, the following
succeeds:
(setq-default major-mode
(lambda () (let ((buffer-file-name (buffer-name)))
(set-auto-mode))))
--
Juri Linkov
http://www.jurta.org/emacs/
- new buffer - should its mode reflect its name when the name matches auto-mode-alist?, Drew Adams, 2009/09/22
- Re: new buffer - should its mode reflect its name when the name matches auto-mode-alist?, Deniz Dogan, 2009/09/22
- RE: new buffer - should its mode reflect its name when the name matches auto-mode-alist?, Drew Adams, 2009/09/22
- Re: new buffer - should its mode reflect its name when the name matches auto-mode-alist?, Mathias Dahl, 2009/09/23
- Re: new buffer - should its mode reflect its name when the name matches auto-mode-alist?, Juri Linkov, 2009/09/24
- Re: new buffer - should its mode reflect its name when the name matches auto-mode-alist?, Kevin Rodgers, 2009/09/23
- RE: new buffer - should its mode reflect its name when the name matches auto-mode-alist?, Drew Adams, 2009/09/23
- Re: new buffer - should its mode reflect its name when the name matches auto-mode-alist?, Juri Linkov, 2009/09/24
- RE: new buffer - should its mode reflect its name when the name matches auto-mode-alist?, Drew Adams, 2009/09/24
- Re: new buffer - should its mode reflect its name when the name matches auto-mode-alist?, Stefan Monnier, 2009/09/24
- Re: new buffer - should its mode reflect its name when the name matches auto-mode-alist?,
Juri Linkov <=
- Re: new buffer - should its mode reflect its name when the name matches auto-mode-alist?, Stefan Monnier, 2009/09/25
- Re: new buffer - should its mode reflect its name when the name matches auto-mode-alist?, Juri Linkov, 2009/09/29