unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Tino Calancha <f92capac@gmail.com>
Cc: 23824@debbugs.gnu.org
Subject: bug#23824: 25.0.95; Prevent compare one buffer with itself
Date: Wed, 22 Jun 2016 18:19:15 +0300	[thread overview]
Message-ID: <83wplh45fw.fsf@gnu.org> (raw)
In-Reply-To: <alpine.DEB.2.20.1606221910180.6293@calancha-pc> (message from Tino Calancha on Wed, 22 Jun 2016 19:12:13 +0900 (JST))

> From: Tino Calancha <f92capac@gmail.com>
> 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	other threads:[~2016-06-22 15:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-22 10:12 bug#23824: 25.0.95; Prevent compare one buffer with itself Tino Calancha
2016-06-22 15:19 ` Eli Zaretskii [this message]
2016-06-23  0:58   ` Tino Calancha
2016-06-23 15:27     ` Eli Zaretskii
2016-06-24  5:07       ` Tino Calancha
2016-06-24 13:16         ` bug#23824: 25.0.95; Do not prompt twice to save a buffer Tino Calancha
2016-06-25 10:26           ` Eli Zaretskii
2016-06-26  1:59 ` bug#23824: (no subject) Tino Calancha

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83wplh45fw.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=23824@debbugs.gnu.org \
    --cc=f92capac@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).