emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs/lisp ChangeLog progmodes/delphi.el


From: Simon South
Subject: [Emacs-diffs] emacs/lisp ChangeLog progmodes/delphi.el
Date: Fri, 11 Sep 2009 02:28:54 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Simon South <ssouth>    09/09/11 02:28:53

Modified files:
        lisp           : ChangeLog 
        lisp/progmodes : delphi.el 

Log message:
        (delphi-tab): Indent region when Transient Mark mode is enabled and
        region is active; otherwise indent or insert TAB as usual.
        (delphi-mode): Update description of TAB-key binding.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/ChangeLog?cvsroot=emacs&r1=1.16124&r2=1.16125
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/progmodes/delphi.el?cvsroot=emacs&r1=3.33&r2=3.34

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.16124
retrieving revision 1.16125
diff -u -b -r1.16124 -r1.16125
--- ChangeLog   11 Sep 2009 01:00:37 -0000      1.16124
+++ ChangeLog   11 Sep 2009 02:28:50 -0000      1.16125
@@ -23,6 +23,13 @@
        than using advertised-undo.
        * tutorial.el (tutorial--default-keys): Adjust accordingly.
 
+2009-09-10  Simon South  <address@hidden>
+
+       * progmodes/delphi.el (delphi-tab): Indent region when Transient
+       Mark mode is enabled and region is active; otherwise indent or
+       insert TAB as usual.
+       (delphi-mode): Update description of TAB-key binding.
+
 2009-09-10  Stefan Monnier  <address@hidden>
 
        * subr.el (define-key-rebound-commands): Mark obsolete.

Index: progmodes/delphi.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/progmodes/delphi.el,v
retrieving revision 3.33
retrieving revision 3.34
diff -u -b -r3.33 -r3.34
--- progmodes/delphi.el 5 Jan 2009 03:23:27 -0000       3.33
+++ progmodes/delphi.el 11 Sep 2009 02:28:53 -0000      3.34
@@ -1652,14 +1652,23 @@
 
 
 (defun delphi-tab ()
-  "Indent the current line or insert a TAB, depending on the value of
-`delphi-tab-always-indents' and the current line position."
+  "Indent the region, when Transient Mark mode is enabled and the region is
+active. Otherwise, indent the current line or insert a TAB, depending on the
+value of `delphi-tab-always-indents' and the current line position."
   (interactive)
-  (if (or delphi-tab-always-indents ; We are always indenting
-          ;; Or we are before the first non-space character on the line.
+  (cond ((use-region-p)
+         ;; If Transient Mark mode is enabled and the region is active, indent
+         ;; the entire region.
+         (indent-region (region-beginning) (region-end)))
+        ((or delphi-tab-always-indents
           (save-excursion (skip-chars-backward delphi-space-chars) (bolp)))
-      (delphi-indent-line)
-    (insert "\t")))
+         ;; Otherwise, if we are configured always to indent (regardless of the
+         ;; point's position in the line) or we are before the first non-space
+         ;; character on the line, indent the line.
+         (delphi-indent-line))
+        (t
+         ;; Otherwise, insert a tab character.
+         (insert "\t"))))
 
 
 (defun delphi-is-directory (path)
@@ -1935,7 +1944,8 @@
 ;;;###autoload
 (defun delphi-mode (&optional skip-initial-parsing)
   "Major mode for editing Delphi code. \\<delphi-mode-map>
-\\[delphi-tab]\t- Indents the current line for Delphi code.
+\\[delphi-tab]\t- Indents the current line (or region, if Transient Mark mode
+\t  is enabled and the region is active) of Delphi code.
 \\[delphi-find-unit]\t- Search for a Delphi source file.
 \\[delphi-fill-comment]\t- Fill the current comment.
 \\[delphi-new-comment-line]\t- If in a // comment, do a new comment line.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]