[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/doc-show-inline 3a4eee3ef3 05/12: Add doc-show-inline-excl
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/doc-show-inline 3a4eee3ef3 05/12: Add doc-show-inline-exclude-regexp |
Date: |
Thu, 7 Jul 2022 11:58:57 -0400 (EDT) |
branch: elpa/doc-show-inline
commit 3a4eee3ef3fb3b50252418308f1b45e22a67bc8e
Author: Campbell Barton <ideasman42@gmail.com>
Commit: Campbell Barton <ideasman42@gmail.com>
Add doc-show-inline-exclude-regexp
---
changelog.rst | 1 +
doc-show-inline.el | 23 ++++++++++++++++++++++-
readme.rst | 6 ++++++
3 files changed, 29 insertions(+), 1 deletion(-)
diff --git a/changelog.rst b/changelog.rst
index 3ad207dc3a..f33937fe72 100644
--- a/changelog.rst
+++ b/changelog.rst
@@ -6,6 +6,7 @@ Change Log
- 2021-12-10
- Include leading white-space to properly align indented multi-line
doc-strings.
+ - Add ``doc-show-inline-exclude-regexp`` to optionally exclude comments
matching a regular expression.
- 2021-12-08
- Keep blank space between the symbol and comments.
diff --git a/doc-show-inline.el b/doc-show-inline.el
index 496b6007d3..3af7030352 100644
--- a/doc-show-inline.el
+++ b/doc-show-inline.el
@@ -70,6 +70,10 @@
Set to 0.0 to highlight immediately (as part of syntax highlighting)."
:type 'float)
+(defcustom doc-show-inline-exclude-regexp nil
+ "Optionally skip comments that match this regular expression."
+ :type '(choice (const nil) (regexp)))
+
(defcustom doc-show-inline-face-background-highlight -0.04
"Use to tint the background color for overlay text (between -1.0 and 1.0).
Ignored when `doc-show-inline-face'
@@ -307,7 +311,24 @@ the point should not be moved by this function."
sym
(current-buffer)
(point))
- ;; Failure.
+ ;; Skip this comment.
+ nil)
+ ;; Optionally exclude a regexp.
+ (
+ (and
+ doc-show-inline-exclude-regexp
+ (save-match-data
+ (goto-char pos-beg)
+ (search-forward-regexp doc-show-inline-exclude-regexp
pos-end t)))
+
+ (doc-show-inline--log-info
+ "comment \"%s\" in %S at point %d was skipped because of regex
match with %S"
+ sym
+ (current-buffer)
+ pos-beg
+ doc-show-inline-exclude-regexp)
+
+ ;; Skip this comment.
nil)
(t
diff --git a/readme.rst b/readme.rst
index 810ab2bf03..e52a653d96 100644
--- a/readme.rst
+++ b/readme.rst
@@ -38,6 +38,12 @@ Customization
``doc-show-inline-idle-delay`` (float ``0.75``)
The idle delay to use before updating doc-strings.
+``doc-show-inline-exclude-regexp`` (regexp / nil ``nil``)
+ Optionally exclude comments that contain text matching this regular
expression.
+
+ This can be useful for excluding comments which define function grouping or
other kinds of file sections,
+ which aren't intended to represent documentation for the following symbol.
+
``doc-show-inline-face-background-highlight`` (float ``-0.04``)
The tint to use when generating the background color for the background of
doc-string overlays.
The value is between -1.0 and 1.0 where negative numbers darken, positive
numbers brighten.
- [nongnu] branch elpa/doc-show-inline created (now 0cceb39df3), ELPA Syncer, 2022/07/07
- [nongnu] elpa/doc-show-inline 2ddb1c70f9 02/12: Display blank space between the symbol and the comment, ELPA Syncer, 2022/07/07
- [nongnu] elpa/doc-show-inline 8b457d565d 06/12: Fix an error with C/C++ raising an error during syntax highlighting, ELPA Syncer, 2022/07/07
- [nongnu] elpa/doc-show-inline 5705f8d6f5 09/12: Cleanup: use brief SPDX license, ELPA Syncer, 2022/07/07
- [nongnu] elpa/doc-show-inline 0cceb39df3 12/12: Change URL to codeberg, ELPA Syncer, 2022/07/07
- [nongnu] elpa/doc-show-inline 2757164831 04/12: Fix for displaying indented doc-strings, ELPA Syncer, 2022/07/07
- [nongnu] elpa/doc-show-inline 6bfea44e0b 08/12: Cleanup: minor improvement to error message, ELPA Syncer, 2022/07/07
- [nongnu] elpa/doc-show-inline 11fc50a13c 03/12: Demote errors, ELPA Syncer, 2022/07/07
- [nongnu] elpa/doc-show-inline daa99f0773 07/12: Fix repeat not being set for the initial timer, ELPA Syncer, 2022/07/07
- [nongnu] elpa/doc-show-inline 1c5837d2a6 01/12: Initial working version., ELPA Syncer, 2022/07/07
- [nongnu] elpa/doc-show-inline 3a4eee3ef3 05/12: Add doc-show-inline-exclude-regexp,
ELPA Syncer <=
- [nongnu] elpa/doc-show-inline 4295439062 10/12: Add doc-show-inline-exclude-blank-lines option, ELPA Syncer, 2022/07/07
- [nongnu] elpa/doc-show-inline 11a29ebfd7 11/12: Fix use of marker-position on an integer, ELPA Syncer, 2022/07/07