[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/logview 0e32301293 002/259: Collect macros and inlined fun
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/logview 0e32301293 002/259: Collect macros and inlined functions at file beginning. |
Date: |
Fri, 31 Jan 2025 07:01:47 -0500 (EST) |
branch: elpa/logview
commit 0e323012937302758c2dd049ec2e42f917f51dc6
Author: Paul Pogonyshev <pogonyshev@gmail.com>
Commit: Paul Pogonyshev <pogonyshev@gmail.com>
Collect macros and inlined functions at file beginning.
---
logview.el | 78 +++++++++++++++++++++++++++++++++-----------------------------
1 file changed, 42 insertions(+), 36 deletions(-)
diff --git a/logview.el b/logview.el
index 781d24b3b5..d35ffcf135 100644
--- a/logview.el
+++ b/logview.el
@@ -381,6 +381,48 @@ levels.")
(make-variable-buffer-local 'logview--process-buffer-changes)
+
+;;; Macros and inlined functions.
+
+;; Lisp is sensitive to declaration order, so these are collected at
+;; the beginnig of the file.
+
+(defmacro logview--std-matching (&rest body)
+ (declare (indent 0) (debug t))
+ `(save-excursion
+ (let ((case-fold-search nil))
+ ,@body)))
+
+(defmacro logview--std-matching-and-altering (&rest body)
+ (declare (indent 0) (debug t))
+ `(save-excursion
+ (let ((logview--process-buffer-changes nil)
+ (case-fold-search nil)
+ (inhibit-read-only t))
+ (with-silent-modifications
+ ,@body))))
+
+
+;; The following (inlined) functions are needed when applying
+;; 'invisible' property. Generally we count entry from start of its
+;; line to the start of next entry's line. This works nice e.g. for
+;; highlighting. However, for hiding entries we need to take linefeed
+;; that _preceeds_ the entry, otherwise ellipses show at line
+;; beginnings, which is ugly and shifts actual buffer text.
+
+(defsubst logview--linefeed-back-checked (position)
+ "Assuming POSITION is at the beginning of a line, return
+position just before the preceding linefeed, if possible."
+ (if (> position 1)
+ (1- position)
+ 1))
+
+(defsubst logview--linefeed-back (position)
+ "Assuming POSITION is at the beginning of a non-first line,
+return position just before the preceding linefeed."
+ (1- position))
+
+
;;; The mode.
@@ -1042,22 +1084,6 @@ argument is positive, disable it otherwise."
(if (> direction 0) "No next (visible) entry" "No previous
(visible) entry")))))
-(defmacro logview--std-matching (&rest body)
- (declare (indent 0) (debug t))
- `(save-excursion
- (let ((case-fold-search nil))
- ,@body)))
-
-(defmacro logview--std-matching-and-altering (&rest body)
- (declare (indent 0) (debug t))
- `(save-excursion
- (let ((logview--process-buffer-changes nil)
- (case-fold-search nil)
- (inhibit-read-only t))
- (with-silent-modifications
- ,@body))))
-
-
(defun logview--match-current-entry ()
"Match the header of the log entry where the point currently is.
@@ -1284,26 +1310,6 @@ See `logview--iterate-entries-forward' for details."
'invisible (cons hider (get-text-property
after-first-line 'invisible))))))))
-;; The following (inlined) functions are needed when applying
-;; 'invisible' property. Generally we count entry from start of its
-;; line to the start of next entry's line. This works nice e.g. for
-;; highlighting. However, for hiding entries we need to take linefeed
-;; that _preceeds_ the entry, otherwise ellipses show at line
-;; beginnings, which is ugly and shifts actual buffer text.
-
-(defsubst logview--linefeed-back-checked (position)
- "Assuming POSITION is at the beginning of a line, return
-position just before the preceding linefeed, if possible."
- (if (> position 1)
- (1- position)
- 1))
-
-(defsubst logview--linefeed-back (position)
- "Assuming POSITION is at the beginning of a non-first line,
-return position just before the preceding linefeed."
- (1- position))
-
-
(defun logview--iterate-split-alists (callback &rest alists)
(let ((seen (make-hash-table :test 'equal)))
(dolist (alist alists)
- [nongnu] elpa/logview 4936b1ce71 015/259: Fix a typo., (continued)
- [nongnu] elpa/logview 4936b1ce71 015/259: Fix a typo., ELPA Syncer, 2025/01/31
- [nongnu] elpa/logview 0738dd1dfe 047/259: Fix 'd' command on entries without details: instead of showing an error, it used to hide the next entry., ELPA Syncer, 2025/01/31
- [nongnu] elpa/logview c22ac44d14 058/259: Bump version because of an important bugfix., ELPA Syncer, 2025/01/31
- [nongnu] elpa/logview b687711aa1 012/259: When adding self to 'auto-mode-alist', append rather than prepend., ELPA Syncer, 2025/01/31
- [nongnu] elpa/logview ab7eabfe9a 078/259: Fix and simplify 'logview-choose-submode' by reusing existing 'logview--get-split-alists' helper; fixes #23., ELPA Syncer, 2025/01/31
- [nongnu] elpa/logview 35f43a806f 024/259: Fix filter buffer highlight breaking whenever you edit the continuation of a multiline filter., ELPA Syncer, 2025/01/31
- [nongnu] elpa/logview b2a9bdf252 032/259: Mention that Logview is now available from MELPA., ELPA Syncer, 2025/01/31
- [nongnu] elpa/logview 4f1db3f208 055/259: Bump version because of an important bugfix., ELPA Syncer, 2025/01/31
- [nongnu] elpa/logview 9bddbbfd7b 076/259: After editing views, mark them as needing saving, otherwise definitions might get lost., ELPA Syncer, 2025/01/31
- [nongnu] elpa/logview a7374a86e2 068/259: Rewrite change in commit a0eab50 to still warn about other I/O errors on older Emacs versions., ELPA Syncer, 2025/01/31
- [nongnu] elpa/logview 0e32301293 002/259: Collect macros and inlined functions at file beginning.,
ELPA Syncer <=
- [nongnu] elpa/logview 96375bed1a 021/259: Mention the new 'o m' keybinding in the README., ELPA Syncer, 2025/01/31
- [nongnu] elpa/logview 7f62361f24 070/259: Add a command to manually choose log submode; requested in issue #15., ELPA Syncer, 2025/01/31
- [nongnu] elpa/logview 98c3855177 010/259: When customizing variables related to submode guessing, automatically try to guess again in buffers where this previously failed., ELPA Syncer, 2025/01/31
- [nongnu] elpa/logview 0c2f99b4f0 008/259: Add LICENSE file (GPL ver. 3)., ELPA Syncer, 2025/01/31
- [nongnu] elpa/logview 9ec279d933 094/259: Bump version because of significant new features., ELPA Syncer, 2025/01/31
- [nongnu] elpa/logview bbed5a7651 060/259: Add 'IGNORED' submode placeholder: used only for matching, not highlighted or handled by filters afterwards; fixes #8., ELPA Syncer, 2025/01/31
- [nongnu] elpa/logview 72b9e05e84 042/259: Add a command that refreshes the current buffer by appending if possible, else reverting it completely., ELPA Syncer, 2025/01/31
- [nongnu] elpa/logview 0512a4b122 016/259: Add message filters., ELPA Syncer, 2025/01/31
- [nongnu] elpa/logview 57dd81f5cc 005/259: Fix a typo., ELPA Syncer, 2025/01/31
- [nongnu] elpa/logview 4b29c9a6c7 020/259: Add a customizable and togglable setting to search only in messages, ignoring all other entry parts., ELPA Syncer, 2025/01/31