aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon South2009-09-11 02:28:50 +0000
committerSimon South2009-09-11 02:28:50 +0000
commit07db58574f8d53a51e849aa6943cdbb91db6761f (patch)
treea66241bf7207c6dfcecceaebff0d4a900546f94a
parent66d77eda77b4a92e0e1f9782e895ab0d98ba59bc (diff)
downloademacs-07db58574f8d53a51e849aa6943cdbb91db6761f.tar.gz
emacs-07db58574f8d53a51e849aa6943cdbb91db6761f.zip
(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.
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/progmodes/delphi.el26
2 files changed, 25 insertions, 8 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index af99ea55822..33819ec6466 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -23,6 +23,13 @@
23 than using advertised-undo. 23 than using advertised-undo.
24 * tutorial.el (tutorial--default-keys): Adjust accordingly. 24 * tutorial.el (tutorial--default-keys): Adjust accordingly.
25 25
262009-09-10 Simon South <ssouth@slowcomputing.org>
27
28 * progmodes/delphi.el (delphi-tab): Indent region when Transient
29 Mark mode is enabled and region is active; otherwise indent or
30 insert TAB as usual.
31 (delphi-mode): Update description of TAB-key binding.
32
262009-09-10 Stefan Monnier <monnier@iro.umontreal.ca> 332009-09-10 Stefan Monnier <monnier@iro.umontreal.ca>
27 34
28 * subr.el (define-key-rebound-commands): Mark obsolete. 35 * subr.el (define-key-rebound-commands): Mark obsolete.
diff --git a/lisp/progmodes/delphi.el b/lisp/progmodes/delphi.el
index 4c721fc622e..c5a38607b38 100644
--- a/lisp/progmodes/delphi.el
+++ b/lisp/progmodes/delphi.el
@@ -1652,14 +1652,23 @@ before the indent, the point is moved to the indent."
1652 1652
1653 1653
1654(defun delphi-tab () 1654(defun delphi-tab ()
1655 "Indent the current line or insert a TAB, depending on the value of 1655 "Indent the region, when Transient Mark mode is enabled and the region is
1656`delphi-tab-always-indents' and the current line position." 1656active. Otherwise, indent the current line or insert a TAB, depending on the
1657value of `delphi-tab-always-indents' and the current line position."
1657 (interactive) 1658 (interactive)
1658 (if (or delphi-tab-always-indents ; We are always indenting 1659 (cond ((use-region-p)
1659 ;; Or we are before the first non-space character on the line. 1660 ;; If Transient Mark mode is enabled and the region is active, indent
1660 (save-excursion (skip-chars-backward delphi-space-chars) (bolp))) 1661 ;; the entire region.
1661 (delphi-indent-line) 1662 (indent-region (region-beginning) (region-end)))
1662 (insert "\t"))) 1663 ((or delphi-tab-always-indents
1664 (save-excursion (skip-chars-backward delphi-space-chars) (bolp)))
1665 ;; Otherwise, if we are configured always to indent (regardless of the
1666 ;; point's position in the line) or we are before the first non-space
1667 ;; character on the line, indent the line.
1668 (delphi-indent-line))
1669 (t
1670 ;; Otherwise, insert a tab character.
1671 (insert "\t"))))
1663 1672
1664 1673
1665(defun delphi-is-directory (path) 1674(defun delphi-is-directory (path)
@@ -1935,7 +1944,8 @@ This is ok since we do our own keyword/comment/string face coloring.")
1935;;;###autoload 1944;;;###autoload
1936(defun delphi-mode (&optional skip-initial-parsing) 1945(defun delphi-mode (&optional skip-initial-parsing)
1937 "Major mode for editing Delphi code. \\<delphi-mode-map> 1946 "Major mode for editing Delphi code. \\<delphi-mode-map>
1938\\[delphi-tab]\t- Indents the current line for Delphi code. 1947\\[delphi-tab]\t- Indents the current line (or region, if Transient Mark mode
1948\t is enabled and the region is active) of Delphi code.
1939\\[delphi-find-unit]\t- Search for a Delphi source file. 1949\\[delphi-find-unit]\t- Search for a Delphi source file.
1940\\[delphi-fill-comment]\t- Fill the current comment. 1950\\[delphi-fill-comment]\t- Fill the current comment.
1941\\[delphi-new-comment-line]\t- If in a // comment, do a new comment line. 1951\\[delphi-new-comment-line]\t- If in a // comment, do a new comment line.