all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#19182: 24.4; which-function-mode end of function detection (easy suggestion for improvement)
@ 2014-11-25 18:38 Carlos Pita
  2022-05-12  2:04 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Carlos Pita @ 2014-11-25 18:38 UTC (permalink / raw)
  To: 19182; +Cc: alexr

It's a known and documented limitation of which-function mode that it
doesn't detect the end of a function due to it's dependence on
imenu. The following quotes are taken from which-func.el:

;; Really this package shows not "function where the current point is
;; located now", but "nearest function which defined above the current

;;     1. Dependence on imenu package should be removed.  Separate
;; function determination mechanism should be used to determine the end

What do you think about the following strategy which avoids to remove
the dependence on imenu and, instead, leverages imenu and the
end-of-defun functionality already provided by many major modes (in one
way or another)?

1) Detect the beginning of function using imenu, as it's currently done.

2) Detect the end of function using the end-of-defun variant for the
current major mode. The function implementing the corresponding
functionality for the current major mode should be configured explicitly
on a per-mode basis, but an *unsafe* option (disabled by default) could
also be provided to take it automatically from the M-C-e binding.

This is not to say that a separate mechanism would be undesirable but to
improve which-function support for many major modes out of the box in
the short term and in a very easy way.

Cheers
--
Carlos





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

* bug#19182: 24.4; which-function-mode end of function detection (easy suggestion for improvement)
  2014-11-25 18:38 bug#19182: 24.4; which-function-mode end of function detection (easy suggestion for improvement) Carlos Pita
@ 2022-05-12  2:04 ` Lars Ingebrigtsen
  2022-06-09 14:09   ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Lars Ingebrigtsen @ 2022-05-12  2:04 UTC (permalink / raw)
  To: Carlos Pita; +Cc: 19182, alexr

Carlos Pita <carlosjosepita@gmail.com> writes:

> It's a known and documented limitation of which-function mode that it
> doesn't detect the end of a function due to it's dependence on
> imenu.

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

Do you have a recipe to reproduce this end-function detection failure?
I tried it in a couple of modes and didn't see anything odd.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

* bug#19182: 24.4; which-function-mode end of function detection (easy suggestion for improvement)
  2022-05-12  2:04 ` Lars Ingebrigtsen
@ 2022-06-09 14:09   ` Lars Ingebrigtsen
  0 siblings, 0 replies; 3+ messages in thread
From: Lars Ingebrigtsen @ 2022-06-09 14:09 UTC (permalink / raw)
  To: Carlos Pita; +Cc: 19182, alexr

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Do you have a recipe to reproduce this end-function detection failure?
> I tried it in a couple of modes and didn't see anything odd.

More information was requested, but no response was given within a
month, so I'm closing this bug report.  If the problem still exists,
please respond to this email and we'll reopen the bug report.

-- 
(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:[~2022-06-09 14:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-25 18:38 bug#19182: 24.4; which-function-mode end of function detection (easy suggestion for improvement) Carlos Pita
2022-05-12  2:04 ` Lars Ingebrigtsen
2022-06-09 14:09   ` 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.