[Top][All Lists]

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

Re: NSTRACE: Create message indicating window and/or buffer.

From: Anders Lindgren
Subject: Re: NSTRACE: Create message indicating window and/or buffer.
Date: Thu, 7 Sep 2017 10:23:26 +0200


Disclaimer: I really don't know that much about the internals of Emacs, so maybe there are better ways to do this...

Anyway, after looking at the `window' structure I see no "name" field. However, it contains a pointer to the frame, which has a name. Also, it contains a linked list of pointers to next and previous windows. By following the link to the previous windows until you have reached the beginning, you can count which position number it has. Using this you can print something like:

    window 5 on frame XXXX

Of course, you can package the argument string and the code to retrieve the values (which may be done inline or using support functions) in macros so that you can write something like:


Or even:

    NSTRACE_WIN ("bla bla", w)

See the rest of the NSTRACE macros for inspiration.

    -- Anders

Ps. Have you seen the https://github.com/Lindydancer/nstrace package? It, among else, contains a major mode with font-lock support that makes is easier to read the output of NSTRACE.

On Thu, Sep 7, 2017 at 7:07 AM, Keith David Bershatsky <address@hidden> wrote:
I would like to insert a NSTRACE message to let me know the window and/or buffer at issue.

For example, ns_update_window_end contains a first argument of `w`.  I would like to see the pretty human readable name for that window, just like what we see when running `M-x trace-redisplay`.  The `%s` format argument requires a `char`, and rejects a Lisp_Object.

How can I achieve this feature?



reply via email to

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