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

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

[nongnu] elpa/webpaste af0474e 139/298: Merge branch 'naclander-master'


From: ELPA Syncer
Subject: [nongnu] elpa/webpaste af0474e 139/298: Merge branch 'naclander-master'
Date: Thu, 9 Dec 2021 19:00:01 -0500 (EST)

branch: elpa/webpaste
commit af0474eceba66570ed277a805ac0dc433b1299b4
Merge: 7d03ed3 b03b90f
Author: Elis Axelsson <elis.axelsson@gmail.com>
Commit: Elis Axelsson <elis.axelsson@gmail.com>

    Merge branch 'naclander-master'
---
 webpaste.el | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/webpaste.el b/webpaste.el
index fa7e5cf..2d303ed 100644
--- a/webpaste.el
+++ b/webpaste.el
@@ -68,6 +68,11 @@ default to all providers in order defined in 
‘webpaste-providers’ list."
   :type '(alist :key-type symbol :value-type string)
   :group 'webpaste)
 
+(defcustom webpaste/paste-confirmation nil
+  "Prompt for a yes/no confirmation before attempting to paste a region or
+buffer"
+  :group 'webpaste)
+
 
 (defvar webpaste/tested-providers ()
   "Variable for storing which providers to try in which order while running.
@@ -372,8 +377,11 @@ Argument POINT Current point.
 Argument MARK Current mark."
   (interactive "r")
 
-  ;; Extract the buffer contents with buffer-substring and paste it
-  (webpaste-paste-text (buffer-substring point mark)))
+  ;; unless we wanted a paste confirmation and declined
+  (unless (and webpaste/paste-confirmation
+               (not (yes-or-no-p "paste entire region?")))
+    ;; Extract the buffer contents with buffer-substring and paste it
+    (webpaste-paste-text (buffer-substring point mark))))
 
 
 ;;;###autoload
@@ -381,8 +389,11 @@ Argument MARK Current mark."
   "Paste current buffer to some paste service."
   (interactive)
 
-  ;; Extract the buffer contents with buffer-substring and paste it
-  (webpaste-paste-text (buffer-substring (point-min) (point-max))))
+  ;; unless we wanted a paste confirmation and declined
+  (unless (and webpaste/paste-confirmation
+               (not (yes-or-no-p "paste entire buffer?")))
+    ;; Extract the buffer contents with buffer-substring and paste it
+    (webpaste-paste-text (buffer-substring (point-min) (point-max)))))
 
 
 



reply via email to

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