branch: elpa/symbol-overlay
commit c630dbd5ce9ce20a1fb3da36fe4b7fcb8ee6da81
Author: Jonas Bernoulli <[email protected]>
Commit: Jonas Bernoulli <[email protected]>
Split code into sections
---
symbol-overlay.el | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/symbol-overlay.el b/symbol-overlay.el
index 4e1ff23ba6..9dd7d913ca 100644
--- a/symbol-overlay.el
+++ b/symbol-overlay.el
@@ -85,6 +85,8 @@
"Highlight symbols with keymap-enabled overlays."
:group 'convenience)
+;;; Faces
+
(defface symbol-overlay-default-face
'((t (:inherit highlight)))
"Symbol Overlay default face"
@@ -130,6 +132,8 @@
"Symbol Overlay default candidate 8"
:group 'symbol-overlay)
+;;; Options
+
(defcustom symbol-overlay-faces '(symbol-overlay-face-1
symbol-overlay-face-2
symbol-overlay-face-3
@@ -161,6 +165,8 @@ definitions to prevent a language's keywords from getting
highlighted."
:group 'symbol-overlay
:type '(repeat (cons (function :tag "Mode") function)))
+;;; Internal
+
(defvar symbol-overlay-map
(let ((map (make-sparse-keymap)))
(define-key map (kbd "i") 'symbol-overlay-put)
@@ -380,6 +386,8 @@ leading \\< and trailing \\>, as per the return value of
`symbol-overlay-get-symbol'."
(cl-find (substring symbol 3 -3) keywords :test #'string=))
+;;; Language-Specific Ignore
+
(defvar c-font-lock-extra-types)
(defun symbol-overlay-ignore-function-c (symbol)
"Determine whether SYMBOL should be ignored (C Language)."
@@ -434,6 +442,8 @@ leading \\< and trailing \\>, as per the return value of
(symbol-overlay-match-keyword-list symbol go-constants)
(symbol-overlay-match-keyword-list symbol go-mode-keywords)))
+;;; Commands
+
;;;###autoload
(defun symbol-overlay-put ()
"Toggle all overlays of symbol at point."
@@ -665,6 +675,8 @@ DIR must be 1 or -1."
(when (string= new (symbol-overlay-get-symbol nil t))
(symbol-overlay-maybe-count keyword)))))
+;;; Internal
+
(defun symbol-overlay-refresh (beg end len)
"Refresh overlays. Installed on `after-change-functions'.
BEG, END and LEN are the beginning, end and length of changed text."