Having `magic:find-file-magic-alist-enable' features turned on, the
following scenario could eventuate...
C-x C-f /path/one/to/a/file/called/Wanda
C-x C-f /path/two/to/another/file/called/Wanda
would result in the *same* buffer being used for *both* files.
Imagine the fun, especially when both paths are writable for you.
This change fixes that.
* lisp/ffi/ffi-magic.el (magic:find-file-noselect): Use
#'create-file-buffer, not #'get-buffer-create. Gah! What was I
thinking?!
Signed-off-by: Steve Youngs <steve@sxemacs.org>
(defun magic:find-file-noselect (file)
(let* ((codesys (intern (magic:file file :mime-encoding)))
(coding-system-for-read codesys)
- (buf (get-buffer-create (file-name-nondirectory file)))
+ (buf (create-file-buffer file))
(coding nil))
(with-current-buffer buf
(insert-file-contents file t)