How to check if a buffer is empty? Checking if count-lines
gives 0 is over-killing for this I think.
UPDATE: Yeah, phils's answer should work. Write it out:
(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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With