bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#33567: Syntactic fontification of diff hunks


From: Eli Zaretskii
Subject: bug#33567: Syntactic fontification of diff hunks
Date: Tue, 04 Dec 2018 08:46:46 +0200

> From: Juri Linkov <juri@linkov.net>
> Cc: Eli Zaretskii <eliz@gnu.org>,  33567@debbugs.gnu.org
> 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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]