diff options
| author | Michael Albinus | 2019-12-06 19:28:01 +0100 |
|---|---|---|
| committer | Michael Albinus | 2019-12-06 19:28:01 +0100 |
| commit | 99ad65eda44e3b6edcc51cf0fb70ea499c3ccb07 (patch) | |
| tree | 973a1a6e02403fd76fc96566b081246ac8330794 | |
| parent | 30eac47981c0d0d97221d5b94fd91ada99097de4 (diff) | |
| download | emacs-99ad65eda44e3b6edcc51cf0fb70ea499c3ccb07.tar.gz emacs-99ad65eda44e3b6edcc51cf0fb70ea499c3ccb07.zip | |
Configure info-look.el to recognize Tramp symbols
* lisp/net/tramp-integration.el (info-lookup->cache)
(info-lookup->mode-value, info-lookup->other-modes)
(info-lookup->topic-value, info-lookup-maybe-add-help)
(info-lookup-cache): Declare.
(info-look): Configure info-look.el to recognize Tramp symbols.
| -rw-r--r-- | lisp/net/tramp-integration.el | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/lisp/net/tramp-integration.el b/lisp/net/tramp-integration.el index 0c3107603fb..f1d9f390e1b 100644 --- a/lisp/net/tramp-integration.el +++ b/lisp/net/tramp-integration.el | |||
| @@ -31,12 +31,18 @@ | |||
| 31 | 31 | ||
| 32 | ;; Pacify byte-compiler. | 32 | ;; Pacify byte-compiler. |
| 33 | (require 'cl-lib) | 33 | (require 'cl-lib) |
| 34 | (declare-function info-lookup->cache "info-look") | ||
| 35 | (declare-function info-lookup->mode-value "info-look") | ||
| 36 | (declare-function info-lookup->other-modes "info-look") | ||
| 37 | (declare-function info-lookup->topic-value "info-look") | ||
| 38 | (declare-function info-lookup-maybe-add-help "info-look") | ||
| 34 | (declare-function recentf-cleanup "recentf") | 39 | (declare-function recentf-cleanup "recentf") |
| 35 | (declare-function tramp-dissect-file-name "tramp") | 40 | (declare-function tramp-dissect-file-name "tramp") |
| 36 | (declare-function tramp-file-name-equal-p "tramp") | 41 | (declare-function tramp-file-name-equal-p "tramp") |
| 37 | (declare-function tramp-tramp-file-p "tramp") | 42 | (declare-function tramp-tramp-file-p "tramp") |
| 38 | (defvar eshell-path-env) | 43 | (defvar eshell-path-env) |
| 39 | (defvar ido-read-file-name-non-ido) | 44 | (defvar ido-read-file-name-non-ido) |
| 45 | (defvar info-lookup-cache) | ||
| 40 | (defvar ivy-completing-read-handlers-alist) | 46 | (defvar ivy-completing-read-handlers-alist) |
| 41 | (defvar recentf-exclude) | 47 | (defvar recentf-exclude) |
| 42 | (defvar tramp-current-connection) | 48 | (defvar tramp-current-connection) |
| @@ -186,6 +192,35 @@ NAME must be equal to `tramp-current-connection'." | |||
| 186 | (add-to-list 'ivy-completing-read-handlers-alist | 192 | (add-to-list 'ivy-completing-read-handlers-alist |
| 187 | '(tramp-these-rename-files . completing-read-default))) | 193 | '(tramp-these-rename-files . completing-read-default))) |
| 188 | 194 | ||
| 195 | ;;; Integration of info-look.el: | ||
| 196 | |||
| 197 | (with-eval-after-load 'info-look | ||
| 198 | ;; Create a pseudo mode `tramp-info-lookup-mode' for Tramp symbol lookup. | ||
| 199 | (info-lookup-maybe-add-help | ||
| 200 | :mode 'tramp-info-lookup-mode :topic 'symbol | ||
| 201 | :regexp "[^][()`'‘’,\" \t\n]+" | ||
| 202 | :doc-spec '(("(tramp)Function Index" nil "^ -+ .*: " "\\( \\|$\\)") | ||
| 203 | ("(tramp)Variable Index" nil "^ -+ .*: " "\\( \\|$\\)"))) | ||
| 204 | |||
| 205 | ;; Add it as `other-modes' to `emacs-lisp-mode' itself, and all | ||
| 206 | ;; modes which use it as `other-modes'. | ||
| 207 | (dolist (mode (mapcar 'car (info-lookup->topic-value 'symbol))) | ||
| 208 | (when (and (or (equal mode 'emacs-lisp-mode) | ||
| 209 | (member | ||
| 210 | 'emacs-lisp-mode (info-lookup->other-modes 'symbol mode))) | ||
| 211 | (not (member | ||
| 212 | 'tramp-info-lookup-mode | ||
| 213 | (info-lookup->other-modes 'symbol mode)))) | ||
| 214 | (setcdr | ||
| 215 | (info-lookup->mode-value 'symbol mode) | ||
| 216 | (append | ||
| 217 | (butlast (cdr (info-lookup->mode-value 'symbol mode))) | ||
| 218 | `(,(cons 'tramp-info-lookup-mode | ||
| 219 | (info-lookup->other-modes 'symbol mode))))))) | ||
| 220 | |||
| 221 | ;; Reset cache. | ||
| 222 | (setq info-lookup-cache nil)) | ||
| 223 | |||
| 189 | ;;; Default connection-local variables for Tramp: | 224 | ;;; Default connection-local variables for Tramp: |
| 190 | 225 | ||
| 191 | (defconst tramp-connection-local-default-profile | 226 | (defconst tramp-connection-local-default-profile |