;; This file is part of GNU Emacs.
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with this program; see the file COPYING. If not, write to
-;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;; set up electric character functions to work with pending-del,
;; (a.k.a. delsel) mode. All symbols get the t value except
;; the functions which delete, which gets 'supersede.
-(mapcar
+(mapc
(function
(lambda (sym)
(put sym 'delete-selection t) ; for delsel (Emacs)
;; compiled, e.g. in the menus.
(c-region-is-active-p))
-(defun c-indent-line-or-region ()
- "When the region is active, indent it syntactically. Otherwise
-indent the current line syntactically."
- ;; Emacs has a variable called mark-active, XEmacs uses region-active-p
- (interactive)
- (if (c-region-is-active-p)
+(defun c-indent-line-or-region (&optional arg region)
+ "Indent active region, current line, or block starting on this line.
+In Transient Mark mode, when the region is active, reindent the region.
+Othewise, with a prefix argument, rigidly reindent the expression
+starting on the current line.
+Otherwise reindent just the current line."
+ (interactive
+ (list current-prefix-arg (use-region-p)))
+ (if region
(c-indent-region (region-beginning) (region-end))
- (c-indent-line)))
-
+ (c-indent-command arg)))
\f
;; for progress reporting
(defvar c-progress-info nil)
(save-excursion
(goto-char (cdr c-lit-limits))
(beginning-of-line)
- (and (search-forward-regexp
+ ;; The following conjunct was added to avoid an
+ ;; "Invalid search bound (wrong side of point)"
+ ;; error in the subsequent re-search. Maybe
+ ;; another fix would be needed (2007-12-08).
+ (and (> (- (cdr c-lit-limits) 2) (point))
+ (search-forward-regexp
(concat "\\=[ \t]*\\(" c-current-comment-prefix "\\)")
(- (cdr c-lit-limits) 2) t)
(not (search-forward-regexp
\f
(cc-provide 'cc-cmds)
-;;; arch-tag: bf0611dc-d1f4-449e-9e45-4ec7c6936677
+;; arch-tag: bf0611dc-d1f4-449e-9e45-4ec7c6936677
;;; cc-cmds.el ends here