From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: "B. T. Raven" Newsgroups: gmane.emacs.help Subject: Re: windows, elisp function to call batch file, shell-command, Whitaker's words--solved Date: Fri, 2 Dec 2016 11:03:08 -0600 Organization: NewsGuy - Unlimited Usenet $23.95 Message-ID: References: <133ad417-b392-4e25-8a1d-b7dbbf19bb55@googlegroups.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1480698334 26785 195.159.176.226 (2 Dec 2016 17:05:34 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 2 Dec 2016 17:05:34 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.5.0 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 18:05:29 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 1cCrH6-0005mE-Gw for geh-help-gnu-emacs@m.gmane.org; Fri, 02 Dec 2016 18:05:28 +0100 Original-Received: from localhost ([::1]:35711 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cCrH7-0008AL-Ey for geh-help-gnu-emacs@m.gmane.org; Fri, 02 Dec 2016 12:05:29 -0500 Original-Path: usenet.stanford.edu!news.glorb.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!spln!extra.newsguy.com!newsp.newsguy.com!news3 Original-Newsgroups: gnu.emacs.help Original-Lines: 57 Original-NNTP-Posting-Host: p2bb55364063f6d0d7cd4d2db0478a9c0ccd71ba6cdef28ce.newsdawg.com In-Reply-To: <133ad417-b392-4e25-8a1d-b7dbbf19bb55@googlegroups.com> X-Received-Bytes: 3126 X-Received-Body-CRC: 1183296774 Original-Xref: usenet.stanford.edu gnu.emacs.help:219016 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:111860 Archived-At: On 12/2/2016 09:03, Hugh Lawson wrote: > On Friday, December 2, 2016 at 8:49:19 AM UTC-5, 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. > > [snip ] >> Here is the batch file, latin.bat >> >> cd c:\WORDS >> words > > I found the problem in my batch file, which I revised as follows: > @Echo off > cd c:\WORDS > words.exe %1 > > Yes, the batch file needs to be setup to accept argument(s). But you don't really need the batch file if you hardcode the path info into the elisp function: (defun wwwd () "Lookup Latin word at point with William Whitaker's Words program" (interactive ) (cd "c:/wwwd") ;; where I unzipped everything (shell-command (concat "wwwd " (thing-at-point 'sentence))) ;; renamed word.exe to wwwd.exe (cd "c:/mydocu~1")) ;; reset current directory for emacs (global-set-key (kbd "") 'wwwd) To use the 'sentence "thing" instead of the 'word "thing" you might have to mess with these settings: '(sentence-end "[.?!][]\"')}]*\\($\\| $\\| \\| \\)[ ]*") '(sentence-end-double-space nil) or else just enter a series of space-separated Latin forms on the same line. With the following (all punctuation removed), the programm parsed all tokens up to and including the words "bonorum omnium," most of them correctly. Quo usque tandem abutere Catilina, patientia nostra quam diu etiam furor iste tuus nos eludet quem ad finem sese effrenata iactabit audacia Nihilne te nocturnum praesidium Palati nihil urbis vigiliae nihil timor populi nihil concursus bonorum omnium nihil hic munitissimus habendi senatus locus nihil horum ora voltusque moverunt Patere tua consilia non sentis constrictam iam horum omnium scientia teneri coniurationem tuam non vides So there is a limit to the number a arguments that the program will accept, even though it's written in Ada. Ed