Wilfred / emacs-refactor

language-specific refactoring in Emacs
GNU General Public License v3.0
348 stars 27 forks source link

Extracting elisp functions is confused by quoted variables #21

Open Wilfred opened 7 years ago

Wilfred commented 7 years ago

Given the elisp code:

(let ((x 1))
  (message "foo: %s %s" x 'bar))

emr-el-extraction-function on message gives:

(defun foo (x bar)
  (message "foo: %s %s" x 'bar))

(let ((x 1))
  (foo x bar))

Expected result:

(defun foo (x)
  (message "foo: %s %s" x 'bar))

(let ((x 1))
  (foo x))
Wilfred commented 7 years ago

This is due to the flattening of the list when extracting variables.

Wilfred commented 7 years ago

There's a similar issue with backquoting and with vectors.