[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: prevent function execution on Emacs startup if not connected to inte
From: |
Brady Trainor |
Subject: |
Re: prevent function execution on Emacs startup if not connected to internet |
Date: |
Wed, 23 Apr 2014 19:22:10 -0700 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 |
On 4/18/2014 5:13 AM, Pascal J. Bourguignon wrote:
(ignore-errors (package-refresh-contents)))
(ignore-errors (package-install pkg))))
So I was able to recreate my issue. Your method worked at these
functions, but then the issue propagates to `require's for packages not
installed. (Every once in a while I switch OS', and simultaneously am
sitting down somewhere without an internet connection.)
I imagine putting `ignore-errors' at every `require' would be bad form.
Maybe I can start up Emacs with an option to ignore errors? "In
pseudocode",
emacs --ignore-errors
Or even better, maybe I can have in my init file, a line to check for a
connection, and if there is none, prompt me to allow a global
`ignore-errors'. Or no prompt, but give a message that it occurred.
Brady
PS
Thank you for the code improvement, I did not notice it the first time,
(when (notevery (lambda (pkg (or (package-installed-p pkg)
(assoc pkg package-archive-contents))))
pkgs-2b-present)
(ignore-errors (package-refresh-contents)))