emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [PATCH] New remote resource download policy


From: Max Nikulin
Subject: Re: [PATCH] New remote resource download policy
Date: Wed, 22 Jun 2022 23:55:15 +0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1

On 22/06/2022 17:01, Timothy wrote:

+(defun org–confirm-resource-safe (uri)
+  “Ask the user if URI should be considered safe, returning non-nil if so.”
+    (unless noninteractive
+      (let ((buf (get-buffer-create “*Org Remote Resource*”)))

I see your intention to add something fancy to the dialog. May `org-mks’ be
reused instead to avoid proliferation variants of rather similar UI code?

Well, the thing here is that I’m explicitly trying to mimic the
file-local-variable dialog, and since a general form isn’t exposed by Emacs, a
little bit of proliferation seems like the best option to me.

From my point of view the result is rather close (prompt should be adjusted):

(let ((uri "https://orgmode.org";))
  (org-mks
   nil
(format "An org-mode document would like to download %s, which is not considered safe.

Do you want to download this?"
           (propertize uri 'face '(:inherit org-link :weight normal)))
   nil ; prompt
   `((,(propertize "!" 'face 'success)
      "download this resource, and permanantly mark it as safe.")
     (,(propertize "y" 'face 'warning)
      "to download this resource, just this once.")
     (,(propertize "n" 'face 'error)
      "skip this resource."))))




reply via email to

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