X-Loop: help-debbugs@HIDDEN
Subject: bug#75108: [PATCH] indent.el Comments for indent-for-tab-command as a first step for refactoring.
Resent-From: Vitaliy <vitalij@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: help-debbugs@HIDDEN
Resent-Date: Thu, 26 Dec 2024 04:34:02 +0000
Resent-Message-ID: <handler.75108.B.173518763623188 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: report 75108
X-GNU-PR-Package: indent.el
X-GNU-PR-Keywords: notabug
To: 75108 <at> debbugs.gnu.org
X-Debbugs-Original-To: bug-gnu-emacs@HIDDEN
Received: via spool by submit <at> debbugs.gnu.org id=B.173518763623188
(code B ref -1); Thu, 26 Dec 2024 04:34:02 +0000
Received: (at submit) by debbugs.gnu.org; 26 Dec 2024 04:33:56 +0000
Received: from localhost ([127.0.0.1]:39685 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
id 1tQfZL-00061t-66
for submit <at> debbugs.gnu.org; Wed, 25 Dec 2024 23:33:56 -0500
Received: from lists.gnu.org ([209.51.188.17]:46626)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from <vitalij@HIDDEN>) id 1tQZCr-0002WW-So
for submit <at> debbugs.gnu.org; Wed, 25 Dec 2024 16:46:18 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10])
by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.90_1) (envelope-from <vitalij@HIDDEN>) id 1tQZCr-0004xR-II
for bug-gnu-emacs@HIDDEN; Wed, 25 Dec 2024 16:46:17 -0500
Received: from mout.gmx.net ([212.227.15.19])
by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.90_1) (envelope-from <vitalij@HIDDEN>) id 1tQZCp-0006pv-Hb
for bug-gnu-emacs@HIDDEN; Wed, 25 Dec 2024 16:46:16 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.com;
s=s31663417; t=1735163174; x=1735767974; i=vitalij@HIDDEN;
bh=qhWynnLYBhNLeLgedHiidShTBceMnAK3ZzGSgIlTQzU=;
h=X-UI-Sender-Class:From:To:Subject:Date:Message-ID:MIME-Version:
Content-Type:cc:content-transfer-encoding:content-type:date:from:
message-id:mime-version:reply-to:subject:to;
b=lyCj+elzwJ3NvBc6ZoVh0mJvXAFnsXJsINAjPsS7rhH5M707yLzIecelXS6tjuyl
w6wDgSe1eMoibQkiLmY0vrWMWA8EoDDSwZ0Mbwf5+7upse4ajXMh29/DdSZoVwj++
r6Mg1jVLwD23Ahxc7MQIhHhCme7go4BeLwFmmjDW65bOYomZ+lfO/uuEaoUn0PLKv
mbdIiGkl7bW4ymQqVaLfCt8G4T+M8PuX//hCHcTO2p28jE5XrYbacXNum2rAmuYqk
ZlmwJWOivxinMgOuSLRXoaGwBrwGoinAsl0jqIZOhV485Yp2VzQ3Ds3ZFT7OQZuU0
2DMtLfq4aIUz9hnlsw==
X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a
Received: from localhost ([202.179.32.225]) by mail.gmx.net (mrgmx005
[212.227.17.184]) with ESMTPSA (Nemesis) id 1MbivM-1tx8ry2brq-00pi0T for
<bug-gnu-emacs@HIDDEN>; Wed, 25 Dec 2024 22:46:14 +0100
From: Vitaliy <vitalij@HIDDEN>
Date: Wed, 25 Dec 2024 21:45:58 -0000
Message-ID: <87v7v7h1wp.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Provags-ID: V03:K1:0D2iktJyK4RYH32Qar/CBi7KKuoqPEnDxsSVR+7pbfXtzPsq/ue
umbJgmVM9ZaOUZTCs6dfUlXg6fgKINrn5gjhqedq+CP6obDPhnGjfQFxZWz4yWb1EZiJ/gK
3f9b1/d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w82hCuUE32qEgnzujLKp+LCEJRBWr+ABM9FfzNDBjGpA4w8/2r/VuAq0ekRs7mm7LIa
iapWVTKlzzBWOj1lF4KVSvu5mSwkxrx8K+joOOT4edaRWJbZmNnxW85tSLWmXTQGPpYS2zCkt
Suz11uHkpXGwUaZ9wyAEMPYk0cG7cVltZ+N31N61JrHphe2mvFY7N2h756nCdQCTS15n0QczN
XWKBfurMuMPaWHMPl9ckQUHJIc5PoL
Received-SPF: pass client-ip=212.227.15.19; envelope-from=vitalij@HIDDEN;
helo=mout.gmx.net
X-Spam_score_int: -27
X-Spam_score: -2.8
X-Spam_bar: --
X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001,
RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001,
SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Mailman-Approved-At: Wed, 25 Dec 2024 23:33:54 -0500
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)
--=-=-=
Content-Type: text/plain
Tags: notabug
Package: indent.el
Version: master
Severity: wishlist
In GNU Emacs master.
#'indent-for-tab-command function now have strict steps, I hope in
future we will add ability to select on what orded they should go, as a
first step I suggest to comment them to separate.
This steps in unclear heap now:
-. **Check for Active Region**: If there is an active region, it indents that region.
1. **Handle Special Indentation Cases**: If the indentation function is specific or certain conditions are met, it inserts a tab character.
2. **Default Indentation Handling**: If neither of the above, it performs standard line indentation.
3. **Check for Completion Conditions**: If specific conditions are met after indentation, it triggers completion.
4. **Rigid Indentation with Prefix Argument**: If a prefix argument is provided, it rigidly indents the balanced expression to reflect the current line's indentation.
--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
filename=0001-Comment-for-indent-for-tab-command-as-a-first-step-t.patch
Content-Transfer-Encoding: quoted-printable
=46rom 00c1dbbf729b1180963abb6743116ec4c8c6b5ad Mon Sep 17 00:00:00 2001
From: none <none>
Date: Wed, 25 Dec 2024 21:26:05 +0000
Subject: [PATCH] Comment for indent-for-tab-command as a first step to
refactoring.
=2D--
lisp/indent.el | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/lisp/indent.el b/lisp/indent.el
index 74ef9183d95..613454918b8 100644
=2D-- a/lisp/indent.el
+++ b/lisp/indent.el
@@ -160,6 +160,7 @@ prefix argument is ignored."
;; The region is active, indent it.
((use-region-p)
(indent-region (region-beginning) (region-end)))
+ ;; *1.* inserts a tab character for special indentation cases.
((or ;; indent-to-left-margin is only meant for indenting,
;; so we force it to always insert a tab here.
(eq indent-line-function 'indent-to-left-margin)
@@ -172,15 +173,17 @@ prefix argument is ignored."
(old-point (point))
(old-indent (current-indentation)))
- ;; Indent the line.
+ ;; *2.* Indent the line with specified function
(or (not (eq (indent--funcall-widened indent-line-function) 'noinde=
nt))
+ ;; *3.* Indent comment
(indent--default-inside-comment)
+ ;; *4.* Fallback to default indent function
(when (or (<=3D (current-column) (current-indentation))
(not (eq tab-always-indent 'complete)))
(indent--funcall-widened (default-value 'indent-line-function=
))))
(cond
- ;; If the text was already indented right, try completion.
+ ;; *5.* If the text was already indented right, try completion.
((and (eq tab-always-indent 'complete)
(eql old-point (point))
(eql old-tick (buffer-chars-modified-tick))
@@ -193,9 +196,9 @@ prefix argument is ignored."
('word-or-paren (not (memq syn '(2 4 5))))
('word-or-paren-or-punct (not (memq syn '(2 4 5 1)))=
)))))
(completion-at-point))
-
- ;; If a prefix argument was given, rigidly indent the following
- ;; sexp to match the change in the current line's indentation.
+ ;; *6* If a prefix argument was given, rigidly indent the
+ ;; following sexp to match the change in the current line's
+ ;; indentation.
(arg
(let ((end-marker
(save-excursion
=2D-
2.45.2
--=-=-=
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable
=2D-
Best regards,
Vitaliy
Magic number: 7850B0B5E3F536601D2E6A9DE1C43E074A047699
--=-=-=--
Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) Content-Type: text/plain; charset=utf-8 X-Loop: help-debbugs@HIDDEN From: help-debbugs@HIDDEN (GNU bug Tracking System) To: Vitaliy <vitalij@HIDDEN> Subject: bug#75108: Acknowledgement ([PATCH] indent.el Comments for indent-for-tab-command as a first step for refactoring.) Message-ID: <handler.75108.B.173518763623188.ack <at> debbugs.gnu.org> References: <87v7v7h1wp.fsf@HIDDEN> X-Gnu-PR-Message: ack 75108 X-Gnu-PR-Package: indent.el X-Gnu-PR-Keywords: notabug Reply-To: 75108 <at> debbugs.gnu.org Date: Thu, 26 Dec 2024 04:34:02 +0000 Thank you for filing a new bug report with debbugs.gnu.org. This is an automatically generated reply to let you know your message has been received. Your message is being forwarded to the package maintainers and other interested parties for their attention; they will reply in due course. Your message has been sent to the package maintainer(s): help-debbugs@HIDDEN If you wish to submit further information on this problem, please send it to 75108 <at> debbugs.gnu.org. Please do not send mail to help-debbugs@HIDDEN unless you wish to report a problem with the Bug-tracking system. --=20 75108: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D75108 GNU Bug Tracking System Contact help-debbugs@HIDDEN with problems
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.