GNU bug report logs -
#21851
ediff-patch-file fails if patch-buf is a buffer nameif patch-buf is a buffer name
Previous Next
Reported by: Tino Calancha <f92capac <at> gmail.com>
Date: Sat, 7 Nov 2015 15:10:03 UTC
Severity: minor
Tags: fixed, patch
Fixed in version 26.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 21851 in the body.
You can then email your comments to 21851 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#21851
; Package
emacs
.
(Sat, 07 Nov 2015 15:10:03 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Tino Calancha <f92capac <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Sat, 07 Nov 2015 15:10:03 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Congratulations! You may have unearthed a bug in Ediff!
Please make a concise and accurate summary of what happened
and mail it to the address above.
-----------------------------------------------------------
ediff-patch-file fails if patch-buf is a buffer name
* lisp/vc/ediff.el (ediff-patch-file)
emacs -Q:
(in *scratch* buffer)
(with-temp-file "/tmp/buff"
(insert "foo bar"))
(with-current-buffer (generate-new-buffer "buff2")
(insert "foo baz"))
;; call ediff-buffers on "buff" and "buff2" and save the
;; differences in a buffer "patch"
(epatch nil (get-buffer "patch")) ; ok
(epatch nil "patch") ; BAD
epatch: Wrong type argument: bufferp, "patch"
Emacs : GNU Emacs 25.0.50.1 (x86_64-pc-linux-gnu, GTK+ Version 2.24.28)
of 2015-11-07
Package: Ediff 2.81.5 of July 4, 2013
[ediff_1.patch (text/plain, attachment)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#21851
; Package
emacs
.
(Tue, 23 Feb 2016 05:09:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 21851 <at> debbugs.gnu.org (full text, mbox):
Tino Calancha <f92capac <at> gmail.com> writes:
> (epatch nil (get-buffer "patch")) ; ok
> (epatch nil "patch") ; BAD
> epatch: Wrong type argument: bufferp, "patch"
[...]
> - (if arg (prefix-numeric-value arg)) patch-buf))
> + (if arg (prefix-numeric-value arg)) (and (stringp patch-buf)
> + (get-buffer patch-buf))))
I don't think that's quite right -- now it'll error out if patch-buf is
a real buffer.
So I've applied the following instead:
diff --git a/lisp/vc/ediff.el b/lisp/vc/ediff.el
index e5e16a1..be4ced9 100644
--- a/lisp/vc/ediff.el
+++ b/lisp/vc/ediff.el
@@ -1367,7 +1367,8 @@ ediff-patch-file
(require 'ediff-ptch)
(setq patch-buf
(ediff-get-patch-buffer
- (if arg (prefix-numeric-value arg)) patch-buf))
+ (if arg (prefix-numeric-value arg))
+ (get-buffer patch-buf)))
(setq source-dir (cond (ediff-use-last-dir ediff-last-dir-patch)
((and (not ediff-patch-default-directory)
(buffer-file-name patch-buf))
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Added tag(s) fixed.
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Tue, 23 Feb 2016 05:09:02 GMT)
Full text and
rfc822 format available.
bug marked as fixed in version 25.2, send any further explanations to
21851 <at> debbugs.gnu.org and Tino Calancha <f92capac <at> gmail.com>
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Tue, 23 Feb 2016 05:09:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#21851
; Package
emacs
.
(Thu, 10 Mar 2016 05:06:02 GMT)
Full text and
rfc822 format available.
Message #15 received at 21851 <at> debbugs.gnu.org (full text, mbox):
> I don't think that's quite right -- now it'll error out if patch-buf is
> a real buffer.
>
> So I've applied the following instead:
>
> diff --git a/lisp/vc/ediff.el b/lisp/vc/ediff.el
> index e5e16a1..be4ced9 100644
> --- a/lisp/vc/ediff.el
> +++ b/lisp/vc/ediff.el
> @@ -1367,7 +1367,8 @@ ediff-patch-file
> (require 'ediff-ptch)
> (setq patch-buf
> (ediff-get-patch-buffer
> - (if arg (prefix-numeric-value arg)) patch-buf))
> + (if arg (prefix-numeric-value arg))
> + (get-buffer patch-buf)))
> (setq source-dir (cond (ediff-use-last-dir ediff-last-dir-patch)
> ((and (not ediff-patch-default-directory)
> (buffer-file-name patch-buf))
>
the interactive calls neesome adjust:
M-x ediff-patch-file RET
;; signals error:
Wrong type argument: stringp, nil
The doc. string starts with "Query for a file name ...",
it should prompt user for a file in this case, right?
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Thu, 07 Apr 2016 11:24:03 GMT)
Full text and
rfc822 format available.
bug unarchived.
Request was from
Tino Calancha <f92capac <at> gmail.com>
to
control <at> debbugs.gnu.org
.
(Wed, 27 Apr 2016 11:07:01 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#21851
; Package
emacs
.
(Wed, 27 Apr 2016 11:11:02 GMT)
Full text and
rfc822 format available.
Message #22 received at 21851 <at> debbugs.gnu.org (full text, mbox):
Hi Lars,
i think this thread should be considered a wish list; the
doc. string doesn't say that PATCH-BUF could be a buffer name:
"If optional PATCH-BUF is given, use the patch in that buffer
and don't ask the user."
So in principle there is nothing wrong if
(epatch nil "buffer-name")
signal an error. In fact, most of the folks would call this
function interactively, so there would not be issue at all.
*) If we prefer to keep the code as it is, maybe is worth to remark
in the doc. string the type of PATCH-BUF, someting like:
"If optional arg PATCH-BUF non-nil, then it is a buffer containing
the patch; use that patch and don't ask the user."
*) We may extend this function, so that, PATCH-BUF is a buffer
or the name of a buffer, like in many others functions in emacs.
Following patch do that:
diff --git a/lisp/vc/ediff.el b/lisp/vc/ediff.el
index 71099ab..f9f2370 100644
--- a/lisp/vc/ediff.el
+++ b/lisp/vc/ediff.el
@@ -1367,7 +1367,9 @@ ediff-patch-file
(require 'ediff-ptch)
(setq patch-buf
(ediff-get-patch-buffer
- (if arg (prefix-numeric-value arg)) patch-buf))
+ (and arg (prefix-numeric-value arg))
+ (and (or (stringp patch-buf) (bufferp patch-buf))
+ (get-buffer patch-buf))))
(setq source-dir (cond (ediff-use-last-dir ediff-last-dir-patch)
((and (not ediff-patch-default-directory)
(buffer-file-name patch-buf))
"GNU Emacs 25.0.93.1 (x86_64-pc-linux-gnu, GTK+ Version 2.24.30)
of 2016-04-27"
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Wed, 25 May 2016 11:24:03 GMT)
Full text and
rfc822 format available.
bug unarchived.
Request was from
Glenn Morris <rgm <at> gnu.org>
to
control <at> debbugs.gnu.org
.
(Sun, 04 Dec 2016 02:50:08 GMT)
Full text and
rfc822 format available.
bug Marked as fixed in versions 26.1.
Request was from
Glenn Morris <rgm <at> gnu.org>
to
control <at> debbugs.gnu.org
.
(Sun, 04 Dec 2016 02:50:08 GMT)
Full text and
rfc822 format available.
bug No longer marked as fixed in versions 25.2.
Request was from
Glenn Morris <rgm <at> gnu.org>
to
control <at> debbugs.gnu.org
.
(Sun, 04 Dec 2016 02:50:08 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sun, 01 Jan 2017 12:24:17 GMT)
Full text and
rfc822 format available.
This bug report was last modified 8 years and 224 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.