Clarify setting and getting of the slynk string elision length
This commit is contained in:
parent
c03da09ede
commit
56de583445
33
README.org
33
README.org
@ -4843,20 +4843,23 @@ silent]{(describe-variable 'no-littering-var-directory)}. Listing
|
|||||||
"(cdr (assoc 'slynk:*string-elision-length* slynk:*slynk-pprint-bindings*))"
|
"(cdr (assoc 'slynk:*string-elision-length* slynk:*slynk-pprint-bindings*))"
|
||||||
"Slynk \"string elision length\" getter command.")
|
"Slynk \"string elision length\" getter command.")
|
||||||
|
|
||||||
(defun slynk-command-set-sel (sel)
|
(defun slynk-command-set-sel (length)
|
||||||
"Slynk SEL \"string elision length\" setter command.
|
"Slynk LENGTH \"string elision length\" setter command.
|
||||||
SEL values must be positive integers to enable or `nil' to disable elision."
|
LENGTH values must be positive integers to enable or `nil' to disable elision."
|
||||||
(format "(setf %s %s)" slynk-command-get-sel sel))
|
(format "(setf %s %s)" slynk-command-get-sel length))
|
||||||
|
|
||||||
(defun slynk-get-sel ()
|
(defun slynk-get-sel ()
|
||||||
"Get the Slynk \"string-elision-length\"."
|
"Get the Slynk \"string-elision-length\"."
|
||||||
(cadr (sly-eval `(slynk:eval-and-grab-output ,slynk-command-get-sel))))
|
(cadr (sly-eval `(slynk:eval-and-grab-output ,slynk-command-get-sel))))
|
||||||
|
|
||||||
(defun slynk-set-sel (sel)
|
;; Most useful for Org source blocks.
|
||||||
"Set the Slynk \"string-elision-length\" SEL.
|
(defun slynk-set-sel (length)
|
||||||
SEL values must be positive integers to enable or `nil' to disable elision."
|
"Set the Slynk \"string-elision-length\" LENGTH.
|
||||||
(cadr (sly-eval `(slynk:eval-and-grab-output ,(slynk-command-set-sel sel)))))
|
LENGTH values must be positive integers to enable or `nil' to disable elision."
|
||||||
|
(cadr
|
||||||
|
(sly-eval `(slynk:eval-and-grab-output ,(slynk-command-set-sel length)))))
|
||||||
|
|
||||||
|
;; Most useful for interactive use.
|
||||||
(defun slynk-eval-sel-command (string)
|
(defun slynk-eval-sel-command (string)
|
||||||
"Evaluate the Slynk \"string-elision-length\" command STRING."
|
"Evaluate the Slynk \"string-elision-length\" command STRING."
|
||||||
(unless (sly-connected-p)
|
(unless (sly-connected-p)
|
||||||
@ -4869,14 +4872,14 @@ SEL values must be positive integers to enable or `nil' to disable elision."
|
|||||||
(interactive)
|
(interactive)
|
||||||
(slynk-eval-sel-command slynk-command-get-sel))
|
(slynk-eval-sel-command slynk-command-get-sel))
|
||||||
|
|
||||||
(defun slynk-set-string-elision-length (&optional sel)
|
(defun slynk-set-string-elision-length (&optional length)
|
||||||
"Set the Slynk \"string-elision-length\" by evaluating SEL.
|
"Set the Slynk \"string-elision-length\" LENGTH.
|
||||||
Valid SEL values are positive integers to enable or `nil' to disable elision."
|
Valid LENGTH values are positive integers to set or `nil' to reset."
|
||||||
(interactive "XSlynk string-elision-length (nil or sel > 0): ")
|
(interactive "X\ Slink string elision length: ")
|
||||||
(unless (or (null sel) (and (integerp sel) (> sel 0)))
|
(unless (or (null length) (and (integerp length) (> length 0)))
|
||||||
(user-error
|
(user-error
|
||||||
"Slynk `sel' must evaluate to `nil' or a positive integer (got `%S')" sel))
|
"Slynk `length' must be `nil' or a positive integer (got `%S')" length))
|
||||||
(slynk-eval-sel-command (slynk-command-set-sel sel))))
|
(slynk-eval-sel-command (slynk-command-set-sel length))))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
#+caption[Script to dump a SBCL core for the Sly Common Lisp IDE]:
|
#+caption[Script to dump a SBCL core for the Sly Common Lisp IDE]:
|
||||||
|
Loading…
Reference in New Issue
Block a user