Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Elisp destructive operation warning?

Tags:

emacs

elisp

Emacs gives useful warnings on byte-compilation. Is there a plugin that adds warnings about destructive operations being used? So that when I write code like this:

(defun get-countdown ()
  (let ((x (number-sequence 0 10)))
    (message (format "%s" (sort x #'>)))
    x))#

Emacs complains:

temp.el:4:5:Warning: using variable modified by `sort'.

Or maybe something like elisp-newbie-mode that highlights all destructive functions?

like image 836
abo-abo Avatar asked Nov 13 '22 01:11

abo-abo


1 Answers

I sent a patch to Emacs Dev today that adds this to the byte compiler.

It's a start anyway. See Emacs bug #15122.

like image 108
Drew Avatar answered Nov 15 '22 06:11

Drew