unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#4354: 23.0.60; delphi-mode: TAB should indent region in Transient Mark mode (with patch)
@ 2009-09-06  4:13 ` Simon South
  2009-09-11  2:50   ` bug#4354: marked as done (23.0.60; delphi-mode: TAB should indent region in Transient Mark mode (with patch)) Emacs bug Tracking System
  0 siblings, 1 reply; 2+ messages in thread
From: Simon South @ 2009-09-06  4:13 UTC (permalink / raw)
  To: emacs-pretest-bug

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-mode-map>
! \\[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-mode-map>
! \\[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.





^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#4354: marked as done (23.0.60; delphi-mode: TAB should indent region in Transient Mark mode (with patch))
  2009-09-06  4:13 ` bug#4354: 23.0.60; delphi-mode: TAB should indent region in Transient Mark mode (with patch) Simon South
@ 2009-09-11  2:50   ` Emacs bug Tracking System
  0 siblings, 0 replies; 2+ messages in thread
From: Emacs bug Tracking System @ 2009-09-11  2:50 UTC (permalink / raw)
  To: Simon South

[-- Attachment #1: Type: text/plain, Size: 992 bytes --]

Your message dated Thu, 10 Sep 2009 22:42:06 -0400
with message-id <1252636926.4395.6.camel@hamlet.localdomain>
and subject line Re: bug#4354: Acknowledgement (23.0.60; delphi-mode: TAB should indent region in Transient Mark mode (with patch))
has caused the Emacs bug report #4354,
regarding 23.0.60; delphi-mode: TAB should indent region in Transient Mark mode (with patch)
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@emacsbugs.donarmstrong.com
immediately.)


-- 
4354: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=4354
Emacs Bug Tracking System
Contact owner@emacsbugs.donarmstrong.com with problems

[-- Attachment #2: Type: message/rfc822, Size: 5439 bytes --]

From: Simon South <ssouth@slowcomputing.org>
To: emacs-pretest-bug@gnu.org
Subject: 23.0.60; delphi-mode: TAB should indent region in Transient Mark mode (with patch)
Date: Sun, 06 Sep 2009 00:13:32 -0400
Message-ID: <87pra4lngz.fsf@hamlet.localdomain>

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-mode-map>
! \\[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-mode-map>
! \\[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.


[-- Attachment #3: Type: message/rfc822, Size: 1578 bytes --]

From: Simon South <ssouth@slowcomputing.org>
To: 4354-done@emacsbugs.donarmstrong.com
Subject: Re: bug#4354: Acknowledgement (23.0.60; delphi-mode: TAB should indent region in Transient Mark mode (with patch))
Date: Thu, 10 Sep 2009 22:42:06 -0400
Message-ID: <1252636926.4395.6.camel@hamlet.localdomain>

Checked in (revision 3.34).


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-09-11  2:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1252636926.4395.6.camel@hamlet.localdomain>
2009-09-06  4:13 ` bug#4354: 23.0.60; delphi-mode: TAB should indent region in Transient Mark mode (with patch) Simon South
2009-09-11  2:50   ` bug#4354: marked as done (23.0.60; delphi-mode: TAB should indent region in Transient Mark mode (with patch)) Emacs bug Tracking System

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).