unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Checking for core-symbols?
@ 2016-12-06 13:35 Andreas Röhler
  2016-12-06 14:24 ` Stefan Monnier
  0 siblings, 1 reply; 2+ messages in thread
From: Andreas Röhler @ 2016-12-06 13:35 UTC (permalink / raw)
  To: Help Gnu Emacs mailing list

Hi,

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. "
   (interactive)
   (while
       (and
        (prog1
        (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?

Cheers,
Andreas



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-12-06 14:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-06 13:35 Checking for core-symbols? Andreas Röhler
2016-12-06 14:24 ` Stefan Monnier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).