Hi Eduardo,

I've made a couple of addition to the factor.el file on my laptop, and
wondered if they were worth adding to the factor distro.

The first one modifies the comment regex to match ! with spaces either
side rather than any word beginning with !. (I've been experimenting !!
as an abbrev for 'set', so had to correct this regex).

The second bit adds factor-refresh-all and factor-usage functions and
key bindings.

N.B. Don't feel obliged to add any of this if you don't want to

Cheers,

Phil


diff --git a/misc/factor.el b/misc/factor.el
index 6598f2c..654ab9e 100644
--- a/misc/factor.el
+++ b/misc/factor.el
@@ -79,8 +79,8 @@
  (defconst factor-font-lock-keywords
    '(("#!.*$" . font-lock-comment-face)
      ("!( .* )" . font-lock-comment-face)
-    ("^!.*$" . font-lock-comment-face)
-    (" !.*$" . font-lock-comment-face)
+    ("^! .*$" . font-lock-comment-face)
+    (" ! .*$" . font-lock-comment-face)
      ("( .* )" . font-lock-comment-face)
      "MAIN:"
      "IN:" "USING:" "TUPLE:" "^C:" "^M:" "USE:" "REQUIRE:" "PROVIDE:"
@@ -165,9 +165,21 @@
    (beginning-of-line)
    (insert "! "))

+(defun factor-refresh-all ()
+  (interactive)
+  (comint-send-string "*factor*" "refresh-all\n"))
+
+(defun factor-usage ()
+  (interactive)
+  (comint-send-string "*factor*" "\\ ")
+  (comint-send-string "*factor*" (thing-at-point 'sexp))
+  (comint-send-string "*factor*" " usage .\n"))
+

  (define-key factor-mode-map "\C-c\C-f" 'factor-run-file)
  (define-key factor-mode-map "\C-c\C-r" 'factor-send-region)
  (define-key factor-mode-map "\C-c\C-s" 'factor-see)
  (define-key factor-mode-map "\C-ce" 'factor-edit)
  (define-key factor-mode-map "\C-c\C-h" 'factor-help)
+(define-key factor-mode-map "\C-c\C-c" 'factor-refresh-all)
+(define-key factor-mode-map "\C-c\C-u" 'factor-usage)



-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to