all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Juri Linkov <juri@jurta.org>
Cc: 'Kevin Rodgers' <kevin.d.rodgers@gmail.com>,
	Drew Adams <drew.adams@oracle.com>,
	emacs-devel@gnu.org
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	[thread overview]
Message-ID: <jwveipvkgqr.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87iqf8qact.fsf@mail.jurta.org> (Juri Linkov's message of "Fri, 25 Sep 2009 00:32:18 +0300")

> ***************
> *** 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




  parent reply	other threads:[~2009-09-25  0:38 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-22 14:31 new buffer - should its mode reflect its name when the name matches auto-mode-alist? Drew Adams
2009-09-22 14:47 ` Deniz Dogan
2009-09-22 15:07   ` Drew Adams
2009-09-23 20:50     ` Mathias Dahl
2009-09-24 21:07       ` Juri Linkov
2009-09-24  2:31     ` Kevin Rodgers
2009-09-24  3:14       ` Drew Adams
2009-09-24 21:32         ` Juri Linkov
2009-09-24 22:01           ` Drew Adams
2009-09-25  0:38           ` Stefan Monnier [this message]
2009-09-25  9:04             ` Juri Linkov
2009-09-25 14:16               ` Stefan Monnier
2009-09-29 23:11                 ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwveipvkgqr.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=juri@jurta.org \
    --cc=kevin.d.rodgers@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.