From 7442e25a3497db92633536945d82b1c383270113 Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Sun, 22 Dec 2024 12:52:39 +0100 Subject: [PATCH] update edit-indirect Signed-off-by: Andreas Gerler --- .../edit-indirect-pkg.el | 12 ----- .../edit-indirect-autoloads.el | 27 +++++----- .../edit-indirect-pkg.el | 9 ++++ .../edit-indirect.el | 49 +++++++++---------- 4 files changed, 45 insertions(+), 52 deletions(-) delete mode 100644 elpa/edit-indirect-20220511.1124/edit-indirect-pkg.el rename elpa/{edit-indirect-20220511.1124 => edit-indirect-20240128.119}/edit-indirect-autoloads.el (80%) create mode 100644 elpa/edit-indirect-20240128.119/edit-indirect-pkg.el rename elpa/{edit-indirect-20220511.1124 => edit-indirect-20240128.119}/edit-indirect.el (94%) diff --git a/elpa/edit-indirect-20220511.1124/edit-indirect-pkg.el b/elpa/edit-indirect-20220511.1124/edit-indirect-pkg.el deleted file mode 100644 index d75030d8..00000000 --- a/elpa/edit-indirect-20220511.1124/edit-indirect-pkg.el +++ /dev/null @@ -1,12 +0,0 @@ -(define-package "edit-indirect" "20220511.1124" "Edit regions in separate buffers" - '((emacs "24.3")) - :commit "f80f63822ffae78de38dbe72cacaeb1aaa96c732" :authors - '(("Fanael Linithien" . "fanael4@gmail.com")) - :maintainers - '(("Fanael Linithien" . "fanael4@gmail.com")) - :maintainer - '("Fanael Linithien" . "fanael4@gmail.com") - :url "https://github.com/Fanael/edit-indirect") -;; Local Variables: -;; no-byte-compile: t -;; End: diff --git a/elpa/edit-indirect-20220511.1124/edit-indirect-autoloads.el b/elpa/edit-indirect-20240128.119/edit-indirect-autoloads.el similarity index 80% rename from elpa/edit-indirect-20220511.1124/edit-indirect-autoloads.el rename to elpa/edit-indirect-20240128.119/edit-indirect-autoloads.el index b22cd119..91d43080 100644 --- a/elpa/edit-indirect-20220511.1124/edit-indirect-autoloads.el +++ b/elpa/edit-indirect-20240128.119/edit-indirect-autoloads.el @@ -1,12 +1,14 @@ -;;; edit-indirect-autoloads.el --- automatically extracted autoloads -*- lexical-binding: t -*- -;; +;;; edit-indirect-autoloads.el --- automatically extracted autoloads (do not edit) -*- lexical-binding: t -*- +;; Generated by the `loaddefs-generate' function. + +;; This file is part of GNU Emacs. + ;;; Code: -(add-to-list 'load-path (directory-file-name - (or (file-name-directory #$) (car load-path)))) +(add-to-list 'load-path (or (and load-file-name (directory-file-name (file-name-directory load-file-name))) (car load-path))) + -;;;### (autoloads nil "edit-indirect" "edit-indirect.el" (0 0 0 0)) ;;; Generated autoloads from edit-indirect.el (autoload 'edit-indirect-region "edit-indirect" "\ @@ -40,20 +42,19 @@ display the edit-indirect buffer in some window and select it. In any case, return the edit-indirect buffer. -\(fn BEG END &optional DISPLAY-BUFFER)" t nil) - +(fn BEG END &optional DISPLAY-BUFFER)" t) (register-definition-prefixes "edit-indirect" '("edit-indirect-")) - -;;;*** -;;;### (autoloads nil nil ("edit-indirect-pkg.el") (0 0 0 0)) +;;; End of scraped data + +(provide 'edit-indirect-autoloads) -;;;*** - ;; Local Variables: ;; version-control: never ;; no-byte-compile: t ;; no-update-autoloads: t -;; coding: utf-8 +;; no-native-compile: t +;; coding: utf-8-emacs-unix ;; End: + ;;; edit-indirect-autoloads.el ends here diff --git a/elpa/edit-indirect-20240128.119/edit-indirect-pkg.el b/elpa/edit-indirect-20240128.119/edit-indirect-pkg.el new file mode 100644 index 00000000..05b54976 --- /dev/null +++ b/elpa/edit-indirect-20240128.119/edit-indirect-pkg.el @@ -0,0 +1,9 @@ +;; -*- no-byte-compile: t; lexical-binding: nil -*- +(define-package "edit-indirect" "20240128.119" + "Edit regions in separate buffers." + '((emacs "24.3")) + :url "https://github.com/Fanael/edit-indirect" + :commit "82a28d8a85277cfe453af464603ea330eae41c05" + :revdesc "82a28d8a8527" + :authors '(("Fanael Linithien" . "fanael4@gmail.com")) + :maintainers '(("Fanael Linithien" . "fanael4@gmail.com"))) diff --git a/elpa/edit-indirect-20220511.1124/edit-indirect.el b/elpa/edit-indirect-20240128.119/edit-indirect.el similarity index 94% rename from elpa/edit-indirect-20220511.1124/edit-indirect.el rename to elpa/edit-indirect-20240128.119/edit-indirect.el index 307f9695..12cb0d33 100644 --- a/elpa/edit-indirect-20220511.1124/edit-indirect.el +++ b/elpa/edit-indirect-20240128.119/edit-indirect.el @@ -2,14 +2,15 @@ ;; Author: Fanael Linithien ;; URL: https://github.com/Fanael/edit-indirect -;; Version: 0.1.10 +;; Package-Version: 20240128.119 +;; Package-Revision: 82a28d8a8527 ;; Package-Requires: ((emacs "24.3")) ;; This file is NOT part of GNU Emacs. ;; SPDX-License-Identifier: BSD-2-clause ;; -;; Copyright (c) 2014-2022, Fanael Linithien +;; Copyright (c) 2014-2024, Fanael Linithien ;; All rights reserved. ;; ;; Redistribution and use in source and binary forms, with or without @@ -192,7 +193,7 @@ buffer." (interactive) (edit-indirect--barf-if-not-indirect) (edit-indirect--commit) - (edit-indirect--clean-up)) + (edit-indirect--abort t)) (defun edit-indirect-save () "Save the modifications done in an edit-indirect buffer. @@ -212,7 +213,7 @@ Can be called only when the current buffer is an edit-indirect buffer." (interactive) (edit-indirect--barf-if-not-indirect) - (edit-indirect--abort)) + (edit-indirect--abort t)) (defun edit-indirect-buffer-indirect-p (&optional buffer) "Non-nil iff the BUFFER is an edit-indirect buffer. @@ -375,41 +376,35 @@ No error is signaled if `inhibit-read-only' or (unless (string= new-data (match-string 0)) (replace-match new-data t t)))) (edit-indirect--run-hook-with-positions - 'edit-indirect-after-commit-functions beg-marker (point)) + 'edit-indirect-after-commit-functions beg-marker end-marker) (set-marker beg-marker nil) (set-marker end-marker nil)))) (set-buffer-modified-p nil))) (defun edit-indirect--run-hook-with-positions (hook beg end) - "Run HOOK with the specified positions BEG and END. + "Run HOOK with the specified markers BEG and END. HOOK should be a symbol, a hook variable. -The functions are passed integer positions. +The functions are passed integer positions instead of markers. If a function changes the buffer contents, the next function will be called with updated positions." - (let ((beg-marker (unless (markerp beg) (copy-marker beg))) - (end-marker (unless (markerp end) (copy-marker end)))) - (run-hook-wrapped hook - (lambda (f beg end) - (funcall f (marker-position beg) (marker-position end)) - nil) - (or beg-marker beg) (or end-marker end)) - (when beg-marker (set-marker beg-marker nil)) - (when end-marker (set-marker end-marker nil)))) - -(defun edit-indirect--abort () - "Abort indirect edit." - (edit-indirect--clean-up)) - -(defun edit-indirect--clean-up () - "Clean up an edit-indirect buffer." + (run-hook-wrapped hook + (lambda (f beg end) + (funcall f (marker-position beg) (marker-position end)) + nil) + beg end)) + +(defun edit-indirect--abort (kill) + "Abort an indirect edit and clean up the edit-indirect buffer." (delete-overlay edit-indirect--overlay) ;; Kill the overlay reference so that `edit-indirect--abort-on-kill-buffer' ;; won't try to call us again. (setq edit-indirect--overlay nil) ;; If we created a window, get rid of it. Kill the buffer we created. - (if edit-indirect--should-quit-window - (quit-window t) - (kill-buffer))) + (if (and edit-indirect--should-quit-window + (eq (window-buffer (selected-window)) + (current-buffer))) + (quit-window kill) + (and kill (kill-buffer)))) (defun edit-indirect--rebind-save-hooks () "Bind our `save-buffer' hooks in the current buffer. @@ -428,7 +423,7 @@ Should only be called from `write-contents-functions'." "Abort indirect edit. Should be called only from `kill-buffer-hook'." (when edit-indirect--overlay - (edit-indirect--abort))) + (edit-indirect--abort nil))) (defun edit-indirect--barf-if-not-indirect () "Signal an error if the current buffer is not an edit-indirect buffer. -- 2.47.3