[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: NSTRACE: Create message indicating window and/or buffer.
From: |
Eli Zaretskii |
Subject: |
Re: NSTRACE: Create message indicating window and/or buffer. |
Date: |
Thu, 07 Sep 2017 17:56:04 +0300 |
> Date: Wed, 06 Sep 2017 22:07:53 -0700
> From: Keith David Bershatsky <address@hidden>
>
> 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?
Something like this should work:
if (BUFFERP (w->contents) && STRINGP (BVAR (XBUFFER (w->contents), name)))
fprintf (stderr, "window %s\n", SSDATA (BVAR (XBUFFER (w->contents), name));
This prints the name of the buffer shown in the window.