[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/webpaste cb9cca7 054/298: Stop moving point and remove usa
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/webpaste cb9cca7 054/298: Stop moving point and remove usage of save-excursion and therefore |
Date: |
Thu, 9 Dec 2021 18:59:43 -0500 (EST) |
branch: elpa/webpaste
commit cb9cca769b04804ab73cb5e6c0bf4df4f8eddfb7
Author: Elis Axelsson <elis.axelsson@gmail.com>
Commit: Elis Axelsson <elis.axelsson@gmail.com>
Stop moving point and remove usage of save-excursion and therefore
simplify the code greatly.
---
webpaste.el | 18 ++++--------------
1 file changed, 4 insertions(+), 14 deletions(-)
diff --git a/webpaste.el b/webpaste.el
index d102fc0..ef2a7d1 100644
--- a/webpaste.el
+++ b/webpaste.el
@@ -177,16 +177,8 @@ When we run out of providers to try, it will restart since
"Paste selected region to some paste service."
(interactive)
- (let ((text (buffer-substring (mark) (point))))
- (webpaste-paste-text text)))
-
-
-;;;###autoload
-(defmacro webpaste-save-mark-and-excursion (&rest body)
- "Wraps usage of sending BODY to ‘save-mark-and-excursion’ /
‘save-excursion’."
- (if (< emacs-major-version 25)
- `(save-excursion ,@body)
- `(save-mark-and-excursion ,@body)))
+ ;; Extract the buffer contents with buffer-substring and paste it
+ (webpaste-paste-text (buffer-substring (mark) (point))))
;;;###autoload
@@ -194,10 +186,8 @@ When we run out of providers to try, it will restart since
"Paste current buffer to some paste service."
(interactive)
- (webpaste-save-mark-and-excursion
- (set-mark (point-min)) ; Set mark on point-min
- (goto-char (point-max)) ; Go to point-max
- (webpaste-paste-region))) ; Paste region
+ ;; Extract the buffer contents with buffer-substring and paste it
+ (webpaste-paste-text (buffer-substring (point-min) (point-max))))
(provide 'webpaste)
- [nongnu] elpa/webpaste 6039591 065/298: Added sprunge.us as provider, (continued)
- [nongnu] elpa/webpaste 6039591 065/298: Added sprunge.us as provider, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 984f838 068/298: Added dpaste.de as provider, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 53dcac8 046/298: Move definition position, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 1c2a9b8 047/298: Merge pull request #1 from syohex/fix-package, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 6d2e063 048/298: Spacing between blocks, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste d7700eb 050/298: Merge pull request #2 from syohex/cl-lib, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste c33f341 019/298: Added custom for provider priority, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste cc05738 025/298: Added some TODO notes, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 729e277 030/298: Paste to selected paste provider at the top of the list, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 80f0afe 051/298: Added provider to todo-list, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste cb9cca7 054/298: Stop moving point and remove usage of save-excursion and therefore,
ELPA Syncer <=
- [nongnu] elpa/webpaste 2250993 061/298: Fix eval of macros, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste c60c712 062/298: Checkdoc, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 39809d8 063/298: Update documentation, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste c57cd53 071/298: Changed string to number, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 78651c9 073/298: Avoid using eval, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste c9d1de0 076/298: Added Makefile for running tests, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 7770c88 080/298: Added first unit test to detect a working provider, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste 20760ac 097/298: Set default value of :parser to provider, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste e998ee4 099/298: Simplify one unit test, ELPA Syncer, 2021/12/09
- [nongnu] elpa/webpaste e905bbc 066/298: Change value-type to catch-all sexp since it's not functions anymore, ELPA Syncer, 2021/12/09