[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/lentic a740327d41 126/333: More efficient detection of
From: |
ELPA Syncer |
Subject: |
[elpa] externals/lentic a740327d41 126/333: More efficient detection of first line. |
Date: |
Tue, 27 Feb 2024 13:00:16 -0500 (EST) |
branch: externals/lentic
commit a740327d41159f0d4de3d91a05df1005ef098793
Author: Phillip Lord <phillip.lord@newcastle.ac.uk>
Commit: Phillip Lord <phillip.lord@newcastle.ac.uk>
More efficient detection of first line.
---
lentic-org.el | 66 ++++++++++++++++++++++++++---------------------------------
1 file changed, 29 insertions(+), 37 deletions(-)
diff --git a/lentic-org.el b/lentic-org.el
index c2a53f426d..12015f8eab 100644
--- a/lentic-org.el
+++ b/lentic-org.el
@@ -35,6 +35,7 @@
;; between the two modes.
;; #+BEGIN_SRC emacs-lisp
+(require 'cl-lib)
(require 'lentic-block)
;; #+END_SRC
@@ -220,38 +221,31 @@
;; consistent state
(call-next-method conf start stop length-before
start-converted stop-converted)
- (m-buffer-replace-match
- (m-buffer-match
- (lentic-that conf)
- ;; we can be in one of two states depending on whether we have made a new
- ;; clone or an incremental change
- "^;; \\(;;;\\|# #\\)"
- :end
- (cadr
- (car
- (m-buffer-match-line
- (lentic-that conf)))))
- ";;;")
- ;; replace big headers, in either of their two states
- (m-buffer-replace-match
- (m-buffer-match
- (lentic-that conf)
- "^;; [*] \\(\\w*\\)$"
- :begin
- (cadr
- (car
- (m-buffer-match-line
- (lentic-that conf)))))
- ";;; \\1:")
- (m-buffer-replace-match
- (m-buffer-match (lentic-that conf)
- "^;; ;;; \\(\\w*:\\)$"
- :begin
- (cadr
- (car
- (m-buffer-match-line
- (lentic-that conf)))))
- ";;; \\1"))
+ (m-buffer-with-markers
+ ((first-line-end-match
+ (cl-cadar
+ (m-buffer-match-first-line
+ (lentic-that conf)))))
+ (m-buffer-replace-match
+ (m-buffer-match
+ (lentic-that conf)
+ ;; we can be in one of two states depending on whether we have made a new
+ ;; clone or an incremental change
+ "^;; \\(;;;\\|# #\\)"
+ :end first-line-end-match)
+ ";;;")
+ ;; replace big headers, in either of their two states
+ (m-buffer-replace-match
+ (m-buffer-match
+ (lentic-that conf)
+ "^;; [*] \\(\\w*\\)$"
+ :begin first-line-end-match)
+ ";;; \\1:")
+ (m-buffer-replace-match
+ (m-buffer-match (lentic-that conf)
+ "^;; ;;; \\(\\w*:\\)$"
+ :begin first-line-end-match)
+ ";;; \\1")))
(defmethod lentic-invert
((conf lentic-org-to-orgel-configuration))
@@ -305,11 +299,9 @@
(lentic-that conf)
";;; "
:end
- ;; we matching a lot of lines for one line here...
- (cadr
- (car
- (m-buffer-match-line
- (lentic-that conf)))))
+ (cl-cadar
+ (m-buffer-match-first-line
+ (lentic-that conf))))
"# # ")
(m-buffer-replace-match
(m-buffer-match (lentic-that conf)
- [elpa] externals/lentic 070c94118e 074/333: Added .dir-locals, (continued)
- [elpa] externals/lentic 070c94118e 074/333: Added .dir-locals, ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 08cb364e4c 094/333: Nil markers after use., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 449c4d0bc1 098/333: Pass start and end through., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 10c91c51d5 110/333: Specialised beginning of line treatment., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 8ab992a0d0 113/333: Added a test to bug with orgel->org mode., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 48d809a4af 115/333: Use unwind-protect in test forms., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic abcdc7f422 117/333: m-buffer-with-markers used., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 934c7bc313 118/333: Fixes for incremental updates., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 779c2d05e3 120/333: Treat start of line properly in blocks., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 30d9141686 121/333: m-buffer update -- move to stable., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic a740327d41 126/333: More efficient detection of first line.,
ELPA Syncer <=
- [elpa] externals/lentic 37eb0a74cd 128/333: More Emacs versions added., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 6ce64ab475 131/333: Test only two versions!, ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 7e39bf724c 134/333: Incorporate new functions from m-buffer., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic b71b478f51 139/333: Test expected to fail., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic c60736c5c6 140/333: Comment removed because it is out of date., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic f0e3d7b287 145/333: Limit to lentic to allow some support files., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 2cfc982759 147/333: New tests added., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 6480e71885 148/333: Fixed some accidentally lower casing., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic b8c096b6d6 149/333: Add autoloads to ignore., ELPA Syncer, 2024/02/27
- [elpa] externals/lentic 26b68cd9da 152/333: init functions are now stateless., ELPA Syncer, 2024/02/27