0

Is there a way to "inspect elements" for Emacs?


e.g. In Firefox, I would open the developer tools, select this icon:

enter image description here

Then pick an element on the page to get information on it.


For an Emacs example, I have the following window:

enter image description here

Is there a way for me to "select" the top yellow bar and get more information about what elisp code is rendering it?

Additional Information

After an Emacs update, one of my packages enabled this yellow top bar by default. I did not want it there. I am looking for an easy way to discover what package, elisp code, or general information about the rendering of a specific UI element either under the cursor, x/y coordinate, or mouse click (like in Firefox).

As for "this" top yellow bar, after a bit of guessing and enabling/disabling packages & modes, this was the culprit:

  • lsp-headerline-breadcrumb-mode

References

Jay
  • 103
  • 4
  • Found a similar (if not the same) question asked here: https://emacs.stackexchange.com/q/45715/798 – Jay Jun 19 '21 at 18:12
  • 1
    That other question seems totally different -- I believe it's asking for a way to inspect a web page (being shown in Firefox) within Emacs; whereas you are asking how to 'inspect' an Emacs buffer. – phils Jun 20 '21 at 08:35

1 Answers1

2

The two scenarios are different, but C-uC-x= calls (with a prefix argument) what-cursor-position which may help you -- it will tell you a lot of information about the character at point, including the faces and text properties.

This won't tell you "what elisp code is rendering it", because no elisp code is rendering it. The rendering is the responsibility of the redisplay code (which is written in C).


Edit: The question was about the header line...

C-cv header-line-format and mode-line-format control the contents of those two lines in any given buffer. See the latter and C-hig (elisp)Mode Line Format for details of how those work.

phils
  • 48,657
  • 3
  • 76
  • 115
  • The top yellow bar is "sticky" in my situation and stays on top as the buffer scrolls. I'll update the Q. Now looking into methods to "force" my cursor at that part of the GUI before running `what-cursor-position`. – Jay Jun 20 '21 at 17:56
  • 1
    Any buffer can have a header line, but you cannot put the cursor in it. It’s one of the more rarely–used features of Emacs, but if you want to see another place that uses it, just open up the info manuals: `C-h i`. Incidentally, you also cannot put the cursor into the mode line. – db48x Jun 20 '21 at 20:31
  • I've updated the answer regarding the header line and mode line. – phils Jun 20 '21 at 21:28