branch: elpa/symbol-overlay
commit 674b78983ce87673032f74b1a0e343c247cd7b67
Author: wolray <[email protected]>
Commit: wolray <[email protected]>
add an image in readme
---
readme.md | 4 +++-
screenshot.png | Bin 0 -> 203310 bytes
symbol-overlay.el | 12 +++++-------
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/readme.md b/readme.md
index f21c4ffd8f..8d94a1d796 100644
--- a/readme.md
+++ b/readme.md
@@ -1,6 +1,8 @@
# Symbol Overlay
-Highlighting symbols with overlays while providing a keymap for various
operations about highlighted symbols. It was originally inspired by the
package `highlight-symbol`. The fundamental difference is that in
`symbol-overlay` every symbol is highlighted by the Emacs built-in function
`overlay-put` rather than the `font-lock` mechanism used in `highlight-symbol`.
+
+
+Highlight symbols with overlays while providing a keymap for various
operations about highlighted symbols. It was originally inspired by the
package `highlight-symbol`. The fundamental difference is that in
`symbol-overlay` every symbol is highlighted by the Emacs built-in function
`overlay-put` rather than the `font-lock` mechanism used in `highlight-symbol`.
What's New!
---
diff --git a/screenshot.png b/screenshot.png
new file mode 100644
index 0000000000..7434db38f4
Binary files /dev/null and b/screenshot.png differ
diff --git a/symbol-overlay.el b/symbol-overlay.el
index e54de7bde5..3644154a56 100644
--- a/symbol-overlay.el
+++ b/symbol-overlay.el
@@ -1,4 +1,4 @@
-;;; symbol-overlay.el --- Highlighting symbols with keymap-enabled overlays
+;;; symbol-overlay.el --- Highlight symbols with keymap-enabled overlays
;; Copyright (C) 2017 wolray
@@ -360,8 +360,7 @@ If COUNT is non-nil, count at the end."
(setq new (read-string (format "Rename (%s): " new)))
(save-excursion
(goto-char (point-min))
- (while (re-search-forward symbol nil t)
- (replace-match new)))
+ (while (re-search-forward symbol nil t) (replace-match new)))
(symbol-overlay-get-symbol new))))
(defun symbol-overlay-refresh (beg end len)
@@ -373,13 +372,12 @@ BEG, END and LEN are the beginning, end and length of
changed text."
(save-excursion
(goto-char end)
(and (looking-at-p re)
- (setq end (or (re-search-forward "\\_>" nil t) end)))
+ (setq end (re-search-forward "\\_>")))
(goto-char beg)
(and (looking-at-p (concat "\\(" re "\\|\\_>\\)"))
- (setq beg (or (re-search-backward "\\_<" nil t) beg)))
+ (setq beg (re-search-backward "\\_<")))
(mapc #'(lambda (overlay)
- (and (overlay-get overlay 'symbol)
- (delete-overlay overlay)))
+ (and (overlay-get overlay 'symbol) (delete-overlay overlay)))
(overlays-in beg end))
(mapc #'(lambda (keyword)
(let ((symbol (car keyword)))