[CM] Snd-Emacs Problems

Michael Scholz mike at fth-devel.net
Tue Aug 4 11:19:33 PDT 2009


James <ja.lira0 at gmail.com> writes:

> I downloaded the three .el files for Forth and Ruby. How would I then update
> my .emacs.
>
> I copied them to /etc/emacs/site-start.d/ but emacs didn't load them.

/etc/emacs/site-start.d/ is in your load-path, isn't it?  If you don't
use forth or ruby code, you shouldn't do anything in your ~/.emacs (I
think).

I copied the *.el files to ${prefix}/share/emacs/site-lisp which is
automatically in load-path and have the following in ~/.emacs:

(autoload 'ruby-mode     "ruby-mode" "Mode for editing ruby source files" t)
(autoload 'run-ruby      "inf-ruby"  "Run an inferior Ruby process" t)
(autoload 'inf-ruby-keys "inf-ruby"  "Local key defs for inf-ruby in ruby-mode" t)

(autoload 'forth-mode          "gforth" "Major mode Forth." t)
(autoload 'forth-block-mode    "gforth" "Major mode Forth." t)
(autoload 'inferior-forth-mode "gforth" "Major mode Forth." t)
(setq forth-jit-parser nil)		;too slow
(setq forth-use-objects nil)
(setq forth-use-oof nil)
(setq forth-hilight-level 3)
(setq forth-indent-level 2)
(setq forth-minor-indent-level 1)
(setq forth-custom-words
      '((("instrument:" "event:") definition-starter (font-lock-keyword-face . 1)
	 "[ \t\n]" t name (font-lock-function-name-face . 3))
	(("lambda:" "let:") definition-starter (font-lock-keyword-face . 1))
	((";instrument" ";event" ";let" ";proc") definition-ender (font-lock-keyword-face . 1))
	((".\\\"") compile-only (font-lock-string-face . 1)
	 "[^\\][\"\n]" nil string (font-lock-string-face . 1))
	(("unless" "?dup-not-if" "?dup-unless" "run" "run-instrument" "end-run"
	  "each" "end-each" "map" "map!" "end-map") compile-only (font-lock-keyword-face . 2))
	(("array(" "#(" "assoc(" "#a(" "hash{" "#{" "list(" "'(" "alist(" "'a(" "gdbm{" "}" "vct(" ")" "make-?obj")
	 non-immediate (font-lock-keyword-face . 2))
	(("[defined]" "[undefined]" "defined?") immediate (font-lock-keyword-face . 2)
	 "[ \t\n]" t name (font-lock-function-name-face . 3))
	(("create-hook" "create-symbol" "create-keyword" "create-exception")
	 non-immediate (font-lock-type-face . 2)
	 "[ \t\n]" t name (font-lock-variable-name-face . 3))
	(("[unless]" "[i]" "[each]" "[map]" "[end-each]" "[end-map]")
	 immediate (font-lock-keyword-face . 2))
	(("+to") immediate (font-lock-keyword-face . 2)
	 "[ \t\n]" t name (font-lock-variable-name-face . 3))
	(("nil" "undef" "#t" "#f" "two-pi" "half-pi" "float" "double" "a/o" "r/a")
	 non-immediate (font-lock-constant-face . 1))
	("[-0-9.+]+[-/+]?[-0-9.+]+i?" non-immediate (font-lock-constant-face . 1))
	(("<'>" "<'set>") immediate (font-lock-keyword-face . 2)
	 "[ \t\n]" t name (font-lock-function-name-face . 3))
	(("<char>") immediate (font-lock-keyword-face . 1)
	 "[ \t\n]" t string (font-lock-string-face . 1))
	("[<{]{" non-immediate (font-lock-variable-name-face . 1)
	 "}[>}]" nil string (font-lock-variable-name-face . 1))
	(("}>" "}") compile-only (font-lock-variable-name-face . 1 ))
	(":\\sw+" non-immediate (font-lock-builtin-face . 1)) ;keywords
	("'[^( ]\\sw+" non-immediate (font-lock-constant-face . 1)) ;symbols
	("\*[^ ]+.+\*" immediate (font-lock-variable-name-face . 1)) ;global variables
	("\".*[^\\]\"" immediate (font-lock-string-face . 1)) ;string "" (w/o space)
	("\/.*[^\\]\/" immediate (font-lock-string-face . 1)) ;regexp // (w/o space)
	(("s\\\"" "c\\\"" "$\"" "doc\"") immediate (font-lock-string-face . 1)
	 "[^\\]\"" nil string (font-lock-string-face . 1))
	(("re\/") immediate (font-lock-string-face . 1)
	 "[^\\]\/" nil string (font-lock-string-face . 1))
	(("defines") non-immediate (font-lock-type-face . 2)
	 "[ \t\n]" t name (font-lock-function-name-face . 3))
	(("dl-load") non-immediate (font-lock-keyword-face . 1)
	 "[\n\t ]" t string (font-lock-string-face . 1)
	 "[\n\t ]" t string (font-lock-string-face . 1))
	(("lambda-create" "proc-create") non-immediate (font-lock-type-face . 2) nil)))

(setq forth-custom-indent-words
      '((("instrument:" "event:" "lambda:" "let:"
	  "unless" "?dup-not-if" "?dup-unless" "[unless]" "run" "run-instrument"
	  "each" "map" "map!" "map" "[each]" "[map]") (0 . 2) (0 . 2))
	(("end-run" "end-map" "end-each" "[end-each]" "[end-map]"
	  ";instrument" ";event" ";let" ";proc") (-2 . 0) (0 . -2))
	(("<{") (0 . 3) (0 . 3))
	(("}>") (-3 . 0) (0 . -3))
	(("array(" "#(" "assoc(" "#a(" "hash{" "#{" "list(" "'(" "alist(" "'a(" "gdbm{" "vct(" "<{") (0 . 3) (0 . 3))
	((")" "}") (-3 . 0) (0 . -3))
	(("does>") (-1 . 1) (0 . 0))))

Mike



More information about the Cmdist mailing list