@@ -225,20 +225,18 @@ Gets updated by `aas-post-self-insert-hook'.")
225
225
Use for the typing history, `aas--current-prefix-maps' and
226
226
`this-command-keys' for the current typed key.."
227
227
(cl-callf nconc aas--current-prefix-maps (list aas--prefix-map))
228
- (let ((next-maps nil ))
229
- (while aas--current-prefix-maps
230
- (let* ((candidate (car aas--current-prefix-maps))
231
- (key-result (lookup-key candidate (this-command-keys ))))
232
- (cond ((keymapp key-result)
233
- ; ; Collect the keymap for the next call
234
- (cl-callf2 cons key-result next-maps))
235
- ((and (functionp key-result) (funcall key-result))
236
- ; ; an ending! no need to call interactively,`aas-expand-snippet-maybe'
237
- ; ; takes care of that
238
- (setq aas--current-prefix-maps nil ; stop the loop
239
- next-maps nil ))) ; abort the collected snippets
240
- (cl-callf cdr aas--current-prefix-maps)))
241
- (setq aas--current-prefix-maps next-maps)))
228
+ (cl-loop for candidate in-ref aas--current-prefix-maps do
229
+ (let ((key-result (lookup-key candidate (this-command-keys ))))
230
+ (cond ((keymapp key-result)
231
+ ; ; Collect the keymap for the next call
232
+ (setf candidate key-result))
233
+ ((and (functionp key-result) (funcall key-result))
234
+ ; ; an ending! no need to call interactively,`aas-expand-snippet-maybe'
235
+ ; ; takes care of that. Clear the map so we start over next time.
236
+ (cl-return (setq aas--current-prefix-maps nil )))
237
+ (t
238
+ (setf candidate nil ))))
239
+ finally do (cl-callf2 delq nil aas--current-prefix-maps)))
242
240
243
241
;;;### autoload
244
242
(defun aas-activate-keymap (keymap-symbol )
0 commit comments