From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Allow #+SETUPFILE to point to an URL for the org file Date: Thu, 25 May 2017 12:18:28 +0200 Message-ID: <87k255b5or.fsf@nicolasgoaziou.fr> References: <87h96eh4qb.fsf@nicolasgoaziou.fr> <871sxigkhk.fsf@nicolasgoaziou.fr> <87twaef3iq.fsf@nicolasgoaziou.fr> <874lybp5ua.fsf@nicolasgoaziou.fr> <87shjtb5wd.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51760) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dDpqo-0005nl-Em for emacs-orgmode@gnu.org; Thu, 25 May 2017 06:18:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dDpqj-0004f6-EH for emacs-orgmode@gnu.org; Thu, 25 May 2017 06:18:38 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:49540) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dDpqj-0004eD-7b for emacs-orgmode@gnu.org; Thu, 25 May 2017 06:18:33 -0400 In-Reply-To: <87shjtb5wd.fsf@nicolasgoaziou.fr> (Nicolas Goaziou's message of "Thu, 25 May 2017 12:13:54 +0200") 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@gnu.org Sender: "Emacs-orgmode" To: Kaushal Modi Cc: emacs-org list Correcting myself, Nicolas Goaziou writes: > (cond > (cache) > (is-url > (with-current-buffer (url-retrieve-synchronously file) > (goto-char (point-min)) > (if (re-search-forward "HTTP.*\\s-+200\\s-OK" nil t) > ;; URL retrieved correctly. Move point to after the > ;; url-retrieve header, update the cache `org--file-cache' > ;; and return contents. > (progn > (search-forward "\n\n" nil 'move) > (puthash file > (buffer-substring-no-properties (point) (point-max)) > org--file-cache)) > (funcall (if noerror #'message #'user-error) > (format "Unable to fetch file from %S" file))))) Err. (funcall (if noerror #'message #'user-error) "Unable to fetch file from %S" file) Also, in your patch, "Test whether FILE is a URL. Return non-nil if it is." -> "Non-nil if FILE is a URL."