如何检查缓冲区是否为空?检查count-lines
给出0是否过度杀死我认为。
更新 是的,菲尔斯的回答应该有效。把它写出来:
(defun buffer-empty-p (&optional buffer)
(= (buffer-size buffer) 0))
答案 0 :(得分:12)
buffer-size is a built-in function in `C source code'.
(buffer-size &optional BUFFER)
Return the number of characters in the current buffer.
If BUFFER, return the number of characters in that buffer instead.