mirror of
https://github.com/protesilaos/dotfiles.git
synced 2026-09-10 07:16:20 -04:00
emacs: define prot-common--rotate
This commit is contained in:
parent
109919ced3
commit
36844d4ba6
|
|
@ -12440,6 +12440,16 @@ floating points: 16.666666666666664 => 16.667."
|
|||
(propertize c-string 'face 'success)
|
||||
(propertize f-string 'face 'error))))
|
||||
|
||||
;;;###autoload
|
||||
(defun prot-common--rotate (elements)
|
||||
"Rotate list ELEMENTS so that nth 0 is last, nth 1 is nth 0, and so on.
|
||||
Do it without side effects, unlike `prot-common-rotate-list-of-symbol'."
|
||||
(declare (side-effect-free t))
|
||||
(setq elements (copy-sequence elements))
|
||||
(let ((first (car elements))
|
||||
(rest (cdr elements)))
|
||||
(append rest (list first))))
|
||||
|
||||
;;;###autoload
|
||||
(defun prot-common-rotate-list-of-symbol (symbol)
|
||||
"Rotate list value of SYMBOL by moving its car to the end.
|
||||
|
|
|
|||
|
|
@ -171,6 +171,16 @@ floating points: 16.666666666666664 => 16.667."
|
|||
(propertize c-string 'face 'success)
|
||||
(propertize f-string 'face 'error))))
|
||||
|
||||
;;;###autoload
|
||||
(defun prot-common--rotate (elements)
|
||||
"Rotate list ELEMENTS so that nth 0 is last, nth 1 is nth 0, and so on.
|
||||
Do it without side effects, unlike `prot-common-rotate-list-of-symbol'."
|
||||
(declare (side-effect-free t))
|
||||
(setq elements (copy-sequence elements))
|
||||
(let ((first (car elements))
|
||||
(rest (cdr elements)))
|
||||
(append rest (list first))))
|
||||
|
||||
;;;###autoload
|
||||
(defun prot-common-rotate-list-of-symbol (symbol)
|
||||
"Rotate list value of SYMBOL by moving its car to the end.
|
||||
|
|
|
|||
Loading…
Reference in a new issue