mirror of
https://github.com/plexus/chemacs2.git
synced 2026-09-10 07:26:27 -04:00
Merge pull request #39 from plexus/arne/better-parse-error
Provide a better error when .emacs-profiles.el is invalid
This commit is contained in:
commit
8683883211
17
chemacs.el
17
chemacs.el
|
|
@ -91,7 +91,7 @@
|
|||
(insert-file-contents chemacs-default-profile-path)
|
||||
(goto-char (point-min))
|
||||
;; (buffer-string))
|
||||
(symbol-name (read (current-buffer)) ))
|
||||
(symbol-name (read (current-buffer))))
|
||||
"default"))
|
||||
|
||||
|
||||
|
|
@ -107,12 +107,15 @@
|
|||
(if (and chemacs--with-profile-value
|
||||
(listp chemacs--with-profile-value))
|
||||
chemacs--with-profile-value
|
||||
(let ((profiles
|
||||
(with-temp-buffer
|
||||
(insert-file-contents chemacs-profiles-path)
|
||||
(goto-char (point-min))
|
||||
(read (current-buffer)))))
|
||||
(cdr (assoc chemacs-profile-name profiles)))))
|
||||
(let ((profiles
|
||||
(with-temp-buffer
|
||||
(insert-file-contents chemacs-profiles-path)
|
||||
(goto-char (point-min))
|
||||
(condition-case err
|
||||
(read (current-buffer))
|
||||
(error
|
||||
(error "Failed to parse %s: %s" chemacs-profiles-path (error-message-string err)))))))
|
||||
(cdr (assoc chemacs-profile-name profiles)))))
|
||||
|
||||
(unless chemacs-profile
|
||||
(error "No profile `%s' in %s" chemacs-profile-name chemacs-profiles-path))
|
||||
|
|
|
|||
Loading…
Reference in a new issue