branch: externals-release/org
commit e8c24b66afd804d58b379266e6efeb147d60a102
Author: Bastien Guerry <[email protected]>
Commit: Bastien Guerry <[email protected]>
ox.el: Remove .gpg extension from the exported file-name
* ox.el (org-export-output-file-name): Remove .gpg extension.
Reported-by: Adalricus Ovicula <[email protected]>
Link: https://orgmode.org/list/[email protected]/
---
lisp/ox.el | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/lisp/ox.el b/lisp/ox.el
index c99e8d1..c0fd33d 100644
--- a/lisp/ox.el
+++ b/lisp/ox.el
@@ -6406,7 +6406,12 @@ When optional argument PUB-DIR is set, use it as the
publishing
directory.
Return file name as a string."
- (let* ((visited-file (buffer-file-name (buffer-base-buffer)))
+ (let* ((visited-file
+ ;; If a buffer is visiting a .gpg file, remove the .gpg
+ ;; extension from the name of the exported file.
+ (replace-regexp-in-string
+ "\\.gpg\\'" ""
+ (buffer-file-name (buffer-base-buffer))))
(base-name
(concat
(file-name-sans-extension