]> gitweb.factorcode.org Git - factor.git/commitdiff
FUEL: New command fuel-help-kill-page (bound to 'k' in help browser).
authorJose A. Ortega Ruiz <jao@gnu.org>
Mon, 5 Jan 2009 05:22:36 +0000 (06:22 +0100)
committerJose A. Ortega Ruiz <jao@gnu.org>
Mon, 5 Jan 2009 05:22:36 +0000 (06:22 +0100)
extra/fuel/fuel.factor
misc/fuel/README
misc/fuel/fuel-connection.el
misc/fuel/fuel-eval.el
misc/fuel/fuel-help.el

index 80d8cde654ed46722e33e3d512c94dca98e92fec..03896029f1e005c2deaf6824a600aa1c54bf70b3 100644 (file)
@@ -4,9 +4,9 @@
 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
 
@@ -74,6 +74,8 @@ M: sequence fuel-pprint
 
 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
index 6c03c7aa0143033ff9c9f288765207508e5a74a8..7c746ff3053e44196d3bab224f2ef6aee13bd27a 100644 (file)
@@ -102,6 +102,7 @@ beast.
     - n/p : next/previous page
     - SPC/S-SPC : scroll up/down
     - TAB/S-TAB : next/previous link
+    - k : kill current page and go to previous or next
     - r : refresh page
     - c : clean browsing history
     - M-. : edit word at point in Emacs
index 05ddad4b1ef2b2f77dec233a9007a98da8dc1add..09d1ddfb5106807cf262a8005a98bf74c639ef63 100644 (file)
@@ -1,6 +1,6 @@
 ;;; 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))))))
 
index 078a7005f83bb05b4d2f7a5759ad7acc6edf4d5d..149e608964fa50b701cdce48a1f91ef4208317dd 100644 (file)
@@ -1,6 +1,6 @@
 ;;; 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)))
 
index 12091ea39934d022b8158bd471dc00e7af8465dd..4b8d1e4e16efd3fcc429f7e59c14c2b3461e630f 100644 (file)
         (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))))
 
@@ -231,20 +231,29 @@ buffer."
   (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)
@@ -273,6 +282,7 @@ buffer."
     (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)