branch: elpa/gptel commit 841dae06defe1b5717f6102cd7dbaf9685a48abc Author: Karthik Chikmagalur <karthikchikmaga...@gmail.com> Commit: Karthik Chikmagalur <karthikchikmaga...@gmail.com>
gptel: Improve binary file detection with multibyte check * gptel.el (gptel--file-binary-p): Detect multibyte coding-systems used for binary files in `gptel--file-binary-p'. Should help with problems like #914 and possibly #912. --- gptel.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gptel.el b/gptel.el index dd2dbe3253..25028a192d 100644 --- a/gptel.el +++ b/gptel.el @@ -976,7 +976,8 @@ Later plists in the sequence take precedence over earlier ones." (condition-case nil (with-temp-buffer (insert-file-contents path nil 1 512 'replace) - (eq buffer-file-coding-system 'no-conversion)) + (memq buffer-file-coding-system + '(no-conversion no-conversion-multibyte))) (file-missing (message "File \"%s\" is not readable." path) nil)))