emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Understanding end-of-defun


From: Yuan Fu
Subject: Understanding end-of-defun
Date: Tue, 25 Oct 2022 19:22:27 -0700

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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]