GNU bug report logs - #29098
improve initial-buffer-choice error messages

Previous Next

Package: emacs;

Reported by: Alex <agrambot <at> gmail.com>

Date: Wed, 1 Nov 2017 05:26:02 UTC

Severity: minor

Tags: fixed, patch

Found in version 26.0.90

Fixed in version 26.2

Done: Noam Postavsky <npostavs <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 29098 in the body.
You can then email your comments to 29098 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#29098; Package emacs. (Wed, 01 Nov 2017 05:26:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Alex <agrambot <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 01 Nov 2017 05:26:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Alex <agrambot <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.0.90; [PATCH] 2 patches: initial-buffer-choice and
 python-indent-dedent-line-backspace
Date: Tue, 31 Oct 2017 23:24:48 -0600
[Message part 1 (text/plain, inline)]
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 (text/x-diff, attachment)]
[0002-Delete-active-region-instead-of-de-indenting-in-pyth.patch (text/x-diff, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#29098; Package emacs. (Wed, 01 Nov 2017 19:37:01 GMT) Full text and rfc822 format available.

Message #8 received at 29098 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Alex <agrambot <at> gmail.com>
Cc: 29098 <at> debbugs.gnu.org
Subject: Re: bug#29098: 26.0.90; [PATCH] 2 patches: initial-buffer-choice and
 python-indent-dedent-line-backspace
Date: Wed, 01 Nov 2017 21:36:02 +0200
> From: Alex <agrambot <at> gmail.com>
> 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 <agrambot <at> gmail.com>
> 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 <agrambot <at> gmail.com>
> 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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#29098; Package emacs. (Fri, 03 Nov 2017 08:38:02 GMT) Full text and rfc822 format available.

Message #11 received at 29098 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> users.sourceforge.net>
To: Alex <agrambot <at> gmail.com>
Cc: 29098 <at> debbugs.gnu.org
Subject: Re: bug#29098: 26.0.90; [PATCH] 2 patches: initial-buffer-choice and
 python-indent-dedent-line-backspace
Date: Fri, 03 Nov 2017 04:37:25 -0400
severity 29098 minor
quit

Alex <agrambot <at> gmail.com> 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.)




Severity set to 'minor' from 'normal' Request was from Noam Postavsky <npostavs <at> users.sourceforge.net> to control <at> debbugs.gnu.org. (Fri, 03 Nov 2017 08:38:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#29098; Package emacs. (Tue, 28 Nov 2017 02:41:02 GMT) Full text and rfc822 format available.

Message #16 received at 29098 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> users.sourceforge.net>
To: Alex <agrambot <at> gmail.com>
Cc: 29098 <at> debbugs.gnu.org
Subject: Re: bug#29098: 26.0.90; [PATCH] 2 patches: initial-buffer-choice and
 python-indent-dedent-line-backspace
Date: Mon, 27 Nov 2017 21:40:34 -0500
Noam Postavsky <npostavs <at> users.sourceforge.net> writes:

> Alex <agrambot <at> gmail.com> 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?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#29098; Package emacs. (Thu, 09 Aug 2018 12:18:02 GMT) Full text and rfc822 format available.

Message #19 received at 29098 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> gmail.com>
To: Alex <agrambot <at> gmail.com>
Cc: 29098 <at> debbugs.gnu.org
Subject: Re: bug#29098: 26.0.90; [PATCH] 2 patches: initial-buffer-choice and
 python-indent-dedent-line-backspace
Date: Thu, 09 Aug 2018 08:17:24 -0400
retitle 29098 improve initial-buffer-choice error messages
tags 29098 fixed
close 29098 26.2
quit

Alex <agrambot <at> gmail.com> 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.





Changed bug title to 'improve initial-buffer-choice error messages' from '26.0.90; [PATCH] 2 patches: initial-buffer-choice and python-indent-dedent-line-backspace' Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 09 Aug 2018 12:18:02 GMT) Full text and rfc822 format available.

Added tag(s) fixed. Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 09 Aug 2018 12:18:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 26.2, send any further explanations to 29098 <at> debbugs.gnu.org and Alex <agrambot <at> gmail.com> Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 09 Aug 2018 12:18:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 07 Sep 2018 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 6 years and 290 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.