[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Addressing confusion over uninterned symbols
From: |
Matt Armstrong |
Subject: |
Addressing confusion over uninterned symbols |
Date: |
Mon, 12 Apr 2021 15:20:07 -0700 |
Recently I came to realize that I have been routinely confused by Emacs
macros that don't use 'gensym' or some equivalent. I have long taken a
liking to running commands like emacs-lisp-macroexpand to debug my use
of macros, but tend to get confused when the macros use merely
'make-symbol' instead of 'gensym'. I regularly run into situations
where the uninterned symbols introduced by the macros aren't distinct
from my own code. I also tend to expand macros and edebug the result,
which often breaks unless `print-gensym' and `print-circle' are set,
which is inconvenient and annoying.
So, two questions.
First, would patches to switch some of the lower level Emacs macros to
'gensym' be welcome? I'm thinking of those in macroexp.el itself. Or,
are there reasons for those macros to continue to use plain old
'make-symbol'?
Second, is there any interest in the package I wrote to effectively call
hack a call to 'gensym' on behalf of all macros that don't appear to
have done so themselves, where needed. I called it 'hacroexp' and I now
use 'hacroexp-1' instead of 'emacs-lisp-macroexpand', and am generally
happy with the result. See attached:
hacroexp.el
Description: application/emacs-lisp
- Addressing confusion over uninterned symbols,
Matt Armstrong <=