emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/el-search d869368 211/332: Implement `cl-print-object'


From: Stefan Monnier
Subject: [elpa] externals/el-search d869368 211/332: Implement `cl-print-object' for el-search-objects
Date: Tue, 1 Dec 2020 15:48:47 -0500 (EST)

branch: externals/el-search
commit d869368228dee5774aa6d52484138d90176c6aa1
Author: Michael Heerdegen <michael_heerdegen@web.de>
Commit: Michael Heerdegen <michael_heerdegen@web.de>

    Implement `cl-print-object' for el-search-objects
    
    * el-search/el-search.el: Add (cl-print "1.0") to Package-Requires.
    Require cl-print.
    (cl-print-object): Implement for `el-search-object's.
---
 el-search.el | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/el-search.el b/el-search.el
index 278f7c2..c519446 100644
--- a/el-search.el
+++ b/el-search.el
@@ -8,7 +8,7 @@
 ;; Keywords: lisp
 ;; Compatibility: GNU Emacs 25
 ;; Version: 1.5.1
-;; Package-Requires: ((emacs "25") (stream "2.2.4"))
+;; Package-Requires: ((emacs "25") (stream "2.2.4") (cl-print "1.0"))
 
 
 ;; This file is not part of GNU Emacs.
@@ -414,6 +414,7 @@
 
 (require 'cl-lib)
 (require 'pcase)    ;we want to bind `pcase--dontwarn-upats' before pcase is 
autoloaded
+(require 'cl-print)
 (require 'elisp-mode)
 (require 'thingatpt)
 (require 'thunk)
@@ -1027,6 +1028,12 @@ optional MESSAGE are used to construct the error 
message."
     (cl-callf copy-alist (el-search-object-properties copy))
     copy))
 
+(cl-defmethod cl-print-object ((object el-search-object) stream)
+  ;; We use a syntax that looks nice with with pp.el
+  (princ "#s(el-search-object " stream)
+  (prin1 (el-search--get-search-description-string object 'verbose 
'dont-propertize) stream)
+  (princ ")" stream))
+
 (defun el-search--current-pattern ()
   (and el-search--current-search
        (el-search-object-pattern el-search--current-search)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]