(ispell-command-loop): Add current dictionary name and program name
[bpt/emacs.git] / lisp / textmodes / paragraphs.el
index 868dcb2..c4f7750 100644 (file)
@@ -1,6 +1,6 @@
 ;;; paragraphs.el --- paragraph and sentence parsing
 
-;; Copyright (C) 1985, 86, 87, 91, 94, 95, 96, 1997, 1999, 2000, 2001
+;; Copyright (C) 1985, 86, 87, 91, 94, 95, 96, 1997, 1999, 2000, 2001, 2004
 ;;    Free Software Foundation, Inc.
 
 ;; Maintainer: FSF
@@ -20,8 +20,8 @@
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
 
 ;;; Commentary:
 
@@ -122,8 +122,8 @@ This is relevant for filling.  See also `sentence-end-without-period'
 and `colon-double-space'.
 
 This value is used by the function `sentence-end' to construct the
-regexp describing the end of a sentence, in case when the value of
-the variable `sentence-end' is nil.  See Info node `Sentences'."
+regexp describing the end of a sentence, when the value of the variable
+`sentence-end' is nil.  See Info node `(elisp)Standard Regexps'."
   :type 'boolean
   :group 'fill)
 
@@ -133,18 +133,18 @@ For example, a sentence in Thai text ends with double space but
 without a period.
 
 This value is used by the function `sentence-end' to construct the
-regexp describing the end of a sentence, in case when the value of
-the variable `sentence-end' is nil.  See Info node `Sentences'."
+regexp describing the end of a sentence, when the value of the variable
+`sentence-end' is nil.  See Info node `(elisp)Standard Regexps'."
   :type 'boolean
   :group 'fill)
 
 (defcustom sentence-end-without-space
   "\e$B!#!%!)!*\e$A!##.#?#!\e$(0!$!%!)!*\e$(G!$!%!)!*\e(B"
-  "*String containing characters that end sentence without following spaces.
+  "*String of characters that end sentence without following spaces.
 
 This value is used by the function `sentence-end' to construct the
-regexp describing the end of a sentence, in case when the value of
-the variable `sentence-end' is nil.  See Info node `Sentences'."
+regexp describing the end of a sentence, when the value of the variable
+`sentence-end' is nil.  See Info node `(elisp)Standard Regexps'."
   :group 'paragraphs
   :type 'string)
 
@@ -169,7 +169,7 @@ and `sentence-end-without-space'.  The default value specifies
 that in order to be recognized as the end of a sentence, the
 ending period, question mark, or exclamation point must be
 followed by two spaces, unless it's inside some sort of quotes or
-parenthesis.  See Info node `Sentences'."
+parenthesis.  See Info node `(elisp)Standard Regexps'."
   (or sentence-end
       (concat (if sentence-end-without-period "\\w  \\|")
               "\\([.?!][]\"'\xd0c9\x5397d)}]*"
@@ -347,7 +347,7 @@ See `forward-paragraph' for more information."
   (or arg (setq arg 1))
   (forward-paragraph (- arg)))
 
-(defun mark-paragraph (&optional arg)
+(defun mark-paragraph (&optional arg allow-extend)
   "Put point at beginning of this paragraph, mark at end.
 The paragraph marked is the one that contains point or follows point.
 
@@ -357,13 +357,16 @@ the number of paragraphs marked equals ARG.
 If ARG is negative, point is put at end of this paragraph, mark is put
 at beginning of this or a previous paragraph.
 
-If this command is repeated, it marks the next ARG paragraphs after (or
-before, if arg is negative) the ones already marked."
-  (interactive "p")
+Interactively, if this command is repeated
+or (in Transient Mark mode) if the mark is active, 
+it marks the next ARG paragraphs after the ones already marked."
+  (interactive "p\np")
   (unless arg (setq arg 1))
   (when (zerop arg)
     (error "Cannot mark zero paragraphs"))
-  (cond ((and (eq last-command this-command) (mark t))
+  (cond ((and allow-extend
+             (or (and (eq last-command this-command) (mark t))
+                 (and transient-mark-mode mark-active)))
         (set-mark
          (save-excursion
            (goto-char (mark))