* .org.bak files are in Org mode -- intended?
@ 2023-01-18 10:12 Alain.Cochard
2023-01-18 10:18 ` Ruijie Yu via General discussions about Org-mode.
2023-01-18 10:51 ` Ihor Radchenko
0 siblings, 2 replies; 3+ messages in thread
From: Alain.Cochard @ 2023-01-18 10:12 UTC (permalink / raw)
To: emacs-orgmode
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?
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'.
--
EOST (École et Observatoire des Sciences de la Terre)
ITE (Institut Terre & Environnement) | alain.cochard@unistra.fr
5 rue René Descartes [bureau 110] | Phone: +33 (0)3 68 85 50 44
F-67084 Strasbourg Cedex, France | [ slot available for rent ]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: .org.bak files are in Org mode -- intended?
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
1 sibling, 0 replies; 3+ messages in thread
From: Ruijie Yu via General discussions about Org-mode. @ 2023-01-18 10:18 UTC (permalink / raw)
To: alain.cochard; +Cc: emacs-orgmode
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?
>
> 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 believe this is not org-specific. Opening "1.txt.bak" makes the
buffer use `text-mode'.
Best,
RY
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: .org.bak files are in Org mode -- intended?
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
1 sibling, 0 replies; 3+ messages in thread
From: Ihor Radchenko @ 2023-01-18 10:51 UTC (permalink / raw)
To: alain.cochard; +Cc: emacs-orgmode
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>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-01-18 10:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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.