From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Sebastien Vauban" Subject: Re: [PATCH] Improve message when file to include is missing Date: Tue, 18 Feb 2014 21:32:48 +0100 Message-ID: <867g8sqhzj.fsf@somewhere.org> References: <86wqhpu021.fsf@somewhere.org> <87fvodvdh9.fsf@gmail.com> <86bny4o4gz.fsf@somewhere.org> <87ppmk2mu5.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-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 Nicolas, Nicolas Goaziou wrote: > "Sebastien Vauban" writes: > >> This should answer your (fruitful) comments. > > Thank you for the update. > > It looks good. Thanks. > AFAIC, you can push it. I don't have (yet) push access... >> + (if (or (not file) (not (file-readable-p file))) >> + (if (not noerror) >> + (error "Cannot read file \"%s\"%s" file info-from-file) >> + (message "Cannot read file \"%s\"%s" file info-from-file)) >> + (with-temp-buffer >> + (insert-file-contents file) >> + (buffer-string))))) > > Minor stylistic issue: I find the following a bit easier to understand. > > (if (and file (file-readable-p file)) > (with-temp-buffer > (insert-file-contents file) > (buffer-string)) > (funcall (if noerror #'message #'error) > "Cannot read file \"%s\"%s" file info-from-file)) So do I... Best regards, Seb -- Sebastien Vauban