├── .gitignore ├── .travis.yml ├── LICENSE ├── Makefile ├── README.md ├── demo ├── all.gif ├── helm-hl-anything.jpg ├── highlight-colors.png ├── highlight-onoff.gif ├── highlight-paren.png ├── highlight-search.gif ├── highlight-special-faces.png └── toolbar.png ├── hl-anything.el └── images ├── killall-highlights.png ├── killall-highlights.xpm ├── material.psd ├── off.png ├── off.xpm ├── on.png ├── on.xpm ├── toggle-global-highlight.png └── toggle-global-highlight.xpm /.gitignore: -------------------------------------------------------------------------------- 1 | *.elc 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: emacs-lisp 2 | 3 | env: 4 | matrix: 5 | - EMACS=emacs24 6 | - EMACS=emacs-snapshot 7 | 8 | install: 9 | - if [ "$EMACS" = "emacs24" ]; then 10 | sudo add-apt-repository -y ppa:cassou/emacs && 11 | sudo apt-get update -qq && 12 | sudo apt-get install -qq emacs24 emacs24-el; 13 | fi 14 | - if [ "$EMACS" = "emacs-snapshot" ]; then 15 | sudo add-apt-repository -y ppa:ubuntu-elisp/ppa && 16 | sudo apt-get update -qq && 17 | sudo apt-get install -qq emacs-snapshot; 18 | fi 19 | 20 | script: 21 | make compile EMACS=${EMACS} 22 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014-2015 boyw165 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # GNU Make rules for fetching and byte-compiling various elisp files. 2 | 3 | EMACS=emacs -q --no-site-file 4 | 5 | .PHONY: compile package elpa 6 | 7 | package: *.el 8 | @ver=`grep -o "Version: .*" hl-anything.el | cut -c 10-`; \ 9 | tar cvf hl-anything-$$ver.tar `git ls-files '*.el' | xargs` 10 | 11 | elpa: *.el 12 | @ver=`grep -o "Version: .*" hl-anything.el | cut -c 10-`; \ 13 | dir=hl-anything-$$ver; \ 14 | mkdir -p "$$dir"; \ 15 | cp `git ls-files '*.el' | xargs` hl-anything-$$ver; \ 16 | echo "(define-package \"hl-anything\" \"$$version\" \ 17 | \"Modular in-buffer completion framework\")" \ 18 | > "$$dir"/hl-anything-pkg.el; \ 19 | tar cvf hl-anything-$$ver.tar "$$dir" 20 | 21 | clean: 22 | @rm -rf hl-anything-*/ hl-anything-*.tar hl-anything-*.tar.bz2 *.elc 23 | 24 | compile: 25 | ${EMACS} -Q --batch -L . -f batch-byte-compile hl-anything.el 26 | 27 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![MELPA](http://melpa.org/packages/hl-anything-badge.svg)](http://melpa.org/#/hl-anything) 2 | [![MELPA Stable](http://stable.melpa.org/packages/hl-anything-badge.svg)](http://stable.melpa.org/#/hl-anything) 3 | [![TRAVIS-CI](https://travis-ci.org/boyw165/hl-anything.svg?branch=master)](https://travis-ci.org/boyw165/hl-anything) 4 | 5 | Highlight Symbols, Selections, Enclosing Parens and More 6 | =================================================================== 7 | 8 | **This repo was deprecated and moved to new place, `https://github.com/hl-anything/hl-anything-emacs`.** 9 | 10 | Highlight things at point, selections, enclosing parentheses with different colors. **Fix grumbling issue of highlights being overridden by** `hl-line-mode` **and** `global-hl-line-mode`. 11 | 12 | Demo 13 | ---- 14 | ![hl-anything screenshot](demo/all.gif "demo") 15 | 16 | Basic Usage - First Step, Enable `hl-highlight-mode` 17 | ---------------------------------------------------- 18 | There're **GLOBAL** and **LOCAL** kinds of highlights. 19 | The global highlights appear in every buffer; The local highlights only exist in the current buffer. 20 | 21 | ![hl-anything screenshot](demo/toolbar.png "toolbar") 22 | 23 | Global Highlights: 24 | 25 | * Command **`hl-highlight-thingatpt-global`** to toggle global highlight at point or selection. 26 | * Command **`hl-unhighlight-all-global`** to remove all global highlights. 27 | 28 | Local Highlights: 29 | 30 | * Command **`hl-highlight-thingatpt-local`** to toggle local highlight at point or selection. 31 | * Command **`hl-unhighlight-all-local`** to remove all local highlights. 32 | 33 | You can change foreground and background colors of highlights: 34 | 35 | * Foreground colors are stored in `hl-highlight-foreground-colors` variable. 36 | * Background colors are stored in `hl-highlight-background-colors` variable. 37 | 38 | ![hl-anything screenshot](demo/highlight-colors.png "colors") 39 | 40 | Turn Highlight On/Off 41 | --------------------- 42 | `M-x` **`hl-global-highlight-on/off`** to turn highlight on or off! 43 | 44 | Example: 45 | 46 | ![hl-anything screenshot](demo/highlight-onoff.gif "highlight on/off") 47 | 48 | Search Highlights 49 | ----------------- 50 | Put your cursor on the highlight and use following commands to search highlights. 51 | 52 | `M-x` **`hl-find-next-thing`** and **`hl-find-prev-thing`** to go through highlights. 53 | 54 | ![hl-anything screenshot](demo/highlight-search.gif "search") 55 | 56 | Save & Restore Highlights 57 | ------------------------- 58 | Once `hl-highlight-mode` is on, it will save highlights automatically before Emacs exits. 59 | It will also try to restore highlights when Emacs opens. 60 | 61 | * `M-x` **`hl-save-highlights`** to save highlights; `M-x` **`hl-restore-highlights`** to restore highlights. 62 | * Saved file-path is stored in `hl-highlight-save-file` variable. 63 | 64 | Parenthese Highlight, `hl-paren-mode` 65 | ------------------------------------- 66 | ![hl-anything screenshot](demo/highlight-paren.png "hl-paren-mode") 67 | 68 | * Colors of outward parentheses are stored in `hl-outward-paren-fg-colors` and `hl-outward-paren-bg-colors` variables. 69 | * Colors of inward parentheses are stored in `hl-inward-paren-fg-color` variables. 70 | 71 | Advanced - `hl-highlight-special-faces` 72 | --------------------------------------- 73 | This is a special faces storage. The faces storing here are always on the top of the current line highlight (`hl-line-mode` and `global-hl-line-mode`). 74 | 75 | ![hl-anything screenshot](demo/highlight-special-faces.png "hl-paren-mode") 76 | 77 | Example: 78 | 79 | ```lisp 80 | ;; 'YOUR-FACE will never be hidden by current line highlight. 81 | (add-to-list 'hl-highlight-special-faces 'YOUR-FACE t) 82 | ``` 83 | 84 | TODO 85 | ---- 86 | * Highlight Enclosing syntax in Emacs REGEX. 87 | * Integrate with `helm` to give ability to navigate highlights. 88 | ![hl-anything screenshot](demo/helm-hl-anything.jpg "helm hl-anything") 89 | * Define all the parenthesis pairs using a variable that can be highlighted. [issue#8](https://github.com/boyw165/hl-anything/issues/8) 90 | 91 | Contribution 92 | ------------ 93 | Forks and pull requests are welcome! 94 | 95 | -------------------------------------------------------------------------------- /demo/all.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcw165/hl-anything/8819e6306d55a72b6de319ddc92e0f543f18687a/demo/all.gif -------------------------------------------------------------------------------- /demo/helm-hl-anything.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcw165/hl-anything/8819e6306d55a72b6de319ddc92e0f543f18687a/demo/helm-hl-anything.jpg -------------------------------------------------------------------------------- /demo/highlight-colors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcw165/hl-anything/8819e6306d55a72b6de319ddc92e0f543f18687a/demo/highlight-colors.png -------------------------------------------------------------------------------- /demo/highlight-onoff.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcw165/hl-anything/8819e6306d55a72b6de319ddc92e0f543f18687a/demo/highlight-onoff.gif -------------------------------------------------------------------------------- /demo/highlight-paren.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcw165/hl-anything/8819e6306d55a72b6de319ddc92e0f543f18687a/demo/highlight-paren.png -------------------------------------------------------------------------------- /demo/highlight-search.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcw165/hl-anything/8819e6306d55a72b6de319ddc92e0f543f18687a/demo/highlight-search.gif -------------------------------------------------------------------------------- /demo/highlight-special-faces.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcw165/hl-anything/8819e6306d55a72b6de319ddc92e0f543f18687a/demo/highlight-special-faces.png -------------------------------------------------------------------------------- /demo/toolbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcw165/hl-anything/8819e6306d55a72b6de319ddc92e0f543f18687a/demo/toolbar.png -------------------------------------------------------------------------------- /hl-anything.el: -------------------------------------------------------------------------------- 1 | ;;; hl-anything.el --- Highlight symbols, selections, enclosing parens and more. 2 | ;; 3 | ;; Copyright (C) 2014-2015 4 | ;; 5 | ;; Author: boyw165 6 | ;; Version: 20150115.1500 7 | ;; Package-Requires: ((emacs "24.3")) 8 | ;; Compatibility: GNU Emacs 24.3+ 9 | ;; 10 | ;; This file is NOT part of GNU Emacs. 11 | ;; 12 | ;; This program is free software; you can redistribute it and/or 13 | ;; modify it under the terms of the GNU General Public License 14 | ;; as published by the Free Software Foundation; either version 2 15 | ;; of the License, or (at your option) any later version. 16 | ;; 17 | ;; This program is distributed in the hope that it will be useful, 18 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | ;; GNU General Public License for more details. 21 | ;; 22 | ;; You should have received a copy of the GNU General Public License 23 | ;; along with this program. If not, see . 24 | ;; 25 | ;;; Commentary: 26 | ;; 27 | ;; Highlight things at point, selections, enclosing parentheses with different 28 | ;; colors. Fix grumbling issue of highlights being overridden by `hl-line-mode' 29 | ;; and `global-hl-line-mode'. 30 | ;; 31 | ;; Of course, there're more advanced features: 32 | ;; * Save highlights and restore them next time Emacs opened. 33 | ;; * Select highlighted things smartly and search forwardly or backwardly. 34 | ;; * Assign highlighting specific faces which makes them always on the top of 35 | ;; current line highlight. 36 | ;; * More... Check official website for details: 37 | ;; https://github.com/boyw165/hl-anything 38 | ;; 39 | ;; Usage: 40 | ;; ------ 41 | ;; M-x `hl-highlight-thingatpt-local' 42 | ;; Toggle highlight locally in current buffer. 43 | ;; 44 | ;; M-x `hl-highlight-thingatpt-global' 45 | ;; Toggle highlight globally in all buffers. 46 | ;; 47 | ;; M-x `hl-unhighlight-all-local' 48 | ;; M-x `hl-unhighlight-all-global' 49 | ;; Remove all highlights. 50 | ;; 51 | ;; M-x `hl-save-highlights' 52 | ;; M-x `hl-restore-highlights' 53 | ;; Save & Restore highlights. 54 | ;; 55 | ;; M-x `hl-find-next-thing' 56 | ;; M-x `hl-find-prev-thing' 57 | ;; Search highlights. 58 | ;; 59 | ;; M-x `hl-paren-mode' 60 | ;; Enable enclosing parenethese highlighting. 61 | ;; 62 | ;; TODO: 63 | ;; ----- 64 | ;; * Advise `self-insert-command'??? 65 | ;; * Highlight enclosing syntax in REGEXP. 66 | ;; 67 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 68 | ;; 69 | ;;; Change Log: 70 | ;; 71 | ;; 2015-02-03 72 | ;; * Add `hl-highlight-flexible-match' switch. 73 | ;; 74 | ;; 2015-01-15 75 | ;; * Use advised function to improve performance. 76 | ;; * Add `hl-global-highlight-on/off', also its menu and tool-bar button. 77 | ;; * Add menu items and tool-bar buttons. 78 | ;; * NOTE: Change `hl-find-thing-backwardly' to `hl-find-prev-thing'. 79 | ;; * NOTE: Change `hl-find-thing-forwardly' to `hl-find-next-thing'. 80 | ;; 81 | ;; 2014-11-24 82 | ;; * Support `hl-highlight-thingatpt-global' and `hl-unhighlight-all-global'. 83 | ;; * Support `hl-save-highlights' and `hl-restore-highlights'. 84 | ;; 85 | ;; 2014-10-03 86 | ;; * Support highlight for special faces. See `hl-highlight-special-faces'. 87 | ;; * Highlights are still visible under the current line when `hl-line-mode' 88 | ;; or `global-hl-line-mode' is enabled. 89 | ;; * Smartly select highlighted region. 90 | ;; * Highlight words cross multiple lines. 91 | ;; 92 | ;; 2014-05-25 93 | ;; * Support searching thing. The regexp might be a symbol text or a selection 94 | ;; text. 95 | ;; * Support one inward parentheses highlight for LISP. 96 | ;; * Support multiple outward parentheses highlight for LISP. 97 | ;; 98 | ;; 2014-05-16 99 | ;; * Initial release, inspired from: 100 | ;; https://github.com/nschum/highlight-parentheses.el 101 | ;; https://github.com/nschum/highlight-symbol.el 102 | ;; 103 | ;;; Code: 104 | 105 | ;; GNU Library. 106 | (require 'advice) 107 | (require 'hl-line) 108 | (require 'thingatpt) 109 | 110 | (defgroup hl-anything nil 111 | "Highlight anything." 112 | :group 'faces 113 | :group 'font-lock 114 | :group 'matching) 115 | 116 | (defgroup hl-advice nil 117 | "Advice of highlight anything." 118 | :group 'hl-anything) 119 | 120 | (defgroup hl-paren nil 121 | "Parentheses highlight." 122 | :group 'hl-anything) 123 | 124 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 125 | ;; Common ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 126 | 127 | ;;;###autoload 128 | (defun hl-configuration () 129 | "Configuration" 130 | (interactive) 131 | (customize-group 'hl-anything)) 132 | 133 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 134 | ;; Highlight things ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 135 | 136 | (defcustom hl-highlight-foreground-colors '("snow" 137 | "snow" 138 | "black" 139 | "black" 140 | "snow" 141 | "snow" 142 | "snow" 143 | "black" 144 | "snow" 145 | "snow") 146 | "The foreground colors for `hl-highlight-thingatpt-global' and 147 | `hl-highlight-thingatpt-local'." 148 | :type '(repeat color) 149 | :group 'hl-anything) 150 | 151 | (defcustom hl-highlight-background-colors '("firebrick" 152 | "Orange" 153 | "gold" 154 | "green1" 155 | "DeepSkyBlue1" 156 | "dark blue" 157 | "blue violet" 158 | "gray90" 159 | "gray60" 160 | "gray30") 161 | "The background colors for `hl-highlight-thingatpt-global' and 162 | `hl-highlight-thingatpt-local'." 163 | :type '(repeat color) 164 | :group 'hl-anything) 165 | 166 | (defcustom hl-before-find-thing-hook nil 167 | "Hook for doing something before `hl-find-next-thing' and 168 | `hl-find-prev-thing'. This hook has one argument, (REGEXP_STRING BEG END). 169 | Maybe you'll need it for history and navigation feature." 170 | :type '(repeat function) 171 | :group 'hl-anything) 172 | 173 | (defcustom hl-after-find-thing-hook nil 174 | "Hook for doing something after `hl-find-next-thing' and 175 | `hl-find-prev-thing'. This hook has one argument, (REGEXP_STRING BEG END). 176 | Maybe you'll need it for history and navigation feature." 177 | :type '(repeat function) 178 | :group 'hl-anything) 179 | 180 | (defcustom hl-highlight-special-faces nil 181 | "For the faces that will be treat as highlights, which means overlays 182 | will also be created for these faces at current line." 183 | :type '(repeat face) 184 | :group 'hl-anything) 185 | 186 | (defcustom hl-highlight-save-file "~/.emacs.d/.hl-save" 187 | "A file storing highlights. Value of nil means don't save and restore 188 | highlight. See `hl-save-highlights' and `hl-restore-highlights'." 189 | :type '(choice (string :tag "User defined") 190 | (const :tag "Disabed" nil)) 191 | :group 'hl-anything) 192 | 193 | (defcustom hl-highlight-flexible-match t 194 | "t means flexible match of highlight for arbitrary words or sentence; 195 | nil is strict match which means the REGEXP is wrapped by 196 | `hl-strict-wrapped-pattern'. 197 | NOTE: Disable it will lose function of highlight for selection or sentence." 198 | :type '(choice (const :tag "Enabled" t) 199 | (const :tag "Disabed" nil)) 200 | :group 'hl-anything) 201 | 202 | (defcustom hl-highlight-cycle-search nil 203 | "t means search will begin from the start when it reach bottom. See 204 | `hl-find-prev-thing' and `hl-find-prev-thing'." 205 | :type '(choice (const :tag "Enabled" t) 206 | (const :tag "Disabed" nil)) 207 | :group 'hl-anything) 208 | 209 | (defcustom hl-global-highlight-advised-function nil 210 | "After-advised function list for global highlight." 211 | :type '(repeat function) 212 | :initialize 'custom-initialize-default 213 | :set (lambda (symb val) 214 | (hl-setup-customizable-advices nil) 215 | (set symb val) 216 | (hl-setup-customizable-advices t)) 217 | :group 'hl-advice) 218 | 219 | (defconst hl-strict-wrapped-pattern 220 | (if (>= emacs-major-version 22) '("\\_<" . "\\_>") '("\\<" . "\\>"))) 221 | 222 | (defvar hl-region nil 223 | "A struct, (START . END), is present when `region-active-p' it t. It is used 224 | in `hl-get-text-highlight-face' to ignore region.") 225 | 226 | (defvar hl-colors-index 0) 227 | 228 | (defvar hl-colors-index-local 0) 229 | (make-variable-buffer-local 'hl-colors-index-local) 230 | 231 | (defvar hl-highlights nil 232 | "Highlights list. Format: (MATCH1 MATCH2 ...)") 233 | 234 | (defvar hl-highlights-local nil 235 | "Local highlights list. Format: (MATCH1 MATCH2 ...)") 236 | (make-variable-buffer-local 'hl-highlights-local) 237 | 238 | (defvar hl-overlays nil 239 | "Overlays for highlighted things. Prevent them to being hide by `hl-line-mode'.") 240 | (make-variable-buffer-local 'hl-overlays) 241 | 242 | (defun hl-export (filename data) 243 | (and (file-writable-p filename) 244 | (with-temp-file filename 245 | (insert (let (print-length) 246 | (prin1-to-string data)))))) 247 | 248 | (defun hl-import (filename) 249 | (and (file-exists-p filename) 250 | (with-temp-buffer 251 | (insert-file-contents-literally filename) 252 | (read (buffer-string))))) 253 | 254 | (defun hl-thingatpt () 255 | "Return a list, (REGEXP_STRING BEG END), on which the point is or just string 256 | of selection." 257 | (let ((bound (if (use-region-p) 258 | (cons (region-beginning) (region-end)) 259 | (hl-bounds-of-thingatpt)))) 260 | (when bound 261 | (let ((text (regexp-quote 262 | (buffer-substring-no-properties (car bound) (cdr bound))))) 263 | ;; Strict match. 264 | (unless hl-highlight-flexible-match 265 | (setq text (concat (car hl-strict-wrapped-pattern) 266 | text 267 | (cdr hl-strict-wrapped-pattern)))) 268 | ;; Replace space as "\\s-+" 269 | (setq text (replace-regexp-in-string "\\s-+" "\\\\s-+" text)) 270 | (list text (car bound) (cdr bound)))))) 271 | 272 | (defun hl-get-text-highlight-face () 273 | (unless (and hl-region 274 | (>= (point) (car hl-region)) 275 | (< (point) (cdr hl-region))) 276 | (let ((face (get-text-property (point) 'face))) 277 | (cond 278 | ;; NULL ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 279 | ((null face) 280 | nil) 281 | ;; Normal Face ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 282 | ((facep face) 283 | (car (memq face hl-highlight-special-faces))) 284 | ;; Face List ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 285 | ((facep (car face)) 286 | (setq face (car face)) 287 | (car (memq face hl-highlight-special-faces))) 288 | ;; Foreground-color & Background-color ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 289 | (t 290 | (let (elm ret) 291 | (when (setq elm (assoc 'foreground-color face)) 292 | (setq ret (append ret `(,elm)))) 293 | (when (setq elm (assoc 'background-color face)) 294 | (setq ret (append ret `(,elm)))) 295 | ret)))))) 296 | 297 | (defun hl-seek-matched-face (matched-face step) 298 | (when (/= step 0) 299 | (let ((face (hl-get-text-highlight-face))) 300 | (ignore-errors 301 | (if (equal matched-face face) 302 | (progn 303 | (forward-char step) 304 | ;; Recursive call. 305 | (hl-seek-matched-face matched-face step)) 306 | (backward-char step)))))) 307 | 308 | (defun hl-bounds-of-highlight () 309 | "Return the start and end locations for the highlighted things at point. 310 | Format: (START . END)" 311 | (let ((face (hl-get-text-highlight-face))) 312 | (when face 313 | (let (beg end) 314 | ;; Find beginning locations. 315 | (save-excursion 316 | (hl-seek-matched-face face -1) 317 | (setq beg (point))) 318 | ;; Find end locations. 319 | (save-excursion 320 | (hl-seek-matched-face face 1) 321 | (setq end (1+ (point)))) 322 | (cons beg end))))) 323 | 324 | (defun hl-bounds-of-thingatpt () 325 | (or (hl-bounds-of-highlight) 326 | (bounds-of-thing-at-point 'symbol))) 327 | 328 | (defun hl-font-lock-keyword-p (regexp) 329 | (let ((keyword (assoc regexp (if (eq t (car font-lock-keywords)) 330 | (cadr font-lock-keywords) 331 | font-lock-keywords)))) 332 | (if (eq 'prepend (nth 3 keyword)) 333 | keyword nil))) 334 | 335 | (defun hl-buffer-list (&optional window? file?) 336 | (if window? 337 | (delq nil (mapcar (lambda (window) 338 | (let ((buffer (window-buffer window))) 339 | (if file? 340 | (and (buffer-file-name buffer) buffer) 341 | buffer))) 342 | (window-list))) 343 | (delq nil (mapcar (lambda (buffer) 344 | (and (buffer-live-p buffer) 345 | (if file? 346 | (and (buffer-file-name buffer) buffer) 347 | buffer))) 348 | (buffer-list))))) 349 | 350 | (defun hl-highlight-fontify (&optional current-line?) 351 | "Update highlights at current line or whole buffer." 352 | (save-excursion 353 | (if current-line? 354 | (font-lock-fontify-region (line-beginning-position) (line-end-position)) 355 | (font-lock-fontify-region (point-min) (point-max))))) 356 | 357 | (defmacro hl-highlight-internal (regexp database index) 358 | "Use `font-lock-add-keywords' to add keywords and add overlays for specific 359 | FACESPEC just at current line. See `hl-add-highlight-overlays'." 360 | (declare (indent 0) (debug t)) 361 | `(let* ((max (max (length hl-highlight-foreground-colors) 362 | (length hl-highlight-background-colors))) 363 | (next-index (1+ ,index)) 364 | (new-index (if (>= next-index max) 0 next-index)) 365 | (fg (nth ,index hl-highlight-foreground-colors)) 366 | (bg (nth ,index hl-highlight-background-colors)) 367 | facespec) 368 | ;; Prepare face for highlight. 369 | (and fg (push `(foreground-color . ,fg) facespec)) 370 | (and bg (push `(background-color . ,bg) facespec)) 371 | ;; Save highlight into database. 372 | (push ,regexp ,database) 373 | ;; Update index of colors. 374 | (setq ,index new-index) 375 | ;; Add keywords for buffer(s). 376 | (mapc (lambda (buffer) 377 | (with-current-buffer buffer 378 | (font-lock-add-keywords nil 379 | `((,regexp 0 ',facespec prepend)) 380 | 'append))) 381 | (if (eq ,database hl-highlights) 382 | (hl-buffer-list) 383 | (list (current-buffer)))) 384 | ;; Fontify buffer(s). 385 | (mapc (lambda (buffer) 386 | (with-current-buffer buffer 387 | (hl-highlight-fontify))) 388 | (if (eq ,database hl-highlights) 389 | (hl-buffer-list t) 390 | (list (current-buffer)))))) 391 | 392 | (defmacro hl-unhighlight-internal (regexp database index) 393 | "Use `font-lock-remove-keywords' to remove keywords." 394 | (declare (indent 0) (debug t)) 395 | `(let ((keyword (hl-font-lock-keyword-p ,regexp))) 396 | ;; Remove highlight from database. 397 | (setq ,database (delete ,regexp ,database)) 398 | ;; Update index of colors. 399 | (unless ,database 400 | (setq ,index 0)) 401 | ;; Remove keywords for buffer(s). 402 | (mapc (lambda (buffer) 403 | (with-current-buffer buffer 404 | (while (setq keyword (hl-font-lock-keyword-p ,regexp)) 405 | (font-lock-remove-keywords nil (list keyword))))) 406 | ;; global or local? 407 | (if (eq ,database hl-highlights) 408 | (hl-buffer-list) 409 | (list (current-buffer)))) 410 | ;; Fontify buffer(s). 411 | (mapc (lambda (buffer) 412 | (with-current-buffer buffer 413 | (hl-highlight-fontify))) 414 | ;; global or local? 415 | (if (eq ,database hl-highlights) 416 | (hl-buffer-list t) 417 | (list (current-buffer)))))) 418 | 419 | (defun hl-add-highlight-overlays () 420 | "Add highlight overlays for current line." 421 | ;; Create overlays. 422 | (let ((hl-region (and (region-active-p) 423 | (cons (region-beginning) (region-end)))) 424 | (end (line-end-position)) 425 | bound) 426 | (save-excursion 427 | (beginning-of-line) 428 | (while (and (<= (point) end) 429 | (not (eobp))) 430 | (if (setq bound (hl-bounds-of-highlight)) 431 | ;; TODO: Add overlay's priority. 432 | (let ((overlay (make-overlay (point) (cdr bound))) 433 | (face (hl-get-text-highlight-face))) 434 | (if (facep face) 435 | (let ((fg (face-attribute face :foreground)) 436 | (bg (face-attribute face :background)) 437 | facespec) 438 | (when fg 439 | (setq facespec 440 | (append facespec `((foreground-color . ,fg))))) 441 | (when bg 442 | (setq facespec 443 | (append facespec `((background-color . ,bg))))) 444 | (overlay-put overlay 'face facespec)) 445 | (overlay-put overlay 'face face)) 446 | (push overlay hl-overlays) 447 | (goto-char (cdr bound))) 448 | (forward-char)))))) 449 | 450 | (defun hl-remove-highlight-overlays (&optional all?) 451 | "Remove highlight overlays." 452 | (dolist (buffer (if all? 453 | (hl-buffer-list t) 454 | (list (current-buffer)))) 455 | (with-current-buffer buffer 456 | (mapc 'delete-overlay hl-overlays) 457 | (setq hl-overlays nil)))) 458 | 459 | (defun hl-sync-global-highlights () 460 | "Add keywords for buffer without highlight keywords." 461 | (let ((index 0) 462 | highlights) 463 | (dolist (regexp (reverse hl-highlights)) 464 | (and (not (assoc regexp font-lock-keywords)) 465 | (hl-highlight-internal regexp highlights index))))) 466 | 467 | (defun hl-setup-customizable-advices (activate?) 468 | "Customizable advices." 469 | (mapc (lambda (func) 470 | (eval 471 | `(defadvice ,func (after hl-highlight-advice 472 | ,(if activate? 'activate 'disable)) 473 | ;; Check keywords for new opened file. 474 | (hl-sync-global-highlights) 475 | ;; Fontify buffer. 476 | (and (memq (current-buffer) 477 | (mapcar 'window-buffer (window-list))) 478 | (hl-highlight-fontify))))) 479 | hl-global-highlight-advised-function)) 480 | 481 | (defun hl-setup-default-advices (activate?) 482 | "Necessary advices of highlight core." 483 | ;; Advise `hl-line-highlight' and `global-hl-line-highlight' to add 484 | ;; highlight overlays. 485 | (mapc (lambda (func) 486 | (eval 487 | `(defadvice ,func (after hl-highlight-advice 488 | ,(if activate? 'activate 'disable)) 489 | (when hl-highlight-mode 490 | (and (buffer-modified-p) (hl-highlight-fontify t)) 491 | (hl-add-highlight-overlays))))) 492 | '(hl-line-highlight 493 | global-hl-line-highlight)) 494 | ;; Advise `switch-to-buffer' or more to add highlight overlays. 495 | (mapc (lambda (func) 496 | (eval 497 | `(defadvice ,func (after hl-highlight-advice 498 | ,(if activate? 'activate 'disable)) 499 | ;; Check keywords for new opened file. 500 | (hl-sync-global-highlights) 501 | ;; Fontify buffer. 502 | (and (memq (current-buffer) 503 | (mapcar 'window-buffer (window-list))) 504 | (hl-highlight-fontify))))) 505 | '(switch-to-buffer 506 | revert-buffer)) 507 | ;; Advise `hl-line-unhighlight' and `global-hl-line-unhighlight' to 508 | ;; Remove highlight overlays. 509 | (mapc (lambda (func) 510 | (eval 511 | `(defadvice ,func (after hl-highlight-advice 512 | ,(if activate? 'activate 'disable)) 513 | (when hl-highlight-mode 514 | (hl-remove-highlight-overlays))))) 515 | '(hl-line-unhighlight 516 | global-hl-line-unhighlight))) 517 | 518 | (defun hl-add-menu-items () 519 | "Add menu and tool-bar buttons." 520 | ;; Menu items. 521 | (define-key-after global-map [menu-bar edit hl-group] 522 | (cons "Highlight" (make-sparse-keymap)) 523 | 'separator-search) 524 | (let ((map (lookup-key global-map [menu-bar edit hl-group]))) 525 | (define-key-after map [highlight-configuration] 526 | '(menu-item "Configuration" hl-configuration)) 527 | (define-key-after map [highlight-separator-1] 528 | '(menu-item "--single-line")) 529 | (define-key-after map [highlight-thingatpt-global] 530 | '(menu-item "Toggle Global Highlight" hl-highlight-thingatpt-global)) 531 | (define-key-after map [killall-highlights-global] 532 | '(menu-item "Remove All Global Highlights" hl-unhighlight-all-global)) 533 | (define-key-after map [global-highlights-on] 534 | '(menu-item "Turn Global Highlights On" hl-global-highlight-on/off 535 | :visible (null hl-highlights))) 536 | (define-key-after map [global-highlights-off] 537 | '(menu-item "Turn Global Highlights Off" hl-global-highlight-on/off 538 | :visible hl-highlights)) 539 | (define-key-after map [highlight-separator-2] 540 | '(menu-item "--single-line")) 541 | (define-key-after map [highlight-thingatpt-local] 542 | '(menu-item "Toggle Local Highlight" hl-highlight-thingatpt-local)) 543 | (define-key-after map [killall-highlights-local] 544 | '(menu-item "Remove All Local Highlights" hl-unhighlight-all-local)) 545 | (define-key-after map [highlight-separator-3] 546 | '(menu-item "--single-line")) 547 | (define-key-after map [find-prev-highlight] 548 | '(menu-item "Find Next Thing" hl-find-prev-thing)) 549 | (define-key-after map [find-next-highlight] 550 | '(menu-item "Find Previous Thing" hl-find-next-thing))) 551 | ;; Tool-bar buttons. 552 | (when tool-bar-mode 553 | (define-key-after tool-bar-map [toggle-global-highlight] 554 | '(menu-item "Toggle Global Highlight" hl-highlight-thingatpt-global 555 | :image (find-image '((:type xpm :file "images/toggle-global-highlight.xpm"))) 556 | :enable (not (minibufferp)))) 557 | (define-key-after tool-bar-map [killall-global-highlights] 558 | '(menu-item "Kill All Global Highlights" hl-unhighlight-all-global 559 | :image (find-image '((:type xpm :file "images/killall-highlights.xpm"))) 560 | :enable (not (minibufferp)))) 561 | (define-key-after tool-bar-map [global-highlights-on] 562 | '(menu-item "Global Highlights On" hl-global-highlight-on/off 563 | :image (find-image '((:type xpm :file "images/on.xpm"))) 564 | :visible hl-highlights 565 | :enable (not (minibufferp)))) 566 | (define-key-after tool-bar-map [global-highlights-off] 567 | '(menu-item "Global Highlights Off" hl-global-highlight-on/off 568 | :image (find-image '((:type xpm :file "images/off.xpm"))) 569 | :visible (null hl-highlights) 570 | :enable (not (minibufferp)))))) 571 | 572 | (defun hl-remove-menu-items () 573 | ;; Menu items. 574 | (define-key global-map [menu-bar edit hl-group] nil) 575 | ;; Tool-bar buttons. 576 | (when tool-bar-mode 577 | (define-key-after tool-bar-map [toggle-global-highlight] nil) 578 | (define-key-after tool-bar-map [killall-global-highlights] nil) 579 | (define-key-after tool-bar-map [global-highlights-on] nil) 580 | (define-key-after tool-bar-map [global-highlights-off] nil))) 581 | 582 | ;;;###autoload 583 | (defun hl-highlight-thingatpt-global () 584 | "Toggle global highlight." 585 | (interactive) 586 | (when hl-highlight-mode 587 | (let* ((thing (hl-thingatpt)) 588 | (regexp (car thing))) 589 | (when thing 590 | (if (member regexp hl-highlights) 591 | (hl-unhighlight-internal regexp 592 | hl-highlights hl-colors-index) 593 | (hl-highlight-internal regexp 594 | hl-highlights hl-colors-index)))))) 595 | 596 | ;;;###autoload 597 | (defun hl-unhighlight-all-global () 598 | "Remove all global highlights." 599 | (interactive) 600 | (dolist (regexp hl-highlights) 601 | (hl-unhighlight-internal regexp 602 | hl-highlights hl-colors-index)) 603 | (setq hl-colors-index 0)) 604 | 605 | ;;;###autoload 606 | (defun hl-highlight-thingatpt-local () 607 | "Toggle local highlights in the current buffer." 608 | (interactive) 609 | (when hl-highlight-mode 610 | (let* ((thing (hl-thingatpt)) 611 | (regexp (car thing))) 612 | (and thing 613 | (if (member regexp hl-highlights-local) 614 | (hl-unhighlight-internal regexp 615 | hl-highlights-local hl-colors-index-local) 616 | (hl-highlight-internal regexp 617 | hl-highlights-local hl-colors-index-local)))))) 618 | 619 | ;;;###autoload 620 | (defun hl-unhighlight-all-local () 621 | "Remove all local highlights in buffer." 622 | (interactive) 623 | (dolist (regexp hl-highlights-local) 624 | (hl-unhighlight-internal regexp 625 | hl-highlights-local hl-colors-index-local)) 626 | (setq hl-colors-index-local 0)) 627 | 628 | ;;;###autoload 629 | (defun hl-save-highlights () 630 | "Save highlights in `hl-highlight-save-file' file. 631 | 632 | (:global HL-HIGHLIGHTS ;; `hl-highlights' 633 | :local (FILE . HL-HIGHLIGHTS-LOCAL)) ;; `hl-highlights-local' 634 | 635 | You can call `hl-restore-highlights' to revert highlights of last session." 636 | (interactive) 637 | (let (save) 638 | ;; Save global highlights. 639 | (setq save (plist-put save :global (reverse hl-highlights))) 640 | ;; Save local highlights. 641 | (let (local) 642 | (dolist (buffer (hl-buffer-list nil t)) 643 | (with-current-buffer buffer 644 | (and hl-highlights-local 645 | (push (cons (buffer-file-name) 646 | (reverse hl-highlights-local)) 647 | local)))) 648 | (setq save (plist-put save :local local))) 649 | ;; Export. 650 | (and (stringp hl-highlight-save-file) 651 | (hl-export hl-highlight-save-file save)))) 652 | 653 | ;;;###autoload 654 | (defun hl-restore-highlights () 655 | "Load highligts from `hl-highlight-save-file' file. Before calling this, you 656 | could call `hl-save-highlights' function." 657 | (interactive) 658 | (when (and hl-highlight-mode 659 | (stringp hl-highlight-save-file)) 660 | ;; Import. 661 | (let* ((save (hl-import hl-highlight-save-file)) 662 | (global (plist-get save :global)) 663 | (local (plist-get save :local))) 664 | ;; Restore global highlights. 665 | (hl-unhighlight-all-global) 666 | (when global 667 | (dolist (regexp global) 668 | (hl-highlight-internal regexp 669 | hl-highlights hl-colors-index))) 670 | ;; Restore local highlights. 671 | (when local 672 | (mapc (lambda (buffer) 673 | (with-current-buffer buffer 674 | (let ((highlights (assoc (buffer-file-name) local))) 675 | (when highlights 676 | (hl-unhighlight-all-local) 677 | (dolist (regexp (cdr highlights)) 678 | (hl-highlight-internal regexp 679 | hl-highlights-local 680 | hl-colors-index-local)))))) 681 | (hl-buffer-list t)))))) 682 | 683 | ;;;###autoload 684 | (defun hl-global-highlight-on/off () 685 | (interactive) 686 | (when hl-highlight-mode 687 | (if (null hl-highlights) 688 | (progn 689 | ;; Restore highlights. 690 | (hl-restore-highlights) 691 | ;; Add overlays. 692 | (dolist (buffer (hl-buffer-list t)) 693 | (with-current-buffer buffer 694 | (hl-add-highlight-overlays)))) 695 | ;; Save highlights 696 | (let (save) 697 | (setq save (plist-put save :global (reverse hl-highlights))) 698 | (hl-export hl-highlight-save-file save)) 699 | ;; Remove overlays. 700 | (hl-unhighlight-all-global) 701 | (hl-remove-highlight-overlays t)) 702 | (when (called-interactively-p 'interactive) 703 | (message "Global highlights %s!" (if hl-highlights "on" "off"))))) 704 | 705 | ;;;###autoload 706 | (define-minor-mode hl-highlight-mode 707 | "Enable highligt engine to do: 708 | - Show highlight over current line highlight (`hl-line-mode' or 709 | `global-hl-line-mode'). 710 | - Synchronize global highlights. 711 | - Save highlights before killing Emacs and restore them next time." 712 | :lighter " hl-highlight" 713 | :global t 714 | (if hl-highlight-mode 715 | (progn 716 | ;; Highlight core. 717 | (hl-setup-default-advices t) 718 | (hl-setup-customizable-advices t) 719 | (add-hook 'kill-emacs-hook 'hl-save-highlights t) 720 | ;; Add menu items. 721 | (hl-add-menu-items) 722 | ;; Restore highlight when Emacs initializing. 723 | (hl-restore-highlights) 724 | ;; 1st time to add highlights overlays. 725 | (dolist (buffer (hl-buffer-list t)) 726 | (with-current-buffer buffer 727 | (hl-add-highlight-overlays)))) 728 | ;; Highlight core. 729 | (hl-setup-default-advices nil) 730 | (hl-setup-customizable-advices nil) 731 | (remove-hook 'kill-emacs-hook 'hl-save-highlights) 732 | ;; Save highlights 733 | (hl-save-highlights) 734 | ;; Remove overlays. 735 | (hl-unhighlight-all-global) 736 | (hl-remove-highlight-overlays t) 737 | ;; Remove menu items. 738 | (hl-remove-menu-items))) 739 | 740 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 741 | ;; Select & Search Highlighted Things ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 742 | 743 | (defun hl-find-thing (step) 744 | (let* ((regexp (hl-thingatpt)) 745 | (match (nth 0 regexp)) 746 | (beg (nth 1 regexp)) 747 | (end (nth 2 regexp)) 748 | (case-fold-search t) 749 | stop?) 750 | (when regexp 751 | ;; Hook before searching. 752 | (run-hook-with-args hl-before-find-thing-hook regexp) 753 | (deactivate-mark) 754 | (goto-char (nth (if (> step 0) 755 | ;; Move to end. 756 | 2 757 | ;; Move to beginning. 758 | 1) regexp)) 759 | (while (null stop?) 760 | (if (re-search-forward match nil t step) 761 | (progn 762 | (set-marker (mark-marker) (match-beginning 0)) 763 | (goto-char (match-end 0)) 764 | ;; Break the loop when matched. 765 | (setq stop? t)) 766 | ;; Start search from the start if `hl-highlight-cycle-search' is t, 767 | (if hl-highlight-cycle-search 768 | (goto-char (cond 769 | ((> step 0) 770 | (message "First one at the top.") 771 | (point-min)) 772 | ((< step 0) 773 | (message "Last one at the bottom.") 774 | (point-max)))) 775 | ;; Stop searching. 776 | (set-marker (mark-marker) beg) 777 | (goto-char end) 778 | (setq stop? t)))) 779 | ;; `hl-highlight-cycle-search' 780 | ;; TODO: deselect automatically. 781 | (activate-mark) 782 | ;; Hook after searching. 783 | (run-hook-with-args hl-after-find-thing-hook regexp)))) 784 | 785 | ;;;###autoload 786 | (defun hl-find-next-thing () 787 | "Find regexp forwardly and jump to it." 788 | (interactive) 789 | (hl-find-thing 1)) 790 | 791 | ;;;###autoload 792 | (defun hl-find-prev-thing () 793 | "Find regexp backwardly and jump to it." 794 | (interactive) 795 | (hl-find-thing -1)) 796 | 797 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 798 | ;; Parentheses ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 799 | 800 | (defun hl-paren-custom-set (symbol value) 801 | (dolist (buffer (buffer-list)) 802 | (with-current-buffer buffer 803 | (set symbol value) 804 | (when hl-paren-mode 805 | (hl-paren-mode -1) 806 | (hl-paren-mode 1))))) 807 | 808 | (defcustom hl-outward-paren-fg-colors '("black" 809 | "black") 810 | "Foreground colors for outward parentheses highlights." 811 | :type '(repeat color) 812 | :initialize 'custom-initialize-default 813 | :set 'hl-paren-custom-set 814 | :group 'hl-paren) 815 | 816 | (defcustom hl-outward-paren-bg-colors '("cyan" 817 | "gold") 818 | "Background colors for outward parentheses highlights." 819 | :type '(repeat color) 820 | :initialize 'custom-initialize-default 821 | :set 'hl-paren-custom-set 822 | :group 'hl-paren) 823 | 824 | (defcustom hl-inward-paren-fg-color "snow" 825 | "Foreground colors for inward the parentheses highlights." 826 | :type 'color 827 | :initialize 'custom-initialize-default 828 | :set 'hl-paren-custom-set 829 | :group 'hl-paren) 830 | 831 | (defcustom hl-inward-paren-bg-color "magenta1" 832 | "Background colors for inward parentheses highlights." 833 | :type 'color 834 | :initialize 'custom-initialize-default 835 | :set 'hl-paren-custom-set 836 | :group 'hl-paren) 837 | 838 | (defface hl-paren-face nil 839 | "Template face used for parentheses highlight." 840 | :group 'hl-paren) 841 | 842 | (defvar hl-paren-timer nil) 843 | 844 | (defvar hl-outward-parens nil) 845 | (make-variable-buffer-local 'hl-outward-parens) 846 | 847 | (defvar hl-inward-parens nil) 848 | (make-variable-buffer-local 'hl-inward-parens) 849 | 850 | (defun hl-paren-idle-begin () 851 | (when (hl-paren-is-begin) 852 | (setq hl-paren-timer (run-with-idle-timer 0.1 nil 'hl-create-parens)))) 853 | 854 | (defun hl-paren-is-begin () 855 | (not (or (active-minibuffer-window)))) 856 | 857 | (defun hl-create-parens () 858 | "Highlight enclosing parentheses." 859 | (when hl-paren-mode 860 | (hl-create-parens-internal) 861 | ;; Outward overlays. 862 | (let ((overlays hl-outward-parens)) 863 | (save-excursion 864 | (ignore-errors 865 | (while overlays 866 | (up-list -1) 867 | (move-overlay (pop overlays) (point) (1+ (point))) 868 | (forward-sexp) 869 | (move-overlay (pop overlays) (1- (point)) (point))))) 870 | ;; Hide unused overlays. 871 | (dolist (overlay overlays) 872 | (move-overlay overlay 1 1))) 873 | ;; Inward overlays. 874 | (unless (memq (get-text-property (point) 'face) 875 | '(font-lock-comment-face 876 | font-lock-string-face)) 877 | (let ((overlays hl-inward-parens)) 878 | (save-excursion 879 | (ignore-errors 880 | (cond 881 | ;; Open parenthesis ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 882 | ((eq ?\( (char-syntax (char-after))) 883 | (move-overlay (pop overlays) (point) (1+ (point))) 884 | (forward-sexp) 885 | (move-overlay (pop overlays) (1- (point)) (point))) 886 | ;; Close parenthesis ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 887 | ((eq ?\) (char-syntax (char-before))) 888 | (move-overlay (pop overlays) (1- (point)) (point)) 889 | (backward-sexp) 890 | (move-overlay (pop overlays) (point) (1+ (point))))))))))) 891 | 892 | (defun hl-create-parens-internal () 893 | ;; outward overlays. 894 | (unless hl-outward-parens 895 | (let ((fg hl-outward-paren-fg-colors) 896 | (bg hl-outward-paren-bg-colors)) 897 | (while (or fg bg) 898 | (let (facespec) 899 | (when fg 900 | (setq facespec (append facespec `((foreground-color . ,(car fg)))))) 901 | (pop fg) 902 | (when bg 903 | (setq facespec (append facespec `((background-color . ,(car bg)))))) 904 | (pop bg) 905 | ;; Make pair overlays. 906 | (dotimes (i 2) 907 | (push (make-overlay 0 0) hl-outward-parens) 908 | (overlay-put (car hl-outward-parens) 'face facespec)))) 909 | (setq hl-outward-parens (reverse hl-outward-parens)))) 910 | ;; inward overlays. 911 | (unless hl-inward-parens 912 | (let ((fg hl-inward-paren-fg-color) 913 | (bg hl-inward-paren-bg-color) 914 | facespec) 915 | (when fg 916 | (setq facespec (append facespec `((foreground-color . ,fg))))) 917 | (when bg 918 | (setq facespec (append facespec `((background-color . ,bg))))) 919 | ;; Make pair overlays. 920 | (dotimes (i 2) 921 | (push (make-overlay 0 0) hl-inward-parens) 922 | (overlay-put (car hl-inward-parens) 'face facespec))))) 923 | 924 | (defun hl-remove-parens () 925 | (when hl-paren-timer 926 | (cancel-timer hl-paren-timer) 927 | (setq hl-paren-timer nil)) 928 | (mapc 'delete-overlay hl-outward-parens) 929 | (mapc 'delete-overlay hl-inward-parens) 930 | (mapc 'kill-local-variable '(hl-outward-parens 931 | hl-inward-parens))) 932 | 933 | ;;;###autoload 934 | (define-minor-mode hl-paren-mode 935 | "Minor mode to highlight the enclosing parentheses and more." 936 | :lighter " hl-paren" 937 | (if hl-paren-mode 938 | (progn 939 | (add-hook 'pre-command-hook 'hl-remove-parens nil t) 940 | (add-hook 'post-command-hook 'hl-paren-idle-begin nil t)) 941 | (remove-hook 'pre-command-hook 'hl-remove-parens t) 942 | (remove-hook 'post-command-hook 'hl-paren-idle-begin t))) 943 | 944 | (provide 'hl-anything) 945 | ;;; hl-anything.el ends here 946 | -------------------------------------------------------------------------------- /images/killall-highlights.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcw165/hl-anything/8819e6306d55a72b6de319ddc92e0f543f18687a/images/killall-highlights.png -------------------------------------------------------------------------------- /images/killall-highlights.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char *killall_highlights[] = { 3 | /* columns rows colors chars-per-pixel */ 4 | "24 24 117 2 ", 5 | " c black", 6 | ". c #6F6F6F", 7 | "X c gray46", 8 | "o c #747679", 9 | "O c #7C7E7E", 10 | "+ c gray50", 11 | "@ c #BE0000", 12 | "# c #C20000", 13 | "$ c #C60000", 14 | "% c #C70000", 15 | "& c #C60200", 16 | "* c #C60201", 17 | "= c #CA0200", 18 | "- c #CC0000", 19 | "; c #CF0300", 20 | ": c #C10909", 21 | "> c #D20000", 22 | ", c #D20300", 23 | "< c #D70400", 24 | "1 c #D80701", 25 | "2 c #DC0902", 26 | "3 c #DD0D07", 27 | "4 c #C41111", 28 | "5 c #C41717", 29 | "6 c #C51919", 30 | "7 c #C61818", 31 | "8 c #E2140D", 32 | "9 c #E21812", 33 | "0 c #EA1B15", 34 | "q c #C72020", 35 | "w c #C72121", 36 | "e c #C82828", 37 | "r c #C92828", 38 | "t c #C92A2A", 39 | "y c #CA2F2F", 40 | "u c #CB2F2F", 41 | "i c #CF312F", 42 | "p c #CD3636", 43 | "a c #D23938", 44 | "s c #D53938", 45 | "d c #D73F3A", 46 | "f c #D23F3E", 47 | "g c #D7403E", 48 | "h c #DA413F", 49 | "j c #DC4643", 50 | "k c #D84746", 51 | "l c #DF4A47", 52 | "z c #DD504E", 53 | "x c #CD5757", 54 | "c c #CD5E5E", 55 | "v c #E04E4B", 56 | "b c #E4524E", 57 | "n c #E95450", 58 | "m c #E25855", 59 | "M c #E6615C", 60 | "N c #D16161", 61 | "B c #D56463", 62 | "V c #D96563", 63 | "C c #DD6E6C", 64 | "Z c #ED6762", 65 | "A c #E17470", 66 | "S c #E67D7A", 67 | "D c #EF7C78", 68 | "F c #FFB107", 69 | "G c #FFB207", 70 | "H c #FFBA00", 71 | "J c #FFC800", 72 | "K c #FFCA00", 73 | "L c #FFDF36", 74 | "P c #FFE63A", 75 | "I c #BCAA46", 76 | "U c #7E8181", 77 | "Y c #818686", 78 | "T c gray75", 79 | "R c #DC8380", 80 | "E c #D18C8C", 81 | "W c #D49494", 82 | "Q c #DF9F9E", 83 | "! c #EA8380", 84 | "~ c #D8A4A4", 85 | "^ c #DCA8A8", 86 | "/ c #DFA8A8", 87 | "( c #D0B3B3", 88 | ") c #D2B5B5", 89 | "_ c #DFB3B3", 90 | "` c #D9BCBD", 91 | "' c #D8BEBE", 92 | "] c #DEBDBC", 93 | "[ c #E2A5A5", 94 | "{ c #FFF68C", 95 | "} c #FFFA95", 96 | "| c #CFCECE", 97 | " . c #D9C0C0", 98 | ".. c #DBC3C3", 99 | "X. c #D2D4D4", 100 | "o. c #D7D7D7", 101 | "O. c #DCD0D0", 102 | "+. c #DFDADA", 103 | "@. c #DFDCDC", 104 | "#. c #EEC4C3", 105 | "$. c #DBE3E3", 106 | "%. c #E2E2E2", 107 | "&. c #E5E4E4", 108 | "*. c gray90", 109 | "=. c #E2E9E9", 110 | "-. c #E1EAEB", 111 | ";. c #E7EAEA", 112 | ":. c #E8E9E9", 113 | ">. c #E9E9E9", 114 | ",. c gray92", 115 | "<. c #ECECEC", 116 | "1. c #ECEEEE", 117 | "2. c #F2FBFB", 118 | "3. c #F6FAFA", 119 | "4. c #F8F8F8", 120 | "5. c white", 121 | "6. c None", 122 | /* pixels */ 123 | "6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.", 124 | "6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.", 125 | "6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.o o 6.6.6.6.6.", 126 | "6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6. 6.o 6.6.6.6.", 127 | "6.6.6.6.6.6.6.6.6.6.6.6.6.6.6. Z R O o 6.6.6.", 128 | "6.6.6.6.6.6.6.6.6.6.6.6.6.6. M b n ` U o 6.6.", 129 | "6.6.6.6.6.6.6.6.6.6.6.6.6. m l z #.5.@. Y o 6.", 130 | "6.6.6.6.6.6.6.6.6.6.6.6. z h j Q 5.3.D d o 6.", 131 | "6.6.6.6.6.6.6.6.6.6.6. j a d [ 5.` ! 8 0 6.6.", 132 | "6.6.6.6.6.6.6.6.6.6. f p a / 5...S 3 9 6.6.6.", 133 | "6.6.6.6.6.6.6.6.6. p e y / 5.` A 1 3 6.6.6.6.", 134 | "6.6.6.6.6.6.6.6. y q y _ 5. .C , , 6.6.6.6.6.", 135 | "6.6.6.6.6.6.6. y 5 q W 5.O.V - , 6.6.6.6.6.6.", 136 | "6.6.6.6.6.6. 5 4 5 E 5.) B % - 6.6.6.6.6.6.6.", 137 | "6.6.6.6.6.o T : ~ 5.) N % - 6.6.6.6.6.6.6.6.", 138 | "6.6.6.6.o o.3.+. =.$.c @ % 6.6.6.6.6.6.6.6.6.", 139 | "6.6.6.o X 4.,.,.$. x @ % 6.6.6.6.6.6.6.6.6.6.", 140 | "6.6.6.6.X O ,.,.*.o. % 6.6.6.6.6.6.6.6.6.6.6.", 141 | "6.6.6.6.6.o X *.*.=.| 6.6.6.6.6.6.6.6.6.6.6.6.", 142 | "6.6.6.6.6.6.o I *.*.o 6.{ { { 6.6.{ { 6.6.} 6.6.", 143 | "6.6.6.6.6.6.6.o o o 6.P P P 6.6.P P 6.6.P 6.6.6.", 144 | "6.6.6.6.6.6.6.6.6.6.J J J 6.6.J J J 6.J H 6.6.6.", 145 | "6.6.6.6.6.6.6.6.G G G G 6.6.G G G 6.6.G G G H 6.", 146 | "6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6.6." 147 | }; 148 | -------------------------------------------------------------------------------- /images/material.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcw165/hl-anything/8819e6306d55a72b6de319ddc92e0f543f18687a/images/material.psd -------------------------------------------------------------------------------- /images/off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcw165/hl-anything/8819e6306d55a72b6de319ddc92e0f543f18687a/images/off.png -------------------------------------------------------------------------------- /images/off.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char *off[] = { 3 | /* columns rows colors chars-per-pixel */ 4 | "24 24 124 2 ", 5 | " c #686A6D", 6 | ". c #6A6D6D", 7 | "X c #6E7174", 8 | "o c #717373", 9 | "O c #787A7C", 10 | "+ c #878988", 11 | "@ c #8D8F8F", 12 | "# c #8F9291", 13 | "$ c #939797", 14 | "% c #969799", 15 | "& c #979B9B", 16 | "* c #989B9A", 17 | "= c #989B9D", 18 | "- c #9C9E9E", 19 | "; c #9D9EA0", 20 | ": c #9FA2A4", 21 | "> c #A1A1A2", 22 | ", c #A0A1A3", 23 | "< c #A1A2A2", 24 | "1 c #A0A2A3", 25 | "2 c #A1A2A4", 26 | "3 c #A1A3A6", 27 | "4 c #A2A4A5", 28 | "5 c #A4A7A7", 29 | "6 c #A5A7A8", 30 | "7 c #A5A7A9", 31 | "8 c #A6A7A8", 32 | "9 c #A6A8A9", 33 | "0 c #A7A8A9", 34 | "q c #A7A9A9", 35 | "w c #A7A9AA", 36 | "e c #A8A9A9", 37 | "r c #A8A9AA", 38 | "t c #A8A9AB", 39 | "y c #A8AAAA", 40 | "u c #A9AAAA", 41 | "i c #AAABAB", 42 | "p c #AAABAC", 43 | "a c #ACADAE", 44 | "s c #ADADAE", 45 | "d c #ADAEAF", 46 | "f c #AEAFAF", 47 | "g c #ADAFB0", 48 | "h c #AFB1B1", 49 | "j c #AEB1B2", 50 | "k c #AFB1B2", 51 | "l c #B1B1B3", 52 | "z c #B3B5B5", 53 | "x c #B4B5B6", 54 | "c c #B6B7B8", 55 | "v c #B7B8B9", 56 | "b c #B8B9BA", 57 | "n c #BABCBD", 58 | "m c #BBBCBD", 59 | "M c #C3C4C5", 60 | "N c #C4C6C6", 61 | "B c #C4C6C7", 62 | "V c #C5C7C7", 63 | "C c #C6C8C9", 64 | "Z c #C7C8C9", 65 | "A c #C9CBCB", 66 | "S c #CBCBCB", 67 | "D c #CBCBCC", 68 | "F c #CBCCCC", 69 | "G c #CBCDCD", 70 | "H c gray80", 71 | "J c #CCCDCD", 72 | "K c #CDCDCD", 73 | "L c #CCCECE", 74 | "P c #CECECE", 75 | "I c gray81", 76 | "U c #CECFD0", 77 | "Y c #CFD0D0", 78 | "T c #D0D1D1", 79 | "R c #D0D2D2", 80 | "E c #D1D2D2", 81 | "W c #D0D3D3", 82 | "Q c #D1D3D3", 83 | "! c #D2D3D3", 84 | "~ c #D3D3D4", 85 | "^ c #D5D5D5", 86 | "/ c gray84", 87 | "( c #D6D7D7", 88 | ") c #D7D8D8", 89 | "_ c #D8D8D8", 90 | "` c #D8D9D9", 91 | "' c gray85", 92 | "] c #D8D9DA", 93 | "[ c #D9DADA", 94 | "{ c #DADBDB", 95 | "} c #DADBDC", 96 | "| c #DBDBDC", 97 | " . c #DBDCDC", 98 | ".. c gainsboro", 99 | "X. c #DCDDDD", 100 | "o. c #DDDDDD", 101 | "O. c #DDDDDE", 102 | "+. c gray87", 103 | "@. c #DFDFDF", 104 | "#. c #DFE0E0", 105 | "$. c gray88", 106 | "%. c #E0E0E1", 107 | "&. c #E0E1E1", 108 | "*. c #E0E2E2", 109 | "=. c #E1E2E2", 110 | "-. c #E2E3E3", 111 | ";. c #E2E3E4", 112 | ":. c #E3E3E4", 113 | ">. c #E4E4E4", 114 | ",. c #E4E5E5", 115 | "<. c gray90", 116 | "1. c #E5E6E6", 117 | "2. c #E6E6E6", 118 | "3. c #E6E7E7", 119 | "4. c #E7E7E8", 120 | "5. c #E8E9E9", 121 | "6. c #E9EAEA", 122 | "7. c #EAEBEB", 123 | "8. c #ECECEC", 124 | "9. c #ECEDED", 125 | "0. c gray93", 126 | "q. c #EEEEEE", 127 | "w. c #F1F1F1", 128 | "e. c None", 129 | /* pixels */ 130 | "e.e.e.e.e.e.e.e.e.o 8 e e 8 , . e.e.e.e.e.e.e.e.", 131 | "e.e.e.e.e.e.e.e.$ , Z G G G G e % e.e.e.e.e.e.e.", 132 | "e.e.e.e.e.e.e.- , R R R R R I G e - e.e.e.e.e.e.", 133 | "e.e.e.e.e.e., , V R / ' ' ' / / G x @ e.e.e.e.e.", 134 | "e.e.e.e.e.e.0 G ( ] ' ' @.' ' ' ' G , e.e.e.e.e.", 135 | "e.e.e.e.e.e.0 Y ( ' <.<.4.<.<.@.' R x e.e.e.e.e.", 136 | "e.e.e.e.e.e.0 R ' O.<.4.4.q.<.' ' R x e.e.e.e.e.", 137 | "e.e.e.e.e.e.e G ' #.<.q.q.q.4.<.O.U e e.e.e.e.e.", 138 | "e.e.e.e.e.e.e v ' #.<.w.q.q.4.#.' G ; e.e.e.e.e.", 139 | "e.e.e.e.e.e.e.j j <.<.q.q.7.7.<.( x O e.e.e.e.e.", 140 | "e.e.e.e.e.e.e.' g ' <.4.4.7.<.#.n # e.e.e.e.e.e.", 141 | "e.e.e.e.e.e.e.e.g G O.#.#.<.4.Y 3 e.e.e.e.e.e.e.", 142 | "e.e.e.e.e.e.e.e.e.z ' O.' #.#.0 e.e.e.e.e.e.e.e.", 143 | "e.e.e.e.e.e.e.e.e.e j Y ] ] C : e.e.e.e.e.e.e.e.", 144 | "e.e.e.e.e.e.e.e.e.e.v B Y Y j e.e.e.e.e.e.e.e.e.", 145 | "e.e.e.e.e.e.e.e.e.e.0 n G V 0 e.e.e.e.e.e.e.e.e.", 146 | "e.e.e.e.e.e.e.e.e.e.: e n n % e.e.e.e.e.e.e.e.e.", 147 | "e.e.e.e.e.e.e.e.e.e.. . X . e.e.e.e.e.e.e.e.e.", 148 | "e.e.e.e.e.e.e.e.e.e.X + # + X e.e.e.e.e.e.e.e.e.", 149 | "e.e.e.e.e.e.e.e.e.e.X + % # X e.e.e.e.e.e.e.e.e.", 150 | "e.e.e.e.e.e.e.e.e.e.. . - X X e.e.e.e.e.e.e.e.e.", 151 | "e.e.e.e.e.e.e.e.e.e.e.X X X e.e.e.e.e.e.e.e.e.e.", 152 | "e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.", 153 | "e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e." 154 | }; 155 | -------------------------------------------------------------------------------- /images/on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcw165/hl-anything/8819e6306d55a72b6de319ddc92e0f543f18687a/images/on.png -------------------------------------------------------------------------------- /images/on.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char *on[] = { 3 | /* columns rows colors chars-per-pixel */ 4 | "24 24 61 1 ", 5 | " c #FF7B00", 6 | ". c #FFB107", 7 | "X c #FFB207", 8 | "o c #FFB208", 9 | "O c #FFCA03", 10 | "+ c #FFDA00", 11 | "@ c #FFE431", 12 | "# c #FFE63A", 13 | "$ c #FFE63D", 14 | "% c #C7BD73", 15 | "& c #C7BC74", 16 | "* c #FDDB53", 17 | "= c #FFDD52", 18 | "- c #FFDD53", 19 | "; c #FCDA54", 20 | ": c #FCDA55", 21 | "> c #FDDB55", 22 | ", c #FCDA56", 23 | "< c #FFDC54", 24 | "1 c #FFDD54", 25 | "2 c #FFDD55", 26 | "3 c #FFDD56", 27 | "4 c #FFDE57", 28 | "5 c #FCDB58", 29 | "6 c #FCDB59", 30 | "7 c #FFDE59", 31 | "8 c #FFDE5C", 32 | "9 c #FFDF5C", 33 | "0 c #FCDC5F", 34 | "q c #FFEA4C", 35 | "w c #FFE058", 36 | "e c #D5C764", 37 | "r c #E4CD6E", 38 | "t c #FCDC60", 39 | "y c #FCDD60", 40 | "u c #FFDF63", 41 | "i c #FFE061", 42 | "p c #FFE062", 43 | "a c #FFE063", 44 | "s c #FFE066", 45 | "d c #FFE566", 46 | "f c #FFE068", 47 | "g c #FFE16A", 48 | "h c #FFE16B", 49 | "j c #FFE16C", 50 | "k c #FFE16D", 51 | "l c #FFE16E", 52 | "z c #FFE26E", 53 | "x c #FFE376", 54 | "c c #848588", 55 | "v c #828A8F", 56 | "b c #A2A5A4", 57 | "n c #A6A6A7", 58 | "m c #FFE684", 59 | "M c #FFE685", 60 | "N c #FFE789", 61 | "B c #FFE996", 62 | "V c #FFEA97", 63 | "C c #FCEFA7", 64 | "Z c #FFFFDA", 65 | "A c None", 66 | /* pixels */ 67 | "AAAAAAAAAmyulllmAAAAAAAA", 68 | "A AAAAAmxZ6yyllNAAAA A", 69 | "AA AAAmxZ444:4ylmA AAA", 70 | "AAAAAAmmZZ44##:4ulNAAAAA", 71 | "AAAAAAmZZ44####44uVAAAAA", 72 | "A AAAAVZZ:*##e##4ZVAAAA ", 73 | "AA AVZZ;###e#44ZVA A", 74 | "AAAAAANZZ;###%##6ZVAAAAA", 75 | "AAAAAAmlZ;##&&#:CZVAAAAA", 76 | "AAAA AAuZ;4#&##,ZmAAAAAA", 77 | "AA AANy66#&#:6lmAA AA", 78 | "A AAAAAmy4#&,6umAAAA A", 79 | "AAAAAAAAAu4#&:6NAAAAAAA ", 80 | "AAAA AAAm44&,ymAA AAAA", 81 | "AAA AAAAA64&4NAAAA AAA", 82 | "AAAAAAAAAAd4&wmAAAAAAAAA", 83 | "AAAAAAAAAArrrrrAAAAAAAAA", 84 | "AAAAAAAAAAcccccAAAAAAAAA", 85 | "AAAAAAAAAAcnnncAAAAAAAAA", 86 | "AAAAAAAAAAcnnncAAAAAAAAA", 87 | "AAAAO++#q#cvnvcq##+OOAAA", 88 | "AXXOOOO++q#ccc##++OOOXXA", 89 | "AXXoXOOO++#####++OOXXXXA", 90 | "AAAAAAAAAAAAAAAAAAAAAAAA" 91 | }; 92 | -------------------------------------------------------------------------------- /images/toggle-global-highlight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tcw165/hl-anything/8819e6306d55a72b6de319ddc92e0f543f18687a/images/toggle-global-highlight.png -------------------------------------------------------------------------------- /images/toggle-global-highlight.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char *toggle_global_highlight[] = { 3 | /* columns rows colors chars-per-pixel */ 4 | "24 24 173 2 ", 5 | " c #0E111E", 6 | ". c #101317", 7 | "X c #151515", 8 | "o c #161616", 9 | "O c #151719", 10 | "+ c #11141F", 11 | "@ c #171818", 12 | "# c #18191A", 13 | "$ c #18191C", 14 | "% c #1F1E1E", 15 | "& c #161D29", 16 | "* c #202021", 17 | "= c #2B2520", 18 | "- c #282A2B", 19 | "; c #2F2F2E", 20 | ": c #272C30", 21 | "> c #2F3037", 22 | ", c #3C3E3F", 23 | "< c #60480F", 24 | "1 c #69421D", 25 | "2 c #604D1F", 26 | "3 c #3E4349", 27 | "4 c #414447", 28 | "5 c #4A4A4B", 29 | "6 c #4B4B4C", 30 | "7 c #505256", 31 | "8 c #6E6F72", 32 | "9 c #D57113", 33 | "0 c #D27117", 34 | "q c #D47115", 35 | "w c #D77314", 36 | "e c #D87416", 37 | "r c #D97517", 38 | "t c #D77A1F", 39 | "y c #DB7819", 40 | "u c #D47822", 41 | "i c #ED8205", 42 | "p c #E9810C", 43 | "a c #F28000", 44 | "s c #F58100", 45 | "d c #F68100", 46 | "f c #F88100", 47 | "g c #FB8400", 48 | "h c #FD8600", 49 | "j c #FD8802", 50 | "k c #FE8E01", 51 | "l c #E5891E", 52 | "z c #EAA50A", 53 | "x c #FCAD05", 54 | "c c #FDB106", 55 | "v c #FCB107", 56 | "b c #FFB107", 57 | "n c #FFB206", 58 | "m c #FFB207", 59 | "M c #FFB307", 60 | "N c #FFB406", 61 | "B c #FFBA00", 62 | "V c #FFB208", 63 | "C c #FFB408", 64 | "Z c #FFB509", 65 | "A c #D7812E", 66 | "S c #DB822D", 67 | "D c #FCC500", 68 | "F c #FFC800", 69 | "G c #FFC900", 70 | "H c #FFCA00", 71 | "J c #FFCA03", 72 | "K c #F0C80D", 73 | "L c #FFD705", 74 | "P c #FFD706", 75 | "I c #FFD707", 76 | "U c #FFDA02", 77 | "Y c #FFD709", 78 | "T c #FFD70B", 79 | "R c #FFD50D", 80 | "E c #FFD60C", 81 | "W c #FFD70C", 82 | "Q c #FFD50E", 83 | "! c #FFD50F", 84 | "~ c #FFD60F", 85 | "^ c #FFD80B", 86 | "/ c #FFDC0C", 87 | "( c #FFDD0E", 88 | ") c #FFDC0F", 89 | "_ c #FFD510", 90 | "` c #FFD610", 91 | "' c #FFD611", 92 | "] c #FFD711", 93 | "[ c #FFD612", 94 | "{ c #FCD614", 95 | "} c #FED715", 96 | "| c #FED717", 97 | " . c #FFDF36", 98 | ".. c #FFE126", 99 | "X. c #FFE639", 100 | "o. c #FFE63A", 101 | "O. c #FFE73A", 102 | "+. c #FFE63D", 103 | "@. c #8D8266", 104 | "#. c #9F9472", 105 | "$. c #B88C64", 106 | "%. c #CFBE48", 107 | "&. c #E8B656", 108 | "*. c #C59C78", 109 | "=. c #EBC648", 110 | "-. c #F7DC49", 111 | ";. c #FFE34F", 112 | ":. c #FAE64E", 113 | ">. c #FFE555", 114 | ",. c #FFE759", 115 | "<. c #FFE75D", 116 | "1. c #ECDE6E", 117 | "2. c #FEE861", 118 | "3. c #FFE965", 119 | "4. c #FEEA69", 120 | "5. c #FEEB6C", 121 | "6. c #FEEB70", 122 | "7. c #FFEF73", 123 | "8. c #CFA882", 124 | "9. c #CFA883", 125 | "0. c #CFA884", 126 | "q. c #D0A782", 127 | "w. c #D0A885", 128 | "e. c #D1A985", 129 | "r. c #D2AA86", 130 | "t. c #D4AB84", 131 | "y. c #D5AE8A", 132 | "u. c #E9D388", 133 | "i. c #EFDA8D", 134 | "p. c #E9D791", 135 | "a. c #EDD590", 136 | "s. c #F2DF9F", 137 | "d. c #FFF68A", 138 | "f. c #FFF68C", 139 | "g. c #FFF78F", 140 | "h. c #F4E49D", 141 | "j. c #F6E99B", 142 | "k. c #FFF790", 143 | "l. c #FFFA95", 144 | "z. c #FCF79D", 145 | "x. c #F3E1A2", 146 | "c. c #F7E5A2", 147 | "v. c #F3E3AB", 148 | "b. c #FAF2AA", 149 | "n. c #FAF3AA", 150 | "m. c #FCF5A8", 151 | "M. c #F9F3AC", 152 | "N. c #FBF7AF", 153 | "B. c #FEF8A8", 154 | "V. c #FEF9A8", 155 | "C. c #FFF9A8", 156 | "Z. c #FEF9A9", 157 | "A. c #FEF9AA", 158 | "S. c #FFFFAB", 159 | "D. c #F4E4B4", 160 | "F. c #FBF7B1", 161 | "G. c #FDF9B3", 162 | "H. c #FFFFB4", 163 | "J. c #FFFEB5", 164 | "K. c #FEFDB6", 165 | "L. c #FFFDB6", 166 | "P. c #FFFFB6", 167 | "I. c #FFFFB7", 168 | "U. c #FDFCB8", 169 | "Y. c #FFFFB8", 170 | "T. c #FFFFB9", 171 | "R. c #FFFFBB", 172 | "E. c #FEFEBD", 173 | "W. c #EBF0F3", 174 | "Q. c #EBF1F4", 175 | "!. c #EFF3F5", 176 | "~. c #F6F5F1", 177 | "^. c None", 178 | /* pixels */ 179 | "^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.", 180 | "^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.h.u.^.^.^.^.", 181 | "^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.j.Y.B.i.^.^.^.", 182 | "^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.M.I.B.6.' =.^.^.", 183 | "^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.b.I.B.6.| U J &.^.", 184 | "^.^.^.^.^.^.^.^.^.^.^.^.^.D.b.Y.B.4.{ U Q N l ^.", 185 | "^.^.^.^.^.^.^.^.^.^.^.^.a.F.Y.B.4.' U Q N y t ^.", 186 | "^.^.^.^.^.^.^.^.^.^.^.v.b.I.B.3.' I Q N d r y.^.", 187 | "^.^.^.^.^.^.^.^.^.^.s.I.I.B.2.Q I ' N y w *.^.^.", 188 | "^.^.^.^.^.^.^.^.^.x.I.Y.b.<.Q Q ' N d r t.^.^.^.", 189 | "^.^.^.^.^.^.^.^.c.Y.Y.B.,.Q ^ ^ Z d r r.^.^.^.^.", 190 | "^.^.^.^.^.^.^.u.Y.Y.B.>.Q Q ' Z d r q.^.^.^.^.^.", 191 | "^.^.^.^.^.^.8 #.m.B.>.Q ^ ' N g r q.^.^.^.^.^.^.", 192 | "^.^.^.^.^.^.3 > @.:.^ ^ Q Z g y q.^.^.^.^.^.^.^.", 193 | "^.^.^.^.^.^.6 @ + < K ( Z j A q.^.^.^.^.^.^.^.^.", 194 | "^.^.^.^.^.^.6 @ * 2 z j S 0.!.^.^.^.^.^.^.^.^.", 195 | "^.^.^.^.^.^.4 o % ; & 1 t q.!.^.^.^.^.^.^.^.^.^.", 196 | "^.^.^.^.^.r 3 @ o + = 7 *.W.^.^.^.^.^.^.^.^.^.^.", 197 | "^.^.^.^.r j Z : - o $.~.^.^.^.^.^.^.^.^.^.^.^.^.", 198 | "^.^.g.r j N j j r 1.k.f.f.f.f.f.f.f.f.f.f.l.^.^.", 199 | "^.^ ..g Z j r %.:.X.X. .X.X.X.X.X.X.X.X. .^.^.^.", 200 | "^.J J J J J J J J J J J J J J J J J J J B ^.^.^.", 201 | "^.N Z N N Z N N N N Z N x x N Z x N Z N x Z N ^.", 202 | "^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^." 203 | }; 204 | --------------------------------------------------------------------------------