[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/m-buffer 18d086666c 083/115: Lentic-doc completed.
From: |
ELPA Syncer |
Subject: |
[elpa] externals/m-buffer 18d086666c 083/115: Lentic-doc completed. |
Date: |
Tue, 19 Jul 2022 15:58:50 -0400 (EDT) |
branch: externals/m-buffer
commit 18d086666c58192ea0dcbd1059f9654535bafbfe
Author: Phillip Lord <phillip.lord@newcastle.ac.uk>
Commit: Phillip Lord <phillip.lord@newcastle.ac.uk>
Lentic-doc completed.
---
m-buffer-macro.el | 33 +++++++++++++++++++++++++++++----
1 file changed, 29 insertions(+), 4 deletions(-)
diff --git a/m-buffer-macro.el b/m-buffer-macro.el
index 298318f622..44119a6674 100644
--- a/m-buffer-macro.el
+++ b/m-buffer-macro.el
@@ -23,15 +23,29 @@
;;; Commentary:
-;; Macro support for markers with post-cleanup.
+;; This file provides some utility macros which help to support stateless
+;; operation on buffers, by restoring global state after to what it was before
+;; the macro starts.
+
+;; These macros are quite useful, but with the exception of
+;; `m-buffer-with-markers', they are mostly meant to underpin `m-buffer-at'.
;;; Code:
+;; ** Markers
+
+;; Markers are generally much nicer than integers, but needs cleaning up
+;; afterwards if a lot are created. It's possible to do this using
+;; `m-buffer-nil-marker', but it can be a bit painful. This form looks like a
+;; `let' form, but removes markers at the end.
+
+
;; #+begin_src emacs-lisp
(defmacro m-buffer-with-markers (varlist &rest body)
"Bind variables after VARLIST then eval BODY.
-All variables should contain markers or collections of markers.
-All markers are niled after BODY."
+VARLIST is of the same form as `let'. All variables should
+contain markers or collections of markers. All markers are niled
+after BODY."
;; indent let part specially, and debug like let
(declare (indent 1)(debug let))
;; so, create a rtn var with make-symbol (for hygene)
@@ -48,7 +62,14 @@ All markers are niled after BODY."
(m-buffer-nil-marker
(list ,@marker-vars))
,rtn-var)))
+;; #+end_src
+
+;; ** Point and Buffer
+
+;; These macros are extensions of `with-current-buffer', and `save-excursion',
+;; which set the current buffer and location.
+;; #+begin_src emacs-lisp
(defmacro m-buffer-with-current-marker
(marker &rest body)
"At MARKER location run BODY."
@@ -69,7 +90,11 @@ All markers are niled after BODY."
(save-excursion
(goto-char ,location)
,@body)))
+;; #+end_src
+
+;; Combines the last two!
+;; #+begin_src emacs-lisp
(defmacro m-buffer-with-current-location
(location &rest body)
"At LOCATION, run BODY.
@@ -92,6 +117,6 @@ If a two element, it is a buffer and position."
(provide 'm-buffer-macro)
+;;; m-buffer-macro.el ends here
;; #+end_src
-;;; m-buffer-macro.el ends here
- [elpa] externals/m-buffer cbd9d12b3d 023/115: Functions for colourizing text. Improved documentation., (continued)
- [elpa] externals/m-buffer cbd9d12b3d 023/115: Functions for colourizing text. Improved documentation., ELPA Syncer, 2022/07/19
- [elpa] externals/m-buffer 6e8e29e12d 022/115: Fix some typos, ELPA Syncer, 2022/07/19
- [elpa] externals/m-buffer 05846a92bc 035/115: Removed "-data" from m-buffer-match-data., ELPA Syncer, 2022/07/19
- [elpa] externals/m-buffer 11990bba65 045/115: Version 0.5 release., ELPA Syncer, 2022/07/19
- [elpa] externals/m-buffer bc7dd63016 051/115: Emacs 24.4 Unit testing., ELPA Syncer, 2022/07/19
- [elpa] externals/m-buffer 115663a882 056/115: Updates for 0.6., ELPA Syncer, 2022/07/19
- [elpa] externals/m-buffer 02feebf931 058/115: Test update due to function private namechange., ELPA Syncer, 2022/07/19
- [elpa] externals/m-buffer 7c5eef2304 067/115: More org documentation changes., ELPA Syncer, 2022/07/19
- [elpa] externals/m-buffer b67897c833 070/115: Reduce Emacs versions in testing., ELPA Syncer, 2022/07/19
- [elpa] externals/m-buffer 643fbef4bf 078/115: replace-match now saves point, ELPA Syncer, 2022/07/19
- [elpa] externals/m-buffer 18d086666c 083/115: Lentic-doc completed.,
ELPA Syncer <=
- [elpa] externals/m-buffer 62df9235a1 087/115: v0.11 release., ELPA Syncer, 2022/07/19
- [elpa] externals/m-buffer 184fe5f609 101/115: Prepare for next iteration., ELPA Syncer, 2022/07/19
- [elpa] externals/m-buffer 9dcfcd69d8 106/115: Update Emacs version requirement, ELPA Syncer, 2022/07/19
- [elpa] externals/m-buffer e2d5a416ce 113/115: Move back to melpa-stable, ELPA Syncer, 2022/07/19
- [elpa] externals/m-buffer 8681342aaf 114/115: Renamespace assess-discover, ELPA Syncer, 2022/07/19
- [elpa] externals/m-buffer f76c2d205b 025/115: Merge branch 'master' of github.com:phillord/m-buffer-el, ELPA Syncer, 2022/07/19
- [elpa] externals/m-buffer fff98c95e3 030/115: Return type of replace-match changed to start end markers. New function `clone-markers', ELPA Syncer, 2022/07/19
- [elpa] externals/m-buffer 32c3077044 031/115: Bump to snapshot version (rather late!), ELPA Syncer, 2022/07/19
- [elpa] externals/m-buffer 71a712044e 033/115: v0.3 release, ELPA Syncer, 2022/07/19
- [elpa] externals/m-buffer 1ce2bb58bb 040/115: Test from melpa-stable only., ELPA Syncer, 2022/07/19