8

如何检查缓冲区是否为空?我认为检查是否count-lines给出 0 是过度杀戮。

更新: 是的,菲尔斯的回答应该有效。把它写出来:

(defun buffer-empty-p (&optional buffer)
  (= (buffer-size buffer) 0))
4

1 回答 1

14
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.
于 2013-08-19T11:42:50.110 回答