Subject: bug#33567: Syntactic fontification of diff hunks

From: Eli Zaretskii <[email-masked]>
Date: Tue, 04 Dec 2018 08:46:46 +0200

> From: Juri Linkov <[email-masked]>
> Cc: Eli Zaretskii <[email-masked]>,  [email-masked]
> Date: Tue, 04 Dec 2018 01:24:52 +0200
> 
> -(defun vc-find-revision-no-save (file revision &optional backend)
> -  "Read REVISION of FILE into a buffer and return the buffer.
> +(defun vc-find-revision-no-save (file revision &optional backend buffer)
> +  "Read REVISION of FILE into a BUFFER and return the buffer.

Since you use BUFFER, please drop the "a" part.

Also, the doc string should tell what BUFFER defaults to if omitted or
nil.

> +  (let ((filebuf (or buffer (get-file-buffer file) (current-buffer)))
                     ^^^^^^^^^
I would use bufferp here.  What if someone calls the function with
something that is not a buffer?  And, btw, are buffer names allowed?

Similarly with other places where you make the same test (why not make
it once and bind some local variable to the result, btw?).

Thanks.