Support
Forums

Printing list for new buffer

I am making a function that takes a string containing the name of a buffer. In a way that if the buffer does not exist it is created. My plan is to use get-buffer-create because it can take a buffer or the name of a buffer.My difficulty is that with (p...
I am making a function that takes a string containing the name of a buffer. In a way that if the buffer does not exist it is created. My plan is to use get-buffer-create because it can take a buffer or the name of a buffer.

My difficulty is that with (print-list animals "*Messages*") things can printed in the *Messages* buffer, but (print-list animals "*Pepsi*") ends up with the *Pepsi* buffer being empty.

[code]
(defun print-list (list &optional nmbufr)
  "DESC"

  (with-current-buffer (get-buffer-create...