From unknown Tue Aug 19 02:58:15 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#4354: 23.0.60; delphi-mode: TAB should indent region in Transient Mark mode (with patch) Reply-To: Simon South , 4354@debbugs.gnu.org Resent-From: Simon South Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Sun, 06 Sep 2009 04:20:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: report 4354 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by submit@emacsbugs.donarmstrong.com id=B.125221042511312 (code B ref -1); Sun, 06 Sep 2009 04:20:03 +0000 Received: (at submit) by emacsbugs.donarmstrong.com; 6 Sep 2009 04:13:45 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.0 required=4.0 tests=MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n864Dh9T011309 for ; Sat, 5 Sep 2009 21:13:44 -0700 Received: from mx10.gnu.org ([199.232.76.166]:49648) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1Mk98I-0001tq-If for emacs-pretest-bug@gnu.org; Sun, 06 Sep 2009 00:13:42 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Mk98G-000178-6z for emacs-pretest-bug@gnu.org; Sun, 06 Sep 2009 00:13:42 -0400 Received: from caiajhbdccah.dreamhost.com ([208.97.132.207]:54983 helo=postalmail-a6.g.dreamhost.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mk98F-00015s-GB for emacs-pretest-bug@gnu.org; Sun, 06 Sep 2009 00:13:39 -0400 Received: from hamlet.localdomain.slowcomputing.org (CPE0019b90fad23-CM00407b87aa6e.cpe.net.cable.rogers.com [99.238.107.135]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by postalmail-a6.g.dreamhost.com (Postfix) with ESMTP id 84283887A4 for ; Sat, 5 Sep 2009 21:13:36 -0700 (PDT) Date: Sun, 06 Sep 2009 00:13:32 -0400 Message-Id: <87pra4lngz.fsf@hamlet.localdomain> From: Simon South To: emacs-pretest-bug@gnu.org X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1) The patch below makes delphi-mode indent the region when the TAB key is pressed, whenever Transient Mark mode is enabled and the region is active. (This became standard behaviour with Emacs 23.1 but wasn't automatically reflected by delphi-mode as it defines its own TAB-key binding.) I've tested this with different combinations of transient-mark-mode, delphi-tab-always-indents and delphi-newline-always-indents and it appears to work fine. Changes: (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. Index: lisp/progmodes/delphi.el =================================================================== RCS file: /sources/emacs/emacs/lisp/progmodes/delphi.el,v retrieving revision 3.33 diff -c -r3.33 delphi.el *** lisp/progmodes/delphi.el 5 Jan 2009 03:23:27 -0000 3.33 --- lisp/progmodes/delphi.el 6 Sep 2009 03:33:09 -0000 *************** *** 1652,1665 **** (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." (interactive) ! (if (or delphi-tab-always-indents ; We are always indenting ! ;; Or we are before the first non-space character on the line. ! (save-excursion (skip-chars-backward delphi-space-chars) (bolp))) ! (delphi-indent-line) ! (insert "\t"))) (defun delphi-is-directory (path) --- 1652,1674 ---- (defun delphi-tab () ! "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) ! (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))) ! ;; 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,1941 **** ;;;###autoload (defun delphi-mode (&optional skip-initial-parsing) "Major mode for editing Delphi code. \\ ! \\[delphi-tab]\t- Indents the current line for 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. --- 1944,1951 ---- ;;;###autoload (defun delphi-mode (&optional skip-initial-parsing) "Major mode for editing 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. From unknown Tue Aug 19 02:58:15 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.427 (Entity 5.427) X-Loop: owner@emacsbugs.donarmstrong.com From: help-debbugs@gnu.org (Emacs bug Tracking System) To: Simon South Subject: bug#4354 closed by Simon South (Re: bug#4354: Acknowledgement (23.0.60; delphi-mode: TAB should indent region in Transient Mark mode (with patch))) Message-ID: References: <1252636926.4395.6.camel@hamlet.localdomain> <87pra4lngz.fsf@hamlet.localdomain> X-Emacs-PR-Message: they-closed 4354 X-Emacs-PR-Package: emacs Reply-To: 4354@debbugs.gnu.org Date: Fri, 11 Sep 2009 02:50:04 +0000 Content-Type: multipart/mixed; boundary="----------=_1252637404-28322-1" This is a multi-part message in MIME format... ------------=_1252637404-28322-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This is an automatic notification regarding your bug report which was filed against the emacs package: #4354: 23.0.60; delphi-mode: TAB should indent region in Transient Mark mod= e (with patch) It has been closed by Simon South . Their explanation is attached below along with your original report. If this explanation is unsatisfactory and you have not received a better one in a separate message then please contact Simon South by replying to this email. --=20 4354: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D4354 Emacs Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1252637404-28322-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 4354-done) by emacsbugs.donarmstrong.com; 11 Sep 2009 02:42:10 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-1.5 required=4.0 tests=AWL,HAS_BUG_NUMBER, MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from postalmail-a6.g.dreamhost.com (caiajhbdcaib.dreamhost.com [208.97.132.81]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8B2g8IC026864 for <4354-done@emacsbugs.donarmstrong.com>; Thu, 10 Sep 2009 19:42:09 -0700 Received: from [192.168.1.101] (CPE0019b90fad23-CM00407b87aa6e.cpe.net.cable.rogers.com [99.238.107.135]) by postalmail-a6.g.dreamhost.com (Postfix) with ESMTP id 11EBE887B9 for <4354-done@emacsbugs.donarmstrong.com>; Thu, 10 Sep 2009 19:42:07 -0700 (PDT) Subject: Re: bug#4354: Acknowledgement (23.0.60; delphi-mode: TAB should indent region in Transient Mark mode (with patch)) From: Simon South To: 4354-done@debbugs.gnu.org In-Reply-To: References: <87pra4lngz.fsf@hamlet.localdomain> Content-Type: text/plain Date: Thu, 10 Sep 2009 22:42:06 -0400 Message-Id: <1252636926.4395.6.camel@hamlet.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.24.5 Content-Transfer-Encoding: 7bit Checked in (revision 3.34). ------------=_1252637404-28322-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by emacsbugs.donarmstrong.com; 6 Sep 2009 04:13:45 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.0 required=4.0 tests=MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n864Dh9T011309 for ; Sat, 5 Sep 2009 21:13:44 -0700 Received: from mx10.gnu.org ([199.232.76.166]:49648) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1Mk98I-0001tq-If for emacs-pretest-bug@gnu.org; Sun, 06 Sep 2009 00:13:42 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Mk98G-000178-6z for emacs-pretest-bug@gnu.org; Sun, 06 Sep 2009 00:13:42 -0400 Received: from caiajhbdccah.dreamhost.com ([208.97.132.207]:54983 helo=postalmail-a6.g.dreamhost.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mk98F-00015s-GB for emacs-pretest-bug@gnu.org; Sun, 06 Sep 2009 00:13:39 -0400 Received: from hamlet.localdomain.slowcomputing.org (CPE0019b90fad23-CM00407b87aa6e.cpe.net.cable.rogers.com [99.238.107.135]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by postalmail-a6.g.dreamhost.com (Postfix) with ESMTP id 84283887A4 for ; Sat, 5 Sep 2009 21:13:36 -0700 (PDT) Date: Sun, 06 Sep 2009 00:13:32 -0400 Message-Id: <87pra4lngz.fsf@hamlet.localdomain> From: Simon South To: emacs-pretest-bug@gnu.org Subject: 23.0.60; delphi-mode: TAB should indent region in Transient Mark mode (with patch) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1) The patch below makes delphi-mode indent the region when the TAB key is pressed, whenever Transient Mark mode is enabled and the region is active. (This became standard behaviour with Emacs 23.1 but wasn't automatically reflected by delphi-mode as it defines its own TAB-key binding.) I've tested this with different combinations of transient-mark-mode, delphi-tab-always-indents and delphi-newline-always-indents and it appears to work fine. Changes: (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. Index: lisp/progmodes/delphi.el =================================================================== RCS file: /sources/emacs/emacs/lisp/progmodes/delphi.el,v retrieving revision 3.33 diff -c -r3.33 delphi.el *** lisp/progmodes/delphi.el 5 Jan 2009 03:23:27 -0000 3.33 --- lisp/progmodes/delphi.el 6 Sep 2009 03:33:09 -0000 *************** *** 1652,1665 **** (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." (interactive) ! (if (or delphi-tab-always-indents ; We are always indenting ! ;; Or we are before the first non-space character on the line. ! (save-excursion (skip-chars-backward delphi-space-chars) (bolp))) ! (delphi-indent-line) ! (insert "\t"))) (defun delphi-is-directory (path) --- 1652,1674 ---- (defun delphi-tab () ! "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) ! (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))) ! ;; 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,1941 **** ;;;###autoload (defun delphi-mode (&optional skip-initial-parsing) "Major mode for editing Delphi code. \\ ! \\[delphi-tab]\t- Indents the current line for 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. --- 1944,1951 ---- ;;;###autoload (defun delphi-mode (&optional skip-initial-parsing) "Major mode for editing 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. ------------=_1252637404-28322-1--