Fix mc/dump-list (take 2): it looses old setting

In the old code, heading part of `value` may lost due to in-place
modification by the `sort` function. ``(symbol-value list-symbol)``
must be re-evaluated before passing it to `mapc`.  To do that,
simply replacing `let` to `symbol-macrolet` works.

See also: #40
This commit is contained in:
Takafumi Arakaki 2012-12-01 22:01:02 +01:00
parent 07b88080b1
commit 84ab4ee26a

View File

@ -505,7 +505,7 @@ for running commands with multiple cursors.")
(defun mc/dump-list (list-symbol) (defun mc/dump-list (list-symbol)
"Insert (setq 'LIST-SYMBOL LIST-VALUE) to current buffer." "Insert (setq 'LIST-SYMBOL LIST-VALUE) to current buffer."
(let ((value (symbol-value list-symbol))) (symbol-macrolet ((value (symbol-value list-symbol)))
(insert "(setq " (symbol-name list-symbol) "\n" (insert "(setq " (symbol-name list-symbol) "\n"
" '(") " '(")
(newline-and-indent) (newline-and-indent)