Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fall back to standard pp-to-string when custom pretty-printer fails

Addresses #677.
  • Loading branch information...
commit 321967a915e619ab1eece5d780590afc3e7e47e5 1 parent 5d5ff16
@DarwinAwardWinner DarwinAwardWinner authored
Showing with 9 additions and 3 deletions.
  1. +9 −3 el-get-status.el
View
12 el-get-status.el
@@ -92,9 +92,15 @@
(pp-buffer)
(goto-char (point-min))
;; Make sure we didn't change the value. That would be bad.
- (assert (equal object (read (current-buffer))) nil
- "Pretty-printing status changes its value. Your pretty-printing function is messed up.")
- (buffer-string)))
+ (if (equal object (read (current-buffer)))
+ (buffer-string)
+ ;; If the pretty-printing function *did* change the value, just
+ ;; use the built-in pretty-printing instead. It's not as good,
+ ;; but at least it's correct.
+ (warn "The custom pretty-printer for the .status.el failed. The original value and pretty-printed-value are shown below. You can try to see where they differ and report a bug.\n---BEGIN ORIGINAL VALUE---\n%s\n---END ORIGINAL VALUE---\n\n---BEGIN PRETTY-PRINTED VALUE---\n%s\n---END PRETTY-PRINTED VALUE---\n"
+ (pp-to-string object)
+ (buffer-string))
+ (pp-to-string object))))
(defun el-get-save-package-status (package status)
"Save given package status"
Please sign in to comment.
Something went wrong with that request. Please try again.