unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Understanding end-of-defun
@ 2022-10-26  2:22 Yuan Fu
  2022-10-26  2:55 ` Stefan Monnier
  0 siblings, 1 reply; 7+ messages in thread
From: Yuan Fu @ 2022-10-26  2:22 UTC (permalink / raw)
  To: emacs-devel

I’m looking at end-of-defun’s definition, and these two lines looks weird:

Line 570 in lisp.el:

(unless (zerop arg)
          (beginning-of-defun-raw (- arg))
          (funcall end-of-defun-function))

Presumably this makes us go to the next arg’h begining-of-defun, and goes to the end of that defun. However, what if beginning-of-defun-raw couldn’t find any defun beyond point, didn’t move point, and returned nil? At that point calling end-of-defun-function breaks the assumption that we only call it when point is at the beginning of a defun. Am I missing something?

Yuan


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

end of thread, other threads:[~2022-11-10 23:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-26  2:22 Understanding end-of-defun Yuan Fu
2022-10-26  2:55 ` Stefan Monnier
2022-10-27  4:44   ` Yuan Fu
2022-10-27 15:25     ` Stefan Monnier
2022-11-10 22:35       ` Yuan Fu
2022-11-10 22:49         ` Stefan Monnier
2022-11-10 23:10           ` Yuan Fu

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).