[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/hyperdrive da6c62919b 4/7: Change: Replace save-some-buffe
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/hyperdrive da6c62919b 4/7: Change: Replace save-some-buffers-functions with buffer-offer-save |
Date: |
Sun, 3 Sep 2023 15:59:51 -0400 (EDT) |
branch: elpa/hyperdrive
commit da6c62919b439970a761c6038367fef6cbb2efe9
Author: Joseph Turner <joseph@ushin.org>
Commit: Joseph Turner <joseph@ushin.org>
Change: Replace save-some-buffers-functions with buffer-offer-save
Thank you to Stefan Monnier for the suggestion!
---
hyperdrive.el | 31 ++++---------------------------
1 file changed, 4 insertions(+), 27 deletions(-)
diff --git a/hyperdrive.el b/hyperdrive.el
index ea2bee56d4..166a972560 100644
--- a/hyperdrive.el
+++ b/hyperdrive.el
@@ -94,32 +94,6 @@
browse-url-handlers :test #'equal)
(cl-pushnew "hyper://" thing-at-point-uri-schemes :test #'equal))
-;;;; `save-some-buffers' integration
-
-(when (version<= "29.1" emacs-version)
- (defun hyperdrive--save-some-buffers (query &optional arg)
- "Save some hyperdrive buffers.
-QUERY and ARGS are passed in from `save-some-buffers-functions', which see."
- (let ((bufs (match-buffers
- (lambda (buf) (and (buffer-local-value
'hyperdrive-current-entry buf)
- ;; TODO: Do we need to check for
`hyperdrive-mode'?
- (buffer-modified-p buf))))))
- (if (eq query 'query)
- ;; Query: Return non-nil if there are unsaved hyperdrive buffers.
- bufs
- ;; Save abbrevs according to ARG.
- (while-let ((buf (car bufs)))
- (cl-callf cdr bufs)
- (with-current-buffer buf
- (when (or arg
- (y-or-n-p (format "Hyperdrive: Save file «%s»? "
- (hyperdrive-entry-description
hyperdrive-current-entry))))
- (hyperdrive-write-buffer hyperdrive-current-entry)))))))
-
- (add-hook 'save-some-buffers-functions (with-no-warnings
- ;; Appease linter.
- #'hyperdrive--save-some-buffers)))
-
;;;; Commands
;; TODO(A): Command to rename paths.
@@ -341,7 +315,10 @@ Intended to be passed to `buffer-local-restore-state'.")
(buffer-local-set-state
revert-buffer-function #'hyperdrive-revert-buffer
bookmark-make-record-function
#'hyperdrive-bookmark-make-record
- write-contents-functions (cl-adjoin
#'hyperdrive--write-contents write-contents-functions)))
+ write-contents-functions (cl-adjoin
#'hyperdrive--write-contents write-contents-functions)
+ ;; TODO: Modify buffer-local value of
`save-some-buffers-action-alist'
+ ;; to allow diffing modified buffer with hyperdrive file
+ buffer-offer-save t))
(add-hook 'after-change-major-mode-hook
#'hyperdrive--hack-write-contents-functions nil 'local))
(buffer-local-restore-state hyperdrive-mode--state)
- [nongnu] elpa/hyperdrive updated (62e1876e7f -> fd693d7f20), ELPA Syncer, 2023/09/03
- [nongnu] elpa/hyperdrive 63171c5487 6/7: Docs: Update documentation about save-some-buffers, ELPA Syncer, 2023/09/03
- [nongnu] elpa/hyperdrive fd693d7f20 7/7: Comment: Add TODO, ELPA Syncer, 2023/09/03
- [nongnu] elpa/hyperdrive cef8bd23d6 1/7: Fix: Typo, ELPA Syncer, 2023/09/03
- [nongnu] elpa/hyperdrive a6e5a4eb2f 2/7: Fix: (hyperdrive-vars.el) Remove :group and fix some :set and :type, ELPA Syncer, 2023/09/03
- [nongnu] elpa/hyperdrive da6c62919b 4/7: Change: Replace save-some-buffers-functions with buffer-offer-save,
ELPA Syncer <=
- [nongnu] elpa/hyperdrive ea835f52ff 3/7: Meta: Add email and mailing list to Author/Maintainer headers, ELPA Syncer, 2023/09/03
- [nongnu] elpa/hyperdrive 5fbc69d111 5/7: Meta: Update changelog, ELPA Syncer, 2023/09/03