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

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

[elpa] externals/m-buffer 8d351bb5fd 054/115: m-buffer-with-current-mark


From: ELPA Syncer
Subject: [elpa] externals/m-buffer 8d351bb5fd 054/115: m-buffer-with-current-marker added.
Date: Tue, 19 Jul 2022 15:58:48 -0400 (EDT)

branch: externals/m-buffer
commit 8d351bb5fd17ea0b2676d310b27e2298616730fa
Author: Phillip Lord <phillip.lord@newcastle.ac.uk>
Commit: Phillip Lord <phillip.lord@newcastle.ac.uk>

    m-buffer-with-current-marker added.
---
 README.md   | 13 +++++++++++++
 m-buffer.el | 10 ++++++++++
 2 files changed, 23 insertions(+)

diff --git a/README.md b/README.md
index 9c0945691b..eed3f8b1bd 100644
--- a/README.md
+++ b/README.md
@@ -28,6 +28,19 @@ with the FSF.
 
 ## Change Log
 
+### 0.6
+
+ - All match functions now take a :numeric argument which forces the
+   return of numbers rather than markers.
+ - Two new functions for subtracting one set of matches from another:
+   `m-buffer-match-subtract` and `m-buffer-match-exact-subtract`
+ - `m-buffer-with-markers` is a `let*` like macro which autonils markers after
+   use.
+ - `m-buffer-with-current-location` is like `with-current-buffer` but
+   also takes a location.
+ - `m-buffer-with-current-marker` is like `with-current-buffer` but takes a
+   marker.
+ 
 ### 0.5
  - Automated Testing with Cask
 
diff --git a/m-buffer.el b/m-buffer.el
index 90866a91ff..a505c40156 100644
--- a/m-buffer.el
+++ b/m-buffer.el
@@ -69,6 +69,16 @@ All markers are niled after BODY."
         (list ,@marker-vars))
        ,rtn-var)))
 
+(defmacro m-buffer-with-current-marker
+  (marker &rest body)
+  "Run BODY at MARKER location."
+  (declare (indent 1) (debug t))
+  `(with-current-buffer
+       (marker-buffer ,marker)
+     (save-excursion
+       (goto-char ,marker)
+       ,@body)))
+
 (defmacro m-buffer-with-current-location
   (buffer location &rest body)
   "Run BODY in BUFFER at LOCATION."



reply via email to

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