| ; `forth-use-oof' could be set to non-nil for automatical adding of those |
; `forth-use-oof' could be set to non-nil for automatical adding of those |
| ; word-lists. Using local variable list? |
; word-lists. Using local variable list? |
| ; |
; |
| ; Anzeige von Screen-Nummern in Status-Zeile (S???) |
|
| ; |
|
| ; Konfiguration über customization groups |
; Konfiguration über customization groups |
| ; |
; |
| ; Bereich nur auf Wortanfang/ende ausweiten, wenn anfang bzw ende in einem |
; Bereich nur auf Wortanfang/ende ausweiten, wenn anfang bzw ende in einem |
| |
|
| (setq debug-on-error t) |
(setq debug-on-error t) |
| |
|
| ;; Filter list by predicat. This is a somewhat standard function for |
;; Filter list by predicate. This is a somewhat standard function for |
| ;; functional programming languages. So why isn't it already implemented |
;; functional programming languages. So why isn't it already implemented |
| ;; in Lisp?? |
;; in Lisp?? |
| (defun forth-filter (predicat list) |
(defun forth-filter (predicate list) |
| (let ((filtered nil)) |
(let ((filtered nil)) |
| (mapcar (lambda (item) |
(mapcar (lambda (item) |
| (when (funcall predicat item) |
(when (funcall predicate item) |
| (if filtered |
(if filtered |
| (nconc filtered (list item)) |
(nconc filtered (list item)) |
| (setq filtered (cons item nil)))) |
(setq filtered (cons item nil)))) |
| (setq overlay-arrow-string forth-overlay-arrow-string) |
(setq overlay-arrow-string forth-overlay-arrow-string) |
| (goto-line first-line) |
(goto-line first-line) |
| (setq overlay-arrow-position forth-screen-marker) |
(setq overlay-arrow-position forth-screen-marker) |
| (when (/= forth-screen-marker (point)) |
(set-marker forth-screen-marker |
| (message "Entered screen #%i" scr) |
(save-excursion (goto-line first-line) (point))) |
| (set-marker forth-screen-marker (point))))))) |
(setq forth-screen-number-string (format "%d" scr)))))) |
| |
|
| (add-hook 'forth-motion-hooks 'forth-update-show-screen) |
(add-hook 'forth-motion-hooks 'forth-update-show-screen) |
| |
|
| (make-local-variable 'forth-show-screen) |
(make-local-variable 'forth-show-screen) |
| (make-local-variable 'forth-screen-marker) |
(make-local-variable 'forth-screen-marker) |
| (make-local-variable 'forth-warn-long-lines) |
(make-local-variable 'forth-warn-long-lines) |
| |
(make-local-variable 'forth-screen-number-string) |
| (setq forth-screen-marker (copy-marker 0)) |
(setq forth-screen-marker (copy-marker 0)) |
| (add-hook 'after-change-functions 'forth-change-function)) |
(add-hook 'after-change-functions 'forth-change-function)) |
| |
|
| Variables controlling block-file editing: |
Variables controlling block-file editing: |
| `forth-show-screen' |
`forth-show-screen' |
| Non-nil means, that the start of the current screen is marked by an |
Non-nil means, that the start of the current screen is marked by an |
| overlay arrow, and motion over screen boundaries displays the number |
overlay arrow, and screen numbers are displayed in the mode line. |
| of the screen entered. This variable is by default nil for `forth-mode' |
This variable is by default nil for `forth-mode' and t for |
| and t for `forth-block-mode'. |
`forth-block-mode'. |
| `forth-overlay-arrow-string' |
`forth-overlay-arrow-string' |
| String to display as the overlay arrow, when `forth-show-screen' is t. |
String to display as the overlay arrow, when `forth-show-screen' is t. |
| Setting this variable to nil disables the overlay arrow. |
Setting this variable to nil disables the overlay arrow. |
| ; (run-forth forth-program-name)) |
; (run-forth forth-program-name)) |
| (run-hooks 'forth-mode-hook)) |
(run-hooks 'forth-mode-hook)) |
| |
|
| |
;;;###autoload |
| (define-derived-mode forth-block-mode forth-mode "Forth Block Source" |
(define-derived-mode forth-block-mode forth-mode "Forth Block Source" |
| "Major mode for editing Forth block source files, derived from |
"Major mode for editing Forth block source files, derived from |
| `forth-mode'. Differences to `forth-mode' are: |
`forth-mode'. Differences to `forth-mode' are: |
| |
|
| Another problem is imposed by block files that contain newline or tab |
Another problem is imposed by block files that contain newline or tab |
| characters. When Emacs converts such files back to block file format, |
characters. When Emacs converts such files back to block file format, |
| it'll translate those characters to a number of spaces. However, whenever |
it'll translate those characters to a number of spaces. However, when |
| you read such a file, a warning message is displayed in the echo area, |
you read such a file, a warning message is displayed in the echo area, |
| including a line number that may help you to locate and fix the problem. |
including a line number that may help you to locate and fix the problem. |
| |
|
| bell during block file read/write operations." |
bell during block file read/write operations." |
| (setq buffer-file-format '(forth-blocks)) |
(setq buffer-file-format '(forth-blocks)) |
| (setq forth-show-screen t) |
(setq forth-show-screen t) |
| (setq forth-warn-long-lines t)) |
(setq forth-warn-long-lines t) |
| |
(setq forth-screen-number-string (format "%d" forth-block-base)) |
| |
(setq mode-line-format (append (reverse (cdr (reverse mode-line-format))) |
| |
'("--S" forth-screen-number-string "-%-")))) |
| |
|
| (add-hook 'forth-mode-hook |
(add-hook 'forth-mode-hook |
| '(lambda () |
'(lambda () |