emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/dash f2c0e0d 184/316: Add dash-fontify-mode


From: ELPA Syncer
Subject: [elpa] externals/dash f2c0e0d 184/316: Add dash-fontify-mode
Date: Mon, 15 Feb 2021 15:57:54 -0500 (EST)

branch: externals/dash
commit f2c0e0d3c19dd30268b5fc08163e0436914e24ba
Author: Basil L. Contovounesios <contovob@tcd.ie>
Commit: Basil L. Contovounesios <contovob@tcd.ie>

    Add dash-fontify-mode
    
    This cleans up the fontification code and makes it less intrusive.
    In particular, Dash function calls are no longer fontified, as
    discussed in #303.
    
    * dash.el (dash): Fix custom group description.
    (dash--enable-fontlock): Remove.
    (dash--keywords): New variable.
    (dash--turn-on-fontify-mode): New function.
    (dash-fontify-mode-lighter): New user option.
    (dash-fontify-mode, global-dash-fontify-mode): New autoloaded minor
    modes replacing dash-enable-fontlock, dash-enable-font-lock, etc.
    (dash-enable-fontlock): Update docstring.  Make obsolete in favor of
    global-dash-fontify-mode, which is now called in the :set function.
    (dash-enable-font-lock): Make obsolete alias of
    global-dash-fontify-mode.
    
    * dash-template.texi (Syntax highlighting of dash functions):
    * readme-template.md (Syntax highlighting of dash functions):
    Retitle as "Fontification of special variables" for clarity and
    accuracy and describe dash-fontify-mode instead of the now obsolete
    dash-enable-font-lock.
    
    * README.md:
    * dash.info:
    * dash.texi: Regenerate docs.
    
    Fixes #298.
    Fixes #303.
    Closes #310.
---
 README.md          |  16 +-
 dash-template.texi |  22 ++-
 dash.el            | 455 ++++++++++++++++++-----------------------------------
 dash.info          | 425 +++++++++++++++++++++++++------------------------
 dash.texi          |  22 ++-
 readme-template.md |  16 +-
 6 files changed, 421 insertions(+), 535 deletions(-)

diff --git a/README.md b/README.md
index 5e0f178..21b1d87 100644
--- a/README.md
+++ b/README.md
@@ -38,12 +38,20 @@ To get function combinators:
   cons-cell return value, use `-zip-pair` instead.  During the 2.x
   release cycle the new API is available as `-zip-lists`.
 
-## Syntax highlighting of dash functions
+## Fontification of special variables
 
-Font lock of dash functions in emacs lisp buffers is now optional.
-Include this in your emacs settings to get syntax highlighting:
+Font lock of special Dash variables (`it`, `acc`, etc.) in Emacs Lisp
+buffers can optionally be enabled with the autoloaded minor mode
+`dash-fontify-mode`.  In older Emacs versions which do not dynamically
+detect macros, the minor mode also fontifies Dash macro calls.
 
-    (eval-after-load 'dash '(dash-enable-font-lock))
+To automatically enable the minor mode in all Emacs Lisp buffers, just
+call its autoloaded global counterpart `global-dash-fontify-mode`,
+either interactively or from your `user-init-file`:
+
+```el
+(global-dash-fontify-mode)
+```
 
 ## Functions
 
diff --git a/dash-template.texi b/dash-template.texi
index 79312ac..26c4a24 100644
--- a/dash-template.texi
+++ b/dash-template.texi
@@ -62,7 +62,7 @@ along with this program.  If not, see 
@uref{http://www.gnu.org/licenses/}.
 Installation
 
 * Using in a package::
-* Syntax highlighting of dash functions::
+* Fontification of special variables::
 
 Functions
 
@@ -99,7 +99,7 @@ Alternatively, you can just dump @verb{~dash.el~} or
 
 @menu
 * Using in a package::
-* Syntax highlighting of dash functions::
+* Fontification of special variables::
 @end menu
 
 @node Using in a package
@@ -117,14 +117,22 @@ Add this to the big comment block at the top:
 ;; Package-Requires: ((dash "2.12.1") (dash-functional "1.2.0") (emacs "24"))
 @end lisp
 
-@node Syntax highlighting of dash functions
-@section Syntax highlighting of dash functions
+@node Fontification of special variables
+@section Fontification of special variables
 
-Font lock of dash functions in emacs lisp buffers is now optional.
-Include this in your emacs settings to get syntax highlighting:
+Font lock of special Dash variables (@code{it}, @code{acc}, etc.@:) in
+Emacs Lisp buffers can optionally be enabled with the autoloaded minor
+mode @code{dash-fontify-mode}.  In older Emacs versions which do not
+dynamically detect macros, the minor mode also fontifies Dash macro
+calls.
+
+To automatically enable the minor mode in all Emacs Lisp buffers, just
+call its autoloaded global counterpart
+@code{global-dash-fontify-mode}, either interactively or from your
+@code{user-init-file}:
 
 @lisp
-(eval-after-load 'dash '(dash-enable-font-lock))
+(global-dash-fontify-mode)
 @end lisp
 
 @node Functions
diff --git a/dash.el b/dash.el
index eab6bc2..2c90512 100644
--- a/dash.el
+++ b/dash.el
@@ -45,18 +45,6 @@
   :group 'lisp
   :prefix "dash-")
 
