[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Checking for core-symbols?

From: Andreas Röhler
Subject: Checking for core-symbols?
Date: Tue, 6 Dec 2016 14:35:27 +0100
User-agent: MozillpoN0 (X11; Linux i686; rv:45.0) Gecko/20100101 Icedove/45.4.0


translated a library of math-symbols WRT convenient inserts by their name.
Basically went fine, howeverEmacs got unusable after evaluating the result.

The reason have been some symbols like "and" and "or", which occur in math but also in Emacs Lisp.
These got re-defined...

Question: what about preventing such things from inside eval?

The checker below was able to detect the conflicting stuff:

(defun not-permitted ()
  "Check if symbols are used as functions or special forms. "
       (re-search-forward "(defun [^ ]+" nil t 1)
     (forward-char -1))
       (let ((erg (car (read-from-string (thing-at-point 'symbol)))))
     (not (or
           (special-form-p erg)
           (functionp erg)))))))

Maybe such option/utility exists?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]