From: Ihor Radchenko <yantar92@posteo.net>
To: alain.cochard@unistra.fr
Cc: emacs-orgmode@gnu.org
Subject: Re: .org.bak files are in Org mode -- intended?
Date: Wed, 18 Jan 2023 10:51:51 +0000 [thread overview]
Message-ID: <87mt6g6rp4.fsf@localhost> (raw)
In-Reply-To: <25543.50706.554658.6937@gargle.gargle.HOWL>
Alain.Cochard@unistra.fr writes:
> I have noticed by chance that files with the .org.bak extension are in
> Org mode by default.
>
> If one does not pay attention, it can lead to mistakes.
>
> If it is really intended, why not mention it in the manual? (In 1.3,
> where it is said that "Files with the ‘.org’ extension use Org mode by
> default.")
>
> Are there other similar cases?
Any backup file is opened as if the file name did not contain the backup
suffix:
`auto-mode-alist' contains:
("\\.~?[0-9]+\\.[0-9][-.0-9]*~?\\'" nil t)
("\\.\\(?:orig\\|in\\|[bB][aA][kK]\\)\\'" nil t)
meaning "if file name matches, strip the match and try determining major
mode again"
> Also, the names of files generated upon export, although making sense,
> cannot be anticipated: while 'foo.org' is latex exported as 'foo.tex'
> (as said in the manual), 'foo.org.bak' becomes 'foo.org.tex'.
I guess we could fix this.
Though, I'd prefer if Emacs provided basic functionality to strip backup
suffix: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=60929
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
prev parent reply other threads:[~2023-01-18 10:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-18 10:12 .org.bak files are in Org mode -- intended? Alain.Cochard
2023-01-18 10:18 ` Ruijie Yu via General discussions about Org-mode.
2023-01-18 10:51 ` Ihor Radchenko [this message]
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
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87mt6g6rp4.fsf@localhost \
--to=yantar92@posteo.net \
--cc=alain.cochard@unistra.fr \
--cc=emacs-orgmode@gnu.org \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).