[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/webpaste b03b90f 138/298: Add confirmation dialog of paste
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/webpaste b03b90f 138/298: Add confirmation dialog of paste, before pasting |
Date: |
Thu, 9 Dec 2021 19:00:00 -0500 (EST) |
branch: elpa/webpaste
commit b03b90fe0b18d125b6001c67b539017e88a830e2
Author: Nathan Aclander <naclander@linux.ucla.edu>
Commit: Elis Axelsson <elis.axelsson@gmail.com>
Add confirmation dialog of paste, before pasting
---
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)))))
- [nongnu] elpa/webpaste d9529de 112/298: Replaced (if (eq VAR nil)) with (unless VAR), (continued)
- [nongnu] elpa/webpaste d9529de 112/298: Replaced (if (eq VAR nil)) with (unless VAR), ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 1bfa9ec 120/298: Bump version for stable release and copyright year, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 6ea53d0 123/298: Added support for custom handler of how to build the post data for providers, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste aff4e42 124/298: The error-lambda now has a default value and is now optional, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 2dc2206 126/298: Added github anonymous gists as provider. This fixes #8., ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste b3bcde1 128/298: Updated some docs that was missed before release..., ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 0fa48e2 129/298: Switch github pastes to not be public. This fixes #9., ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 4e58b0a 131/298: Fix bug in link returned from dpaste.de, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste b35b30d 134/298: Added documentation for how to configure provider priority, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 70e8fd0 135/298: Bump version for new release, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste b03b90f 138/298: Add confirmation dialog of paste, before pasting,
ELPA Syncer <=
- [nongnu] elpa/webpaste f0a36e2 140/298: Added some docs of how to enable the confirmation dialog before pasting, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 272757b 056/298: Change documentation string, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 58f66ef 069/298: Bump version to prepare for melpa stable, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 6e34759 072/298: Added another privider to list to implement, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste f378ca9 075/298: Added Cask file, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 2bb8a4c 077/298: Set up tests directory, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste f338ca7 083/298: Added Travis-CI build status image, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste f658339 096/298: Bump version number for stable release, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste e485847 107/298: Break out pasting to provider to own function, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 406d713 115/298: Shared success lambdas between different paste providers, ELPA Syncer, 2021/12/09