all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* NSTRACE:  Create message indicating window and/or buffer.
@ 2017-09-07  5:07 Keith David Bershatsky
  2017-09-07  8:23 ` Anders Lindgren
  2017-09-07 14:56 ` Eli Zaretskii
  0 siblings, 2 replies; 4+ messages in thread
From: Keith David Bershatsky @ 2017-09-07  5:07 UTC (permalink / raw)
  To: Emacs Devel

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?

Thanks,

Keith



^ permalink raw reply	[flat|nested] 4+ messages in thread
* Re: NSTRACE:  Create message indicating window and/or buffer.
@ 2017-09-07 16:34 Keith David Bershatsky
  0 siblings, 0 replies; 4+ messages in thread
From: Keith David Bershatsky @ 2017-09-07 16:34 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Anders Lindgren, emacs-devel

Printing to stderr achieves the desired result -- thank you very much!  I wrapped it in an NSTRACE_ENABLED condition:

#if NSTRACE_ENABLED
  if (BUFFERP (w->contents) && STRINGP (BVAR (XBUFFER (w->contents), name)))
    fprintf (stderr, "window %s\n", SSDATA (BVAR (XBUFFER (w->contents), name)));
#endif

Thank you also to Anders for taking an interest in this thread.  Your assistance is always greatly appreciated.

Keith

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

DATE:  [09-07-2017 07:56:04] <07 Sep 2017 17:56:04 +0300>
FROM:  Eli Zaretskii <eliz@gnu.org>
> 
> * * * 
> 
>   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.



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-09-07 16:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-07  5:07 NSTRACE: Create message indicating window and/or buffer Keith David Bershatsky
2017-09-07  8:23 ` Anders Lindgren
2017-09-07 14:56 ` Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2017-09-07 16:34 Keith David Bershatsky

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.