unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eduard Wiebe <usenet@pusto.de>
To: 20584@debbugs.gnu.org
Subject: bug#20584: 25.0.50; [PATCH] (list-packages) do not fail, if no user config file present
Date: Fri, 15 May 2015 09:59:55 +0200	[thread overview]
Message-ID: <87h9re2rus.fsf@pusto.de> (raw)

* lisp/emacs-lisp/package.el (package--ensure-init-file) Ensure
user-init-file exists.
---
 lisp/emacs-lisp/package.el | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 6156313..55901f5 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -1810,9 +1810,10 @@ using `package-compute-transaction'."
                       (search-forward "(package-initialize)" nil 'noerror))))
               ;; Don't visit the file if we don't have to.
               (with-temp-buffer
-                (insert-file-contents user-init-file)
-                (goto-char (point-min))
-                (search-forward "(package-initialize)" nil 'noerror)))))
+                (when (file-exists-p user-init-file)
+                  (insert-file-contents user-init-file)
+                  (goto-char (point-min))
+                  (search-forward "(package-initialize)" nil 'noerror))))))
       (unless contains-init
         (with-current-buffer (or buffer
                                  (let ((delay-mode-hooks t))
-- 
Eduard Wiebe






             reply	other threads:[~2015-05-15  7:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-15  7:59 Eduard Wiebe [this message]
2015-05-15  9:21 ` bug#20584: 25.0.50; [PATCH] (list-packages) do not fail, if no user config file present Artur Malabarba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h9re2rus.fsf@pusto.de \
    --to=usenet@pusto.de \
    --cc=20584@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).