From b1ff9afc3b1db13cd8d6bd88a0172c0177540ae3 Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Tue, 27 Apr 2021 10:21:05 +0200 Subject: [PATCH] ox.el: Remove .gpg extension from the exported file-name * ox.el (org-export-output-file-name): Remove .gpg extension. Reported-by: Adalricus Ovicula Link: https://orgmode.org/list/87a74x7g6v.fsf@xenon.ovicula/ This is a rework of the previous reverted commit e8c24b66a. --- lisp/ox.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/ox.el b/lisp/ox.el index c99e8d111..8ab431429 100644 --- a/lisp/ox.el +++ b/lisp/ox.el @@ -6424,7 +6424,10 @@ Return file name as a string." (throw :found (org-element-property :value element)))))))) ;; Extract from buffer's associated file, if any. - (and visited-file (file-name-nondirectory visited-file)) + (and visited-file + (file-name-nondirectory + ;; For a .gpg visited file, remove the .gpg extension: + (replace-regexp-in-string "\\.gpg\\'" "" visited-file))) ;; Can't determine file name on our own: ask user. (read-file-name "Output file: " pub-dir nil nil nil