branch: externals/preview-tailor
commit bf465c18c5e827e018879a2897d256e5b09fc66f
Author: Paul Nelson <[email protected]>
Commit: Paul Nelson <[email protected]>
Fix safe list access and print variables
* preview-tailor.el (preview-tailor--get-multiplier): Use 'cdr-safe'
instead of 'cdr'.
(preview-tailor-save): Bind 'print-length', 'print-level', and
'print-quoted' to ensure complete output.
---
preview-tailor.el | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/preview-tailor.el b/preview-tailor.el
index 3afaf77103..c24e801b38 100644
--- a/preview-tailor.el
+++ b/preview-tailor.el
@@ -71,7 +71,7 @@ nil if no match found."
(defun preview-tailor--get-multiplier ()
"Get the preview scale multiplier for the current monitor."
- (or (cdr (preview-tailor--get-match (frame-monitor-attributes)))
+ (or (cdr-safe (preview-tailor--get-match (frame-monitor-attributes)))
;; the above should match unless the user deletes the default
;; entry in `preview-tailor-multipliers'
1.0))
@@ -150,12 +150,15 @@ Use SCALE if provided, otherwise prompt for it."
(setq preview-tailor--initialized t))
;;;###autoload
-(defun preview-tailor-save ()
- "Save preview-tailor customization to a dotfile."
- (interactive)
- (when preview-tailor--initialized
- (with-temp-file preview-tailor-storage-file
- (prin1 preview-tailor-multipliers (current-buffer)))))
+ (defun preview-tailor-save ()
+ "Save preview-tailor customization to a dotfile."
+ (interactive)
+ (when preview-tailor--initialized
+ (with-temp-file preview-tailor-storage-file
+ (let ((print-length nil)
+ (print-level nil)
+ (print-quoted t))
+ (prin1 preview-tailor-multipliers (current-buffer))))))
(provide 'preview-tailor)
;;; preview-tailor.el ends here