[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 10/13: Fix #12: don't silenty change to `list' when +/- on `sexp'
From: |
Leo Liu |
Subject: |
[elpa] 10/13: Fix #12: don't silenty change to `list' when +/- on `sexp' |
Date: |
Sun, 13 Apr 2014 07:34:58 +0000 |
leoliu pushed a commit to branch master
in repository elpa.
commit 6b10f876dcab7e740fa2ab9b57ee49dc1be199de
Author: Leo Liu <address@hidden>
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)
- [elpa] branch master updated (d1dd484 -> 47d5d5b), Leo Liu, 2014/04/13
- [elpa] 01/13: Improve README.rst to include some use examples, Leo Liu, 2014/04/13
- [elpa] 02/13: Provide a universal accessor easy-kill-get and use it, Leo Liu, 2014/04/13
- [elpa] 03/13: New function easy-kill-interprogram-cut, Leo Liu, 2014/04/13
- [elpa] 04/13: Show tooltip describing kill candidate and echo js2 node, Leo Liu, 2014/04/13
- [elpa] 05/13: New format of easy-kill-alist to support append separator, Leo Liu, 2014/04/13
- [elpa] 06/13: New function easy-kill-thing-handler for mode-based dispatch, Leo Liu, 2014/04/13
- [elpa] 07/13: Make js2 dependency optional, Leo Liu, 2014/04/13
- [elpa] 08/13: Implement #10: allow `-' to move before first selection, Leo Liu, 2014/04/13
- [elpa] 09/13: Fix last change for the case of no thing at point, Leo Liu, 2014/04/13
- [elpa] 10/13: Fix #12: don't silenty change to `list' when +/- on `sexp',
Leo Liu <=
- [elpa] 11/13: Fix thinko in last change, Leo Liu, 2014/04/13
- [elpa] 12/13: Fix #11: Work around http://debbugs.gnu.org/17247, Leo Liu, 2014/04/13
- [elpa] 13/13: Merge branch 'master' of https://github.com/leoliu/easy-kill, Leo Liu, 2014/04/13