From mboxrd@z Thu Jan  1 00:00:00 1970
From: "Sebastien Vauban" <sva-news-D0wtAvR13HarG/iDocfnWg@public.gmane.org>
Subject: [PATCH] Improve message when file to include is missing
Date: Fri, 24 Jan 2014 11:49:26 +0100
Message-ID: <86wqhpu021.fsf@somewhere.org>
Mime-Version: 1.0
Content-Type: text/plain
Return-path: <emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org>
List-Id: "General discussions about Org-mode." <emacs-orgmode.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/emacs-orgmode>,
	<mailto:emacs-orgmode-request-mXXj517/zsQ@public.gmane.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/emacs-orgmode>
List-Post: <mailto:emacs-orgmode-mXXj517/zsQ@public.gmane.org>
List-Help: <mailto:emacs-orgmode-request-mXXj517/zsQ@public.gmane.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/emacs-orgmode>,
	<mailto:emacs-orgmode-request-mXXj517/zsQ@public.gmane.org?subject=subscribe>
Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org
Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org
To: emacs-orgmode-mXXj517/zsQ@public.gmane.org

Hello,

When a SETUPFILE is missing, there is an error or message generated, but
we don't know in which file the bad reference is -- when all those files
are loaded during the agenda generation.

Hence, a better message, specifying where to go and look for the bad
link.

Best regards,
  Seb

>From 4c31c1cf649c2eb3487e61e56296f058a62d7c08 Mon Sep 17 00:00:00 2001
From: "Sebastien Vauban" <sva-news-D0wtAvR13HarG/iDocfnWg@public.gmane.org>
Date: Fri, 24 Jan 2014 11:43:52 +0100
Subject: [PATCH] Improve message when file to include is missing

* org.el (org-file-contents): Improve message when linked file does not exist.

---
 lisp/org.el |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index a225bae..787a09f 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5235,8 +5235,10 @@ Support for group tags is controlled by the option
   (if (or (not file)
 	  (not (file-readable-p file)))
       (if noerror
-	  (message "Cannot read file \"%s\"" file)
-	(error "Cannot read file \"%s\"" file))
+	  (message "Cannot read file \"%s\" referenced in file \"%s\""
+		   file (buffer-file-name))
+	(error "Cannot read file \"%s\" referenced in file \"%s\""
+	       file (buffer-file-name)))
     (with-temp-buffer
       (insert-file-contents file)
       (buffer-string))))
-- 
1.7.9

-- 
Sebastien Vauban