[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 74/77: Require cl-lib
From: |
Leo Liu |
Subject: |
[elpa] 74/77: Require cl-lib |
Date: |
Sat, 05 Apr 2014 04:08:29 +0000 |
leoliu pushed a commit to branch master
in repository elpa.
commit a40258f397bf97f038fd17d267db0e30d2d371eb
Author: Leo Liu <address@hidden>
Date: Thu Mar 27 12:15:18 2014 +0800
Require cl-lib
---
easy-kill.el | 35 +++++++++++++++++------------------
1 files changed, 17 insertions(+), 18 deletions(-)
diff --git a/easy-kill.el b/easy-kill.el
index 07c8a37..caa59d2 100644
--- a/easy-kill.el
+++ b/easy-kill.el
@@ -4,7 +4,7 @@
;; Author: Leo Liu <address@hidden>
;; Version: 0.9.1
-;; Package-Requires: ((emacs "24"))
+;; Package-Requires: ((emacs "24") (cl-lib "0.5"))
;; Keywords: convenience
;; Created: 2013-08-12
;; URL: https://github.com/leoliu/easy-kill
@@ -39,7 +39,7 @@
;;; Code:
-(eval-when-compile (require 'cl))
+(require 'cl-lib)
(require 'thingatpt)
(eval-and-compile
@@ -158,10 +158,10 @@ Do nothing if `easy-kill-inhibit-message' is non-nil."
(narrow-to-region (max (point-min) (- (point) 1000))
(min (point-max) (+ (point) 1000)))
(let ((easy-kill-inhibit-message t))
- (dolist (thing easy-kill-try-things)
+ (cl-dolist (thing easy-kill-try-things)
(easy-kill-thing thing n)
(or (string= (easy-kill-candidate) "")
- (return)))))
+ (cl-return)))))
o))
(defun easy-kill-indicate-origin ()
@@ -257,18 +257,18 @@ candidate property instead."
;; helper for `easy-kill-thing'.
(defun easy-kill-thing-forward (n)
(let ((thing (overlay-get easy-kill-candidate 'thing))
- (direction (if (minusp n) -1 +1))
+ (direction (if (cl-minusp n) -1 +1))
(start (overlay-start easy-kill-candidate))
(end (overlay-end easy-kill-candidate)))
(when (and thing (/= n 0))
(let ((new-end (save-excursion
(goto-char end)
(with-demoted-errors
- (dotimes (_ (abs n))
+ (cl-dotimes (_ (abs n))
(forward-thing thing direction)
(when (<= (point) start)
(forward-thing thing 1)
- (return))))
+ (cl-return))))
(point))))
(when (/= end new-end)
(easy-kill-adjust-candidate thing nil new-end)
@@ -446,21 +446,20 @@ Char properties `help-echo', `shr-url' and
`w3m-href-anchor' are
inspected."
(if (or easy-kill-mark (bounds-of-thing-at-point 'url))
(easy-kill-thing 'url nil t)
- (let ((get-url (lambda (text)
- (when (stringp text)
- (with-temp-buffer
- (insert text)
- (and (bounds-of-thing-at-point 'url)
- (thing-at-point 'url)))))))
- (dolist (p '(help-echo shr-url w3m-href-anchor))
+ (cl-labels ((get-url (text)
+ (when (stringp text)
+ (with-temp-buffer
+ (insert text)
+ (and (bounds-of-thing-at-point 'url)
+ (thing-at-point 'url))))))
+ (cl-dolist (p '(help-echo shr-url w3m-href-anchor))
(pcase-let* ((`(,text . ,ov)
(get-char-property-and-overlay (point) p))
- (url (or (funcall get-url text)
- (funcall get-url
- (and ov (overlay-get ov p))))))
+ (url (or (get-url text)
+ (get-url (and ov (overlay-get ov p))))))
(when url
(easy-kill-adjust-candidate 'url url)
- (return url)))))))
+ (cl-return url)))))))
;;; Handler for `sexp' and `list'.
- [elpa] 62/77: Small tweak to easy-kill-on-nxml-element, (continued)
- [elpa] 62/77: Small tweak to easy-kill-on-nxml-element, Leo Liu, 2014/04/05
- [elpa] 60/77: Make easy-kill-on-buffer-file-name do nothing in easy-mark, Leo Liu, 2014/04/05
- [elpa] 68/77: Fix easy-kill-append to update clipboard, Leo Liu, 2014/04/05
- [elpa] 65/77: Fix #8: Don't strip trailing blank chars, Leo Liu, 2014/04/05
- [elpa] 67/77: New handler for defun-name and bind it to `D', Leo Liu, 2014/04/05
- [elpa] 66/77: Fix #9: Work around fixed bug in thingatpt.el, Leo Liu, 2014/04/05
- [elpa] 71/77: In no case should easy-kill-activate-keymap err, Leo Liu, 2014/04/05
- [elpa] 70/77: Adapt to upstream change, Leo Liu, 2014/04/05
- [elpa] 72/77: Rename easy-kill-backward-down to easy-kill-forward-down, Leo Liu, 2014/04/05
- [elpa] 73/77: Support list expand/shrink on js2 nodes, Leo Liu, 2014/04/05
- [elpa] 74/77: Require cl-lib,
Leo Liu <=
- [elpa] 76/77: Add easy-kill to externals-list, Leo Liu, 2014/04/05
- [elpa] 77/77: Merge easy-kill as packages/easy-kill, Leo Liu, 2014/04/05
- [elpa] 75/77: Cleanup and preparation for inclusion in GNU ELPA, Leo Liu, 2014/04/05
- [elpa] 69/77: Consolidate easy-mark and easy-mark-sexp into one command, Leo Liu, 2014/04/05