1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-05 11:45:45 +00:00

Move setf substring to cl-lib since it relies on it (bug#60102)

* lisp/emacs-lisp/cl-lib.el (substring): Move gv-expander here...
* lisp/emacs-lisp/gv.el (substring): ...from here.
This commit is contained in:
Stefan Monnier 2023-09-04 16:39:55 -04:00
parent f9b43107ce
commit d5e7d9e257
2 changed files with 11 additions and 12 deletions

View File

@ -170,6 +170,17 @@ to an element already in the list stored in PLACE.
val
(and (< end (length str)) (substring str end))))
(gv-define-expander substring
(lambda (do place from &optional to)
(gv-letplace (getter setter) place
(macroexp-let2* nil ((start from) (end to))
(funcall do `(substring ,getter ,start ,end)
(lambda (v)
(macroexp-let2 nil v v
`(progn
,(funcall setter `(cl--set-substring
,getter ,start ,end ,v))
,v))))))))
;;; Blocks and exits.

View File

@ -821,17 +821,5 @@ REF must have been previously obtained with `gv-ref'."
((eq ,getter ,val) ,(funcall setter `(not ,val))))))))))
(make-obsolete-generalized-variable 'eq nil "29.1")
(gv-define-expander substring
(lambda (do place from &optional to)
(gv-letplace (getter setter) place
(macroexp-let2* nil ((start from) (end to))
(funcall do `(substring ,getter ,start ,end)
(lambda (v)
(macroexp-let2 nil v v
`(progn
,(funcall setter `(cl--set-substring
,getter ,start ,end ,v))
,v))))))))
(provide 'gv)
;;; gv.el ends here