help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: using DDE from gnu-emacs


From: Jesper Harder
Subject: Re: using DDE from gnu-emacs
Date: Tue, 10 Dec 2002 23:37:59 +0100
User-agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.3.50 (i686-pc-linux-gnu)

address@hidden (Ehud Reshef) writes:

> Jesper Harder <address@hidden> wrote:
>> address@hidden (Ehud Reshef) writes:
>>
>> > I am looking for a way to send to Acrobat, a DDE command from
>> > gnu-Emacs
>> 
>> See:
>> 
>> <http://groups.google.com/groups?threadm=wkd778pgoh.fsf%40try.harder.Invalid&rnum=3>
>
> I Tried to follow the lead from there, and create the following (vey
> similar) lisp code:

You probably want something like this:

(defun acrobat-close-doc (file)
  "Close <file> in Acrobat, using DDE."
  (save-excursion
    (set-buffer (get-buffer-create " *ddeclient*"))
    (erase-buffer)
    (insert (concat "[DocClose( " file ".pdf )]" ))
    (call-process-region (point-min) (point-max)
                         "ddeclient" t t nil "acroview" "control")
    (if (= 0 (string-to-int (buffer-string))) t nil)))

(defun TeX-run-pdfLaTeX (name command file)
  "Create a process for NAME using COMMAND to format FILE with
pdfLaTeX."
  ;;  (acrobat-close-all-docs)
  (acrobat-close-doc file)
  (TeX-run-LaTeX name command file))

> I'm not very proficient with lisp...

The problem with you Lisp code is the way you are calling functions.  In
Lisp you call the function 'foo' with an argument arg1 like this:

  (foo arg1)

So instead of

  (acrobat-close-doc(file))

you should say: (acrobat-close-doc file)

[Contrary to popular belief, there are no redundant parens i Lisp :-)]

*But* I still don't think your version will work.  It's been a while
since I used it, but I think the Acrobat DDE interface will only
let you close a *specific* file if you *opened* it through DDE.  

AUC TeX doesn't open files with DDE, so you can't close them that way.
The only easy work-around I could think of at the time was to close all
files in Acrobat, which *is* possible even though they weren't opened
through DDE.
>From address@hidden  Tue Dec 10 18:10:18 2002
Path: 
shelby.stanford.edu!newsfeed.stanford.edu!headwall.stanford.edu!fu-berlin.de!uni-berlin.de!129.187.19.220!not-for-mail
From: Bjoern <address@hidden>
Newsgroups: gnu.emacs.help
Date: Wed, 11 Dec 2002 00:13:48 +0100
Lines: 28
Message-ID: <address@hidden>
References: <address@hidden>
        <address@hidden>
NNTP-Posting-Host: 129.187.19.220
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: fu-berlin.de 1039561786 33991919 129.187.19.220 (16 [142197])
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US;
        rv:1.2.1) Gecko/20021130
X-Accept-Language: en-us, en
In-Reply-To: <address@hidden>
Xref: shelby.stanford.edu gnu.emacs.help:107977
To: address@hidden
Subject: Re: xml indenting, possibly with psgml?
X-BeenThere: address@hidden
X-Mailman-Version: 2.1b5
Precedence: list
List-Id: Users list for the GNU Emacs text editor <help-gnu-emacs.gnu.org>
List-Help: <mailto:address@hidden>
List-Post: <mailto:address@hidden>
List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-gnu-emacs>,
        <mailto:address@hidden>
List-Archive: <http://mail.gnu.org/pipermail/help-gnu-emacs>
List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-gnu-emacs>,
        <mailto:address@hidden>
X-List-Received-Date: Tue, 10 Dec 2002 23:10:18 -0000

Jim Crossley wrote:
> Bjoern <address@hidden> writes:
> 
> 
>>I can't figure out how to make psgml indent my xml-files. It just
>>doesn't do anything when I press 'tab' or do 'indent-region'.
> 
> 
> M-x customize-variable RET sgml-indent-data

Hm, my emacs doesn't seem to know that variable :-(

>>I also get an error message because it doesn't find the dtd, can't I
>>get rid of that. I guess I really only need indenting and possibly
>>syntax highlighting.
> 
> 
> You'll only get that error once (the first time it attempts to
> parse).  You can live with it (and still derive benefit from
> indentation, etc) or you can create a local CATALOG file that contains
> the DTD references you commonly use.  I highly recommend this article:

The problem is that there isn't really a DTD for ant build.xml files. 
ALthough I think there now is a target to create one from a build file, 
but I am not sure if it's practical if it's constantly changing.

Bjoern


reply via email to

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