names
names copied to clipboard
Manually rewriting files is boring and error-prone
When trying to use names
, removing all the prefixes manually is boring, even in Emacs. This can't be done automatically (e.g., with a non-interactive search/replace) because:
- references to functions and variables in docstrings must not be changed
- it is easy for a call to a global function (e.g., emacs lisp
length
function) to become a call to a local function (e.g., when removing the prefix ofmypackage-length
):
(defun mypackage-length (foo)
(length foo))
will easily be replaced by this non-working code:
(defun length (foo)
(length foo)) ;; <-- should have been ::length instead
At the moment, names is more adequate for new packages than existing ones. I would love to offer a feature like the one you suggest, unfortunately it's also quite a challenge.
My guess is that something like this will have to make use of the code-walker. A simple replace-regexp won't do.