Kaushal Modi <kaushal.m...@gmail.com> writes: > Hmm, is there a way to read a file from a URL to a variable directly? Or > did you mean to download the file first, read that into a temp buffer and > then delete the temp file?
You can use something like `url-insert' and `url-retrieve' or `url-retrieve-synchronously'. > This proposal was for the case where we have > > #+SETUPFILE: http://foo.bar/config.org > > So it cannot be local to begin with. Sure, but SETUPFILE still accepts local file names. So I was pointing out that you need to check if the URL is a local file name before proceeding. In particular, this check needs to happen when using "C-c '" (which may display URL contents in a read-only buffer, BTW). > With respect to the point about not having the file in temp, we can have a > flag that if set, will prevent re-downloading of the file. User can choose > to reset that flag and then re-download that file. This will be lieu of the > earlier condition "(2) that temp file does not exist." Is it necessary? File contents could be stored in, e.g., a hash table, url being the key. The file is downloaded only if the entry doesn't exist in the table and the user didn't force download.- > I would like to work on this. But I will be away from my computer for about > a month starting tomorrow. Will get back to this once I am back from my > vacation. Great. Thank you. Regards,