emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/hyperdrive 44ddb430de 04/14: Change: (h/handler-default) P


From: ELPA Syncer
Subject: [nongnu] elpa/hyperdrive 44ddb430de 04/14: Change: (h/handler-default) Prompt to mark safe when loading file
Date: Sun, 18 Aug 2024 19:00:18 -0400 (EDT)

branch: elpa/hyperdrive
commit 44ddb430deeed841f1e6a0523767f5a750c6a546
Author: Joseph Turner <joseph@ushin.org>
Commit: Joseph Turner <joseph@ushin.org>

    Change: (h/handler-default) Prompt to mark safe when loading file
---
 hyperdrive-lib.el | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/hyperdrive-lib.el b/hyperdrive-lib.el
index 87d7cc88c7..615884b0d6 100644
--- a/hyperdrive-lib.el
+++ b/hyperdrive-lib.el
@@ -1369,6 +1369,7 @@ Otherwise, return nil.  SLOT may be one of
 
 (declare-function h/org--link-goto "hyperdrive-org")
 (declare-function h/blob-mode "hyperdrive")
+(declare-function h/mark-as-safe "hyperdrive")
 (cl-defun h/handler-default (entry &key then)
   "Load ENTRY's file into an Emacs buffer.
 If then, then call THEN with no arguments.  Default handler."
@@ -1393,11 +1394,12 @@ If then, then call THEN with no arguments.  Default 
handler."
                 (or (not (h/writablep hyperdrive)) version))
           (set-buffer-modified-p nil)
           (set-visited-file-modtime (current-time))))
-      (if (map-elt (hyperdrive-etc hyperdrive) 'safep)
-          (let ((buffer-file-name (he/name entry)))
-            (set-auto-mode))
-        (h/message "Mark hyperdrive `%s' as safe to auto-enable major mode."
-                   (h//format-hyperdrive hyperdrive)))
+      (when (eq 'unknown (h/safe-p hyperdrive))
+        (call-interactively #'h/mark-as-safe))
+      ;; Check safe-p again after potential call to `h/mark-as-safe'.
+      (when (eq t (h/safe-p hyperdrive))
+        (let ((buffer-file-name (he/name entry)))
+          (set-auto-mode)))
       (when target
         (pcase major-mode
           ('org-mode



reply via email to

[Prev in Thread] Current Thread [Next in Thread]