From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.bugs Subject: bug#60930: 30.0.50; 24.3 Choosing File Modes section of Emacs manual does not explain dealing with backup files Date: Wed, 18 Jan 2023 10:58:20 +0000 Message-ID: <87k01k6reb.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4094"; mail-complaints-to="usenet@ciao.gmane.io" To: 60930@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jan 18 11:58:16 2023 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 1pI691-0000qT-GP for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 18 Jan 2023 11:58:15 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pI68q-0006go-1w; Wed, 18 Jan 2023 05:58:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pI68o-0006gK-89 for bug-gnu-emacs@gnu.org; Wed, 18 Jan 2023 05:58:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pI68n-0004fe-VQ for bug-gnu-emacs@gnu.org; Wed, 18 Jan 2023 05:58:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pI68n-0005gZ-RT for bug-gnu-emacs@gnu.org; Wed, 18 Jan 2023 05:58:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ihor Radchenko Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 18 Jan 2023 10:58:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 60930 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.167403947821844 (code B ref -1); Wed, 18 Jan 2023 10:58:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 18 Jan 2023 10:57:58 +0000 Original-Received: from localhost ([127.0.0.1]:39435 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pI68k-0005gG-5w for submit@debbugs.gnu.org; Wed, 18 Jan 2023 05:57:58 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:43852) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pI68i-0005g8-BY for submit@debbugs.gnu.org; Wed, 18 Jan 2023 05:57:56 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pI68i-0006fq-2Q for bug-gnu-emacs@gnu.org; Wed, 18 Jan 2023 05:57:56 -0500 Original-Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pI68f-0004ey-PK for bug-gnu-emacs@gnu.org; Wed, 18 Jan 2023 05:57:55 -0500 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 5EFE82404F6 for ; Wed, 18 Jan 2023 11:57:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1674039471; bh=e3hMgbXq9Em85KWUHGtEDm7IBQQINsLrYvVKB+iX3rQ=; h=From:To:Subject:Date:From; b=KC5noKGj+/H+7UUwVWGFSBDWmwqP3ptSm4JsPmKzzrnOYUJ7w29BDzfUN8setMRk6 2yDe1r7t+ec3qWtPzbCpDuKHhpfbY17g/lw6Va2HAko+7Z0NqfQu23m6I//hCOUYkO npoZpVlDmM1xsVm9RsgAOFM+we8qKpN8sT0ja1g9/nEJ0c5nlwFFhYSRnCrRSZeCZg nvbWyQWfI6fYZ7imBAbgA0yVy0EIcy69QoHW/Zz8iqWNjbjWPoeYCut8sOYUlR0mX/ LrdKry0NV2OLR8ClOscLHcYmWG0l2uGAkHRJ1mW+4HW/cTaFCg3TCJ91+f1UcWJZHR mXN6Ts23vB2Pg== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4NxjQk1lthz9rxD for ; Wed, 18 Jan 2023 11:57:48 +0100 (CET) Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:253618 Archived-At: Hi, The 24.3 Choosing File Modes section of Emacs manual explains how the `auto-mode-alist' works, but fail to address an important point about backup files being open in the major mode used for files with a name stripped from the backup suffix: Fifth=E2=80=94if Emacs still hasn=E2=80=99t found a suitable major m= ode=E2=80=94it looks at the file=E2=80=99s name. The correspondence between file names and maj= or modes is controlled by the variable =E2=80=98auto-mode-alist=E2=80=99. Its v= alue is a list in which each element has this form, I think that it is worth mentioning the backup file handling entry in `auto-mode-alist' in the manual itself: ----------- By default, `auto-mode-alist' contains: ("\\.~?[0-9]+\\.[0-9][-.0-9]*~?\\'" nil t) ("\\.\\(?:orig\\|in\\|[bB][aA][kK]\\)\\'" nil t) meaning that backup files (for example, foo.txt~, foo.txt~12, foo.txt.orig, foo.txt.in, foo.txt.bak) will use major mode as for foo.txt - the file with backup suffix stripped. ----- WDYT? In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, cairo version 1.17.6) of 2023-01-16 built on localhost Repository revision: bb679244152dddd9949ca065aa6617457f7a7144 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12101006 System Description: Gentoo Linux --=20 Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at