mhayashi1120 / Emacs-erefactor

Emacs-Lisp refactoring utilities
26 stars 6 forks source link

Rename symbol attempts to rename in non-docstrings #1

Closed monsanto closed 9 years ago

monsanto commented 12 years ago

Rename symbol to sym in the following:

(let ((symbol k))
  (message "Find symbol: %s" symbol))

erefactor tries to rename "Find symbol: " to "Find sym: " which is undesirable imo. I think renamings should ignore strings that are not docstrings completely--and even then, i'd be inclined to say we should ignore docstrings unless they `quote' the identifiers or put them in uppercase.

mhayashi1120 commented 12 years ago

Thanks for the comment.

erefactor tries to rename "Find symbol: " to "Find sym: " which is undesirable imo. I think renamings should ignore strings that are not docstrings completely--and

I disagree. Local symbol may have a same meaning of UI message or any strings. Also, shouldn't forget about intern' andmake-symbol'.

erefactor.el highlight renaming candidates as long as the program can, and then, leave the choice to programmer. Programmer could rename the target carefully with `y-or-n-p'.

I think that behavior is not perfect, but a destiny of dynamic typed language.

i'd be inclined to say we should ignore docstrings unless they `quote' the identifiers or put them in uppercase.

Agree. I have been realizing this as a problem, expressed in erefactor.el TODO section.

Please wait patiently or feel free to send pull request to me. :-)