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.
Full log
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"
This bug report was last modified 8 years and 225 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.