all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Nikolaj Schumacher <n_schumacher@web.de>
To: bug-gnu-emacs@gnu.org
Subject: diff-find-file-name and /dev/null
Date: Sat, 18 Aug 2007 00:53:23 +0200	[thread overview]
Message-ID: <m2643dydr0.fsf@nschum.de> (raw)

[-- Attachment #1: Type: text/plain, Size: 272 bytes --]

Hello,

using diff files (from git) that create new files like this:

--- /dev/null
+++ b/foo/bar.c

I noticed that `diff-goto-source' opens /dev/null, which is usually not
desirable.  I use the attached small change to get the actual file.


regards,
Nikolaj Schumacher


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-patch, Size: 454 bytes --]

--- lisp/diff-mode.el	2007-08-17 06:03:27.000000000 +0200
+++ lisp/diff-mode.el	2007-08-18 00:48:25.000000000 +0200
@@ -667,6 +667,7 @@
       (or (ignore-errors (diff-beginning-of-file))
 	  (re-search-forward diff-file-header-re nil t)))
     (let ((fs (diff-hunk-file-names old)))
+      (setq fs (delete "/dev/null" fs))
       (if prefix (setq fs (mapcar (lambda (f) (concat prefix f)) fs)))
       (or
        ;; use any previously used preference

[-- Attachment #3: Type: text/plain, Size: 149 bytes --]

_______________________________________________
bug-gnu-emacs mailing list
bug-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-gnu-emacs

             reply	other threads:[~2007-08-17 22:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-17 22:53 Nikolaj Schumacher [this message]
2007-08-17 23:33 ` diff-find-file-name and /dev/null Michaël Cadilhac
2007-08-19 21:06   ` Nikolaj Schumacher
2007-08-25  1:54     ` Glenn Morris
2007-08-27  4:51       ` Stefan Monnier
2007-08-27  7:10         ` Glenn Morris

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

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

  git send-email \
    --in-reply-to=m2643dydr0.fsf@nschum.de \
    --to=n_schumacher@web.de \
    --cc=bug-gnu-emacs@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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.