GNU bug report logs - #26378
26.0.50; Hitting 'n' during ediff gives Error

Previous Next

Package: emacs;

Reported by: Kaushal Modi <kaushal.modi <at> gmail.com>

Date: Wed, 5 Apr 2017 20:58:02 UTC

Severity: normal

Tags: fixed

Merged with 26385, 26394

Found in version 26.0.50

Done: npostavs <at> users.sourceforge.net

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Kaushal Modi <kaushal.modi <at> gmail.com>
To: Noam Postavsky <npostavs <at> users.sourceforge.net>
Cc: phst <at> google.com, 26378 <at> debbugs.gnu.org
Subject: bug#26378: 26.0.50; Hitting 'n' during ediff gives Error
Date: Wed, 05 Apr 2017 22:36:03 +0000
[Message part 1 (text/plain, inline)]
On Wed, Apr 5, 2017 at 5:53 PM Noam Postavsky <
npostavs <at> users.sourceforge.net> wrote:

> On Wed, Apr 5, 2017 at 5:20 PM, Kaushal Modi <kaushal.modi <at> gmail.com>
> wrote:
> > Subject: [PATCH] Check that file argument is a string
>
> We should probably update the comment above `ediff-exec-process' where it
> says:
>
>     All elements in FILES must be strings.
>
> This seems to be a lie, as they can also be nil.
>

How does this look?

From d4c732d16a5a79293c6f205ba9c75f82b17b3aa8 Mon Sep 17 00:00:00 2001
From: Kaushal Modi <kaushal.modi <at> gmail.com>
Date: Wed, 5 Apr 2017 17:16:33 -0400
Subject: [PATCH] Check that file argument is a string

* lisp/vc/ediff-diff.el (ediff-exec-process): Check that the argument
  passed to `file-local-copy' is a string (Bug#26378).  Also convert
  an existing comment for the function to its doc-string.
---
 lisp/vc/ediff-diff.el | 24 +++++++++++++++++-------
 1 file changed, 17 insertions(+), 7 deletions(-)

diff --git a/lisp/vc/ediff-diff.el b/lisp/vc/ediff-diff.el
index cfa08ef360..ca7c3ab517 100644
--- a/lisp/vc/ediff-diff.el
+++ b/lisp/vc/ediff-diff.el
@@ -1134,12 +1134,21 @@ ediff-setup-diff-regions3
    ))


-;; Execute PROGRAM asynchronously, unless OS/2, Windows-*, or DOS, or
unless
-;; SYNCH is non-nil.  BUFFER must be a buffer object, and must be alive.
The
-;; OPTIONS arg is a list of options to pass to PROGRAM. It may be a blank
-;; string.  All elements in FILES must be strings.  We also delete nil from
-;; args.
 (defun ediff-exec-process (program buffer synch options &rest files)
+  "Execute the diff PROGRAM.
+
+The PROGRAM output is sent to BUFFER, which must be a buffer object,
+and must be alive.
+
+The PROGRAM is executed asynchronously unless the OS is OS/2,
+Windows-*, or DOS, or unless SYNCH is non-nil.
+
+OPTIONS is a list of options to pass to PROGRAM.  It may be a blank
+string.
+
+An element in FILES must be either a string or nil.
+
+We also delete nil and \"\" from all arguments."
   (let ((data (match-data))
  ;; If this is a buffer job, we are diffing temporary files
  ;; produced by Emacs with ediff-coding-system-for-write, so
@@ -1151,8 +1160,9 @@ ediff-exec-process
  args)
     (setq args (append (split-string options)
                        (mapcar (lambda (file)
-                                 (file-name-unquote
-                                  (or (file-local-copy file) file)))
+                                 (when (stringp file)
+                                   (file-name-unquote
+                                    (or (file-local-copy file) file))))
                                files)))
     (setq args (delete "" (delq nil args))) ; delete nil and "" from
arguments
     ;; the --binary option, if present, should be used only for buffer jobs
-- 
2.11.0




-- 

Kaushal Modi
[Message part 2 (text/html, inline)]

This bug report was last modified 8 years and 40 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.