unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Tino Calancha <f92capac@gmail.com>
To: 21851@debbugs.gnu.org
Subject: bug#21851: (no subject)
Date: Wed, 27 Apr 2016 20:13:27 +0900 (JST)	[thread overview]
Message-ID: <alpine.LRH.2.20.1604272013070.29329@calancha-ilc.kek.jp> (raw)
In-Reply-To: <alpine.LRH.2.20.1511080005290.11525@calancha-ilc.kek.jp>


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"






      parent reply	other threads:[~2016-04-27 11:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-07 15:12 bug#21851: ediff-patch-file fails if patch-buf is a buffer nameif patch-buf is a buffer name Tino Calancha
2016-02-23  5:07 ` Lars Ingebrigtsen
2016-03-10  5:08   ` Tino Calancha
2016-04-27 11:13 ` Tino Calancha [this message]

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=alpine.LRH.2.20.1604272013070.29329@calancha-ilc.kek.jp \
    --to=f92capac@gmail.com \
    --cc=21851@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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).