[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 14/77: Doc fix and release v0.7.0
From: |
Leo Liu |
Subject: |
[elpa] 14/77: Doc fix and release v0.7.0 |
Date: |
Sat, 05 Apr 2014 04:08:12 +0000 |
leoliu pushed a commit to branch master
in repository elpa.
commit dfc7ff4caaba931a9556a2a850b6071c9be5dd35
Author: Leo Liu <address@hidden>
Date: Mon Oct 7 16:37:28 2013 +0800
Doc fix and release v0.7.0
---
README.rst | 40 +++++++++++++++++++++++++++++++---------
easy-kill.el | 23 ++++++++++++++++++-----
2 files changed, 49 insertions(+), 14 deletions(-)
diff --git a/README.rst b/README.rst
index 39263e6..abdd2ff 100644
--- a/README.rst
+++ b/README.rst
@@ -1,13 +1,14 @@
-====================
- Kill Things Easily
-====================
-
-Provide a more powerful command ``easy-kill`` for key ``M-w``.
-
-``M-w`` tries in order:
+=============================
+ Kill Things Easily in Emacs
+=============================
+
+``easy-kill`` let users kill things at point without moving point. Its
+goal is to be a drop-in replacement for ``kill-ring-save``. It tries
+in order:
#. current region if active
-#. url at point
+#. url at point (snarf char properties ``help-echo``, ``shr-url``,
+ ``w3m-href-anchor`` etc.)
#. email at point
#. current line
@@ -18,8 +19,16 @@ Keys (customisable) immediately following ``M-w``:
#. ``f`` -> file at point
#. ``l`` -> list at point
#. ``d`` -> defun at point
+#. ``b`` -> ``buffer-file-name`` or ``default-directory``
+#. ``C-w`` -> kill current region
+#. ``+``, ``-`` and ``0..9`` -> enlarge/shrink selection
-More features are planned.
+The following `screenshot <http://i.imgur.com/8TNgPly.png>`_ shows
+``M-w l`` in action:
+
+.. figure:: http://i.imgur.com/8TNgPly.png
+ :target: http://i.imgur.com/8TNgPly.png
+ :alt: ``M-w l``
To Use
~~~~~~
@@ -28,3 +37,16 @@ To Use
(require 'easy-kill)
(global-set-key "\M-w" 'easy-kill)
+
+Extensions
+~~~~~~~~~~
+
+New things can be defined by following package ``thingatpt.el``'s
+convention, or by defining new functions named like
+``easy-kill-on-THING-NAME``. See ``easy-kill-on-buffer-file-name`` and
+``easy-kill-on-url`` for examples.
+
+Bugs
+~~~~
+
+https://github.com/leoliu/easy-kill/issues
diff --git a/easy-kill.el b/easy-kill.el
index 98a284c..0966b2f 100644
--- a/easy-kill.el
+++ b/easy-kill.el
@@ -3,9 +3,10 @@
;; Copyright (C) 2013 Leo Liu
;; Author: Leo Liu <address@hidden>
-;; Version: 0.6.0
+;; Version: 0.7.0
;; Keywords: convenience
;; Created: 2013-08-12
+;; URL: https://github.com/leoliu/easy-kill
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
@@ -38,11 +39,13 @@
(?f . filename)
(?d . defun)
(?b . buffer-file-name))
- "A list of (Key . THING)."
+ "A list of (CHAR . THING).
+CHAR is used immediately following `easy-kill' to select THING."
:type '(repeat (cons character symbol))
:group 'killing)
(defun easy-kill-map ()
+ "Build the keymap according to `easy-kill-alist'."
(let ((map (make-sparse-keymap)))
(define-key map "-" 'easy-kill-shrink)
(define-key map "+" 'easy-kill-enlarge)
@@ -74,7 +77,7 @@
(t s)))
(defvar easy-kill-exit nil
- "If non-nil tells `set-temporary-overlay-map' to exit.")
+ "Tell `set-temporary-overlay-map' to exit if non-nil.")
(defvar easy-kill-candidate nil)
@@ -92,7 +95,7 @@ Otherwise, it is the value of the overlay's candidate
property."
(defun easy-kill-adjust-candidate (thing &optional beg end)
"Adjust kill candidate to THING, BEG, END.
-If BEG is a string, shring the overlay to zero length and set its
+If BEG is a string, shrink the overlay to zero length and set its
candidate property instead."
(let ((o easy-kill-candidate))
(overlay-put o 'thing thing)
@@ -195,7 +198,15 @@ candidate property instead."
;;;###autoload
(defun easy-kill (&optional n)
- "Kill thing at point in the order of region, url, email and line."
+ "Kill thing at point in the order of region, url, email and line.
+Immediately following this additional key bindings are temporally
+activated:
+
+ letters => select things (according to `easy-kill-alist');
+ 0..9 => enlarge current selection by that number;
+ +,=/- => enlarge or shrink current selection by 1;
+ C-w => kill current selection
+ others => save current selection to kill ring and exit"
(interactive "p")
(setq easy-kill-candidate
(let ((o (make-overlay (point) (point))))
@@ -209,6 +220,8 @@ candidate property instead."
(easy-kill-thing thing n)
(when (overlay-get easy-kill-candidate 'thing)
(return)))
+ (when (zerop (buffer-size))
+ (easy-kill-message-nolog "Warn: `easy-kill' activated in empty buffer"))
(easy-kill-activate-keymap))
;;; Extended things
- [elpa] 11/77: Minor tweaks to easy-kill-on-url, (continued)
- [elpa] 11/77: Minor tweaks to easy-kill-on-url, Leo Liu, 2014/04/05
- [elpa] 12/77: Tweak the definition of thing `region', Leo Liu, 2014/04/05
- [elpa] 13/77: New command easy-kill-region to kill current selection, Leo Liu, 2014/04/05
- [elpa] 10/77: New function easy-kill-adjust-candidate and doc fix, Leo Liu, 2014/04/05
- [elpa] 16/77: Make function easy-kill-candidate always return string, Leo Liu, 2014/04/05
- [elpa] 17/77: Fix error: (args-out-of-range 1009 1035), Leo Liu, 2014/04/05
- [elpa] 15/77: Some string and comment fixes, Leo Liu, 2014/04/05
- [elpa] 23/77: Use parse-partial-sexp in easy-kill-bounds-of-list, Leo Liu, 2014/04/05
- [elpa] 20/77: Replace `enlarge' with `expand' in strings and comments, Leo Liu, 2014/04/05
- [elpa] 19/77: Add lispy treatment for +/- on list and sexp, Leo Liu, 2014/04/05
- [elpa] 14/77: Doc fix and release v0.7.0,
Leo Liu <=
- [elpa] 22/77: Handle the case when overlay has already been destroyed, Leo Liu, 2014/04/05
- [elpa] 25/77: Fix thinko in easy-kill-backward-down, Leo Liu, 2014/04/05
- [elpa] 21/77: New command easy-kill-mark-region, Leo Liu, 2014/04/05
- [elpa] 24/77: Improve list expand/shrink support in smie-based modes, Leo Liu, 2014/04/05
- [elpa] 18/77: Consolidate all kill features in easy-kill-thing, Leo Liu, 2014/04/05
- [elpa] 26/77: Fix #2: just call kill-ring-save when region is active, Leo Liu, 2014/04/05
- [elpa] 27/77: Declare dependency on emacs 24, Leo Liu, 2014/04/05
- [elpa] 29/77: Merge pull request #4 from purcell/patch-1, Leo Liu, 2014/04/05
- [elpa] 31/77: Simplify the interactive form of easy-kill-thing, Leo Liu, 2014/04/05
- [elpa] 28/77: [remap kill-ring-save] should be a better key binding for this feature., Leo Liu, 2014/04/05