From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#9054: 24.0.50; show source in other window Date: Tue, 03 May 2022 20:25:00 +0300 Organization: LINKOV.NET Message-ID: <861qxak4cj.fsf@mail.linkov.net> References: <87k4bovfd0.fsf@sophokles.streitblatt.de> <87k0b446xa.fsf@gnus.org> <86sfpsq67z.fsf@mail.linkov.net> <87bkwezz7h.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6914"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) Cc: Florian Beck , 9054@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue May 03 20:03:00 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nlwrS-0001X5-Sd for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 03 May 2022 20:02:58 +0200 Original-Received: from localhost ([::1]:43706 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nlwrR-0005nt-KZ for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 03 May 2022 14:02:57 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40550) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nlwpb-0002s3-Ip for bug-gnu-emacs@gnu.org; Tue, 03 May 2022 14:01:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47105) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nlwpb-0006hG-9U for bug-gnu-emacs@gnu.org; Tue, 03 May 2022 14:01:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nlwpb-0001ql-8P for bug-gnu-emacs@gnu.org; Tue, 03 May 2022 14:01:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 03 May 2022 18:01:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9054 X-GNU-PR-Package: emacs Original-Received: via spool by 9054-submit@debbugs.gnu.org id=B9054.16516008056867 (code B ref 9054); Tue, 03 May 2022 18:01:03 +0000 Original-Received: (at 9054) by debbugs.gnu.org; 3 May 2022 18:00:05 +0000 Original-Received: from localhost ([127.0.0.1]:40986 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nlwoe-0001me-AM for submit@debbugs.gnu.org; Tue, 03 May 2022 14:00:04 -0400 Original-Received: from relay5-d.mail.gandi.net ([217.70.183.197]:48585) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nlwob-0001lb-MC for 9054@debbugs.gnu.org; Tue, 03 May 2022 14:00:02 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 15F9B1C0007; Tue, 3 May 2022 17:59:53 +0000 (UTC) In-Reply-To: <87bkwezz7h.fsf@gnus.org> (Lars Ingebrigtsen's message of "Tue, 03 May 2022 12:29:22 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:231352 Archived-At: >> BTW, I can't find a discussion about scratch-buffer, so I'll ask here: >> when I accidentally delete the *scratch* buffer, the first thing I do is >> 'C-x b *scratch* RET' and discover an empty buffer. I wonder would it help >> to add a '("\*scratch\*\\'" . scratch-buffer) to 'auto-mode-alist' >> that will recreate it after switching to a new buffer with this name? > > Hm... that seems quite attractive, but also somewhat surprising. I > mean, `C-x b foo.c RET' doesn't put the resulting buffer in C mode. I get C mode after `C-x b foo.c RET' due to such customization: ``` (setq-default major-mode (lambda () (if buffer-file-name (fundamental-mode) (let ((buffer-file-name (buffer-name))) (set-auto-mode))))) ``` > On the other hand, the *scratch* buffer is slightly special, so perhaps > this would be helpful for users. The reason I added the > `scratch-buffer' command is that I remember a number of users saying > that they'd accidentally killed the buffer, and couldn't find a way to > get it back to how it was working (because typing `M-x > lisp-interaction-mode' is a pretty obscure thing to say). > > So perhaps it would be helpful to do what you say. Now I tried again to switch to the deleted *scratch* buffer to recreate it, and it activated the correct mode. This is because switch-to-buffer uses set-buffer-major-mode that has special handling for *scratch*: if (strcmp (SSDATA (BVAR (XBUFFER (buffer), name)), "*scratch*") == 0) function = find_symbol_value (intern ("initial-major-mode"));