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

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

bug#23824: 25.0.95; Prevent compare one buffer with itself


From: Eli Zaretskii
Subject: bug#23824: 25.0.95; Prevent compare one buffer with itself
Date: Wed, 22 Jun 2016 18:19:15 +0300

> From: Tino Calancha <address@hidden>
> Date: Wed, 22 Jun 2016 19:12:13 +0900 (JST)
> 
> When the current buffer, buf-a, is visiting FILE-B, buf-b should
> be a temporary buffer on sync with FILE-B.
> 
> ./emacs -r -Q -eval '(progn (with-temp-file "/tmp/foo" (insert "foo")) 
> (find-file "/tmp/foo") (insert "bar"))'
> M-: (highlight-compare-with-file "/tmp/foo") RET
> n n ; Answer no to saving suggestions.
> ;; Current buffer content different than /tmp/foo but no face 
> highlight-changes shown.

I think we need first to establish what exactly is the semantic of
this situation.  You are comparing a buffer with the file that the
buffer visits.  The doc string of this function tries to say something
about this situation:

  If the current buffer is visiting the file being compared against, it
  also will have its differences highlighted.  Otherwise, the file is
  read in temporarily but the buffer is deleted.

but I must confess that this is incomprehensible for me.  So I think
we should first establish what that means, or what the code is trying
to do.

> +                         (with-current-buffer buf-new
> +                           (insert-file-contents-literally file-b)

??? Why insert-file-contents-literally?  That definitely sounds wrong.

Thanks.





reply via email to

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