* bug#30230: 27.0.50; find-face-definition wrong result for default face
@ 2018-01-23 12:28 Basil L. Contovounesios
2018-04-17 20:13 ` Lars Ingebrigtsen
2021-06-25 15:17 ` Lars Ingebrigtsen
0 siblings, 2 replies; 3+ messages in thread
From: Basil L. Contovounesios @ 2018-01-23 12:28 UTC (permalink / raw)
To: 30230
Steps to reproduce:
1. emacs -Q
2. M-x find-face-definition RET default RET
Expected result: point at definition of default defface in
lisp/faces.el.
Actual result: point in docstring of face-spec-recalc defun in
lisp/faces.el
Some solution suggestions, in order of increasing complexity:
1. Reword aforementioned docstring to make it look less like a defface,
e.g. by replacing parens with brackets.
2. Replace find-face-regexp in find-function-regexp-alist with a
function which repeats the find-face-regexp search until point is
actually at a defface.
3. ?
If option (2) is entertained, I wonder if this approach should be
generalised to all regexp searches, i.e. including those for defuns,
defvars, etc.
Let me know what you think and whether you would like me to provide a
patch.
Thanks,
--
Basil
In GNU Emacs 27.0.50 (build 25, x86_64-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
of 2018-01-22 built on thunk
Repository revision: c42959cc206bcb52baffd45f892da1b767f0f8c1
Windowing system distributor 'The X.Org Foundation', version 11.0.11905000
System Description: Debian GNU/Linux testing (buster)
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#30230: 27.0.50; find-face-definition wrong result for default face
2018-01-23 12:28 bug#30230: 27.0.50; find-face-definition wrong result for default face Basil L. Contovounesios
@ 2018-04-17 20:13 ` Lars Ingebrigtsen
2021-06-25 15:17 ` Lars Ingebrigtsen
1 sibling, 0 replies; 3+ messages in thread
From: Lars Ingebrigtsen @ 2018-04-17 20:13 UTC (permalink / raw)
To: Basil L. Contovounesios; +Cc: 30230
"Basil L. Contovounesios" <contovob@tcd.ie> writes:
> Steps to reproduce:
>
> 1. emacs -Q
> 2. M-x find-face-definition RET default RET
>
> Expected result: point at definition of default defface in
> lisp/faces.el.
>
> Actual result: point in docstring of face-spec-recalc defun in
> lisp/faces.el
Yup.
> Some solution suggestions, in order of increasing complexity:
>
> 1. Reword aforementioned docstring to make it look less like a defface,
> e.g. by replacing parens with brackets.
>
> 2. Replace find-face-regexp in find-function-regexp-alist with a
> function which repeats the find-face-regexp search until point is
> actually at a defface.
At least it could look around and see whether it's in a doc string or a
comment, and not return the definition if it's there, I would have
thought? And without looking at the code, I would imagine that that
shouldn't be very difficult.
> Let me know what you think and whether you would like me to provide a
> patch.
Yes, please patches. :-)
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#30230: 27.0.50; find-face-definition wrong result for default face
2018-01-23 12:28 bug#30230: 27.0.50; find-face-definition wrong result for default face Basil L. Contovounesios
2018-04-17 20:13 ` Lars Ingebrigtsen
@ 2021-06-25 15:17 ` Lars Ingebrigtsen
1 sibling, 0 replies; 3+ messages in thread
From: Lars Ingebrigtsen @ 2021-06-25 15:17 UTC (permalink / raw)
To: Basil L. Contovounesios; +Cc: 30230
"Basil L. Contovounesios" <contovob@tcd.ie> writes:
> 2. Replace find-face-regexp in find-function-regexp-alist with a
> function which repeats the find-face-regexp search until point is
> actually at a defface.
I've now done this in Emacs 28 for defface. An even more general
solution would be to change `find-function-search-for-symbol' to ignore
all matches that are inside comments or strings, but I didn't feel
familiar enough with all the use cases here to do that.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-06-25 15:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-23 12:28 bug#30230: 27.0.50; find-face-definition wrong result for default face Basil L. Contovounesios
2018-04-17 20:13 ` Lars Ingebrigtsen
2021-06-25 15:17 ` Lars Ingebrigtsen
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.