From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Kaushal Modi Newsgroups: gmane.emacs.bugs Subject: bug#26378: 26.0.50; Hitting 'n' during ediff gives Error Date: Wed, 05 Apr 2017 22:36:03 +0000 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1142c3762755ff054c7305be X-Trace: blaine.gmane.org 1491431837 22997 195.159.176.226 (5 Apr 2017 22:37:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 5 Apr 2017 22:37:17 +0000 (UTC) Cc: phst@google.com, 26378@debbugs.gnu.org To: Noam Postavsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Apr 06 00:37:13 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cvtY8-0005PT-1r for geb-bug-gnu-emacs@m.gmane.org; Thu, 06 Apr 2017 00:37:12 +0200 Original-Received: from localhost ([::1]:42692 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cvtYC-0002HT-9q for geb-bug-gnu-emacs@m.gmane.org; Wed, 05 Apr 2017 18:37:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43417) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cvtY1-0002FS-Kw for bug-gnu-emacs@gnu.org; Wed, 05 Apr 2017 18:37:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cvtXy-0007aX-Ho for bug-gnu-emacs@gnu.org; Wed, 05 Apr 2017 18:37:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:35962) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cvtXy-0007aL-DU for bug-gnu-emacs@gnu.org; Wed, 05 Apr 2017 18:37:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cvtXy-0004hl-25 for bug-gnu-emacs@gnu.org; Wed, 05 Apr 2017 18:37:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Kaushal Modi Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 05 Apr 2017 22:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26378 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 26378-submit@debbugs.gnu.org id=B26378.149143178318037 (code B ref 26378); Wed, 05 Apr 2017 22:37:02 +0000 Original-Received: (at 26378) by debbugs.gnu.org; 5 Apr 2017 22:36:23 +0000 Original-Received: from localhost ([127.0.0.1]:34161 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cvtXL-0004gr-Il for submit@debbugs.gnu.org; Wed, 05 Apr 2017 18:36:23 -0400 Original-Received: from mail-lf0-f43.google.com ([209.85.215.43]:33134) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cvtXJ-0004gZ-IG for 26378@debbugs.gnu.org; Wed, 05 Apr 2017 18:36:22 -0400 Original-Received: by mail-lf0-f43.google.com with SMTP id h125so17302091lfe.0 for <26378@debbugs.gnu.org>; Wed, 05 Apr 2017 15:36:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7vBW/4XS9IhdwGlY3wDfhJLHkCogxIKOwAyRebRuX6Q=; b=r+naHohS0yO9YZNdqor3qUj2zU3fee2SwO5EJI0H1RA2V6LJnB+XmWdbZuFzOH0oQt Ar3qe8x23zX+dXANeY/hmnVf4AqrqGtxtD11RJdVDyDFdqYaYku+Oc2s1Doc7zn2FLjW anU+5IuaPf0N3YTJwFZVQlaL0eJF70ew9GAwH+XkZC7ZR816FqYUOmhSR8h7STQVKtiZ LH/ViltAZ0lJIowZolLy0urlzuaY9b6rZxAmlfZ2Fp8Csq3ihKcNoeHscZqTxWLu0J2W ZPR+Fg5duVRQsw30/oXKqCQ7jC7jrXzUgUaW9V2Yc2U9SBzb3Q3aEyF0Ud4j+BV8RjvR Powg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7vBW/4XS9IhdwGlY3wDfhJLHkCogxIKOwAyRebRuX6Q=; b=AZPQlU4nVXwG7aQsYCDGvjDrSuPOviMkQhtFoe7UNq3vDpf5ugcBMv51NRp3GpAnJM 9I9LTbOFu2V3B+WIHiRIPa4GbMAgQGxPma9Jx1YcHMNOuEmdbeqWnrTH7iWdiWR+rp7K 7RJq3a0gmNwHWx9E0U7hcfP7d8OJtuISZ4DjruPlsp3+/5WVCzdFCEHWJr6BItPjHqrz 0VxzcHZ7mijw8oIufzsPxM1PZ7cMfCGpcS8M5GiCdq5iZGupoIk9XSf3oqkttMUZ/IBL WSo9PKA/J5hUsE1r4H5SkeGNiGkUFnmM0j0DpOpBpXygZut0K1sHBe32LmT8zZZyHL2H ldCQ== X-Gm-Message-State: AFeK/H1qT7kKP3UgejThVZHH8oG8hVV/WokbMwiPDB9Cb30S7kX6ELWUdKk3/HKrMuIY8aKot00ba8KCP2PXMw== X-Received: by 10.46.1.220 with SMTP id f89mr9650118lji.7.1491431774965; Wed, 05 Apr 2017 15:36:14 -0700 (PDT) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:131299 Archived-At: --001a1142c3762755ff054c7305be Content-Type: text/plain; charset=UTF-8 On Wed, Apr 5, 2017 at 5:53 PM Noam Postavsky < npostavs@users.sourceforge.net> wrote: > On Wed, Apr 5, 2017 at 5:20 PM, Kaushal Modi > 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 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 --001a1142c3762755ff054c7305be Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Wed, Apr 5, 2017 at 5:53 PM Noam Postavsky &l= t;npostavs@users.sourcefo= rge.net> wrote:
On Wed, Apr 5, 2017 at 5:20 PM, Kaushal Modi <kausha= l.modi@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:

