[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dash eaf33b3 226/316: Add info-lookup-symbol support
From: |
ELPA Syncer |
Subject: |
[elpa] externals/dash eaf33b3 226/316: Add info-lookup-symbol support |
Date: |
Mon, 15 Feb 2021 15:58:05 -0500 (EST) |
branch: externals/dash
commit eaf33b334f06389e742b46b84845399d750936e1
Author: Basil L. Contovounesios <contovob@tcd.ie>
Commit: Basil L. Contovounesios <contovob@tcd.ie>
Add info-lookup-symbol support
Provide a command to register the Dash Info index under
emacs-lisp-mode in info-lookup-alist for the benefit of 'C-h S', and
provide an unloader function for unload-feature to undo this.
* dash.el (dash--info-doc-spec, dash--info-elisp-docs)
(dash-register-info-lookup, dash-unload-function): New definitions.
* dash-template.texi (Info symbol lookup):
* readme-template.md (Info symbol lookup): New sections.
* README.md:
* dash.texi: Regenerate docs.
Fixes #326.
---
README.md | 15 +++++++++++++++
dash-template.texi | 19 +++++++++++++++++++
dash.el | 35 ++++++++++++++++++++++++++++++++++-
dash.texi | 19 +++++++++++++++++++
readme-template.md | 15 +++++++++++++++
5 files changed, 102 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 91d69a7..0b29a8c 100644
--- a/README.md
+++ b/README.md
@@ -58,6 +58,21 @@ either interactively or from your `user-init-file`:
(global-dash-fontify-mode)
```
+## Info symbol lookup
+
+While editing Elisp files, you can use `C-h S` (`info-lookup-symbol`)
+to look up Elisp symbols in the relevant Info manuals (see [`(emacs)
+Info
+Lookup`](https://gnu.org/software/emacs/manual/html_node/emacs/Info-Lookup.html)).
+To enable the same for Dash symbols, use the command
+`dash-register-info-lookup`. It can be called directly when needed,
+or automatically from your `user-init-file`. For example:
+
+```el
+(with-eval-after-load 'info-look
+ (dash-register-info-lookup))
+```
+
## Functions
All functions and constructs in the library use a dash (`-`) prefix.
diff --git a/dash-template.texi b/dash-template.texi
index e194078..cb97a3b 100644
--- a/dash-template.texi
+++ b/dash-template.texi
@@ -64,6 +64,7 @@ Installation
* Using in a package:: Listing Dash as a package dependency.
* Fontification of special variables:: Font Lock of anaphoric macro variables.
+* Info symbol lookup:: Looking up Dash symbols in this manual.
Functions
@@ -101,6 +102,7 @@ Alternatively, you can just dump @file{dash.el} or
@menu
* Using in a package:: Listing Dash as a package dependency.
* Fontification of special variables:: Font Lock of anaphoric macro variables.
+* Info symbol lookup:: Looking up Dash symbols in this manual.
@end menu
@node Using in a package
@@ -142,6 +144,23 @@ call its autoloaded global counterpart
(global-dash-fontify-mode)
@end lisp
+@node Info symbol lookup
+@section Info symbol lookup
+
+@findex dash-register-info-lookup
+While editing Elisp files, you can use @kbd{C-h S}
+(@code{info-lookup-symbol}) to look up Elisp symbols in the relevant
+Info manuals (@pxref{Info Lookup,,, emacs, The GNU Emacs Manual}). To
+enable the same for Dash symbols, use the command
+@code{dash-register-info-lookup}. It can be called directly when
+needed, or automatically from your @code{user-init-file}. For
+example:
+
+@lisp
+(with-eval-after-load 'info-look
+ (dash-register-info-lookup))
+@end lisp
+
@node Functions
@chapter Functions
diff --git a/dash.el b/dash.el
index b461ea4..f249f5b 100644
--- a/dash.el
+++ b/dash.el
@@ -2894,7 +2894,7 @@ replaced with new ones. This is useful when you need to
clone a
structure such as plist or alist."
(declare (pure t) (side-effect-free t))
(-tree-map 'identity list))
-
+
;;; Font lock
(defvar dash--keywords
@@ -3050,6 +3050,39 @@ See also `dash-fontify-mode-lighter' and
(define-obsolete-function-alias
'dash-enable-font-lock #'global-dash-fontify-mode "2.18.0")
+
+;;; Info
+
+(defvar dash--info-doc-spec '("(dash) Index" nil "^ -+ .*: " "\\( \\|$\\)")
+ "The Dash :doc-spec entry for `info-lookup-alist'.
+It is based on that for `emacs-lisp-mode'.")
+
+(defun dash--info-elisp-docs ()
+ "Return the `emacs-lisp-mode' symbol docs from `info-lookup-alist'.
+Specifically, return the cons containing their
+`info-lookup->doc-spec' so that we can modify it."
+ (defvar info-lookup-alist)
+ (nthcdr 3 (assq #'emacs-lisp-mode (cdr (assq 'symbol info-lookup-alist)))))
+
+;;;###autoload
+(defun dash-register-info-lookup ()
+ "Register the Dash Info manual with `info-lookup-symbol'.
+This allows Dash symbols to be looked up with \\[info-lookup-symbol]."
+ (interactive)
+ (require 'info-look)
+ (let ((docs (dash--info-elisp-docs)))
+ (setcar docs (append (car docs) (list dash--info-doc-spec)))
+ (info-lookup-reset)))
+
+(defun dash-unload-function ()
+ "Remove Dash from `info-lookup-alist'.
+Used by `unload-feature', which see."
+ (let ((docs (and (featurep 'info-look)
+ (dash--info-elisp-docs))))
+ (when (member dash--info-doc-spec (car docs))
+ (setcar docs (remove dash--info-doc-spec (car docs)))
+ (info-lookup-reset)))
+ nil)
(provide 'dash)
;;; dash.el ends here
diff --git a/dash.texi b/dash.texi
index 866bc29..175035e 100644
--- a/dash.texi
+++ b/dash.texi
@@ -64,6 +64,7 @@ Installation
* Using in a package:: Listing Dash as a package dependency.
* Fontification of special variables:: Font Lock of anaphoric macro variables.
+* Info symbol lookup:: Looking up Dash symbols in this manual.
Functions
@@ -116,6 +117,7 @@ Alternatively, you can just dump @file{dash.el} or
@menu
* Using in a package:: Listing Dash as a package dependency.
* Fontification of special variables:: Font Lock of anaphoric macro variables.
+* Info symbol lookup:: Looking up Dash symbols in this manual.
@end menu
@node Using in a package
@@ -157,6 +159,23 @@ call its autoloaded global counterpart
(global-dash-fontify-mode)
@end lisp
+@node Info symbol lookup
+@section Info symbol lookup
+
+@findex dash-register-info-lookup
+While editing Elisp files, you can use @kbd{C-h S}
+(@code{info-lookup-symbol}) to look up Elisp symbols in the relevant
+Info manuals (@pxref{Info Lookup,,, emacs, The GNU Emacs Manual}). To
+enable the same for Dash symbols, use the command
+@code{dash-register-info-lookup}. It can be called directly when
+needed, or automatically from your @code{user-init-file}. For
+example:
+
+@lisp
+(with-eval-after-load 'info-look
+ (dash-register-info-lookup))
+@end lisp
+
@node Functions
@chapter Functions
diff --git a/readme-template.md b/readme-template.md
index 6cc06b7..8ae2693 100644
--- a/readme-template.md
+++ b/readme-template.md
@@ -58,6 +58,21 @@ either interactively or from your `user-init-file`:
(global-dash-fontify-mode)
```
+## Info symbol lookup
+
+While editing Elisp files, you can use `C-h S` (`info-lookup-symbol`)
+to look up Elisp symbols in the relevant Info manuals (see [`(emacs)
+Info
+Lookup`](https://gnu.org/software/emacs/manual/html_node/emacs/Info-Lookup.html)).
+To enable the same for Dash symbols, use the command
+`dash-register-info-lookup`. It can be called directly when needed,
+or automatically from your `user-init-file`. For example:
+
+```el
+(with-eval-after-load 'info-look
+ (dash-register-info-lookup))
+```
+
## Functions
All functions and constructs in the library use a dash (`-`) prefix.
- [elpa] externals/dash 3cfbebf 293/316: Port more Texinfo generation changes to Markdown, (continued)
- [elpa] externals/dash 3cfbebf 293/316: Port more Texinfo generation changes to Markdown, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 03748d8 297/316: Prefer '() over () in printed examples, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 6ffcd89 299/316: Print actual error messages in README, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 4f3238b 300/316: Strip leading zeros from octal escapes in Emacs 26, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 2028805 302/316: Don't quote error messages in Texinfo examples, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 6c41b32 301/316: Move case-fold-search binding to where it's used, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 1c711f1 303/316: Unquote results in Texinfo examples, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 1bf9ddb 304/316: Makefile aesthetics, ELPA Syncer, 2021/02/15
- [elpa] externals/dash da0415b 312/316: * NEWS.md (2.18): Start news for upcoming release., ELPA Syncer, 2021/02/15
- [elpa] externals/dash 5eea156 315/316: Absorb dash-functional into dash, ELPA Syncer, 2021/02/15
- [elpa] externals/dash eaf33b3 226/316: Add info-lookup-symbol support,
ELPA Syncer <=
- [elpa] externals/dash 565055e 229/316: * dash.el (---truthy?): Simplify., ELPA Syncer, 2021/02/15
- [elpa] externals/dash 97bd233 231/316: Use lexical binding for -grade-up/down, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 1152feb 237/316: Deprecate variadic -list, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 609ac28 245/316: Improve Texinfo markup when documenting errors, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 999cae9 253/316: Fix short-circuiting of --first, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 3726eb1 254/316: Improve the examples of -some, ELPA Syncer, 2021/02/15
- [elpa] externals/dash b0bef0f 276/316: Don't set text-quoting-style globally, ELPA Syncer, 2021/02/15
- [elpa] externals/dash bedc804 282/316: Improve function-to-info, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 9727f7c 288/316: Simplify Lisp -> Texinfo printing, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 7b2584c 294/316: Simplify GitHub link creation, ELPA Syncer, 2021/02/15