| (global-set-key "\e " 'forth-reload) |
(global-set-key "\e " 'forth-reload) |
| |
|
| (define-key forth-mode-map "\M-\C-x" 'compile) |
(define-key forth-mode-map "\M-\C-x" 'compile) |
| |
(define-key forth-mode-map "\C-x\\" 'comment-region) |
| |
(define-key forth-mode-map "\C-x|" 'uncomment-region) |
| |
(define-key forth-mode-map "\C-x~" 'forth-remove-tracers) |
| (define-key forth-mode-map "\e\C-m" 'forth-send-paragraph) |
(define-key forth-mode-map "\e\C-m" 'forth-send-paragraph) |
| (define-key forth-mode-map "\eo" 'forth-send-buffer) |
(define-key forth-mode-map "\eo" 'forth-send-buffer) |
| (define-key forth-mode-map "\C-x\C-m" 'forth-split) |
(define-key forth-mode-map "\C-x\C-m" 'forth-split) |
| (define-key forth-mode-map "\e " 'forth-reload) |
(define-key forth-mode-map "\e " 'forth-reload) |
| (define-key forth-mode-map "\t" 'forth-indent-command) |
(define-key forth-mode-map "\t" 'forth-indent-command) |
| (define-key forth-mode-map "\C-m" 'reindent-then-newline-and-indent) |
(define-key forth-mode-map "\C-m" 'reindent-then-newline-and-indent) |
| |
(define-key forth-mode-map "\M-q" 'forth-fill-paragraph) |
| |
|
| (defvar forth-mode-syntax-table nil |
(defvar forth-mode-syntax-table nil |
| "Syntax table in use in Forth-mode buffers.") |
"Syntax table in use in Forth-mode buffers.") |
| (setq forth-mode-hook |
(setq forth-mode-hook |
| '(lambda () (setq compile-command "gforth "))) |
'(lambda () (setq compile-command "gforth "))) |
| |
|
| |
(defun forth-fill-paragraph () |
| |
"Fill comments (starting with '\'; do not fill code (block style |
| |
programmers who tend to fill code won't use emacs anyway:-)." |
| |
; currently only comments at the start of the line are |
| |
; filled. something like lisp-fill-paragraph may be better |
| |
(interactive) |
| |
(save-excursion |
| |
(beginning-of-line) |
| |
(if (looking-at "[ \t]*\\\\[ \t]+") |
| |
(progn (goto-char (match-end 0)) |
| |
(set-fill-prefix) |
| |
(fill-paragraph nil))))) |
| |
|
| (defun forth-comment-indent () |
(defun forth-comment-indent () |
| (save-excursion |
(save-excursion |
| (beginning-of-line) |
(beginning-of-line) |
| |
|
| ;; Forth commands |
;; Forth commands |
| |
|
| |
(defun forth-remove-tracers () |
| |
"Remove tracers of the form `~~ '. Queries the user for each occurrence." |
| |
(interactive) |
| |
(query-replace "~~ " "")) |
| |
|
| (defvar forth-program-name "gforth" |
(defvar forth-program-name "gforth" |
| "*Program invoked by the `run-forth' command.") |
"*Program invoked by the `run-forth' command.") |
| |
|
| (error "forth-help-load-path not specified"))) |
(error "forth-help-load-path not specified"))) |
| |
|
| |
|
| (define-key forth-mode-map "\C-hf" 'forth-documentation) |
;(define-key forth-mode-map "\C-hf" 'forth-documentation) |
| |
|
| (defun forth-documentation (function) |
(defun forth-documentation (function) |
| "Display the full documentation of FORTH word." |
"Display the full documentation of FORTH word." |