[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: windows, elisp function to call batch file, shell-command, Whitaker'

From: tomas
Subject: Re: windows, elisp function to call batch file, shell-command, Whitaker's words
Date: Fri, 2 Dec 2016 15:06:22 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

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 "<f12>") '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"?

- -- tomás
Version: GnuPG v1.4.12 (GNU/Linux)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]