scel: initial support for SCDoc help browser
this patch introduces two new key bindings: C-c C-y: open help browser via Help.gui C-c h: open help browser for a specific topic the old help browser is still available via C-c C-h and can be used to display pre-rendered help files. Signed-off-by: Tim Blechmann <tim@klingt.org>
This commit is contained in:
parent
7c8c5fe535
commit
a20081f26a
2 changed files with 97 additions and 73 deletions
|
@ -596,6 +596,27 @@ Either visit file internally (.sc) or start external editor (.rtf)."
|
|||
(sclang-message "Help file not found") nil)
|
||||
(sclang-message "No help for \"%s\"" topic) nil)))
|
||||
|
||||
|
||||
(defun sclang-open-help-gui ()
|
||||
"Open SCDoc Help Browser"
|
||||
(interactive)
|
||||
(sclang-eval-string (sclang-format "Help.gui"))
|
||||
)
|
||||
|
||||
(defun sclang-find-help-in-gui (topic)
|
||||
"Search for topic in SCDoc Help Browser"
|
||||
(interactive
|
||||
(list
|
||||
(let ((topic (or (and mark-active (buffer-substring-no-properties (region-beginning) (region-end)))
|
||||
(sclang-help-topic-at-point)
|
||||
"Help")))
|
||||
(completing-read (format "Help topic%s: " (if (sclang-get-help-file topic)
|
||||
(format " (default %s)" topic) ""))
|
||||
sclang-help-topic-alist nil t nil 'sclang-help-topic-history topic)))
|
||||
)
|
||||
(sclang-eval-string (sclang-format "HelpBrowser.openHelpFor(%o)" topic))
|
||||
)
|
||||
|
||||
;; =====================================================================
|
||||
;; module setup
|
||||
;; =====================================================================
|
||||
|
|
|
@ -101,6 +101,7 @@
|
|||
["Index Help Topics" sclang-index-help-topics]
|
||||
["Find Help ..." sclang-find-help]
|
||||
["Switch to Help Browser" sclang-goto-help-browser]
|
||||
["Open Help GUI" sclang-open-help-gui]
|
||||
"-"
|
||||
["Run Main" sclang-main-run]
|
||||
["Stop Main" sclang-main-stop]
|
||||
|
@ -134,6 +135,8 @@
|
|||
;; documentation access
|
||||
(define-key map "\C-c\C-h" 'sclang-find-help)
|
||||
(define-key map "\C-\M-h" 'sclang-goto-help-browser)
|
||||
(define-key map "\C-c\C-y" 'sclang-open-help-gui)
|
||||
(define-key map "\C-ch" 'sclang-find-help-in-gui)
|
||||
;; language control
|
||||
(define-key map "\C-c\C-r" 'sclang-main-run)
|
||||
(define-key map "\C-c\C-s" 'sclang-main-stop)
|
||||
|
|
Loading…
Reference in a new issue