From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Newsgroups: gmane.emacs.help Subject: Re: windows, elisp function to call batch file, shell-command, Whitaker's words Date: Fri, 2 Dec 2016 15:06:22 +0100 Message-ID: <20161202140622.GA25935@tuxteam.de> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; x-action=pgp-signed Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1480687624 1056 195.159.176.226 (2 Dec 2016 14:07:04 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 2 Dec 2016 14:07:04 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Dec 02 15:06:56 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cCoUJ-0007Nb-BG for geh-help-gnu-emacs@m.gmane.org; Fri, 02 Dec 2016 15:06:55 +0100 Original-Received: from localhost ([::1]:34692 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cCoUL-0001rp-GS for geh-help-gnu-emacs@m.gmane.org; Fri, 02 Dec 2016 09:06:57 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49304) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cCoTt-0001qh-SD for help-gnu-emacs@gnu.org; Fri, 02 Dec 2016 09:06:30 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cCoTq-0008Ou-Mc for help-gnu-emacs@gnu.org; Fri, 02 Dec 2016 09:06:29 -0500 Original-Received: from mail.tuxteam.de ([5.199.139.25]:60372 helo=tomasium.tuxteam.de) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cCoTq-0008Oe-G6 for help-gnu-emacs@gnu.org; Fri, 02 Dec 2016 09:06:26 -0500 Original-Received: from tomas by tomasium.tuxteam.de with local (Exim 4.80) (envelope-from ) id 1cCoTm-0006rB-3T for help-gnu-emacs@gnu.org; Fri, 02 Dec 2016 15:06:22 +0100 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 5.199.139.25 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:111852 Archived-At: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Fri, Dec 02, 2016 at 05:49:17AM -0800, Hugh Lawson wrote: > The problem is that William Whitaker's Words program returns an error when I try to call it with this setup, in Windows 10. I have a Latin text in a buffer. I put the cursor on a Latin word, and strike F12. The elisp function calls the latin.bat bath file, which calls the words latin dictionary program. I think something is wrong either with my elisp function or my batch file. > > The following error is displayed: > > =>Raised END_ERROR, although in STANDARD_INPUT > ^Z is inappropriate keyboard input, WORDS should be terminated with a blank line > Giving up! > > In .emacs file: > > (defun whitaker-lookup () > "Lookup Latin word at point in Whitaker's words" > (interactive ) > (shell-command (concat "C:\latin " (thing-at-point 'word)))) > ;;C:\latin is a batch file > (global-set-key (kbd "") 'whitaker-lookup) It seems to me that words (and thus latin) are expecting the word(s) at their standard input, whereas your elisp snippet above is providing it as a command line argument. That would also (half-) explain why the program is complaining about a ^Z (which in DOS tradition sometimes signals an "end of file/stream"). You could try to mark the word in question (possibly appending it with a newline if things don't work right away) and invoking "M-x shell-command-on-region". If you get *that* to run, you at least know in which general direction to shoot. > Here is the batch file, latin.bat > > cd c:\WORDS > words > > > The same error occurs if I issue these commands: > > m-x shell-command > latin > > However, if I go into the shell mode buffer I can make things work: > > mx-shell > > c:\> cd c:\words > c:\words> words > ;;calls the words program with no error > c:\words> latin > ;; calls the batch file which calls the words program, successfully. *Here it is* how do now the words "arrive" at words viz. latin? Are they waiting for you to type them "at them"? regards - -- tomás -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlhBf94ACgkQBcgs9XrR2kZhSwCfX9okqHt1Q4KQprfgrlm+XYxz nPkAn1enQL03XFGeLlFwDzLoMyWbM1M0 =I5H+ -----END PGP SIGNATURE-----