branch: externals/m-buffer
commit 8d351bb5fd17ea0b2676d310b27e2298616730fa
Author: Phillip Lord <[email protected]>
Commit: Phillip Lord <[email protected]>
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."