USING: accessors arrays assocs classes.tuple combinators
compiler.units continuations debugger definitions help help.crossref
help.markup help.topics io io.pathnames io.streams.string kernel lexer
-make math math.order memoize namespaces parser prettyprint sequences
-sets sorting source-files strings summary tools.crossref tools.vocabs
-vectors vocabs vocabs.parser words ;
+make math math.order memoize namespaces parser quotations prettyprint
+sequences sets sorting source-files strings summary tools.crossref
+tools.vocabs vectors vocabs vocabs.parser words ;
IN: fuel
M: tuple fuel-pprint tuple>array fuel-pprint ; inline
+M: quotation fuel-pprint pprint ; inline
+
M: continuation fuel-pprint drop ":continuation" write ; inline
M: restart fuel-pprint name>> fuel-pprint ; inline
;;; fuel-connection.el -- asynchronous comms with the fuel listener
-;; Copyright (C) 2008 Jose Antonio Ortega Ruiz
+;; Copyright (C) 2008, 2009 Jose Antonio Ortega Ruiz
;; See http://factorcode.org/license.txt for BSD license.
;; Author: Jose Antonio Ortega Ruiz <jao@gnu.org>
(condition-case cerr
(with-current-buffer (or buffer (current-buffer))
(funcall cont (fuel-con--comint-buffer-form))
- (fuel-log--info "<%s>: processed\n\t%s" id req))
+ (fuel-log--info "<%s>: processed" id))
(error (fuel-log--error
"<%s>: continuation failed %S \n\t%s" id rstr cerr))))))
;;; fuel-eval.el --- evaluating Factor expressions
-;; Copyright (C) 2008 Jose Antonio Ortega Ruiz
+;; Copyright (C) 2008, 2009 Jose Antonio Ortega Ruiz
;; See http://factorcode.org/license.txt for BSD license.
;; Author: Jose Antonio Ortega Ruiz <jao@gnu.org>
;;; Code:
-(require 'fuel-base)
(require 'fuel-syntax)
(require 'fuel-connection)
+(require 'fuel-log)
+(require 'fuel-base)
(eval-when-compile (require 'cl))
(fuel-eval--retort-make (cons 'fuel-parse-retort-error str) nil))
(defun fuel-eval--parse-retort (ret)
+ (fuel-log--info "RETORT: %S" ret)
(if (fuel-eval--retort-p ret) ret
(fuel-eval--make-parse-error-retort ret)))
(setcar fuel-help--history link))))
link)
-(defun fuel-help--history-next ()
+(defun fuel-help--history-next (&optional forget-current)
(when (not (ring-empty-p (nth 2 fuel-help--history)))
- (when (car fuel-help--history)
+ (when (and (car fuel-help--history) (not forget-current))
(ring-insert (nth 1 fuel-help--history) (car fuel-help--history)))
(setcar fuel-help--history (ring-remove (nth 2 fuel-help--history) 0))))
-(defun fuel-help--history-previous ()
+(defun fuel-help--history-previous (&optional forget-current)
(when (not (ring-empty-p (nth 1 fuel-help--history)))
- (when (car fuel-help--history)
+ (when (and (car fuel-help--history) (not forget-current))
(ring-insert (nth 2 fuel-help--history) (car fuel-help--history)))
(setcar fuel-help--history (ring-remove (nth 1 fuel-help--history) 0))))
(interactive)
(fuel-help--word-help))
-(defun fuel-help-next ()
- "Go to next page in help browser."
- (interactive)
- (let ((item (fuel-help--history-next)))
+(defun fuel-help-next (&optional forget-current)
+ "Go to next page in help browser.
+With prefix, the current page is deleted from history."
+ (interactive "P")
+ (let ((item (fuel-help--history-next forget-current)))
(unless item (error "No next page"))
(apply 'fuel-help--follow-link item)))
-(defun fuel-help-previous ()
- "Go to previous page in help browser."
- (interactive)
- (let ((item (fuel-help--history-previous)))
+(defun fuel-help-previous (&optional forget-current)
+ "Go to previous page in help browser.
+With prefix, the current page is deleted from history."
+ (interactive "P")
+ (let ((item (fuel-help--history-previous forget-current)))
(unless item (error "No previous page"))
(apply 'fuel-help--follow-link item)))
+(defun fuel-help-kill-page ()
+ "Kill current page if a previous or next one exists."
+ (interactive)
+ (condition-case nil
+ (fuel-help-previous t)
+ (error (fuel-help-next t))))
+
(defun fuel-help-refresh ()
"Refresh the contents of current page."
(interactive)
(define-key map "bd" 'fuel-help-delete-bookmark)
(define-key map "c" 'fuel-help-clean-history)
(define-key map "h" 'fuel-help)
+ (define-key map "k" 'fuel-help-kill-page)
(define-key map "n" 'fuel-help-next)
(define-key map "p" 'fuel-help-previous)
(define-key map "r" 'fuel-help-refresh)