Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Alexander Skobelev Newsgroups: comp.lang.forth Subject: Running iForth from Emacs Date: Thu, 24 Jul 2014 10:32:30 +0400 Organization: A noiseless patient Spider Lines: 83 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: mx05.eternal-september.org; posting-host="afbcf13c4e98a1536a9883306c6ff086"; logging-data="2957"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/gU9pjGwsozd8leGMr8yWi" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (darwin) Cancel-Lock: sha1:F1g7kycDrPlDbuJkWUyXSUnh+SE= sha1:6+/EcdQVWPDe0o8/meJmnurBjQU= Xref: csiph.com comp.lang.forth:32602 Hello! I'm trying to run iForth from Emacs the way I've done this for gforth. So I have the following in my .emacs: --------- (require 'forth-mode "gforth.el") (autoload 'run-forth "gforth") (autoload 'forth-block-mode "gforth") (add-to-list 'auto-mode-alist '("\\.\\(f[s]?\\|frt\\)$" . forth-mode)) (add-to-list 'auto-mode-alist '("\\.fb$" . forth-block-mode)) (add-hook 'forth-mode-hook (function (lambda () ;; customize variables here: (setq forth-indent-level 4) (setq forth-minor-indent-level 2) (setq forth-hilight-level 3) ))) (defun run-gforth () (interactive) (run-forth "/usr/local/bin/gforth")) (defun run-iforth () (interactive) (run-forth "/Users/sasha/Library/iForth/i64.app/Contents/MacOS/i64.sh")) --------- Threr is a problem yet. When I try calling run-iforth it hangs with the following output: --------- IFORTH=/Users/sasha/Library/iForth IFORTHBIN64=/Users/sasha/Library/iForth/i64.app/Contents/MacOS/iforth.img IFORTH_VERBOSE=1 TERM_PROGRAM= [1] iForth server for Darwin, rev 1.01, Dec 30 2010, 11:09:21. [2] Stuffed iForth at 0x1000000 [entry: 0x1000000] /Users/sasha/Library/iForth/i64.app/Contents/MacOS/iforth :: TERM does not exist. ^[[6n --------- The result of successfull run in iTerm looks like this: --------- IFORTH=/Users/sasha/Library/iForth IFORTHBIN64=/Users/sasha/Library/iForth/i64.app/Contents/MacOS/iforth.img IFORTH_VERBOSE=1 TERM_PROGRAM=iTerm.app [1] iForth server for Darwin, rev 1.01, Dec 30 2010, 11:09:21. [2] Stuffed iForth at 0x1000000 [entry: 0x1000000] /Users/sasha/Library/iForth/i64.app/Contents/MacOS/iforth :: TERM does not exist. [4] Console is /dev/ttys000 [5] Audio support with: IN fjack [6] Executing include/iforth.prf Creating --- LOCATE utility Version 1.10 --- Creating --- Several utilities Version 3.11 --- Creating --- Extended OS words Version 3.17 --- Creating --- Terminal Driver Version 3.14 --- Creating --- Command line Editor Version 1.30 --- Creating --- Online help Version 1.36 --- Creating --- Glossary Generator Version 1.05 --- Creating --- Disassembler Version 2.40 --- Creating --- OS Library support Version 2.00 --- Creating --- Mach Timing Version 1.01 --- iForth version 4.0.635, generated 00:54:30, December 26, 2010. x86_64 binary, native floating-point, extended precision. Copyright 1996 - 2010 Marcel Hendrix. FORTH> --------- As far as I understand there is a problem with a terminal handling. BTW there is a similar problem with Swift Forth – it also can not be running from Emacs for the same reason. I'm just wondering, is it possible and how to run iForth from Emacs and use it with gforth-mode? Thanks in advance, Alexander