FUEL: remove fuel-help-short and supporting code

The feature is not used anywhere (not bound to any key) and the normal
fuel-help display works better than fuel-help-short anyway
db4
Björn Lindqvist 2014-04-17 01:20:11 +02:00 committed by John Benediktsson
parent d3935d2ef3
commit 385a8a0798
6 changed files with 8 additions and 23 deletions

View File

@ -114,8 +114,6 @@ PRIVATE>
: fuel-word-help ( name -- ) (fuel-word-help) fuel-eval-set-result ; : fuel-word-help ( name -- ) (fuel-word-help) fuel-eval-set-result ;
: fuel-word-see ( name -- ) (fuel-word-see) fuel-eval-set-result ;
: fuel-word-def ( name -- ) (fuel-word-def) fuel-eval-set-result ; : fuel-word-def ( name -- ) (fuel-word-def) fuel-eval-set-result ;
: fuel-vocab-help ( name -- ) (fuel-vocab-help) fuel-eval-set-result ; : fuel-vocab-help ( name -- ) (fuel-vocab-help) fuel-eval-set-result ;

View File

@ -96,10 +96,6 @@ PRIVATE>
search [ synopsis ] [ f ] if* search [ synopsis ] [ f ] if*
] with-scope ; ] with-scope ;
: (fuel-word-see) ( word -- elem )
[ name>> \ article swap ]
[ [ see ] with-string-writer \ $code swap 2array ] bi 3array ; inline
: (fuel-word-def) ( name -- str ) : (fuel-word-def) ( name -- str )
search [ [ def>> pprint ] with-string-writer ] [ f ] if* ; inline search [ [ def>> pprint ] with-string-writer ] [ f ] if* ; inline

View File

@ -127,7 +127,6 @@ M-x <command>, not necessarily in a factor buffer.
|--------------------+------------------------------------------------------------| |--------------------+------------------------------------------------------------|
| C-c C-d a | toggle autodoc mode (fuel-autodoc-mode) | | C-c C-d a | toggle autodoc mode (fuel-autodoc-mode) |
| C-c C-d d | help for word at point (fuel-help) | | C-c C-d d | help for word at point (fuel-help) |
| C-c C-d s | short help word at point (fuel-help-short) |
| C-c C-d e | show stack effect of current sexp (with prefix, region) | | C-c C-d e | show stack effect of current sexp (with prefix, region) |
| C-c C-d p | find words containing given substring (fuel-apropos) | | C-c C-d p | find words containing given substring (fuel-apropos) |
| C-c C-d v | show words in current file (with prefix, ask for vocab) | | C-c C-d v | show words in current file (with prefix, ask for vocab) |

View File

@ -49,7 +49,7 @@ user.")
(let ((word (factor-symbol-at-point)) (let ((word (factor-symbol-at-point))
(fuel-log--inhibit-p t)) (fuel-log--inhibit-p t))
(when word (when word
(fuel-help--word-help nil word t)))) (fuel-help--word-help word t))))
(error (message "FUEL Autohelp error: %s" err)))) (error (message "FUEL Autohelp error: %s" err))))
(defun fuel-autohelp-schedule-timer () (defun fuel-autohelp-schedule-timer ()

View File

@ -114,10 +114,9 @@
(defvar-local fuel-help--buffer-link nil) (defvar-local fuel-help--buffer-link nil)
(defun fuel-help--read-word (see) (defun fuel-help--read-word ()
(let* ((def (factor-symbol-at-point)) (let* ((def (factor-symbol-at-point))
(prompt (format "See%s help on%s: " (if see " short" "") (prompt (format "See help on%s: " (if def (format " (%s)" def) "")))
(if def (format " (%s)" def) "")))
(ask (or (not def) fuel-help-always-ask))) (ask (or (not def) fuel-help-always-ask)))
(if ask (if ask
(fuel-completion--read-word prompt (fuel-completion--read-word prompt
@ -126,11 +125,10 @@
t) t)
def))) def)))
(defun fuel-help--word-help (&optional see word display-only print-message) (defun fuel-help--word-help (&optional word display-only print-message)
(let ((def (or word (fuel-help--read-word see)))) (let ((def (or word (fuel-help--read-word))))
(when def (when def
(let ((cmd `(:fuel* (,def (let ((cmd `(:fuel* (,def ,'fuel-word-help)
,(if see 'fuel-word-see 'fuel-word-help))
,(factor-current-vocab) ,(factor-current-vocab)
,(factor-usings)))) ,(factor-usings))))
(when print-message (when print-message
@ -189,7 +187,7 @@
(cached (and (not no-cache) (fuel-help--cache-get llink)))) (cached (and (not no-cache) (fuel-help--cache-get llink))))
(if (not cached) (if (not cached)
(let ((fuel-help-always-ask nil)) (let ((fuel-help-always-ask nil))
(cond ((eq type 'word) (fuel-help--word-help nil link)) (cond ((eq type 'word) (fuel-help--word-help link))
((eq type 'article) (fuel-help--get-article link label)) ((eq type 'article) (fuel-help--get-article link label))
((eq type 'vocab) (fuel-help--get-vocab link)) ((eq type 'vocab) (fuel-help--get-vocab link))
((eq type 'author) (fuel-help--get-vocab/author label)) ((eq type 'author) (fuel-help--get-vocab/author label))
@ -250,18 +248,13 @@
;;; Interactive help commands: ;;; Interactive help commands:
(defun fuel-help-short ()
"See help summary of symbol at point."
(interactive)
(fuel-help--word-help t))
(defun fuel-help (&optional print-message) (defun fuel-help (&optional print-message)
"Show extended help about the word or vocabulary at point, using a "Show extended help about the word or vocabulary at point, using a
help buffer." help buffer."
(interactive "p") (interactive "p")
(if (factor-in-using) (if (factor-in-using)
(fuel-help-vocab (factor-symbol-at-point)) (fuel-help-vocab (factor-symbol-at-point))
(fuel-help--word-help nil nil nil print-message))) (fuel-help--word-help nil nil print-message)))
(defun fuel-help-vocab (vocab) (defun fuel-help-vocab (vocab)
"Ask for a vocabulary name and show its help page." "Ask for a vocabulary name and show its help page."

View File

@ -193,7 +193,6 @@ interacting with a factor listener is at your disposal.
("Jump back" "\M-," fuel-edit-pop-edit-word-stack) ("Jump back" "\M-," fuel-edit-pop-edit-word-stack)
-- --
("Help on word" ("\C-c\C-d\C-d" "\C-c\C-dd") fuel-help) ("Help on word" ("\C-c\C-d\C-d" "\C-c\C-dd") fuel-help)
("Short help on word" ("\C-c\C-d\C-s" "\C-c\C-ds") fuel-help)
("Apropos..." ("\C-c\C-d\C-p" "\C-c\C-dp") fuel-apropos) ("Apropos..." ("\C-c\C-d\C-p" "\C-c\C-dp") fuel-apropos)
("Show stack effect" ("\C-c\C-d\C-e" "\C-c\C-de") fuel-stack-effect-sexp) ("Show stack effect" ("\C-c\C-d\C-e" "\C-c\C-de") fuel-stack-effect-sexp)
-- --