GNU bug report logs - #36480
26.2; Using a sh-basic-offset value with a multiple of tab-width has side effects when building function using “C-c (”

Previous Next

Package: emacs;

Reported by: Phoenix <gnu <at> phx-home.net>

Date: Tue, 2 Jul 2019 19:22:02 UTC

Severity: normal

Tags: confirmed

Found in version 26.2

Full log


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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Phoenix <gnu <at> phx-home.net>
Cc: 36480 <at> debbugs.gnu.org
Subject: Re: bug#36480: 26.2; Using a sh-basic-offset value with a multiple
 of tab-width has side effects when building function using “C-c (”
Date: Mon, 08 Jul 2019 23:30:36 +0200
Phoenix <gnu <at> phx-home.net> writes:

> When using a multiple of the "tab-width" value for "sh-basic-offset",
> creating a function using the built-in command "C-c (" removes
> characters from the expected result. That being said, I can create a
> shell function by manually typing it. It is just this built-in
> command, which causes odd behavior.
>
> When "tab-width" and/or "sh-basic-offset" are not set inside the
> ".emacs" file or the latter is not a multiple of the former, it works
> as expected.

I was not able to reproduce it with the recipe above, and it's strange
that that should have any effect -- `tab-width' is automatically
buffer-local.

But I'm able to reproduce it with "emacs -Q /tmp/a.sh" and then
`M-: (setq tab-width 4 sh-basic-offset 4) RET'.

> Here are the tests I did:
> In the below examples I use "asdf" as the function name and the pipe character ("|") is the visualization of where point is located after I completed the built-in command.
>
> With either variables not defined or not a multiple of one another, the (default) result is:
> function asdf() {
>     |
> }
>
> With both set to 4, the result is:
> function asdf() {}|
>
> With tab-width set to 4 and sh-basic-offset to 8, the result is:
> function asdf()}|
>
> With both set to 8, the result is:
> function asdf}|
>
> With both set to 16 (just for a test), the result is (semantically a rather amusing):
> fu}|

I don't get exactly what you're getting, but I'm getting something very
close to it.  For instance, with 16, the buffer becomes completely blank.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




This bug report was last modified 5 years and 340 days ago.

Previous Next


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