From: Ross Donaldson <gastove@gmail.com>
To: Noam Postavsky <npostavs@users.sourceforge.net>
Cc: 28475@debbugs.gnu.org
Subject: bug#28475: 25.3; python double-indents multi-line function argument blocks
Date: Mon, 25 Dec 2017 20:54:35 +0000 [thread overview]
Message-ID: <CAC+S334C7fmPLbQ-GDou9wfy6Sk-XVbyS3toAHitVRhUEDmeEQ@mail.gmail.com> (raw)
In-Reply-To: <87lgji6ghm.fsf@users.sourceforge.net>
[-- Attachment #1.1: Type: text/plain, Size: 472 bytes --]
Okay. Let's try this again.
Thanks for the guidance and the patience! Let me know if this is closer ;P
On Mon, Nov 6, 2017 at 5:10 PM Noam Postavsky <
npostavs@users.sourceforge.net> wrote:
> Ross Donaldson <gastove@gmail.com> writes:
>
> > ARG -- apologies! I somehow missed this as it came in. Thank you very
> > much for the feedback; I'll make those changes and submit a new patch
> > soon.
>
> There's no deadline, just checking if maybe this got lost again...
>
[-- Attachment #1.2: Type: text/html, Size: 864 bytes --]
[-- Attachment #2: 0001-Provide-a-new-customization-variable-for-python-mode.patch --]
[-- Type: application/octet-stream, Size: 2159 bytes --]
From c085301d720e43fdbacd3327d5fa995abac00580 Mon Sep 17 00:00:00 2001
From: Ross Donaldson <gastove@gmail.com>
Date: Mon, 25 Dec 2017 12:51:19 -0800
Subject: [PATCH] Provide a new customization variable for python-mode
indentation
`python-indent-def-block-scale` allows uses to control how many indent
levels are inserted for multi-line function signatures.
---
etc/NEWS.26 | 7 +++++++
lisp/progmodes/python.el | 10 ++++++++--
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/etc/NEWS.26 b/etc/NEWS.26
index 692c28a721..646755bbb1 100644
--- a/etc/NEWS.26
+++ b/etc/NEWS.26
@@ -1037,6 +1037,13 @@ located and whether GnuPG's option '--homedir' is used or not.
---
*** Deleting a package no longer respects 'delete-by-moving-to-trash'.
+** Python
+
++++
+*** The new variable 'python-indent-def-block-scale' has been added to
+control the depth of indentation of arguments inside multi-line function
+signatures.
+
** Tramp
+++
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index a72a55d2d9..6755ac8e49 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -752,6 +752,12 @@ It makes underscores and dots word constituent chars.")
:type '(repeat symbol)
:group 'python)
+(defcustom python-indent-def-block-scale 2
+ "Multiplier applied to indentation inside multi-line def blocks."
+ :version "26.1"
+ :type 'integer
+ :safe 'natnump)
+
(defvar python-indent-current-level 0
"Deprecated var available for compatibility.")
@@ -1071,9 +1077,9 @@ possibilities can be narrowed to specific indentation points."
(current-indentation)))
opening-block-start-points))))
(`(,(or :inside-paren-newline-start-from-block) . ,start)
- ;; Add two indentation levels to make the suite stand out.
(goto-char start)
- (+ (current-indentation) (* python-indent-offset 2))))))
+ (+ (current-indentation)
+ (* python-indent-offset python-indent-def-block-scale))))))
(defun python-indent--calculate-levels (indentation)
"Calculate levels list given INDENTATION.
--
2.15.1
next prev parent reply other threads:[~2017-12-25 20:54 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-16 18:42 bug#28475: 25.3; python double-indents multi-line function argument blocks Ross Donaldson
2017-09-24 12:26 ` Noam Postavsky
2017-09-24 16:25 ` Ross Donaldson
2017-09-24 16:42 ` Noam Postavsky
2017-09-24 17:02 ` Ross Donaldson
2017-09-24 17:42 ` Noam Postavsky
2017-10-12 21:11 ` Ross Donaldson
2017-11-07 1:10 ` Noam Postavsky
2017-12-25 20:54 ` Ross Donaldson [this message]
2018-01-01 16:17 ` Noam Postavsky
2018-01-02 17:55 ` Ross Donaldson
2017-09-26 0:50 ` Dmitry Gutov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAC+S334C7fmPLbQ-GDou9wfy6Sk-XVbyS3toAHitVRhUEDmeEQ@mail.gmail.com \
--to=gastove@gmail.com \
--cc=28475@debbugs.gnu.org \
--cc=npostavs@users.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.