How can I check if a current buffer exists in Emacs?

From the documentation:

(get-buffer name)

Return the buffer named name (a string).
If there is no live buffer named name, return nil.
name may also be a buffer; if so, the value is that buffer.

(get-buffer-create name)

Return the buffer named name, or create such a buffer and return it.
A new buffer is created if there is no live buffer named name.
If name starts with a space, the new buffer does not keep undo information.
If name is a buffer instead of a string, then it is the value returned.
The value is never nil.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)