0

The following loop hangs my emacs (even when called with -q) to the point that I have to force quit it.

(let ((buffs (buffer-list)))
  (while buffs
    (delq (car buffs) buffs)
    (print (cadr buffs))))

I don't understand why this should happen, but is there something I can do to recover from a hanging Emacs?

Daniel
  • 3,563
  • 16
  • 41

1 Answers1

1

I guess since youre saving the result of buffer-list, buffs never evaluates to a falsy value. You should update the buffs variable by seting it to the return vaulue of your delq.

(setq buffs (delq (car buffs) buffs))