=C2=A0 =C2=A0 All elements in FILES must be strings.

This seems to be a lie, as they can also be nil.

How does this look?

From d= 4c732d16a5a79293c6f205ba9c75f82b17b3aa8 Mon Sep 17 00:00:00 2001
= From: Kaushal Modi <kaushal.mo= di@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 argumen= t
=C2=A0 passed to `file-local-copy' is a string (Bug#26378).= =C2=A0 Also convert
=C2=A0 an existing comment for the function t= o its doc-string.
---
=C2=A0lisp/vc/ediff-diff.el | 24 = +++++++++++++++++-------
=C2=A01 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
=C2=A0 = =C2=A0 ))
=C2=A0
=C2=A0
-;; Execute PROGRAM a= synchronously, unless OS/2, Windows-*, or DOS, or unless
-;; SYNC= H is non-nil.=C2=A0 BUFFER must be a buffer object, and must be alive.=C2= =A0 The
-;; OPTIONS arg is a list of options to pass to PROGRAM. = It may be a blank
-;; string.=C2=A0 All elements in FILES must be= strings.=C2=A0 We also delete nil from
-;; args.
=C2= =A0(defun ediff-exec-process (program buffer synch options &rest files)=
+ =C2=A0"Execute the diff PROGRAM.
+
+T= he PROGRAM output is sent to BUFFER, which must be a buffer object,
+and must be alive.
+
+The PROGRAM is executed async= hronously unless the OS is OS/2,
+Windows-*, or DOS, or unless SY= NCH is non-nil.
+
+OPTIONS is a list of options to pass= to PROGRAM.=C2=A0 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."
=C2=A0 =C2=A0(let ((data (match-data))
=C2=A0 ;; If this is a= buffer job, we are diffing temporary files
=C2=A0 ;; produced b= y Emacs with ediff-coding-system-for-write, so
@@ -1151,8 +1160,9= @@ ediff-exec-process
=C2=A0 args)
=C2=A0 =C2=A0 =C2= =A0(setq args (append (split-string options)
=C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (mapcar (la= mbda (file)
- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (file-name-u= nquote
- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(or (file-loc= al-copy file) file)))
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (whe= n (stringp file)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (= file-name-unquote
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0(or (file-local-copy file) file))))
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 files)))
=C2=A0 =C2=A0 =C2=A0(setq args (delete= "" (delq nil args))) ; delete nil and "" from argument= s
=C2=A0 =C2=A0 =C2=A0;; the --binary option, if present, should = be used only for buffer jobs
--=C2=A0
2.11.0
=

=C2=A0
--

Kaushal Modi

--001a1142c3762755ff054c7305be--