Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何检查缓冲区是否为空?我认为检查是否count-lines给出 0 是过度杀戮。
count-lines
更新: 是的,菲尔斯的回答应该有效。把它写出来:
(defun buffer-empty-p (&optional buffer) (= (buffer-size buffer) 0))
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.