leoliu pushed a commit to branch master
in repository elpa.
commit 6b10f876dcab7e740fa2ab9b57ee49dc1be199de
Author: Leo Liu <[email protected]>
Date: Sun Apr 13 10:06:27 2014 +0800
Fix #12: don't silenty change to `list' when +/- on `sexp'
---
README.rst | 5 +++--
easy-kill.el | 10 +++++++---
2 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/README.rst b/README.rst
index dec0a04..ef660aa 100644
--- a/README.rst
+++ b/README.rst
@@ -47,8 +47,8 @@ So for ``word`` the expansion is word-wise, for ``line``
line-wise,
for ``list`` or ``sexp``, list-wise.
``list-wise`` expanding/shrinking work well in lispy modes (elisp,
-Common Lisp, Scheme, Clojure etc.), smie-based modes (Shell, Ruby,
-Octave, SML, Prolog, Modula2, SQL etc.), nxml modes and js2 mode.
+Common Lisp, Scheme, Clojure etc.), smie-based modes (Prolog, SML,
+Modula2, Shell, Ruby, Octave, CSS, SQL etc.), Nxml mode and Js2 mode.
To copy the enclosing list in lispy modes, I used to do a lot of
``C-M-u C-M-SPC M-w``. Now the key sequence is replaced by ``M-w l``
@@ -90,6 +90,7 @@ NEWS
+++++
#. ``-`` can move pass the first selection.
+#. ``+``/``-`` on ``sexp`` no longer change ``thing`` to ``list``
#. Mouse over the selection now shows description.
#. Echo js2 node name.
#. Append now uses sensible separator (customisable via
diff --git a/easy-kill.el b/easy-kill.el
index 8cb3450..002c094 100644
--- a/easy-kill.el
+++ b/easy-kill.el
@@ -258,7 +258,8 @@ Otherwise, it is the value of the overlay's candidate
property."
;; description.
for dk = (intern-soft (format "describe-%s" k))
for v = (or (plist-get all dk) (plist-get all k))
- when v collect (format "%s:\t%s" k v)))
+ when v collect (format "%s:\t%s" k
+ (if (functionp v) (funcall v)
v))))
(txt (mapconcat #'identity props "\n")))
(format "cmd:\t%s\n%s" (if easy-kill-mark "easy-mark" "easy-kill") txt)))
@@ -604,7 +605,8 @@ inspected."
(defun easy-kill-on-sexp (n)
(pcase n
((or `+ `-)
- (easy-kill-thing 'list n))
+ (unwind-protect (easy-kill-thing 'list n)
+ (setf (easy-kill-get thing) 'sexp)))
(_ (easy-kill-thing 'sexp n t))))
;;; nxml support for list-wise +/-
@@ -662,7 +664,9 @@ inspected."
(js2-node-abs-pos node)
(js2-node-abs-end node))
(setf (easy-kill-get describe-thing)
- (format "list (%s)" (js2-node-short-name node)))
+ ;; Also used by `sexp' so delay computation until needed.
+ (lambda ()
+ (format "%s (%s)" (easy-kill-get thing) (js2-node-short-name
node))))
(easy-kill-echo "%s" (js2-node-short-name node))))
(provide 'easy-kill)