[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: |
Stefan Monnier |
Subject: |
Re: new buffer - should its mode reflect its name when the name matches auto-mode-alist? |
Date: |
Thu, 24 Sep 2009 20:38:23 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) |
> ***************
> *** 1190,1197 ****
> (set (make-local-variable 'icomplete-with-completion-tables)
> (cons rbts-completion-table
> icomplete-with-completion-tables))))
> ! (read-buffer prompt (other-buffer (current-buffer))
> ! (confirm-nonexistent-file-or-buffer)))))
> (defun switch-to-buffer-other-window (buffer-or-name &optional norecord)
> "Select the buffer specified by BUFFER-OR-NAME in another window.
> --- 1190,1202 ----
> (set (make-local-variable 'icomplete-with-completion-tables)
> (cons rbts-completion-table
> icomplete-with-completion-tables))))
> ! (let ((buffer (read-buffer prompt (other-buffer (current-buffer))
> ! (confirm-nonexistent-file-or-buffer))))
> ! (unless (get-buffer buffer)
> ! (with-current-buffer (get-buffer-create buffer)
> ! (let ((buffer-file-name (buffer-name)))
> ! (normal-mode))))
> ! buffer))))
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.
Stefan
- 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?, 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 <=
- Re: new buffer - should its mode reflect its name when the name matches auto-mode-alist?, Juri Linkov, 2009/09/25
- 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