[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/symbol-overlay 5c6c57a529 054/152: fix message
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/symbol-overlay 5c6c57a529 054/152: fix message |
Date: |
Thu, 7 Jul 2022 12:04:12 -0400 (EDT) |
branch: elpa/symbol-overlay
commit 5c6c57a529d9c41cae86f21eea74c3853219598b
Author: wolray <290061869@qq.com>
Commit: wolray <290061869@qq.com>
fix message
---
readme.md | 2 +-
symbol-overlay.el | 40 ++++++++++++++++------------------------
2 files changed, 17 insertions(+), 25 deletions(-)
diff --git a/readme.md b/readme.md
index 703dc7773c..1119cd9be4 100644
--- a/readme.md
+++ b/readme.md
@@ -19,7 +19,7 @@ Toggling to isearch-mode is now enabled. Try
`symbol-overlay-isearch-literally`
### 20170420:
-Toggling overlays to be showed in buffer or only in scope is now enabled.
When symbol is highlighted in scope, all related operations is narrowed to the
scope, too. Try `symbol-overlay-toggle-in-scope` via "t". This feature is
applicable only for languages that support the lisp function `narrow-to-defun`.
+Toggling overlays to be showed in buffer or only in scope is now enabled.
When symbol is highlighted in scope, all related operations is narrowed to the
scope, too. Try `symbol-overlay-toggle-in-scope` via "t". This feature is
applicable only for languages that support the lisp function `narrow-to-defun`.
Otherwise you may specify `symbol-overlay-narrow-function` on your own.
### 20170417:
diff --git a/symbol-overlay.el b/symbol-overlay.el
index 4bd0e77fe7..0581192c6a 100644
--- a/symbol-overlay.el
+++ b/symbol-overlay.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2017 wolray
;; Author: wolray <wolray@foxmail.com>
-;; Version: 3.3
+;; Version: 3.4
;; URL: https://github.com/wolray/symbol-overlay/
;; Keywords: faces, matching
;; Package-Requires: ((emacs "24.3"))
@@ -147,7 +147,7 @@ If NOERROR is non-nil, just return nil when no symbol is
found."
(cddr keyword)))
(defvar symbol-overlay-narrow-function nil
- "Nil or a function that returns a cons of region beginning and end.")
+ "Nil or a function that narrows to a specific region.")
(make-variable-buffer-local 'symbol-overlay-narrow-function)
(defvar symbol-overlay-temp-symbol nil
@@ -166,22 +166,18 @@ SCOPE, `symbol-overlay-narrow-function' and WINDOW."
(if (or scope (and symbol-overlay-temp-symbol symbol-overlay-temp-in-scope))
(let ((f symbol-overlay-narrow-function)
(pt (point))
- region min max p)
+ min max p)
(save-excursion
- (if f (progn (setq region (funcall f))
- (narrow-to-region (car region) (cdr region)))
- (if (eq scope 'scope) (narrow-to-defun)
- (if (eq scope 'paragraph) (setq p t)
- (save-excursion
- (save-restriction
- (narrow-to-defun)
- (setq min (point-min)
- max (point-max)
- p (/= pt (point))))))
- (and p (setq min (progn (backward-paragraph) (point))
- max (progn (forward-paragraph) (point))))
- (narrow-to-region min max))))
- (setq scope (if p 'paragraph 'scope)))
+ (if f (funcall f)
+ (save-excursion
+ (save-restriction
+ (narrow-to-defun)
+ (setq min (point-min)
+ max (point-max)
+ p (/= pt (point)))))
+ (and p (setq min (progn (backward-paragraph) (point))
+ max (progn (forward-paragraph) (point))))
+ (narrow-to-region min max))))
(when window
(let ((lines (round (window-screen-lines)))
(pt (point))
@@ -191,8 +187,7 @@ SCOPE, `symbol-overlay-narrow-function' and WINDOW."
(setq beg (point))
(goto-char pt)
(forward-line lines)
- (narrow-to-region beg (point))))))
- scope)
+ (narrow-to-region beg (point)))))))
(defvar symbol-overlay-temp-face
'((:background "gray70")
@@ -291,7 +286,7 @@ If KEYWORD is non-nil, use its color on new overlays."
(and symbol-overlay-temp-symbol (symbol-overlay-remove-temp))
(save-excursion
(save-restriction
- (setq scope (symbol-overlay-narrow scope))
+ (symbol-overlay-narrow scope)
(goto-char (point-min))
(while (re-search-forward symbol nil t)
(symbol-overlay-put-one symbol color)
@@ -306,15 +301,12 @@ If KEYWORD is non-nil, use its color on new overlays."
If SHOW-COLOR is non-nil, display the color used by current overlay."
(when keyword
(let* ((symbol (car keyword))
- (scope (cadr keyword))
(before (symbol-overlay-get-list symbol 'car))
(after (symbol-overlay-get-list symbol 'cdr))
(count (length before)))
(message (concat (substring symbol 3 -3)
": %d/%d"
- (and scope
- (concat " in " (if (eq scope 'scope) "scope"
- "paragraph (scope not found)")))
+ (and keyword (cadr keyword) " in scope")
(and show-color (format " (%s)" (cddr keyword))))
(+ count 1)
(+ count (length after))))))
- [nongnu] elpa/symbol-overlay 88c3ed02a0 115/152: bind kbd < > to jump-first/last, (continued)
- [nongnu] elpa/symbol-overlay 88c3ed02a0 115/152: bind kbd < > to jump-first/last, ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay 7fa58ecaa7 144/152: Avoid positional arguments to define-minor-mode, ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay a37404a6a0 097/152: Merge pull request #26 from jguenther/patch-1, ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay 831506ee12 103/152: Merge pull request #29 from Wilfred/font-customize, ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay 18d2f4ea65 148/152: Enable lexical-binding use hashed symbols for better compiler warnings, ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay 5290fd464f 150/152: Only use one timer for all buffers, ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay a71d6d1f31 018/152: add auto-refresh, ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay 5b00bb2952 032/152: (v2.6) new feature: scope, ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay 8cdd9ab096 038/152: add documentation of new feature, ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay 59053522a8 044/152: fix bugs, ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay 5c6c57a529 054/152: fix message,
ELPA Syncer <=
- [nongnu] elpa/symbol-overlay f5392fb932 051/152: fix case-error in rename, ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay 01aff461c2 055/152: better query-replace and rename, ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay 3eb0864b65 071/152: Merge pull request #9 from purcell/patch-1, ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay 4a70f6d999 075/152: When renaming, don't add coloured highlight if there wasn't previously one, ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay 305ef1d283 080/152: fix bug caused by last merge, ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay f3046beeae 085/152: better not to use box as faces, ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay 39a2ad8ba5 104/152: Add "h" binding for help in symbol-overlay-map, ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay dd7f126217 112/152: update readme, ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay 11f91ce5b6 110/152: Merge pull request #34 from tarsiiformes/preserve-highlighting, ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay 66eaaefb8c 134/152: Check liveness of buffer in timer callback, ELPA Syncer, 2022/07/07