bug#29098: 26.0.90; [PATCH] 2 patches: initial-buffer-choice and python-indent-dedent-line-backspace

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

bug#29098: 26.0.90; [PATCH] 2 patches: initial-buffer-choice and python-indent-dedent-line-backspace

Alex-2
I have 2 small patches that I think should go to emacs-26, and I'm not
sure if they deserve their own individual reports. Is this alright, or
should I split them up in the future?

Anyway, these alleviate/solve some issues that I've seen people report.
The first patch provides more information to an error message, and the
second deals with pressing backspace in a python-mode buffer with an
active region.

When in a python-mode buffer with the contents:

def foo():
    print('bar')

with an active region and point at the "p", then pressing backspace
de-indents the line instead of deleting it. This is at odds with the
behaviour in other modes, where a similar action deletes the line, at
least with ‘delete-active-region’ non-nil.

I thought about making this behaviour conditional using
‘delete-active-region’, but that might be a bit inconsistent.


0001-Improve-error-messages-regarding-initial-buffer-choi.patch (1K) Download Attachment
0002-Delete-active-region-instead-of-de-indenting-in-pyth.patch (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

bug#29098: 26.0.90; [PATCH] 2 patches: initial-buffer-choice and python-indent-dedent-line-backspace

Eli Zaretskii
> From: Alex <[hidden email]>
> Date: Tue, 31 Oct 2017 23:24:48 -0600
>
> I have 2 small patches that I think should go to emacs-26, and I'm not
> sure if they deserve their own individual reports. Is this alright, or
> should I split them up in the future?

If they are unrelated (as in this case, I believe), it is best to
split them.

> >From 922fe8f466ad039f65fb423af6636bfd1695f039 Mon Sep 17 00:00:00 2001
> From: Alexander Gramiak <[hidden email]>
> Date: Tue, 31 Oct 2017 21:10:52 -0600
> Subject: [PATCH 1/2] Improve error messages regarding initial-buffer-choice
>
> * lisp/startup.el (command-line-1) <initial-buffer-choice>: Make the
> messages conform to Emacs conventions, and show the invalid return
> value in the message.

This looks okay to me.

> >From 50bd5bd058b71031f84c4d5a4d511353c671d66d Mon Sep 17 00:00:00 2001
> From: Alexander Gramiak <[hidden email]>
> Date: Tue, 31 Oct 2017 22:36:16 -0600
> Subject: [PATCH 2/2] Delete active region instead of de-indenting in
>  python-mode
>
> This conforms to the behaviour of `backward-delete-char-untabify' when
> there's an active region.  183f9296f1 fixes this behaviour for
> `delete-selection-mode' only.
>
> * lisp/progmodes/python.el (python-indent-dedent-line): Restructure
> and check for an active region conditionally using a new optional
> argument.
> (python-indent-dedent-line-backspace): Use the new argument to
> `python-indent-dedent-line'.
> * test/lisp/progmodes/python-tests.el: Add test.

I'll let users of Python mode to comment on this.

Thanks.



Reply | Threaded
Open this post in threaded view
|

bug#29098: 26.0.90; [PATCH] 2 patches: initial-buffer-choice and python-indent-dedent-line-backspace

Noam Postavsky-2
In reply to this post by Alex-2
severity 29098 minor
quit

Alex <[hidden email]> writes:

> I thought about making this behaviour conditional using
> ‘delete-active-region’, but that might be a bit inconsistent.

Could you elaborate on this?  Wouldn't it be more consistent to respect
delete-active-region, like other commands do?  (I assume other commands
do respect it.)



Reply | Threaded
Open this post in threaded view
|

bug#29098: 26.0.90; [PATCH] 2 patches: initial-buffer-choice and python-indent-dedent-line-backspace

Noam Postavsky-2
Noam Postavsky <[hidden email]> writes:

> Alex <[hidden email]> writes:
>
>> I thought about making this behaviour conditional using
>> ‘delete-active-region’, but that might be a bit inconsistent.
>
> Could you elaborate on this?  Wouldn't it be more consistent to respect
> delete-active-region, like other commands do?  (I assume other commands
> do respect it.)

Ping?



Reply | Threaded
Open this post in threaded view
|

bug#29098: 26.0.90; [PATCH] 2 patches: initial-buffer-choice and python-indent-dedent-line-backspace

Noam Postavsky
In reply to this post by Alex-2
retitle 29098 improve initial-buffer-choice error messages
tags 29098 fixed
close 29098 26.2
quit

Alex <[hidden email]> writes:

> The first patch provides more information to an error message, and the
> second deals with pressing backspace in a python-mode buffer with an
> active region.

I pushed this to emacs-26.

[1: 96be6b6eb9]: 2018-08-09 08:12:07 -0400
  Improve error messages regarding initial-buffer-choice (Bug#29098)
  https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=96be6b6eb99ae1d77702932c97e8b3a147c6265a

> When in a python-mode buffer with the contents:
>
> def foo():
>     print('bar')
>
> with an active region and point at the "p", then pressing backspace
> de-indents the line instead of deleting it. This is at odds with the
> behaviour in other modes, where a similar action deletes the line, at
> least with ‘delete-active-region’ non-nil.

> I thought about making this behaviour conditional using
> ‘delete-active-region’, but that might be a bit inconsistent.

I suggest opening a new bug thread to discuss this.