-(defun dash--enable-fontlock (symbol value)
-  (when value
-    (dash-enable-font-lock))
-  (set-default symbol value))
-
-(defcustom dash-enable-fontlock nil
-  "If non-nil, enable fontification of dash functions, macros and
-special values."
-  :type 'boolean
-  :set 'dash--enable-fontlock
-  :group 'dash)
-
 (defmacro !cons (car cdr)
   "Destructive: Set CDR to the cons of CAR and CDR."
   `(setq ,cdr (cons ,car ,cdr)))
@@ -2776,298 +2764,157 @@ structure such as plist or alist."
   (declare (pure t) (side-effect-free t))
   (-tree-map 'identity list))
 
-(defun dash-enable-font-lock ()
-  "Add syntax highlighting to dash functions, macros and magic values."
-  (eval-after-load 'lisp-mode
-    '(progn
-       (let ((new-keywords '(
-                             "!cons"
-                             "!cdr"
-                             "-each"
-                             "--each"
-                             "-each-indexed"
-                             "--each-indexed"
-                             "-each-while"
-                             "--each-while"
-                             "-doto"
-                             "-dotimes"
-                             "--dotimes"
-                             "-map"
-                             "--map"
-                             "-reduce-from"
-                             "--reduce-from"
-                             "-reduce"
-                             "--reduce"
-                             "-reduce-r-from"
-                             "--reduce-r-from"
-                             "-reduce-r"
-                             "--reduce-r"
-                             "-reductions-from"
-                             "-reductions-r-from"
-                             "-reductions"
-                             "-reductions-r"
-                             "-filter"
-                             "--filter"
-                             "-select"
-                             "--select"
-                             "-remove"
-                             "--remove"
-                             "-reject"
-                             "--reject"
-                             "-remove-first"
-                             "--remove-first"
-                             "-reject-first"
-                             "--reject-first"
-                             "-remove-last"
-                             "--remove-last"
-                             "-reject-last"
-                             "--reject-last"
-                             "-remove-item"
-                             "-non-nil"
-                             "-keep"
-                             "--keep"
-                             "-map-indexed"
-                             "--map-indexed"
-                             "-splice"
-                             "--splice"
-                             "-splice-list"
-                             "--splice-list"
-                             "-map-when"
-                             "--map-when"
-                             "-replace-where"
-                             "--replace-where"
-                             "-map-first"
-                             "--map-first"
-                             "-map-last"
-                             "--map-last"
-                             "-replace"
-                             "-replace-first"
-                             "-replace-last"
-                             "-flatten"
-                             "-flatten-n"
-                             "-concat"
-                             "-mapcat"
-                             "--mapcat"
-                             "-copy"
-                             "-cons*"
-                             "-snoc"
-                             "-first"
-                             "--first"
-                             "-find"
-                             "--find"
-                             "-some"
-                             "--some"
-                             "-any"
-                             "--any"
-                             "-last"
-                             "--last"
-                             "-first-item"
-                             "-second-item"
-                             "-third-item"
-                             "-fourth-item"
-                             "-fifth-item"
-                             "-last-item"
-                             "-butlast"
-                             "-count"
-                             "--count"
-                             "-any?"
-                             "--any?"
-                             "-some?"
-                             "--some?"
-                             "-any-p"
-                             "--any-p"
-                             "-some-p"
-                             "--some-p"
-                             "-some->"
-                             "-some->>"
-                             "-some-->"
-                             "-all?"
-                             "-all-p"
-                             "--all?"
-                             "--all-p"
-                             "-every?"
-                             "--every?"
-                             "-all-p"
-                             "--all-p"
-                             "-every-p"
-                             "--every-p"
-                             "-none?"
-                             "--none?"
-                             "-none-p"
-                             "--none-p"
-                             "-only-some?"
-                             "--only-some?"
-                             "-only-some-p"
-                             "--only-some-p"
-                             "-slice"
-                             "-take"
-                             "-drop"
-                             "-drop-last"
-                             "-take-last"
-                             "-take-while"
-                             "--take-while"
-                             "-drop-while"
-                             "--drop-while"
-                             "-split-at"
-                             "-rotate"
-                             "-insert-at"
-                             "-replace-at"
-                             "-update-at"
-                             "--update-at"
-                             "-remove-at"
-                             "-remove-at-indices"
-                             "-split-with"
-                             "--split-with"
-                             "-split-on"
-                             "-split-when"
-                             "--split-when"
-                             "-separate"
-                             "--separate"
-                             "-partition-all-in-steps"
-                             "-partition-in-steps"
-                             "-partition-all"
-                             "-partition"
-                             "-partition-after-item"
-                             "-partition-after-pred"
-                             "-partition-before-item"
-                             "-partition-before-pred"
-                             "-partition-by"
-                             "--partition-by"
-                             "-partition-by-header"
-                             "--partition-by-header"
-                             "-group-by"
-                             "--group-by"
-                             "-interpose"
-                             "-interleave"
-                             "-unzip"
-                             "-zip-with"
-                             "--zip-with"
-                             "-zip"
-                             "-zip-fill"
-                             "-zip-lists"
-                             "-zip-pair"
-                             "-cycle"
-                             "-pad"
-                             "-annotate"
-                             "--annotate"
-                             "-table"
-                             "-table-flat"
-                             "-partial"
-                             "-elem-index"
-                             "-elem-indices"
-                             "-find-indices"
-                             "--find-indices"
-                             "-find-index"
-                             "--find-index"
-                             "-find-last-index"
-                             "--find-last-index"
-                             "-select-by-indices"
-                             "-select-columns"
-                             "-select-column"
-                             "-grade-up"
-                             "-grade-down"
-                             "->"
-                             "->>"
-                             "-->"
-                             "-as->"
-                             "-when-let"
-                             "-when-let*"
-                             "--when-let"
-                             "-if-let"
-                             "-if-let*"
-                             "--if-let"
-                             "-let*"
-                             "-let"
-                             "-lambda"
-                             "-distinct"
-                             "-uniq"
-                             "-union"
-                             "-intersection"
-                             "-difference"
-                             "-powerset"
-                             "-permutations"
-                             "-inits"
-                             "-tails"
-                             "-common-prefix"
-                             "-common-suffix"
-                             "-contains?"
-                             "-contains-p"
-                             "-same-items?"
-                             "-same-items-p"
-                             "-is-prefix-p"
-                             "-is-prefix?"
-                             "-is-suffix-p"
-                             "-is-suffix?"
-                             "-is-infix-p"
-                             "-is-infix?"
-                             "-sort"
-                             "--sort"
-                             "-list"
-                             "-repeat"
-                             "-sum"
-                             "-running-sum"
-                             "-product"
-                             "-running-product"
-                             "-max"
-                             "-min"
-                             "-max-by"
-                             "--max-by"
-                             "-min-by"
-                             "--min-by"
-                             "-iterate"
-                             "--iterate"
-                             "-fix"
-                             "--fix"
-                             "-unfold"
-                             "--unfold"
-                             "-cons-pair?"
-                             "-cons-pair-p"
-                             "-cons-to-list"
-                             "-value-to-list"
-                             "-tree-mapreduce-from"
-                             "--tree-mapreduce-from"
-                             "-tree-mapreduce"
-                             "--tree-mapreduce"
-                             "-tree-map"
-                             "--tree-map"
-                             "-tree-reduce-from"
-                             "--tree-reduce-from"
-                             "-tree-reduce"
-                             "--tree-reduce"
-                             "-tree-seq"
-                             "--tree-seq"
-                             "-tree-map-nodes"
-                             "--tree-map-nodes"
-                             "-clone"
-                             "-rpartial"
-                             "-juxt"
-                             "-applify"
-                             "-on"
-                             "-flip"
-                             "-const"
-                             "-cut"
-                             "-orfn"
-                             "-andfn"
-                             "-iteratefn"
-                             "-fixfn"
-                             "-prodfn"
-                             ))
-             (special-variables '(
-                                  "it"
-                                  "it-index"
-                                  "acc"
-                                  "other"
-                                  )))
-         (font-lock-add-keywords 'emacs-lisp-mode `((,(concat "\\_<" 
(regexp-opt special-variables 'paren) "\\_>")
-                                                     1 
font-lock-variable-name-face)) 'append)
-         (font-lock-add-keywords 'emacs-lisp-mode `((,(concat "(\\s-*" 
(regexp-opt new-keywords 'paren) "\\_>")
-                                                     1 
font-lock-keyword-face)) 'append))
-       (--each (buffer-list)
-         (with-current-buffer it
-           (when (and (eq major-mode 'emacs-lisp-mode)
-                      (boundp 'font-lock-mode)
-                      font-lock-mode)
-             (font-lock-refresh-defaults)))))))
+;;; Font lock
+
+(defvar dash--keywords
+  `(;; TODO: Do not fontify the following automatic variables
+    ;; globally; detect and limit to their local anaphoric scope.
+    (,(concat "\\_<" (regexp-opt '("acc" "it" "it-index" "other")) "\\_>")
+     0 font-lock-variable-name-face)
+    ;; Elisp macro fontification was static prior to Emacs 25.
+    ,@(when (< emacs-major-version 25)
+        (let ((macs '("!cdr"
+                      "!cons"
+                      "-->"
+                      "--all?"
+                      "--annotate"
+                      "--any?"
+                      "--count"
+                      "--dotimes"
+                      "--doto"
+                      "--drop-while"
+                      "--each"
+                      "--each-r"
+                      "--each-r-while"
+                      "--each-while"
+                      "--filter"
+                      "--find-index"
+                      "--find-indices"
+                      "--find-last-index"
+                      "--first"
+                      "--fix"
+                      "--group-by"
+                      "--if-let"
+                      "--iterate"
+                      "--keep"
+                      "--last"
+                      "--map"
+                      "--map-first"
+                      "--map-indexed"
+                      "--map-last"
+                      "--map-when"
+                      "--mapcat"
+                      "--max-by"
+                      "--min-by"
+                      "--none?"
+                      "--only-some?"
+                      "--partition-by"
+                      "--partition-by-header"
+                      "--reduce"
+                      "--reduce-from"
+                      "--reduce-r"
+                      "--reduce-r-from"
+                      "--remove"
+                      "--remove-first"
+                      "--remove-last"
+                      "--separate"
+                      "--some"
+                      "--sort"
+                      "--splice"
+                      "--splice-list"
+                      "--split-when"
+                      "--split-with"
+                      "--take-while"
+                      "--tree-map"
+                      "--tree-map-nodes"
+                      "--tree-mapreduce"
+                      "--tree-mapreduce-from"
+                      "--tree-reduce"
+                      "--tree-reduce-from"
+                      "--tree-seq"
+                      "--unfold"
+                      "--update-at"
+                      "--when-let"
+                      "--zip-with"
+                      "->"
+                      "->>"
+                      "-as->"
+                      "-doto"
+                      "-if-let"
+                      "-if-let*"
+                      "-lambda"
+                      "-let"
+                      "-let*"
+                      "-setq"
+                      "-some-->"
+                      "-some->"
+                      "-some->>"
+                      "-split-on"
+                      "-when-let"
+                      "-when-let*")))
+          `((,(concat "(" (regexp-opt macs 'symbols)) . 1)))))
+  "Font lock keywords for `dash-fontify-mode'.")
+
+(defcustom dash-fontify-mode-lighter nil
+  "Mode line lighter for `dash-fontify-mode'.
+Either a string to display in the mode line when
+`dash-fontify-mode' is on, or nil to display
+nothing (the default)."
+  :package-version '(dash . "2.18.0")
+  :group 'dash
+  :type '(choice (string :tag "Lighter" :value " Dash")
+                 (const :tag "Nothing" nil)))
+
+;;;###autoload
+(define-minor-mode dash-fontify-mode
+  "Toggle fontification of Dash special variables.
+
+Dash-Fontify mode is a buffer-local minor mode intended for Emacs
+Lisp buffers.  Enabling it causes the special variables bound in
+anaphoric Dash macros to be fontified.  These anaphoras include
+`it', `it-index', `acc', and `other'.  In older Emacs versions
+which do not dynamically detect macros, Dash-Fontify mode
+additionally fontifies Dash macro calls.
+
+See also `dash-fontify-mode-lighter' and
+`global-dash-fontify-mode'."
+  :group 'dash :lighter dash-fontify-mode-lighter
+  (if dash-fontify-mode
+      (font-lock-add-keywords nil dash--keywords t)
+    (font-lock-remove-keywords nil dash--keywords))
+  (cond ((fboundp 'font-lock-flush) ;; Added in Emacs 25.
+         (font-lock-flush))
+        ;; `font-lock-fontify-buffer' unconditionally enables
+        ;; `font-lock-mode' and is marked `interactive-only' in later
+        ;; Emacs versions which have `font-lock-flush', so we guard
+        ;; and pacify as needed, respectively.
+        (font-lock-mode
+         (with-no-warnings
+           (font-lock-fontify-buffer)))))
+
+(defun dash--turn-on-fontify-mode ()
+  "Enable `dash-fontify-mode' if in an Emacs Lisp buffer."
+  (when (derived-mode-p #'emacs-lisp-mode)
+    (dash-fontify-mode)))
+
+;;;###autoload
+(define-globalized-minor-mode global-dash-fontify-mode
+  dash-fontify-mode dash--turn-on-fontify-mode
+  :group 'dash)
+
+(defcustom dash-enable-fontlock nil
+  "If non-nil, fontify Dash macro calls and special variables."
+  :group 'dash
+  :set (lambda (sym val)
+         (set-default sym val)
+         (global-dash-fontify-mode (if val 1 0)))
+  :type 'boolean)
+
+(make-obsolete-variable
+ 'dash-enable-fontlock #'global-dash-fontify-mode "2.18.0")
+
+(define-obsolete-function-alias
+  'dash-enable-font-lock #'global-dash-fontify-mode "2.17.0")
 
 (provide 'dash)
 ;;; dash.el ends here
diff --git a/dash.info b/dash.info
index a1e7232..8be0a07 100644
--- a/dash.info
+++ b/dash.info
@@ -58,7 +58,7 @@ This manual is for ‘dash.el’ version 2.12.1.
 Installation
 
 * Using in a package::
-* Syntax highlighting of dash functions::
+* Fontification of special variables::
 
 Functions
 
@@ -106,10 +106,10 @@ your load path somewhere.
 * Menu:
 
 * Using in a package::
-* Syntax highlighting of dash functions::
+* Fontification of special variables::
 
 
-File: dash.info,  Node: Using in a package,  Next: Syntax highlighting of dash 
functions,  Up: Installation
+File: dash.info,  Node: Using in a package,  Next: Fontification of special 
variables,  Up: Installation
 
 1.1 Using in a package
 ======================
@@ -123,15 +123,22 @@ To get function combinators:
      ;; Package-Requires: ((dash "2.12.1") (dash-functional "1.2.0") (emacs 
"24"))
 
 
-File: dash.info,  Node: Syntax highlighting of dash functions,  Prev: Using in 
a package,  Up: Installation
+File: dash.info,  Node: Fontification of special variables,  Prev: Using in a 
package,  Up: Installation
 
-1.2 Syntax highlighting of dash functions
-=========================================
+1.2 Fontification of special variables
+======================================
 
-Font lock of dash functions in emacs lisp buffers is now optional.
-Include this in your emacs settings to get syntax highlighting:
+Font lock of special Dash variables (‘it’, ‘acc’, etc.) in Emacs Lisp
+buffers can optionally be enabled with the autoloaded minor mode
+‘dash-fontify-mode’.  In older Emacs versions which do not dynamically
+detect macros, the minor mode also fontifies Dash macro calls.
 
-     (eval-after-load 'dash '(dash-enable-font-lock))
+   To automatically enable the minor mode in all Emacs Lisp buffers,
+just call its autoloaded global counterpart
+‘global-dash-fontify-mode’, either interactively or from your
+‘user-init-file’:
+
+     (global-dash-fontify-mode)
 
 
 File: dash.info,  Node: Functions,  Next: Development,  Prev: Installation,  
Up: Top
@@ -3215,206 +3222,206 @@ Index
 
 Tag Table:
 Node: Top946
-Node: Installation2425
-Node: Using in a package2995
-Node: Syntax highlighting of dash functions3359
-Node: Functions3742
-Node: Maps4953
-Ref: -map5248
-Ref: -map-when5589
-Ref: -map-first6172
-Ref: -map-last6650
-Ref: -map-indexed7123
-Ref: -annotate7603
-Ref: -splice8093
-Ref: -splice-list8874
-Ref: -mapcat9336
-Ref: -copy9712
-Node: Sublist selection9916
-Ref: -filter10109
-Ref: -remove10561
-Ref: -remove-first10972
-Ref: -remove-last11499
-Ref: -remove-item12020
-Ref: -non-nil12415
-Ref: -slice12574
-Ref: -take13106
-Ref: -take-last13414
-Ref: -drop13737
-Ref: -drop-last14010
-Ref: -take-while14270
-Ref: -drop-while14620
-Ref: -select-by-indices14976
-Ref: -select-columns15490
-Ref: -select-column16195
-Node: List to list16658
-Ref: -keep16850
-Ref: -concat17353
-Ref: -flatten17650
-Ref: -flatten-n18409
-Ref: -replace18796
-Ref: -replace-first19259
-Ref: -replace-last19756
-Ref: -insert-at20246
-Ref: -replace-at20573
-Ref: -update-at20968
-Ref: -remove-at21459
-Ref: -remove-at-indices21947
-Node: Reductions22529
-Ref: -reduce-from22698
-Ref: -reduce-r-from23464
-Ref: -reduce24231
-Ref: -reduce-r24965
-Ref: -reductions-from25835
-Ref: -reductions-r-from26550
-Ref: -reductions27275
-Ref: -reductions-r27900
-Ref: -count28535
-Ref: -sum28759
-Ref: -running-sum28948
-Ref: -product29241
-Ref: -running-product29450
-Ref: -inits29763
-Ref: -tails30011
-Ref: -common-prefix30258
-Ref: -common-suffix30555
-Ref: -min30852
-Ref: -min-by31078
-Ref: -max31601
-Ref: -max-by31826
-Node: Unfolding32354
-Ref: -iterate32593
-Ref: -unfold33038
-Node: Predicates33846
-Ref: -any?33970
-Ref: -all?34290
-Ref: -none?34620
-Ref: -only-some?34922
-Ref: -contains?35407
-Ref: -same-items?35796
-Ref: -is-prefix?36181
-Ref: -is-suffix?36504
-Ref: -is-infix?36827
-Node: Partitioning37181
-Ref: -split-at37369
-Ref: -split-with37654
-Ref: -split-on38057
-Ref: -split-when38733
-Ref: -separate39373
-Ref: -partition39815
-Ref: -partition-all40267
-Ref: -partition-in-steps40695
-Ref: -partition-all-in-steps41192
-Ref: -partition-by41677
-Ref: -partition-by-header42059
-Ref: -partition-after-pred42663
-Ref: -partition-before-pred43007
-Ref: -partition-before-item43358
-Ref: -partition-after-item43669
-Ref: -group-by43975
-Node: Indexing44412
-Ref: -elem-index44614
-Ref: -elem-indices45009
-Ref: -find-index45392
-Ref: -find-last-index45881
-Ref: -find-indices46385
-Ref: -grade-up46793
-Ref: -grade-down47196
-Node: Set operations47606
-Ref: -union47789
-Ref: -difference48231
-Ref: -intersection48648
-Ref: -powerset49085
-Ref: -permutations49298
-Ref: -distinct49598
-Node: Other list operations49976
-Ref: -rotate50201
-Ref: -repeat50571
-Ref: -cons*50834
-Ref: -snoc51221
-Ref: -interpose51634
-Ref: -interleave51932
-Ref: -zip-with52301
-Ref: -zip53018
-Ref: -zip-lists53850
-Ref: -zip-fill54551
-Ref: -unzip54874
-Ref: -cycle55619
-Ref: -pad55992
-Ref: -table56315
-Ref: -table-flat57105
-Ref: -first58114
-Ref: -some58486
-Ref: -last58795
-Ref: -first-item59129
-Ref: -second-item59545
-Ref: -third-item59825
-Ref: -fourth-item60103
-Ref: -fifth-item60369
-Ref: -last-item60631
-Ref: -butlast60923
-Ref: -sort61170
-Ref: -list61658
-Ref: -fix61989
-Node: Tree operations62529
-Ref: -tree-seq62725
-Ref: -tree-map63583
-Ref: -tree-map-nodes64026
-Ref: -tree-reduce64881
-Ref: -tree-reduce-from65763
-Ref: -tree-mapreduce66364
-Ref: -tree-mapreduce-from67224
-Ref: -clone68510
-Node: Threading macros68838
-Ref: ->68983
-Ref: ->>69475
-Ref: -->69980
-Ref: -as->70541
-Ref: -some->70996
-Ref: -some->>71370
-Ref: -some-->71806
-Node: Binding72277
-Ref: -when-let72489
-Ref: -when-let*72974
-Ref: -if-let73502
-Ref: -if-let*73897
-Ref: -let74514
-Ref: -let*80602
-Ref: -lambda81543
-Ref: -setq82345
-Node: Side-effects83161
-Ref: -each83355
-Ref: -each-while83762
-Ref: -each-indexed84122
-Ref: -each-r84640
-Ref: -each-r-while85073
-Ref: -dotimes85448
-Ref: -doto85751
-Ref: --doto86178
-Node: Destructive operations86453
-Ref: !cons86626
-Ref: !cdr86832
-Node: Function combinators87027
-Ref: -partial87301
-Ref: -rpartial87694
-Ref: -juxt88096
-Ref: -compose88528
-Ref: -applify89086
-Ref: -on89517
-Ref: -flip90043
-Ref: -const90355
-Ref: -cut90699
-Ref: -not91185
-Ref: -orfn91495
-Ref: -andfn91929
-Ref: -iteratefn92424
-Ref: -fixfn93127
-Ref: -prodfn94696
-Node: Development95765
-Node: Contribute96114
-Node: Changes96862
-Node: Contributors99861
-Node: Index101485
+Node: Installation2422
+Node: Using in a package2989
+Node: Fontification of special variables3350
+Node: Functions4054
+Node: Maps5265
+Ref: -map5560
+Ref: -map-when5901
+Ref: -map-first6484
+Ref: -map-last6962
+Ref: -map-indexed7435
+Ref: -annotate7915
+Ref: -splice8405
+Ref: -splice-list9186
+Ref: -mapcat9648
+Ref: -copy10024
+Node: Sublist selection10228
+Ref: -filter10421
+Ref: -remove10873
+Ref: -remove-first11284
+Ref: -remove-last11811
+Ref: -remove-item12332
+Ref: -non-nil12727
+Ref: -slice12886
+Ref: -take13418
+Ref: -take-last13726
+Ref: -drop14049
+Ref: -drop-last14322
+Ref: -take-while14582
+Ref: -drop-while14932
+Ref: -select-by-indices15288
+Ref: -select-columns15802
+Ref: -select-column16507
+Node: List to list16970
+Ref: -keep17162
+Ref: -concat17665
+Ref: -flatten17962
+Ref: -flatten-n18721
+Ref: -replace19108
+Ref: -replace-first19571
+Ref: -replace-last20068
+Ref: -insert-at20558
+Ref: -replace-at20885
+Ref: -update-at21280
+Ref: -remove-at21771
+Ref: -remove-at-indices22259
+Node: Reductions22841
+Ref: -reduce-from23010
+Ref: -reduce-r-from23776
+Ref: -reduce24543
+Ref: -reduce-r25277
+Ref: -reductions-from26147
+Ref: -reductions-r-from26862
+Ref: -reductions27587
+Ref: -reductions-r28212
+Ref: -count28847
+Ref: -sum29071
+Ref: -running-sum29260
+Ref: -product29553
+Ref: -running-product29762
+Ref: -inits30075
+Ref: -tails30323
+Ref: -common-prefix30570
+Ref: -common-suffix30867
+Ref: -min31164
+Ref: -min-by31390
+Ref: -max31913
+Ref: -max-by32138
+Node: Unfolding32666
+Ref: -iterate32905
+Ref: -unfold33350
+Node: Predicates34158
+Ref: -any?34282
+Ref: -all?34602
+Ref: -none?34932
+Ref: -only-some?35234
+Ref: -contains?35719
+Ref: -same-items?36108
+Ref: -is-prefix?36493
+Ref: -is-suffix?36816
+Ref: -is-infix?37139
+Node: Partitioning37493
+Ref: -split-at37681
+Ref: -split-with37966
+Ref: -split-on38369
+Ref: -split-when39045
+Ref: -separate39685
+Ref: -partition40127
+Ref: -partition-all40579
+Ref: -partition-in-steps41007
+Ref: -partition-all-in-steps41504
+Ref: -partition-by41989
+Ref: -partition-by-header42371
+Ref: -partition-after-pred42975
+Ref: -partition-before-pred43319
+Ref: -partition-before-item43670
+Ref: -partition-after-item43981
+Ref: -group-by44287
+Node: Indexing44724
+Ref: -elem-index44926
+Ref: -elem-indices45321
+Ref: -find-index45704
+Ref: -find-last-index46193
+Ref: -find-indices46697
+Ref: -grade-up47105
+Ref: -grade-down47508
+Node: Set operations47918
+Ref: -union48101
+Ref: -difference48543
+Ref: -intersection48960
+Ref: -powerset49397
+Ref: -permutations49610
+Ref: -distinct49910
+Node: Other list operations50288
+Ref: -rotate50513
+Ref: -repeat50883
+Ref: -cons*51146
+Ref: -snoc51533
+Ref: -interpose51946
+Ref: -interleave52244
+Ref: -zip-with52613
+Ref: -zip53330
+Ref: -zip-lists54162
+Ref: -zip-fill54863
+Ref: -unzip55186
+Ref: -cycle55931
+Ref: -pad56304
+Ref: -table56627
+Ref: -table-flat57417
+Ref: -first58426
+Ref: -some58798
+Ref: -last59107
+Ref: -first-item59441
+Ref: -second-item59857
+Ref: -third-item60137
+Ref: -fourth-item60415
+Ref: -fifth-item60681
+Ref: -last-item60943
+Ref: -butlast61235
+Ref: -sort61482
+Ref: -list61970
+Ref: -fix62301
+Node: Tree operations62841
+Ref: -tree-seq63037
+Ref: -tree-map63895
+Ref: -tree-map-nodes64338
+Ref: -tree-reduce65193
+Ref: -tree-reduce-from66075
+Ref: -tree-mapreduce66676
+Ref: -tree-mapreduce-from67536
+Ref: -clone68822
+Node: Threading macros69150
+Ref: ->69295
+Ref: ->>69787
+Ref: -->70292
+Ref: -as->70853
+Ref: -some->71308
+Ref: -some->>71682
+Ref: -some-->72118
+Node: Binding72589
+Ref: -when-let72801
+Ref: -when-let*73286
+Ref: -if-let73814
+Ref: -if-let*74209
+Ref: -let74826
+Ref: -let*80914
+Ref: -lambda81855
+Ref: -setq82657
+Node: Side-effects83473
+Ref: -each83667
+Ref: -each-while84074
+Ref: -each-indexed84434
+Ref: -each-r84952
+Ref: -each-r-while85385
+Ref: -dotimes85760
+Ref: -doto86063
+Ref: --doto86490
+Node: Destructive operations86765
+Ref: !cons86938
+Ref: !cdr87144
+Node: Function combinators87339
+Ref: -partial87613
+Ref: -rpartial88006
+Ref: -juxt88408
+Ref: -compose88840
+Ref: -applify89398
+Ref: -on89829
+Ref: -flip90355
+Ref: -const90667
+Ref: -cut91011
+Ref: -not91497
+Ref: -orfn91807
+Ref: -andfn92241
+Ref: -iteratefn92736
+Ref: -fixfn93439
+Ref: -prodfn95008
+Node: Development96077
+Node: Contribute96426
+Node: Changes97174
+Node: Contributors100173
+Node: Index101797
 
 End Tag Table
 
diff --git a/dash.texi b/dash.texi
index 0284837..6ef77eb 100644
--- a/dash.texi
+++ b/dash.texi
@@ -62,7 +62,7 @@ along with this program.  If not, see 
@uref{http://www.gnu.org/licenses/}.
 Installation
 
 * Using in a package::
-* Syntax highlighting of dash functions::
+* Fontification of special variables::
 
 Functions
 
@@ -114,7 +114,7 @@ Alternatively, you can just dump @verb{~dash.el~} or
 
 @menu
 * Using in a package::
-* Syntax highlighting of dash functions::
+* Fontification of special variables::
 @end menu
 
 @node Using in a package
@@ -132,14 +132,22 @@ Add this to the big comment block at the top:
 ;; Package-Requires: ((dash "2.12.1") (dash-functional "1.2.0") (emacs "24"))
 @end lisp
 
-@node Syntax highlighting of dash functions
-@section Syntax highlighting of dash functions
+@node Fontification of special variables
+@section Fontification of special variables
 
-Font lock of dash functions in emacs lisp buffers is now optional.
-Include this in your emacs settings to get syntax highlighting:
+Font lock of special Dash variables (@code{it}, @code{acc}, etc.@:) in
+Emacs Lisp buffers can optionally be enabled with the autoloaded minor
+mode @code{dash-fontify-mode}.  In older Emacs versions which do not
+dynamically detect macros, the minor mode also fontifies Dash macro
+calls.
+
+To automatically enable the minor mode in all Emacs Lisp buffers, just
+call its autoloaded global counterpart
+@code{global-dash-fontify-mode}, either interactively or from your
+@code{user-init-file}:
 
 @lisp
-(eval-after-load 'dash '(dash-enable-font-lock))
+(global-dash-fontify-mode)
 @end lisp
 
 @node Functions
diff --git a/readme-template.md b/readme-template.md
index 600f19e..8d8dafe 100644
--- a/readme-template.md
+++ b/readme-template.md
@@ -38,12 +38,20 @@ To get function combinators:
   cons-cell return value, use `-zip-pair` instead.  During the 2.x
   release cycle the new API is available as `-zip-lists`.
 
-## Syntax highlighting of dash functions
+## Fontification of special variables
 
-Font lock of dash functions in emacs lisp buffers is now optional.
-Include this in your emacs settings to get syntax highlighting:
+Font lock of special Dash variables (`it`, `acc`, etc.) in Emacs Lisp
+buffers can optionally be enabled with the autoloaded minor mode
+`dash-fontify-mode`.  In older Emacs versions which do not dynamically
+detect macros, the minor mode also fontifies Dash macro calls.
 
-    (eval-after-load 'dash '(dash-enable-font-lock))
+To automatically enable the minor mode in all Emacs Lisp buffers, just
+call its autoloaded global counterpart `global-dash-fontify-mode`,
+either interactively or from your `user-init-file`:
+
+```el
+(global-dash-fontify-mode)
+```
 
 ## Functions
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]