Permalink
Browse files

Somewhat clearer docstrings.

  • Loading branch information...
1 parent 8610f09 commit cb86950c4226be1789d098e3acc05baaf8a88474 Thomas Kappler committed May 16, 2010
Showing with 16 additions and 17 deletions.
  1. +6 −6 README.md
  2. +10 −11 delim-kill.el
View
@@ -1,4 +1,4 @@
-# delim-kill.el --- Kill text between bounding characters
+# delim-kill.el --- Kill text between delimiters.
Copyright (C) 2010 Thomas Kappler
@@ -16,16 +16,16 @@ Licensed under the [GPL version 3](http://www.gnu.org/licenses/) or later.
Kill text between two delimiters, preserving structure.
delim-kill.el contains a single convenience function for editing
-structured data: delim-kill. Given two characters FROM and TO,
-delim-kill kills the text between the first occurence of FROM
-before point and the first occurence of TO after point. FROM and TO
-may be identical.
+structured data: delim-kill. Given two characters FROM and TO, it
+kills the text between the first occurence of FROM before point and
+the first occurence of TO after point. FROM and TO may be
+identical.
If FROM and TO are not identical, the function preserves the
balance between the two characters: For each FROM that is
encountered while looking for TO, one additional TO is required;
and vice versa. For example, in "{ foo X{bar} baz }", with X being
-point and "{" as TO and "}" as FROM, the text "{ foo {bar} baz }"
+point and "{" and "}" as delimiters, the text "{ foo {bar} baz }"
will be killed, not "{ foo {bar}".
delim-kill is useful in programming and in editing other files with
View
@@ -1,4 +1,4 @@
-;;; delim-kill.el --- Kill text between bounding characters
+;;; delim-kill.el --- Kill text between delimiters.
;; Copyright (C) 2010 Thomas Kappler
@@ -27,16 +27,16 @@
;; Kill text between two delimiters, preserving structure.
;; delim-kill.el contains a single convenience function for editing
-;; structured data: delim-kill. Given two characters FROM and TO,
-;; delim-kill kills the text between the first occurence of FROM
-;; before point and the first occurence of TO after point. FROM and TO
-;; may be identical.
+;; structured data: delim-kill. Given two characters FROM and TO, it
+;; kills the text between the first occurence of FROM before point and
+;; the first occurence of TO after point. FROM and TO may be
+;; identical.
;; If FROM and TO are not identical, the function preserves the
;; balance between the two characters: For each FROM that is
;; encountered while looking for TO, one additional TO is required;
;; and vice versa. For example, in "{ foo X{bar} baz }", with X being
-;; point and "{" as TO and "}" as FROM, the text "{ foo {bar} baz }"
+;; point and "{" and "}" as delimiters, the text "{ foo {bar} baz }"
;; will be killed, not "{ foo {bar}".
;; delim-kill is useful in programming and in editing other files with
@@ -59,17 +59,16 @@
;;; Code:
(defun delim-kill (from-char to-char orig-point save)
- "Kill the text between two given characters, preserving balance.
+ "Kill the text between two characters, preserving balance.
-Given FROM and TO, goes backwards from point until it finds FROM
-and forward from point until it finds TO, and kills the text
-between the two, including FROM and TO.
+Kills the text between the first occurence of FROM before point
+and the first occurence of TO after point, including FROM and TO.
If FROM and TO are not identical, the function preserves the
balance between the two characters: For each FROM that is
encountered while looking for TO, one additional TO is required;
and vice versa. For example, in \"{ foo X{bar} baz }\", with X
-being point and \"{\" as TO and \"}\" as FROM, the text \" foo
+being point and \"{\" and \"}\" as delimiters, the text \" foo
{bar} baz \" will be killed, not \"bar} baz \".
If FROM and TO are identical, and point is on that character when

0 comments on commit cb86950

Please sign in to comment.