all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dima Kogan <dima@secretsauce.net>
To: 21262@debbugs.gnu.org
Subject: bug#21262: 25.0.50; Diff-mode gets confused about its narrowing if hunk source not found
Date: Fri, 14 Aug 2015 22:12:09 -0700	[thread overview]
Message-ID: <87lhdd5e52.fsf@secretsauce.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 672 bytes --]

Hi. This bug has been there since at least emacs23 it seems like. To
reproduce:

1. emacs -Q

2. Open any patch file that has hunks from more than one file in it. For
instance, the attached patch file works, but it really doesn't matter

3. Narrow to just the second file's diffs. For instance: M-N M-N C-SPC
C-> C-x n n SPC (last SPC to confirm the narrowing)

4. Try to see the source of the hunk. Move the point to the guts of the
hunk, and M-enter. Emacs asks for the directory where the sources live.
In the process, it changes the narrowing to the wrong hunk. This is
wrong. The narrowing shouldn't change.

5. If we cancel with C-g, the wrong narrowing persists




[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: tst2.diff --]
[-- Type: text/x-diff, Size: 1214 bytes --]

diff --git a/src/charset.c b/src/charset.c
index b19e344..eeebf17 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -555,7 +555,7 @@ load_charset_map_from_vector (struct charset *charset, Lisp_Object vec, int cont
 
   if (len % 2 == 1)
     {
-      add_to_log ("Failure in loading charset map: %V", vec, Qnil);
+      add_to_log ("Failure in loading charset map: %V", vec);
       return;
     }
 
diff --git a/src/image.c b/src/image.c
index 066db74..313419b 100644
--- a/src/image.c
+++ b/src/image.c
@@ -629,16 +629,19 @@ valid_image_p (Lisp_Object object)
 }
 
 
-/* Log error message with format string FORMAT and argument ARG.
+/* Log error message with format string FORMAT and trailing arguments.
    Signaling an error, e.g. when an image cannot be loaded, is not a
    good idea because this would interrupt redisplay, and the error
    message display would lead to another redisplay.  This function
    therefore simply displays a message.  */
 
 static void
-image_error (const char *format, Lisp_Object arg1, Lisp_Object arg2)
+image_error (const char *format, ...)
 {
-  add_to_log (format, arg1, arg2);
+  va_list ap;
+  va_start (ap, format);
+  vadd_to_log (format, ap);
+  va_end (ap);
 }
 
 

             reply	other threads:[~2015-08-15  5:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-15  5:12 Dima Kogan [this message]
2017-08-21 19:49 ` bug#21262: 25.0.50; Diff-mode gets confused about its narrowing if hunk source not found Charles A. Roelli
2017-08-22  0:18   ` npostavs
2017-08-22 14:02     ` Charles A. Roelli
2017-08-27 12:21       ` Charles A. Roelli

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

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

  git send-email \
    --in-reply-to=87lhdd5e52.fsf@secretsauce.net \
    --to=dima@secretsauce.net \
    --cc=21262@debbugs.gnu.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.