[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 02/16: Teach easy-kill-help to handle old format of easy-kill-ali
From: |
Leo Liu |
Subject: |
[elpa] 02/16: Teach easy-kill-help to handle old format of easy-kill-alist |
Date: |
Tue, 22 Apr 2014 00:33:38 +0000 |
leoliu pushed a commit to branch master
in repository elpa.
commit 804e88fbb4a2c6823a2c7163e44a1bce7dd0a105
Author: Leo Liu <address@hidden>
Date: Mon Apr 14 12:10:09 2014 +0800
Teach easy-kill-help to handle old format of easy-kill-alist
Also enhance it to handle long thing names and missing append
separator.
---
easy-kill.el | 23 +++++++++++++----------
1 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/easy-kill.el b/easy-kill.el
index 91a1a21..0eda453 100644
--- a/easy-kill.el
+++ b/easy-kill.el
@@ -170,19 +170,20 @@ The value is the function's symbol if non-nil."
(mapcar 'car easy-kill-alist))
map))
-(defun easy-kill--fmt (x y z)
+(defun easy-kill--fmt (x y &optional z)
(cl-etypecase x
(character (easy-kill--fmt
(single-key-description x)
(symbol-name y)
- (let ((print-escape-newlines t))
- (prin1-to-string z))))
+ (and z (let ((print-escape-newlines t))
+ (prin1-to-string z)))))
(string (with-output-to-string
(princ x)
- (princ (make-string (- 16 (length x)) ?\s))
+ (princ (make-string (- 16 (mod (length x) 16)) ?\s))
(princ y)
- (princ (make-string (- 16 (length y)) ?\s))
- (princ z)))))
+ (when z
+ (princ (make-string (- 16 (mod (length y) 16)) ?\s))
+ (princ z))))))
(defun easy-kill-help ()
(interactive)
@@ -195,11 +196,13 @@ The value is the function's symbol if non-nil."
(princ "\n")
(princ (easy-kill--fmt "---" "-----" "---------"))
(princ "\n\n")
- (princ (mapconcat (lambda (x)
- (pcase x
- (`(,c ,thing ,sep) (easy-kill--fmt c thing sep))))
+ (princ (mapconcat (lambda (x) (pcase x
+ (`(,c ,thing ,sep)
+ (easy-kill--fmt c thing sep))
+ ((or `(,c ,thing) `(,c . ,thing))
+ (easy-kill--fmt c thing))))
easy-kill-alist "\n"))
- (princ "\n")
+ (princ "\n\n")
(princ (substitute-command-keys "\\{easy-kill-base-map}"))))
(defvar easy-kill-candidate nil)
- [elpa] branch master updated (a1fe7f0 -> 6e73bbb), Leo Liu, 2014/04/21
- [elpa] 01/16: New command easy-kill-help, Leo Liu, 2014/04/21
- [elpa] 02/16: Teach easy-kill-help to handle old format of easy-kill-alist,
Leo Liu <=
- [elpa] 05/16: Stricter check on bounds of list in strings, Leo Liu, 2014/04/21
- [elpa] 06/16: New command easy-kill-exchange-point-and-mark, Leo Liu, 2014/04/21
- [elpa] 03/16: For #14: Treat strings like lists, Leo Liu, 2014/04/21
- [elpa] 07/16: Fix #15: Make `M-w l' in strings save to clipboard, Leo Liu, 2014/04/21
- [elpa] 04/16: Improve last change for easy-kill-thing-forward, Leo Liu, 2014/04/21
- [elpa] 09/16: Make digit key 0 shrink selection to its initial size, Leo Liu, 2014/04/21
- [elpa] 14/16: Fix easy-kill-org-up-element, Leo Liu, 2014/04/21
- [elpa] 08/16: Add wrappers for thingatpt.el for better code organisation, Leo Liu, 2014/04/21
- [elpa] 16/16: Merge branch 'master' of https://github.com/leoliu/easy-kill, Leo Liu, 2014/04/21
- [elpa] 13/16: Some tests and bug fixes for org, Leo Liu, 2014/04/21