From f32b13cada7ce9035ac6ec1f4b0222b6a380bc16 Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Tue, 13 Nov 2018 12:40:44 +0100 Subject: [PATCH] update rainbow and rainbow-delimiters. Signed-off-by: Andreas Gerler --- bba.org | 2 +- .../rainbow-delimiters-pkg.el | 1 - .../rainbow-delimiters-autoloads.el | 10 +- .../rainbow-delimiters-pkg.el | 2 + .../rainbow-delimiters.el | 29 +++-- elpa/rainbow-mode-0.12.signed | 1 - elpa/rainbow-mode-0.12/rainbow-mode-pkg.el | 1 - .../rainbow-mode-autoloads.el | 14 +-- elpa/rainbow-mode-1.0.1/rainbow-mode-pkg.el | 2 + .../rainbow-mode.el | 100 +++++++++++++++--- 10 files changed, 122 insertions(+), 40 deletions(-) delete mode 100644 elpa/rainbow-delimiters-20150320.17/rainbow-delimiters-pkg.el rename elpa/{rainbow-delimiters-20150320.17 => rainbow-delimiters-20170929.1132}/rainbow-delimiters-autoloads.el (73%) create mode 100644 elpa/rainbow-delimiters-20170929.1132/rainbow-delimiters-pkg.el rename elpa/{rainbow-delimiters-20150320.17 => rainbow-delimiters-20170929.1132}/rainbow-delimiters.el (93%) delete mode 100644 elpa/rainbow-mode-0.12.signed delete mode 100644 elpa/rainbow-mode-0.12/rainbow-mode-pkg.el rename elpa/{rainbow-mode-0.12 => rainbow-mode-1.0.1}/rainbow-mode-autoloads.el (60%) create mode 100644 elpa/rainbow-mode-1.0.1/rainbow-mode-pkg.el rename elpa/{rainbow-mode-0.12 => rainbow-mode-1.0.1}/rainbow-mode.el (93%) diff --git a/bba.org b/bba.org index 3d60df12..a680f95e 100644 --- a/bba.org +++ b/bba.org @@ -389,7 +389,7 @@ But we use it only in graphical mode as text mode lacks color depth. #+BEGIN_SRC emacs-lisp :tangle yes (if (>= emacs-major-version 24) (when (display-graphic-p) - (add-to-list 'load-path "~/.emacs.d/elpa/rainbow-delimiters-20150320.17") + (add-to-list 'load-path "~/.emacs.d/elpa/rainbow-delimiters-20170929.1132") )) diff --git a/elpa/rainbow-delimiters-20150320.17/rainbow-delimiters-pkg.el b/elpa/rainbow-delimiters-20150320.17/rainbow-delimiters-pkg.el deleted file mode 100644 index 488b2f9d..00000000 --- a/elpa/rainbow-delimiters-20150320.17/rainbow-delimiters-pkg.el +++ /dev/null @@ -1 +0,0 @@ -(define-package "rainbow-delimiters" "20150320.17" "Highlight brackets according to their depth" 'nil :url "https://github.com/Fanael/rainbow-delimiters" :keywords '("faces" "convenience" "lisp" "tools")) diff --git a/elpa/rainbow-delimiters-20150320.17/rainbow-delimiters-autoloads.el b/elpa/rainbow-delimiters-20170929.1132/rainbow-delimiters-autoloads.el similarity index 73% rename from elpa/rainbow-delimiters-20150320.17/rainbow-delimiters-autoloads.el rename to elpa/rainbow-delimiters-20170929.1132/rainbow-delimiters-autoloads.el index f0bffd84..c13f8f77 100644 --- a/elpa/rainbow-delimiters-20150320.17/rainbow-delimiters-autoloads.el +++ b/elpa/rainbow-delimiters-20170929.1132/rainbow-delimiters-autoloads.el @@ -1,10 +1,13 @@ ;;; rainbow-delimiters-autoloads.el --- automatically extracted autoloads ;; ;;; Code: -(add-to-list 'load-path (or (file-name-directory #$) (car load-path))) + +(add-to-list 'load-path (directory-file-name + (or (file-name-directory #$) (car load-path)))) + ;;;### (autoloads nil "rainbow-delimiters" "rainbow-delimiters.el" -;;;;;; (21908 14195 0 0)) +;;;;;; (0 0 0 0)) ;;; Generated autoloads from rainbow-delimiters.el (autoload 'rainbow-delimiters-mode "rainbow-delimiters" "\ @@ -22,11 +25,14 @@ Disable `rainbow-delimiters-mode'. \(fn)" nil nil) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "rainbow-delimiters" '("rainbow-delimiters-"))) + ;;;*** ;; Local Variables: ;; version-control: never ;; no-byte-compile: t ;; no-update-autoloads: t +;; coding: utf-8 ;; End: ;;; rainbow-delimiters-autoloads.el ends here diff --git a/elpa/rainbow-delimiters-20170929.1132/rainbow-delimiters-pkg.el b/elpa/rainbow-delimiters-20170929.1132/rainbow-delimiters-pkg.el new file mode 100644 index 00000000..7e89106b --- /dev/null +++ b/elpa/rainbow-delimiters-20170929.1132/rainbow-delimiters-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "rainbow-delimiters" "20170929.1132" "Highlight brackets according to their depth" 'nil :commit "19b93892afa0494ba749c2ca9c154e04447ad778" :keywords '("faces" "convenience" "lisp" "tools") :authors '(("Jeremy Rayman" . "opensource@jeremyrayman.com") ("Fanael Linithien" . "fanael4@gmail.com")) :maintainer '("Fanael Linithien" . "fanael4@gmail.com") :url "https://github.com/Fanael/rainbow-delimiters") diff --git a/elpa/rainbow-delimiters-20150320.17/rainbow-delimiters.el b/elpa/rainbow-delimiters-20170929.1132/rainbow-delimiters.el similarity index 93% rename from elpa/rainbow-delimiters-20150320.17/rainbow-delimiters.el rename to elpa/rainbow-delimiters-20170929.1132/rainbow-delimiters.el index 97a22d22..c4a4b644 100644 --- a/elpa/rainbow-delimiters-20150320.17/rainbow-delimiters.el +++ b/elpa/rainbow-delimiters-20170929.1132/rainbow-delimiters.el @@ -2,13 +2,13 @@ ;; Copyright (C) ;; 2010-2013 Jeremy Rayman -;; 2013-2015 Fanael Linithien +;; 2013-2016 Fanael Linithien ;; Author: Jeremy Rayman ;; Fanael Linithien ;; Maintainer: Fanael Linithien ;; Created: 2010-09-02 -;; Version: 2.1.1 -;; Package-Version: 20150320.17 +;; Version: 2.1.3 +;; Package-Version: 20170929.1132 ;; Keywords: faces, convenience, lisp, tools ;; Homepage: https://github.com/Fanael/rainbow-delimiters @@ -105,14 +105,20 @@ The function should not move the point or mark or change the match data." :type 'function :group 'rainbow-delimiters) +(defface rainbow-delimiters-base-face + '((default (:inherit unspecified))) + "Face inherited by all other rainbow-delimiter faces." + :group 'rainbow-delimiters-faces) + (defface rainbow-delimiters-unmatched-face - '((((background light)) (:foreground "#88090B")) - (((background dark)) (:foreground "#88090B"))) + '((default (:inherit rainbow-delimiters-base-face)) + (((background light)) (:foreground "#88090B")) + (((background dark)) (:inherit rainbow-delimiters-base-face :foreground "#88090B"))) "Face to highlight unmatched closing delimiters in." :group 'rainbow-delimiters-faces) (defface rainbow-delimiters-mismatched-face - '((t :inherit rainbow-delimiters-unmatched-face)) + '((t :inherit (rainbow-delimiters-unmatched-face rainbow-delimiters-base-face))) "Face to highlight mismatched closing delimiters in." :group 'rainbow-delimiters-faces) @@ -125,7 +131,8 @@ The function should not move the point or mark or change the match data." "#b0b0b3" "#90a890" "#a2b6da" "#9cb6ad"])) (dotimes (i 9) (push `(defface ,(intern (format "rainbow-delimiters-depth-%d-face" (1+ i))) - '((((class color) (background light)) :foreground ,(aref light-colors i)) + '((default (:inherit rainbow-delimiters-base-face)) + (((class color) (background light)) :foreground ,(aref light-colors i)) (((class color) (background dark)) :foreground ,(aref dark-colors i))) ,(format "Nested delimiter face, depth %d." (1+ i)) :group 'rainbow-delimiters-faces) @@ -221,8 +228,7 @@ Returns t if char at loc meets one of the following conditions: "Highlight delimiters in region between point and END. Used by font-lock for dynamic highlighting." - (let* ((inhibit-point-motion-hooks t) - (last-ppss-pos (point)) + (let* ((last-ppss-pos (point)) (ppss (syntax-ppss))) (while (> end (progn (skip-syntax-forward "^()" end) (point))) @@ -262,7 +268,7 @@ Used by font-lock for dynamic highlighting." (when rainbow-delimiters-mode (font-lock-add-keywords nil rainbow-delimiters--font-lock-keywords 'append) (set (make-local-variable 'jit-lock-contextually) t) - (when (or syntax-begin-function + (when (or (bound-and-true-p syntax-begin-function) (bound-and-true-p font-lock-beginning-of-syntax-function)) ;; We're going to modify `syntax-begin-function', so flush the cache to ;; avoid getting cached values that used the old value. @@ -270,7 +276,8 @@ Used by font-lock for dynamic highlighting." ;; `syntax-begin-function' may break the assumption we rely on that ;; `syntax-ppss' is exactly equivalent to `parse-partial-sexp' from ;; `point-min'. Just don't use it, the performance hit should be negligible. - (set (make-local-variable 'syntax-begin-function) nil) + (when (boundp 'syntax-begin-function) + (set (make-local-variable 'syntax-begin-function) nil)) ;; Obsolete equivalent of `syntax-begin-function'. (when (boundp 'font-lock-beginning-of-syntax-function) (set (make-local-variable 'font-lock-beginning-of-syntax-function) nil))) diff --git a/elpa/rainbow-mode-0.12.signed b/elpa/rainbow-mode-0.12.signed deleted file mode 100644 index 61c4b796..00000000 --- a/elpa/rainbow-mode-0.12.signed +++ /dev/null @@ -1 +0,0 @@ -Good signature from 474F05837FBDEF9B GNU ELPA Signing Agent (trust undefined) created at 2015-10-13T11:05:02+0200 using DSA \ No newline at end of file diff --git a/elpa/rainbow-mode-0.12/rainbow-mode-pkg.el b/elpa/rainbow-mode-0.12/rainbow-mode-pkg.el deleted file mode 100644 index e39ad9cd..00000000 --- a/elpa/rainbow-mode-0.12/rainbow-mode-pkg.el +++ /dev/null @@ -1 +0,0 @@ -(define-package "rainbow-mode" "0.12" "Colorize color names in buffers" 'nil :url "http://elpa.gnu.org/packages/rainbow-mode.html" :keywords '("faces")) diff --git a/elpa/rainbow-mode-0.12/rainbow-mode-autoloads.el b/elpa/rainbow-mode-1.0.1/rainbow-mode-autoloads.el similarity index 60% rename from elpa/rainbow-mode-0.12/rainbow-mode-autoloads.el rename to elpa/rainbow-mode-1.0.1/rainbow-mode-autoloads.el index 5c8b01fd..db96c6a4 100644 --- a/elpa/rainbow-mode-0.12/rainbow-mode-autoloads.el +++ b/elpa/rainbow-mode-1.0.1/rainbow-mode-autoloads.el @@ -1,10 +1,12 @@ ;;; rainbow-mode-autoloads.el --- automatically extracted autoloads ;; ;;; Code: -(add-to-list 'load-path (or (file-name-directory #$) (car load-path))) + +(add-to-list 'load-path (directory-file-name + (or (file-name-directory #$) (car load-path)))) + -;;;### (autoloads nil "rainbow-mode" "rainbow-mode.el" (22216 26216 -;;;;;; 0 0)) +;;;### (autoloads nil "rainbow-mode" "rainbow-mode.el" (0 0 0 0)) ;;; Generated autoloads from rainbow-mode.el (autoload 'rainbow-mode "rainbow-mode" "\ @@ -13,10 +15,7 @@ This will fontify with colors the string like \"#aabbcc\" or \"blue\". \(fn &optional ARG)" t nil) -;;;*** - -;;;### (autoloads nil nil ("rainbow-mode-pkg.el") (22216 26216 901245 -;;;;;; 0)) +(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "rainbow-mode" '("rainbow-"))) ;;;*** @@ -24,5 +23,6 @@ This will fontify with colors the string like \"#aabbcc\" or \"blue\". ;; version-control: never ;; no-byte-compile: t ;; no-update-autoloads: t +;; coding: utf-8 ;; End: ;;; rainbow-mode-autoloads.el ends here diff --git a/elpa/rainbow-mode-1.0.1/rainbow-mode-pkg.el b/elpa/rainbow-mode-1.0.1/rainbow-mode-pkg.el new file mode 100644 index 00000000..b9c51fb1 --- /dev/null +++ b/elpa/rainbow-mode-1.0.1/rainbow-mode-pkg.el @@ -0,0 +1,2 @@ +;;; -*- no-byte-compile: t -*- +(define-package "rainbow-mode" "1.0.1" "Colorize color names in buffers" 'nil :url "http://elpa.gnu.org/packages/rainbow-mode.html" :keywords '("faces")) diff --git a/elpa/rainbow-mode-0.12/rainbow-mode.el b/elpa/rainbow-mode-1.0.1/rainbow-mode.el similarity index 93% rename from elpa/rainbow-mode-0.12/rainbow-mode.el rename to elpa/rainbow-mode-1.0.1/rainbow-mode.el index 29200280..0037cf85 100644 --- a/elpa/rainbow-mode-0.12/rainbow-mode.el +++ b/elpa/rainbow-mode-1.0.1/rainbow-mode.el @@ -1,10 +1,10 @@ ;;; rainbow-mode.el --- Colorize color names in buffers -;; Copyright (C) 2010-2015 Free Software Foundation, Inc +;; Copyright (C) 2010-2018 Free Software Foundation, Inc ;; Author: Julien Danjou ;; Keywords: faces -;; Version: 0.12 +;; Version: 1.0.1 ;; This file is part of GNU Emacs. @@ -44,7 +44,8 @@ :tag "Rainbow" :group 'help) -;; Hexadecimal colors +;;; Hexadecimal colors + (defvar rainbow-hexadecimal-colors-font-lock-keywords '(("[^&]\\(#\\(?:[0-9a-fA-F]\\{3\\}\\)+\\{1,4\\}\\)" (1 (rainbow-colorize-itself 1))) @@ -58,7 +59,8 @@ (0 (rainbow-colorize-itself)))) "Font-lock keywords to add for hexadecimal colors.") -;; rgb() colors +;;; rgb() colors + (defvar rainbow-html-rgb-colors-font-lock-keywords '(("rgb(\s*\\([0-9]\\{1,3\\}\\(?:\.[0-9]\\)?\\(?:\s*%\\)?\\)\s*,\s*\\([0-9]\\{1,3\\}\\(?:\\.[0-9]\\)?\\(?:\s*%\\)?\\)\s*,\s*\\([0-9]\\{1,3\\}\\(?:\\.[0-9]\\)?\\(?:\s*%\\)?\\)\s*)" (0 (rainbow-colorize-rgb))) @@ -70,7 +72,8 @@ (0 (rainbow-colorize-hsl)))) "Font-lock keywords to add for RGB colors.") -;; HTML colors name +;;; HTML colors + (defvar rainbow-html-colors-font-lock-keywords nil "Font-lock keywords to add for HTML colors.") (make-variable-buffer-local 'rainbow-html-colors-font-lock-keywords) @@ -225,12 +228,14 @@ ("YellowGreen" . "#9ACD32")) "Alist of HTML colors. Each entry should have the form (COLOR-NAME . HEXADECIMAL-COLOR)." + :type 'alist :group 'rainbow) (defcustom rainbow-html-colors-major-mode-list '(html-mode css-mode php-mode nxml-mode xml-mode) "List of major mode where HTML colors are enabled when `rainbow-html-colors' is set to auto." + :type '(repeat (symbol :tag "Major-Mode")) :group 'rainbow) (defcustom rainbow-html-colors 'auto @@ -239,9 +244,13 @@ If set to t, the HTML colors will be enabled. If set to nil, the HTML colors will not be enabled. If set to auto, the HTML colors will be enabled if a major mode has been detected from the `rainbow-html-colors-major-mode-list'." + :type '(choice (symbol :tag "enable in certain modes" auto) + (symbol :tag "enable globally" t) + (symbol :tag "disable" nil)) :group 'rainbow) -;; X colors +;;; X colors + (defvar rainbow-x-colors-font-lock-keywords `((,(regexp-opt (x-defined-colors) 'words) (0 (rainbow-colorize-itself)))) @@ -251,6 +260,7 @@ will be enabled if a major mode has been detected from the '(emacs-lisp-mode lisp-interaction-mode c-mode c++-mode java-mode) "List of major mode where X colors are enabled when `rainbow-x-colors' is set to auto." + :type '(repeat (symbol :tag "Major-Mode")) :group 'rainbow) (defcustom rainbow-x-colors 'auto @@ -259,9 +269,13 @@ If set to t, the X colors will be enabled. If set to nil, the X colors will not be enabled. If set to auto, the X colors will be enabled if a major mode has been detected from the `rainbow-x-colors-major-mode-list'." + :type '(choice (symbol :tag "enable in certain modes" auto) + (symbol :tag "enable globally" t) + (symbol :tag "disable" nil)) :group 'rainbow) -;; LaTeX colors +;;; LaTeX colors + (defvar rainbow-latex-rgb-colors-font-lock-keywords '(("{rgb}{\\([0-9.]+\\),\s*\\([0-9.]+\\),\s*\\([0-9.]+\\)}" (0 (rainbow-colorize-rgb-float))) @@ -275,6 +289,7 @@ will be enabled if a major mode has been detected from the '(latex-mode) "List of major mode where LaTeX colors are enabled when `rainbow-x-colors' is set to auto." + :type '(repeat (symbol :tag "Major-Mode")) :group 'rainbow) (defcustom rainbow-latex-colors 'auto @@ -283,9 +298,13 @@ If set to t, the LaTeX colors will be enabled. If set to nil, the LaTeX colors will not be enabled. If set to auto, the LaTeX colors will be enabled if a major mode has been detected from the `rainbow-latex-colors-major-mode-list'." + :type '(choice (symbol :tag "enable in certain modes" auto) + (symbol :tag "enable globally" t) + (symbol :tag "disable" nil)) :group 'rainbow) -;; Shell colors +;;; Shell colors + (defvar rainbow-ansi-colors-font-lock-keywords '(("\\(\\\\[eE]\\|\\\\033\\|\\\\x1[bB]\\|\033\\)\\[\\([0-9;]*m\\)" (0 (rainbow-colorize-ansi)))) @@ -295,6 +314,7 @@ will be enabled if a major mode has been detected from the '(sh-mode c-mode c++-mode) "List of major mode where ANSI colors are enabled when `rainbow-ansi-colors' is set to auto." + :type '(repeat (symbol :tag "Major-Mode")) :group 'rainbow) (defcustom rainbow-ansi-colors 'auto @@ -303,11 +323,13 @@ If set to t, the ANSI colors will be enabled. If set to nil, the ANSI colors will not be enabled. If set to auto, the ANSI colors will be enabled if a major mode has been detected from the `rainbow-ansi-colors-major-mode-list'." + :type '(choice (symbol :tag "enable in certain modes" auto) + (symbol :tag "enable globally" t) + (symbol :tag "disable" nil)) :group 'rainbow) -;; R colors +;;; R colors -;; R colors name (defvar rainbow-r-colors-font-lock-keywords nil "Font-lock keywords to add for R colors.") (make-variable-buffer-local 'rainbow-r-colors-font-lock-keywords) @@ -975,11 +997,14 @@ will be enabled if a major mode has been detected from the ("yellowgreen" . "#9ACD32")) "Alist of R colors. Each entry should have the form (COLOR-NAME . HEXADECIMAL-COLOR)." + :type 'alist :group 'rainbow) + (defcustom rainbow-r-colors-major-mode-list '(ess-mode) "List of major mode where R colors are enabled when `rainbow-r-colors' is set to auto." + :type '(repeat (symbol :tag "Major-Mode")) :group 'rainbow) (defcustom rainbow-r-colors 'auto @@ -988,10 +1013,13 @@ If set to t, the R colors will be enabled. If set to nil, the R colors will not be enabled. If set to auto, the R colors will be enabled if a major mode has been detected from the `rainbow-r-colors-major-mode-list'." + :type '(choice (symbol :tag "enable in certain modes" auto) + (symbol :tag "enable globally" t) + (symbol :tag "disable" nil)) :group 'rainbow) +;;; Functions -;; Functions (defun rainbow-colorize-match (color &optional match) "Return a matched string propertized with a face whose background is COLOR. The foreground is computed using @@ -1033,7 +1061,7 @@ If the percentage value is above 100, it's converted to 100." (l (/ (string-to-number (match-string-no-properties 3)) 100.0))) (rainbow-colorize-match (multiple-value-bind (r g b) - (color-hsl-to-rgb h s l) + (color-hsl-to-rgb h s l) (format "#%02X%02X%02X" (* r 255) (* g 255) (* b 255)))))) (defun rainbow-colorize-rgb () @@ -1073,7 +1101,7 @@ If the percentage value is above 100, it's converted to 100." 0 (if xterm-color? 'face 'font-lock-face) applied))) - (unless (listp (car face-property)) + (unless (listp (or (car-safe face-property) face-property)) (setq face-property (list face-property))) (setq color (funcall (if xterm-color? 'cadr 'cdr) (or (assq (if xterm-color? @@ -1088,7 +1116,7 @@ If the percentage value is above 100, it's converted to 100." (rainbow-colorize-match color)))) (defun rainbow-color-luminance (red green blue) - "Calculate the luminance of color composed of RED, BLUE and GREEN. + "Calculate the luminance of color composed of RED, GREEN and BLUE. Return a value between 0 and 1." (/ (+ (* .2126 red) (* .7152 green) (* .0722 blue)) 256)) @@ -1096,11 +1124,13 @@ Return a value between 0 and 1." "Calculate the luminance of a color string (e.g. \"#ffaa00\", \"blue\"). Return a value between 0 and 1." (let* ((values (x-color-values color)) - (r (/ (car values) 256.0)) + (r (/ (car values) 256.0)) (g (/ (cadr values) 256.0)) - (b (/ (caddr values) 256.0))) + (b (/ (caddr values) 256.0))) (rainbow-color-luminance r g b))) +;;; Mode + (defun rainbow-turn-on () "Turn on raibow-mode." (font-lock-add-keywords nil @@ -1174,6 +1204,41 @@ This will fontify with colors the string like \"#aabbcc\" or \"blue\"." ;;;; ChangeLog: +;; 2018-05-21 Julien Danjou +;; +;; * rainbow-mode/rainbow-mode.el: do not fail if face-property is a symbol +;; +;; It turns out there are cases when `face-property' can be just a symbol +;; and we need to protect our selves from that, i.e. `car' should not fail. +;; Hence, +;; `car-safe' is there and if it's `nil', then fall back to `face-property' +;; as is. +;; +;; See https://github.com/tarsius/hl-todo/issues/17 +;; +;; 2018-03-26 Julien Danjou +;; +;; rainbow-mode: release 1.0 +;; +;; 2018-03-26 Jonas Bernoulli +;; +;; Allow outline-minor-mode to find section headings +;; +;; 2018-03-26 Jonas Bernoulli +;; +;; Set type of customizable options +;; +;; 2018-03-26 Jonas Bernoulli +;; +;; Enforce use of spaces for indentation +;; +;; Also untabify some code added by a contributor who, unlike you, has not +;; globally set `indent-tabs-mode' to nil. +;; +;; 2017-05-29 Julien Danjou +;; +;; Fix `rainbow-color-luminance' docstring +;; ;; 2015-10-12 Julien Danjou ;; ;; rainbow: add font-lock at the end @@ -1251,4 +1316,7 @@ This will fontify with colors the string like \"#aabbcc\" or \"blue\"." (provide 'rainbow-mode) +;; Local Variables: +;; indent-tabs-mode: nil +;; End: ;;; rainbow-mode.el ends here -- 2.47.3