unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* diff-find-file-name and /dev/null
@ 2007-08-17 22:53 Nikolaj Schumacher
  2007-08-17 23:33 ` Michaël Cadilhac
  0 siblings, 1 reply; 6+ messages in thread
From: Nikolaj Schumacher @ 2007-08-17 22:53 UTC (permalink / raw)
  To: bug-gnu-emacs

[-- 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-08-27  7:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-17 22:53 diff-find-file-name and /dev/null Nikolaj Schumacher
2007-08-17 23:33 ` 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

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).