branch: externals-release/org
commit b1ff9afc3b1db13cd8d6bd88a0172c0177540ae3
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]/
    
    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 c99e8d1..8ab4314 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

Reply via email to