vile
[Top][All Lists]
Advanced

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

Re: [vile] Vile saves twice


From: Paul van Tilburg
Subject: Re: [vile] Vile saves twice
Date: Tue, 10 Mar 2009 14:13:08 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

Hello,

Thanks for the reply, it was perfectly on time for me to fix
things.

On Mon, Mar 09, 2009 at 03:54:01PM -0400, Thomas Dickey wrote:
> On Wed, Mar 04, 2009 at 05:41:40PM +0100, Paul van Tilburg wrote:
> > I am using a LaTeX authoring system that employes inotify to compile
> > the document when the right files change.  This works all find and all,
> > except that it seems that if I do ":w", or ":file-save", Vile seems
> > to save twice (I get two MODIFY events) while this is not the case with
> > other editors.  Is there are reason for it, is it a bug, or a feature? 
> 
> I just tried inotify, see this from one ":w" command:
> 
> foo MODIFY
> foo OPEN
> foo MODIFY
> foo CLOSE_WRITE,CLOSE
> 
> vile's doing a stat() call before it opens the file.

CLOSE_WRITE works even better, indeed.  Thanks.

> > Another small macro question:  I have created a macro that calls
> > find-next-error.  [...] How do I prevent this move or trap the error
> > and just print something on the prompt?
> 
> something like this:
> 
> store-procedure oops
>       ~force find-next-error
>       ~if &not $status
>               write-message "No more errors..."
>       ~endif
> ~endm
> bind-key oops ^X-^X

Excellent.  I overlook ~force.  Another question.  I now have the
following macro:

; Special variant of find-next-error that uses a specific .err file
; as error buffer.
store-procedure find-next-error-from-err-file "move to the next \"error\" in 
the error file"
  ~local %cbufname
  ~local %errfile
  setv %errfile &cat &path "root" $cfilname ".err"
  setv %cbufname $cbufname
  kill-buffer %errfile
  ~quiet edit-file %errfile
  error-buffer %errfile
  buffer %cbufname
  ~force find-next-error
  ~if &not $status
    write-message &cat &cat "[No (more) errors in " %errfile " buffer]"
  ~endif   
~endm
bind-key find-next-error-from-err-file ^X-l

So, in a common situation I edit paper.tex and save it, it will be
compiled asynchronously and if there are errors they are put in
paper.err.  Using ^X-l I can jump to an error, fix it and save again to
trigger a new compile.  However, since paper.err can be changed
asynchronously, I have to do a kill-buffer and edit-file of %errfile to
make it reload every time I run the macro, because a plain edit-file
doesn't seem to reload.  The result is that
find-next-error-from-err-file will only jump to the first error in
%errfile, even if it doesn't change between calls.  How can I make it
reload the file only if it has changed?

Another issue:  sometimes I start vile with several buffers, paper.tex,
01chapter1.tex.inc, 02chapter2.tex.inc, etc.  If I'm editing
02chapter2.tex.inc, I'd still like ^X-l to examine paper.err, not
attempt to use 02chapter2.tex.err which will not be generated.  Now, to
make it even remotely possible to get this working, I can agree to
always have the main file, in this case paper.tex, as the first file
on the commond line, but I am not sure how I can fix %errfile for this
session.  Any ideas/suggestions?

If I can solve the above two issues, this would lead to the perfect
(La)TeX editing setup for me.  I hope I can attain it. :)

Kind regards,
Paul

-- 
PhD Student @ Eindhoven                     | email: address@hidden
University of Technology, The Netherlands   | JID: address@hidden
>>> Using the Power of Debian GNU/Linux <<< | GnuPG key ID: 0x50064181




reply via email to

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