[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/annotate c21b95273e 177/372: Merge pull request #57 from c
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/annotate c21b95273e 177/372: Merge pull request #57 from cage2/master |
Date: |
Fri, 4 Feb 2022 16:58:56 -0500 (EST) |
branch: elpa/annotate
commit c21b95273eab57d6ec5a5b65d0bf88538d18f152
Merge: d10b915857 41e85c8435
Author: cage2 <1257703+cage2@users.noreply.github.com>
Commit: GitHub <noreply@github.com>
Merge pull request #57 from cage2/master
fixed error for regexp search in 'annotate--font-lock-matcher'
---
Changelog | 9 ++++++
NEWS.org | 4 +++
annotate.el | 93 +++++++++++++++++++++++++++++++------------------------------
3 files changed, 60 insertions(+), 46 deletions(-)
diff --git a/Changelog b/Changelog
new file mode 100644
index 0000000000..9d9f09e3fd
--- /dev/null
+++ b/Changelog
@@ -0,0 +1,9 @@
+2020-01-22 Bastian Bechtold, cage
+
+ * annotate.el (annotate--font-lock-matcher):
+ - fixed error for regexp search
+ Sometimes some modes/package puts overlay on the last character of a
+ buffer (notably SLIME when the parenthesis of a form are not
+ balanced). This will make 're-search-forward' in the aforementioned
+ function fails and font lock becomes a mess (e.g. text color
+ disappears).
diff --git a/NEWS.org b/NEWS.org
index a8ead98ba0..14f9889c14 100644
--- a/NEWS.org
+++ b/NEWS.org
@@ -81,3 +81,7 @@
not loaded;
- a simple heuristic is used to search for annotated text when
annotate mode is loaded.
+
+- 2020-01-22 V0.5.1 Bastian Bechtold, cage ::
+ - fixed bug that prevented correct fontifications for major modes
+ that puts overlays on the buffer's text (e.g. SLIME).
diff --git a/annotate.el b/annotate.el
index b34091d8af..884424ed06 100644
--- a/annotate.el
+++ b/annotate.el
@@ -7,7 +7,7 @@
;; Maintainer: Bastian Bechtold
;; URL: https://github.com/bastibe/annotate.el
;; Created: 2015-06-10
-;; Version: 0.5.0
+;; Version: 0.5.1
;; This file is NOT part of GNU Emacs.
@@ -52,7 +52,7 @@
;;;###autoload
(defgroup annotate nil
"Annotate files without changing them."
- :version "0.4.7"
+ :version "0.5.1"
:group 'text)
;;;###autoload
@@ -135,8 +135,8 @@ major mode is a member of this list (space separated
entries)."
:group 'annotate)
(defcustom annotate-summary-ask-query t
- "If non nil a prompt asking for a query to filter the database
-before showing it in a summary window is used. If nil the
+ "If non nil a prompt asking for a query to filter the database
+before showing it in a summary window is used. If nil the
database is not filtered at all."
:type 'boolean
:group 'annotate)
@@ -415,7 +415,7 @@ major mode."
(string-width (annotate-actual-comment-end))))
(defun annotate-wrap-in-comment (&rest strings)
- "Put comment markers at the start and (if it makes sense)
+ "Put comment markers at the start and (if it makes sense)
end of a string. See: annotate-actual-comment-start and
annotate-actual-comment-end"
(apply #'concat (append (list (annotate-actual-comment-start))
@@ -638,16 +638,17 @@ annotation plus the newline."
(if (>= (point) limit)
nil ; no match found before limit
(progn
- ;; go to the end of the longest overlay under point
- (let ((overlays (sort (overlays-at (point))
+ ;; go to the end of the longest annotation under point
+ (let ((overlays (sort (cl-remove-if-not 'annotationp
+ (overlays-at (point)))
(lambda (x y)
(> (overlay-end x) (overlay-end y))))))
- (if overlays
- (goto-char (overlay-end (car overlays)))))
- ;; capture the area from the overlay to EOL for the modification guard
- ;; and the newline itself for the annotation.
- (re-search-forward "\\(.*\\(\n\\)\\)")
- t)))
+ (when overlays
+ (goto-char (overlay-end (car overlays)))))
+ ;; capture the area from the overlay to EOL (regexp match #1)
+ ;; for the modification guard and the newline itself (regexp
+ ;; match #2) for the annotation.
+ (re-search-forward "\\(.*\\(\n\\)\\)" limit t))))
(cl-defstruct annotate-group
words
@@ -796,17 +797,17 @@ to 'maximum-width'."
(setq bol (1- bol)))
(setq overlays
(sort (cl-remove-if (lambda (a) (or (not (annotationp a))
- ;; if an annotated
- ;; text contains a
- ;; newline (is a
+ ;; if an annotated
+ ;; text contains a
+ ;; newline (is a
;; multiline one) do
- ;; not add
+ ;; not add
;; annotation for it
;; here (i.e. remove
- ;; from that list),
- ;; this annotation
- ;; will be shown on
- ;; the next newline
+ ;; from that list),
+ ;; this annotation
+ ;; will be shown on
+ ;; the next newline
;; instead
(<= (overlay-start a)
newline-position
@@ -814,9 +815,9 @@ to 'maximum-width'."
(overlays-in bol eol))
(lambda (x y)
(< (overlay-end x) (overlay-end y)))))
- ;; configure each annotation's properties and place it on the
- ;; the window. The actual position of the annotation (newline
- ;; or right marigin) is indicated by the value of the
+ ;; configure each annotation's properties and place it on the
+ ;; the window. The actual position of the annotation (newline
+ ;; or right marigin) is indicated by the value of the
;; variable: `annotate-annotation-position-policy'.
(dolist (ov overlays)
(let* ((face (if (= (cl-rem annotation-counter 2) 0)
@@ -932,7 +933,7 @@ an overlay and it's annotation."
;;; database related procedures
(defun annotate-info-actual-filename ()
- "The info filename that feed this buffer or nil if not this
+ "The info filename that feed this buffer or nil if not this
buffer is not on info-mode"
(annotate-guess-filename-for-dump Info-current-file nil))
@@ -1722,8 +1723,8 @@ summary window is shown")
(cl-defun annotate-summary-lexer (&optional (look-ahead-p nil))
"The lexer for `annotate-summary-query'.
-This function, when called, will produce the next token from
-`annotate-summary-query'; a token is a substring with a well
+This function, when called, will produce the next token from
+`annotate-summary-query'; a token is a substring with a well
defined meaning according to our grammar.
For example this string:
@@ -1754,13 +1755,13 @@ The format is a proper list where:
the substring limits for this token (as returned by
`match-beginning' and `match-end'
-Note that spaces are ignored and all the tokens except `re' must
+Note that spaces are ignored and all the tokens except `re' must
not be prefixed with a backslash to match. So, for example not ->
will match the token type 'not but \not will match the token 're;
-this way we can 'protect' a regexp that contains reserved
+this way we can 'protect' a regexp that contains reserved
keyword (aka escaping).
-the special value :no-more-token is returned after the whole
+The special value :no-more-token is returned after the whole
input is processed.
Calling this function with value of `look-ahead-p' nil will `consume' the
token from
@@ -1921,16 +1922,16 @@ Arguments:
(annotate-summary-lexer) ; consume the token 'not'
;; the note after the 'not' operator in rule
;; NOTE := NOT NOTE
- ;; the third argument is the value to return if
+ ;; the third argument is the value to return if
;; there are no more token left in the input string
(let ((res (annotate-summary-query-parse-note filter-fn
annotation :error))) ; recurse
- ;; if there are no more tokens here this is an error
- ;; because, according to the grammar, after a NOT a
+ ;; if there are no more tokens here this is an error
+ ;; because, according to the grammar, after a NOT a
;; NOTE is non optional
(if (eq :error res)
(error "No more input after 'not'")
- ;; if the last rule (saved in res) is not nil (and
- ;; is not :error) return nil, return the last
+ ;; if the last rule (saved in res) is not nil (and
+ ;; is not :error) return nil, return the last
;; annotation otherwise remember that the user asked
;; for an annotation that *not* matches a regex
(if (null res)
@@ -1953,7 +1954,7 @@ Arguments:
(rhs (annotate-summary-query-parse-note filter-fn
annotation :error))) ; recurse
(if (eq :error rhs)
(error "No more input after 'or'")
- (or lhs rhs)))) ; either lhs or rhs match as this is a
logic or
+ (or lhs rhs)))) ; either lhs or rhs match as this is a logic
or
((token-symbol-match-p 'escaped-re look-ahead)
;; here we match the rule:
;; NOTE := ESCAPED-RE
@@ -2043,24 +2044,24 @@ Note: this function return the annotation part of the
record, see
((eq operator 'or) ; operator is 'or
;; try to parse with the rule
;; EXPRESSION := FILE-MASK OR NOTE
- ;; return only the list annotation filtered by
+ ;; return only the list annotation filtered by
;; file-mask the former is non nil
(if filtered-annotation
(annotate-annotations-from-dump filtered-annotation)
- ;; the annotation filtered by file-mask is empty, try to
+ ;; the annotation filtered by file-mask is empty, try to
;; match the NOTE rule
(let ((look-ahead (annotate-summary-lexer t)))
- ;; no more input after operator this is wrong
- ;; according to the rule we are trying to match:
+ ;; no more input after operator this is wrong
+ ;; according to the rule we are trying to match:
;; EXPRESSION := FILE-MASK OR NOTE
(if (annotate-summary-query-parse-end-input-p look-ahead)
(error "No more input after 'or'")
(progn
- ;; copy the string for note parsing note
+ ;; copy the string for note parsing note
;; that annotate-summary-query only contains
;; the substring to match the NOTE rule
(setf query-notes-only (concat
annotate-summary-query))
- ;; parse all the annotations, we get a list
+ ;; parse all the annotations, we get a list
;; where non nil elements are the annotation
;; that passes the note-filter-fn test
(mapcar (lambda (a)
@@ -2072,13 +2073,13 @@ Note: this function return the annotation part of the
record, see
;; try to parse with the rule
;; EXPRESSION := FILE-MASK OR NOTE
(let ((look-ahead (annotate-summary-lexer t)))
- ;; no more input after operator, this is wrong
- ;; according to the rule we are trying to match:
+ ;; no more input after operator, this is wrong
+ ;; according to the rule we are trying to match:
;; EXPRESSION := FILE-MASK AND NOTE
(if (annotate-summary-query-parse-end-input-p look-ahead)
(error "No more input after 'and'")
(progn
- ;; copy the string for note parsing note
+ ;; copy the string for note parsing note
;; that annotate-summary-query only contains
;; the substring to match the NOTE rule
(setf query-notes-only (concat annotate-summary-query))
@@ -2091,7 +2092,7 @@ Note: this function return the annotation part of the
record, see
a)))
(annotate-annotations-from-dump
filtered-annotation))))))
(t
- ;; there is something after the file-mask in the
+ ;; there is something after the file-mask in the
;; input but it is not an operator
(error (format "Unknown operator: %s is not in '(and, or)"
(annotate-summary-query-lexer-string
operator-token)))))))))))))
- [nongnu] elpa/annotate fbd21602e8 129/372: - refactored 'annotate-actual-file-name' and used where appropriate., (continued)
- [nongnu] elpa/annotate fbd21602e8 129/372: - refactored 'annotate-actual-file-name' and used where appropriate., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 7127180360 145/372: - added 'cl-' prefix to 'remove-if';, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate e43d2f9e65 069/372: - fixed left margin of annotation, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate a51b5239b9 062/372: fixes incorrect annotation display for wide characters, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 0d315a806e 105/372: - fixed first argument of 'lwarn';, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 1ed168a79e 131/372: Merge pull request #47 from cage2/master, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate c8aea8392d 135/372: - rewritten filename juggling to make it works with info file in, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 286646bc0c 137/372: - made recongnizable code that refers to info file annotation. (2/3), ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 13391d9576 157/372: - expanded a comment and a docstring., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 0ae5752526 161/372: Merge pull request #54 from cage2/annotations-on-their-own-line, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate c21b95273e 177/372: Merge pull request #57 from cage2/master,
ELPA Syncer <=
- [nongnu] elpa/annotate 2ccdad1504 193/372: - starting with a new method to render multiline annotations, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 71f316be2f 236/372: - added dependency on 'info'., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 7a96192be2 248/372: - according to documentation the secon argument of 'signal' must be a list., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate f2b085d279 288/372: - fixed typos., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 26ea8e3631 266/372: - prevented getting shared value for 'annotate-file' in '%load-annotation-data'., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate b505af0f27 300/372: - updated NEWS, Changelog and version number., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 17958167da 298/372: Merge pull request #96 from cage2/master, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 784df37cba 313/372: - updated version number., ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 9cdc2a90fb 350/372: - added prompt to confirm deletion also when deleting annotation's text;, ELPA Syncer, 2022/02/04
- [nongnu] elpa/annotate 3e0d5f39b2 302/372: Merge pull request #98 from cage2/master, ELPA Syncer, 2022/02/04