aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2010-02-13 11:29:25 -0800
committerGlenn Morris2010-02-13 11:29:25 -0800
commit360206424705f20e51a77588c82c3bb698452fc9 (patch)
tree8a6b29c1765e98826881a2851b487916c6ffe0ac
parent471e4f044041f16e50c4e817d3fa0249b8e84748 (diff)
downloademacs-360206424705f20e51a77588c82c3bb698452fc9.tar.gz
emacs-360206424705f20e51a77588c82c3bb698452fc9.zip
Improve docs of some transposition functions.
* simple.el (transpose-subr): Give it a doc-string. * textmodes/paragraphs.el (transpose-paragraphs, transpose-sentences): Doc fixes.
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/simple.el11
-rw-r--r--lisp/textmodes/paragraphs.el17
3 files changed, 32 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 702f283a9ff..0b764b3a452 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
12010-02-13 Glenn Morris <rgm@gnu.org>
2
3 * simple.el (transpose-subr): Give it a doc-string.
4
5 * textmodes/paragraphs.el (transpose-paragraphs, transpose-sentences):
6 Doc fixes.
7
12010-02-12 Juri Linkov <juri@jurta.org> 82010-02-12 Juri Linkov <juri@jurta.org>
2 9
3 * arc-mode.el (archive-unique-fname): Make directories for nested 10 * arc-mode.el (archive-unique-fname): Make directories for nested
diff --git a/lisp/simple.el b/lisp/simple.el
index 5de308ee229..b16794f2770 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -4854,7 +4854,18 @@ With argument 0, interchanges line point is in with line mark is in."
4854 (forward-line arg)))) 4854 (forward-line arg))))
4855 arg)) 4855 arg))
4856 4856
4857;; FIXME seems to leave point BEFORE the current object when ARG = 0,
4858;; which seems inconsistent with the ARG /= 0 case.
4859;; FIXME document SPECIAL.
4857(defun transpose-subr (mover arg &optional special) 4860(defun transpose-subr (mover arg &optional special)
4861 "Subroutine to do the work of transposing objects.
4862Works for lines, sentences, paragraphs, etc. MOVER is a function that
4863moves forward by units of the given object (e.g. forward-sentence,
4864forward-paragraph). If ARG is zero, exchanges the current object
4865with the one containing mark. If ARG is an integer, moves the
4866current object past ARG following (if ARG is positive) or
4867preceding (if ARG is negative) objects, leaving point after the
4868current object."
4858 (let ((aux (if special mover 4869 (let ((aux (if special mover
4859 (lambda (x) 4870 (lambda (x)
4860 (cons (progn (funcall mover x) (point)) 4871 (cons (progn (funcall mover x) (point))
diff --git a/lisp/textmodes/paragraphs.el b/lisp/textmodes/paragraphs.el
index 51f893af6e6..2c698a836fe 100644
--- a/lisp/textmodes/paragraphs.el
+++ b/lisp/textmodes/paragraphs.el
@@ -1,7 +1,8 @@
1;;; paragraphs.el --- paragraph and sentence parsing 1;;; paragraphs.el --- paragraph and sentence parsing
2 2
3;; Copyright (C) 1985, 1986, 1987, 1991, 1994, 1995, 1996, 1997, 1999, 2000, 3;; Copyright (C) 1985, 1986, 1987, 1991, 1994, 1995, 1996, 1997, 1999, 2000,
4;; 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. 4;; 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
5;; Free Software Foundation, Inc.
5 6
6;; Maintainer: FSF 7;; Maintainer: FSF
7;; Keywords: wp 8;; Keywords: wp
@@ -409,7 +410,12 @@ negative arg -N means kill forward to Nth end of paragraph."
409 (kill-region (point) (progn (backward-paragraph arg) (point)))) 410 (kill-region (point) (progn (backward-paragraph arg) (point))))
410 411
411(defun transpose-paragraphs (arg) 412(defun transpose-paragraphs (arg)
412 "Interchange this (or next) paragraph with previous one." 413 "Interchange the current paragraph with the next one.
414With prefix argument ARG a non-zero integer, moves the current
415paragraph past ARG paragraphs, leaving point after the current paragraph.
416If ARG is positive, moves the current paragraph forwards, if
417ARG is negative moves it backwards. If ARG is zero, exchanges
418the current paragraph with the one containing the mark."
413 (interactive "*p") 419 (interactive "*p")
414 (transpose-subr 'forward-paragraph arg)) 420 (transpose-subr 'forward-paragraph arg))
415 421
@@ -509,7 +515,12 @@ ones already marked."
509 nil t)) 515 nil t))
510 516
511(defun transpose-sentences (arg) 517(defun transpose-sentences (arg)
512 "Interchange this (next) and previous sentence." 518 "Interchange the current sentence with the next one.
519With prefix argument ARG a non-zero integer, moves the current
520sentence past ARG sentences, leaving point after the current sentence.
521If ARG is positive, moves the current sentence forwards, if
522ARG is negative moves it backwards. If ARG is zero, exchanges
523the current sentence with the one containing the mark."
513 (interactive "*p") 524 (interactive "*p")
514 (transpose-subr 'forward-sentence arg)) 525 (transpose-subr 'forward-sentence arg))
515 526