[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/forth-mode 2813a7bf3d 090/153: Introduce a hook to initial
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/forth-mode 2813a7bf3d 090/153: Introduce a hook to initialize backends |
Date: |
Sat, 29 Jan 2022 08:02:21 -0500 (EST) |
branch: elpa/forth-mode
commit 2813a7bf3dbcdf7780834b53385993620c7a9fd5
Author: Helmut Eller <eller.helmut@gmail.com>
Commit: Lars Brinkhoff <lars@nocrew.org>
Introduce a hook to initialize backends
Run a hook to initialize backends as require only executes the file once.
---
backend/gforth.el | 6 +++++-
backend/swiftforth.el | 13 ++++++-------
forth-interaction-mode.el | 8 +++++++-
3 files changed, 18 insertions(+), 9 deletions(-)
diff --git a/backend/gforth.el b/backend/gforth.el
index 9515268f28..6d5983fec5 100644
--- a/backend/gforth.el
+++ b/backend/gforth.el
@@ -1,5 +1,9 @@
(require 'forth-interaction-mode)
-(forth-interaction-send "' drop is Attr!")
+(defun forth-gforth-init (backend-type process)
+ (when (eq backend-type 'gforth)
+ (forth-interaction-send "' drop is Attr!")))
+
+(add-hook 'forth-interaction-init-backend-hook #'forth-gforth-init)
(provide 'gforth)
diff --git a/backend/swiftforth.el b/backend/swiftforth.el
index 4a91c26a6c..3399225ede 100644
--- a/backend/swiftforth.el
+++ b/backend/swiftforth.el
@@ -1,12 +1,11 @@
(require 'forth-interaction-mode)
-(set-process-coding-system (get-buffer-process forth-interaction-buffer)
- 'raw-text-dos 'raw-text-dos)
-(save-excursion
- (with-current-buffer forth-interaction-buffer
- (goto-char (point-max))
- (insert "\n")))
+(defun forth-swiftforth-init (backend-type process)
+ (when (eq backend-type 'swiftforth)
+ (set-process-coding-system process 'raw-text-dos 'raw-text-dos)
+ (forth-interaction-send (concat "include " forth-backend-dir
+ "/swiftforth.fth"))))
-(forth-interaction-send (concat "include " forth-backend-dir
"/swiftforth.fth"))
+(add-hook 'forth-interaction-init-backend-hook #'forth-swiftforth-init)
(provide 'swiftforth)
diff --git a/forth-interaction-mode.el b/forth-interaction-mode.el
index ef0c9e788d..6273a32df9 100644
--- a/forth-interaction-mode.el
+++ b/forth-interaction-mode.el
@@ -31,13 +31,19 @@
:syntax-table forth-mode-syntax-table
(use-local-map forth-interaction-mode-map))
+(defvar forth-interaction-init-backend-hook '())
+
(defun forth-interaction-preoutput-filter (text)
(unless forth-implementation
(setq forth-banner (concat forth-banner text))
(dolist (x forth-implementation-matches)
(when (string-match (car x) forth-banner)
+ (setq forth-implementation (cdr x))
(let ((load-path (cons forth-backend-dir load-path)))
- (require (setq forth-implementation (cdr x)))))))
+ (require forth-implementation))
+ (run-hook-with-args 'forth-interaction-init-backend-hook
+ forth-implementation
+ (get-buffer-process (current-buffer))))))
(if forth-interaction-callback
(funcall forth-interaction-callback text)
text))
- [nongnu] elpa/forth-mode ef60dcd180 036/153: If forth-executable is nil, query user for file name., (continued)
- [nongnu] elpa/forth-mode ef60dcd180 036/153: If forth-executable is nil, query user for file name., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode b29a929b78 028/153: Add provide forms., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 992bfb64b4 103/153: Fix warning about font-lock-fontify-buffer non-interactive use., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode efa1f0a336 046/153: Build Emacs Lisp files., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 1bc27cd6b6 115/153: Support paragraph filling in comments, ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 4868a0ff03 051/153: Fix for imenu integration., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 5b42dfac0c 105/153: Merge branch 'master' into case-insensitive-indentation, ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode c8103312c3 041/153: Fix typo., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode b83ff1274b 054/153: Type C-c C-s to SEE a word., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 2f5d87f3c5 126/153: No 64-bit build for pForth in Ubuntu. Try Gforth., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 2813a7bf3d 090/153: Introduce a hook to initialize backends,
ELPA Syncer <=
- [nongnu] elpa/forth-mode c64035c209 073/153: Add backends for Forth implementations., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode d1498037a2 107/153: Add simple tests for forward-sexp, ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 83a62c82c4 030/153: Move all package metadata to forth-mode.el., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 186bae4853 083/153: Fix set-process-window-size parameter order., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 48bcf41d63 058/153: Cache words from interactive Forth., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode f418b9aac2 087/153: Set process coding system for SwiftForth., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode f3d76c12c1 125/153: Test completion-at-point, ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 4dc1ff0f3b 086/153: Include backend files in make dependencies., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 2779ca61ab 075/153: Improve building of backend files., ELPA Syncer, 2022/01/29
- [nongnu] elpa/forth-mode 71016700dc 095/153: Emacs 23: use cl library instead of cl-lib., ELPA Syncer, 2022/01/29