unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "Andreas Röhler" <andreas.roehler@easy-emacs.de>
To: Help Gnu Emacs mailing list <help-gnu-emacs@gnu.org>
Subject: Checking for core-symbols?
Date: Tue, 6 Dec 2016 14:35:27 +0100	[thread overview]
Message-ID: <11cece5c-ef6d-532f-7aea-b2c36d8a2ea1@easy-emacs.de> (raw)

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



             reply	other threads:[~2016-12-06 13:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-06 13:35 Andreas Röhler [this message]
2016-12-06 14:24 ` Checking for core-symbols? Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=11cece5c-ef6d-532f-7aea-b2c36d8a2ea1@easy-emacs.de \
    --to=andreas.roehler@easy-emacs.de \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).