diff options
| author | Tom Tromey | 2017-01-16 15:59:06 -0700 |
|---|---|---|
| committer | Tom Tromey | 2017-01-17 15:40:16 -0700 |
| commit | dbb29d7eb428dd53617d31a9cc159d889deb1e8e (patch) | |
| tree | f14753b2ea969f34ee0a2fe101e1d13a82528b8b | |
| parent | 8083d258ba96065ac5a201a69f34f7a4d92fe24c (diff) | |
| download | emacs-dbb29d7eb428dd53617d31a9cc159d889deb1e8e.tar.gz emacs-dbb29d7eb428dd53617d31a9cc159d889deb1e8e.zip | |
Add info-lookup help for gdb-script-mode
Bug#25464:
* lisp/info-look.el (info-lookup-guess-gdb-script-symbol): New
function.
Add help for gdb-script-mode.
| -rw-r--r-- | lisp/info-look.el | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/lisp/info-look.el b/lisp/info-look.el index 1f3c50870e0..694bcb462ce 100644 --- a/lisp/info-look.el +++ b/lisp/info-look.el | |||
| @@ -43,6 +43,7 @@ | |||
| 43 | ;;; Code: | 43 | ;;; Code: |
| 44 | 44 | ||
| 45 | (require 'info) | 45 | (require 'info) |
| 46 | (require 'subr-x) | ||
| 46 | 47 | ||
| 47 | (defgroup info-lookup nil | 48 | (defgroup info-lookup nil |
| 48 | "Major mode sensitive help agent." | 49 | "Major mode sensitive help agent." |
| @@ -648,6 +649,26 @@ Return nil if there is nothing appropriate in the buffer near point." | |||
| 648 | (buffer-substring-no-properties beg end))))) | 649 | (buffer-substring-no-properties beg end))))) |
| 649 | (error nil))) | 650 | (error nil))) |
| 650 | 651 | ||
| 652 | (defun info-lookup-guess-gdb-script-symbol () | ||
| 653 | "Get symbol at point in GDB script buffers." | ||
| 654 | (condition-case nil | ||
| 655 | (save-excursion | ||
| 656 | (back-to-indentation) | ||
| 657 | ;; Try to find the current line's full command in the index; | ||
| 658 | ;; and default to the longest subset that is found. | ||
| 659 | (when (looking-at "[-a-z]+\\(\\s-[-a-z]+\\)*") | ||
| 660 | (let ((str-list (split-string (match-string-no-properties 0) | ||
| 661 | "\\s-+" t)) | ||
| 662 | (completions (info-lookup->completions 'symbol | ||
| 663 | 'gdb-script-mode))) | ||
| 664 | (catch 'result | ||
| 665 | (while str-list | ||
| 666 | (let ((str (string-join str-list " "))) | ||
| 667 | (when (assoc str completions) | ||
| 668 | (throw 'result str)) | ||
| 669 | (nbutlast str-list))))))) | ||
| 670 | (error nil))) | ||
| 671 | |||
| 651 | ;;;###autoload | 672 | ;;;###autoload |
| 652 | (defun info-complete-symbol (&optional mode) | 673 | (defun info-complete-symbol (&optional mode) |
| 653 | "Perform completion on symbol preceding point." | 674 | "Perform completion on symbol preceding point." |
| @@ -1051,6 +1072,14 @@ Return nil if there is nothing appropriate in the buffer near point." | |||
| 1051 | :mode 'help-mode | 1072 | :mode 'help-mode |
| 1052 | :regexp "[^][()`'‘’,:\" \t\n]+" | 1073 | :regexp "[^][()`'‘’,:\" \t\n]+" |
| 1053 | :other-modes '(emacs-lisp-mode)) | 1074 | :other-modes '(emacs-lisp-mode)) |
| 1075 | |||
| 1076 | (info-lookup-maybe-add-help | ||
| 1077 | :mode 'gdb-script-mode | ||
| 1078 | :ignore-case nil | ||
| 1079 | :regexp "\\([-a-z]+\\(\\s-+[-a-z]+\\)*\\)" | ||
| 1080 | :doc-spec '(("(gdb)Command and Variable Index" nil | ||
| 1081 | nil nil)) | ||
| 1082 | :parse-rule 'info-lookup-guess-gdb-script-symbol) | ||
| 1054 | 1083 | ||
| 1055 | (provide 'info-look) | 1084 | (provide 'info-look) |
| 1056 | 1085 | ||