branch: elpa/symbol-overlay
commit 2ad907ae15f8b8432093db3a2591477cba3c4868
Author: wolray <[email protected]>
Commit: wolray <[email protected]>
edit the descripition
---
readme.md | 8 ++++----
symbol-overlay.el | 24 +++++++++++++++---------
2 files changed, 19 insertions(+), 13 deletions(-)
diff --git a/readme.md b/readme.md
index 9c69129ecd..232edc4823 100644
--- a/readme.md
+++ b/readme.md
@@ -4,10 +4,10 @@ Highlighting symbol while enabling you to jump from one
occurrence to another or
Advantages
---
-1. In `symbol-overlay`, `overlay-put` is much faster than the traditional
highligting method `font-lock-fontify-buffer`, especially in a large buffer or
even a less-than-100-lines small buffer of major-mode with complicated keywords
syntax such as haskell-mode.
-2. You can directly jump to a symbol's definition from any occurrence by using
`so-jump-to-def`, as long as the syntax of the definition is specified in the
buffer-local variable `so-def-function`.
-3. More importantly, using `overlay-put` to highlight-symbol has an extra
benifit to enable **AN AUTO-ACTIVATED OVERLAY-INSIDE KEYMAP** for quick jump
and other operations.
-4. All the overlays of each symbol are stored sequentially in an alist
`so-keywords-alist`. By simply getting the current overlay's index in the alist
as well as the length of it, the number of occurrences can be immediately
obtained. While in `highlight-symbol`, this would call the function `how-many`
twice, causing extra costs.
+- In `symbol-overlay`, `overlay-put` is much faster than the traditional
highligting method `font-lock-fontify-buffer`, especially in a large buffer or
even a less-than-100-lines small buffer of major-mode with complicated keywords
syntax such as haskell-mode.
+- More importantly, using `overlay-put` to highlight symbols has an extra
benifit to enable **AN AUTO-ACTIVATED OVERLAY-INSIDE KEYMAP** for quick jump
and other useful commands.
+- You can also jump to a symbol's definition from any occurrence by using
`so-jump-to-def`, as long as the syntax of the definition is specified in the
buffer-local variable `so-def-function`.
+- All the overlays of each symbol are stored sequentially in an alist
`so-keywords-alist`. By simply getting the current overlay's index in the
corresponding keyword-list as well as the length of it in the alist, the number
of occurrences can be immediately obtained. While in `highlight-symbol`, this
would call the function `how-many` twice, causing extra costs.
Usage
---
diff --git a/symbol-overlay.el b/symbol-overlay.el
index 9b77181025..6fbb075fe7 100644
--- a/symbol-overlay.el
+++ b/symbol-overlay.el
@@ -29,23 +29,29 @@
;; used in `highlight-symbol'.
;; Advantages
-;; 1. In `symbol-overlay', `overlay-put' is much faster than the traditional
+
+;; In `symbol-overlay', `overlay-put' is much faster than the traditional
;; highligting method `font-lock-fontify-buffer', especially in a large buffer
;; or even a less-than-100-lines small buffer of major-mode with complicated
;; keywords syntax such as haskell-mode.
-;; 2. You can directly jump to a symbol's definition from any occurrence by
+
+;; More importantly, using `overlay-put' to highlight symbols has an extra
+;; benifit to enable AN AUTO-ACTIVATED OVERLAY-INSIDE KEYMAP for quick jump and
+;; other useful commands.
+
+;; You can also jump to a symbol's definition from any occurrence by
;; using `so-jump-to-def', as long as the syntax of the definition is specified
;; in the buffer-local variable `so-def-function'.
-;; 3. More importantly, using `overlay-put' to highlight-symbol has an extra
-;; benifit to enable AN AUTO-ACTIVATED OVERLAY-INSIDE KEYMAP for quick jump and
-;; other operations.
-;; 4. All the overlays of each symbol are stored sequentially in an alist
+
+;; All the overlays of each symbol are stored sequentially in an alist
;; `so-keywords-alist'. By simply getting the current overlay's index in the
-;; alist as well as the length of it, the number of occurrences can be
-;; immediately obtained. While in `highlight-symbol', this would call the
-;; function `how-many' twice, causing extra costs.
+;; corresponding keyword-list as well as the length of it in the alist, the
+;; number of occurrences can be immediately obtained. While in
+;; `highlight-symbol', this would call the function `how-many' twice, causing
+;; extra costs.
;; Usage
+
;; To use `symbol-overlay' in your Emacs, you need only to bind one key:
;; (require 'symbol-overlay)
;; (global-set-key (kbd "M-i") 'so-put)