bug-zile
[Top][All Lists]
Advanced

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

Re: [Bug-zile] Bug-zile Digest, Vol 45, Issue 13


From: Garnaik Sumeet
Subject: Re: [Bug-zile] Bug-zile Digest, Vol 45, Issue 13
Date: Fri, 21 Mar 2014 23:40:31 +0530

Hi Gary,
         Thank you for the background and the solution. I am looking into it and will commit as soon as it is fixed.

Thank you,

Garnaik.


On Thu, Mar 20, 2014 at 9:30 PM, <address@hidden> wrote:
Send Bug-zile mailing list submissions to
        address@hidden

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.gnu.org/mailman/listinfo/bug-zile
or, via email, send a message with subject or body 'help' to
        address@hidden

You can reach the person managing the list at
        address@hidden

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Bug-zile digest..."


Today's Topics:

   1. Re: Fix Me: Warn when file changes on disk (Gary V. Vaughan)


----------------------------------------------------------------------

Message: 1
Date: Thu, 20 Mar 2014 16:15:24 +1300
From: "Gary V. Vaughan" <address@hidden>
To: Garnaik Sumeet <address@hidden>
Cc: Zile bugs <address@hidden>
Subject: Re: [Bug-zile] Fix Me: Warn when file changes on disk
Message-ID: <address@hidden>
Content-Type: text/plain; charset="us-ascii"

[[Resend to Zile Bugs List]]

Hi Garnaik,

On Mar 20, 2014, at 8:28 AM, Garnaik Sumeet <address@hidden> wrote:
>          Do we have any function for printing alert messages on the screen or just use the standard printing functions of luaposix.curses

Yes... and no.

Most terminal types have a mode called 'alternate screen', which is why when you start most curses apps you'll see the entire screen change over to display the app, and then when the app exits, the original display output is restored to your show your shell history undamaged by whatever screen drawing curses did.

Consequently Zmacs and Zz also switch to the alternate screen, but at least save any Lua error message and traceback that causes abnormal termination, for display on the normal screen after curses has exited.  This means, of course, that anything you print to the stderr and stdout by bypassing the curses display functions, while curses is managing the alternate screen display, will probably be wholly or partially removed shortly afterwards by the curses display update algorithms, and then lost entirely when switching out of the 'alternate screen' mode when they exit.

Here are a couple of tricks I use to work around this when debugging:

 1. send any debug messages to stderr with `io.stderr:write ("var = " .. value .. "\n")` (note the final \n is required to ensure the output is flushed when stderr is in its default line-buffered mode) and then run Zmacs with `lib/zmacs/zmacs 2>log`, which saves the stderr output to a log file that survives screen switching.
 2. send debug messages to the '*Messages*' buffer, either using `minibuf_echo ("var = " .. value .. "\n")`, and then split the screen into two buffers and visit '*Messages*' with one of them so I can watch the debug messages as they arrive.
 3. write a test-case for the problem I'm having (in Specl for a test that is worth keeping, or just x.lua for a throwaway check), and use it to run zmacs in batch mode (zmacs --batch --load x.lua) so that `minibuf_echo` output is displayed on stderr without switching to the alternate screen.

Hope that helps!

Cheers,
--
Gary V. Vaughan (gary AT vaughan DOT pe)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 163 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.gnu.org/archive/html/bug-zile/attachments/20140320/4fac7480/attachment.pgp>

------------------------------

_______________________________________________
Bug-zile mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/bug-zile


End of Bug-zile Digest, Vol 45, Issue 13
****************************************


reply via email to

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