From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Phoenix Newsgroups: gmane.emacs.bugs Subject: bug#36480: 26.2; Using a sh-basic-offset value with a multiple of tab-width has side effects when building function using =?UTF-8?Q?=E2=80=9CC-c?= (=?UTF-8?Q?=E2=80=9D?= Date: Tue, 02 Jul 2019 20:53:10 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="=-7/TYRrVaqcFct9L3i5Xl" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="93821"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Evolution 3.32.3 (3.32.3-1.fc30) To: 36480@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jul 02 22:37:06 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hiPWU-000OF8-7e for geb-bug-gnu-emacs@m.gmane.org; Tue, 02 Jul 2019 22:37:06 +0200 Original-Received: from localhost ([::1]:57246 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hiPWT-0004n9-1v for geb-bug-gnu-emacs@m.gmane.org; Tue, 02 Jul 2019 16:37:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56518) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hiOM5-0001ST-Pm for bug-gnu-emacs@gnu.org; Tue, 02 Jul 2019 15:22:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hiOM0-00081M-91 for bug-gnu-emacs@gnu.org; Tue, 02 Jul 2019 15:22:16 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39148) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hiOLq-0007wj-Sp for bug-gnu-emacs@gnu.org; Tue, 02 Jul 2019 15:22:06 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hiOLq-0006Qh-Kw for bug-gnu-emacs@gnu.org; Tue, 02 Jul 2019 15:22:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Phoenix Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 02 Jul 2019 19:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 36480 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.156209527824659 (code B ref -1); Tue, 02 Jul 2019 19:22:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 2 Jul 2019 19:21:18 +0000 Original-Received: from localhost ([127.0.0.1]:47969 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hiOL7-0006Pf-U7 for submit@debbugs.gnu.org; Tue, 02 Jul 2019 15:21:18 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:39142) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hiNub-0001SD-Qk for submit@debbugs.gnu.org; Tue, 02 Jul 2019 14:53:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40157) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hiNuU-0001Id-9X for bug-gnu-emacs@gnu.org; Tue, 02 Jul 2019 14:53:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hiNuN-0007gT-Me for bug-gnu-emacs@gnu.org; Tue, 02 Jul 2019 14:53:43 -0400 Original-Received: from v-smtpout3.han.skanova.net ([81.236.60.156]:49071) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hiNuI-0007X8-Qn for bug-gnu-emacs@gnu.org; Tue, 02 Jul 2019 14:53:36 -0400 Original-Received: from ssl.phx-home.net ([90.224.180.50]) by cmsmtp with ESMTP id iNtvhcVVgXLfmiNtvhua5f; Tue, 02 Jul 2019 20:53:13 +0200 Original-Received: from phxpro.phx-home.net (phxpro.phx-home.net [192.168.100.9]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by ssl.phx-home.net (Postfix) with ESMTPSA id 6F1AB202494A for ; Tue, 2 Jul 2019 20:53:11 +0200 (CEST) X-CMAE-Envelope: MS4wfFlX8jAmN89E1TKHHqyVaBi8qMgbF7N3d7G0unK4aIwXoyxR9hv+Lbt5/L6OBwtMbOwJJgQMVBQEEeWKSZ6wKuE2hN6dBT01MTEY0mXKmV6MGJXV2+aM FLTXBF82WgVt/hSqFgpY1BUfHsnS4ijCUYBW3hLg/atgtFpA3w2/MZhu X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Mailman-Approved-At: Tue, 02 Jul 2019 15:21:16 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:161991 Archived-At: --=-7/TYRrVaqcFct9L3i5Xl Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit The issue had been reported to the Emacs StackExchange group using thefollowing description. A commentator could replicate it.----------- -----------------------------------------------------------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. 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}| Is this a bug or do I need to set another variable to a certain value for it to work? I at least tried the variables stated in this question, but they did not have any effect at all for this issue.-------------- --------------------------------------------------------Source: https://emacs.stackexchange.com/q/51324/23319 In GNU Emacs 26.2 (build 1, x86_64-redhat-linux-gnu, GTK+ Version 3.24.8) of 2019-04-30 built on buildvm- 06.phx2.fedoraproject.orgWindowing system distributor 'Fedora Project', version 11.0.12005000Recent messages:Loading /usr/share/emacs/site- lisp/site-start.d/autoconf-init.el (source)...doneLoading /usr/share/emacs/site-lisp/site-start.d/desktop-entry-mode-init.el (source)...doneLoading time...doneLoading elec-pair...doneLoading display-line-numbers...doneLoading paren...doneFor information about GNU Emacs and the GNU system, type C-h C-a. Configured using: 'configure --build=x86_64-redhat-linux-gnu -- host=x86_64-redhat-linux-gnu --program-prefix= --disable-dependency- tracking --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin -- sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share -- includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-dbus --with-gif --with-jpeg --with-png --with-rsvg --with-tiff --with-xft --with-xpm --with-x-toolkit=gtk3 -- with-gpm=no --with-xwidgets --with-modules build_alias=x86_64-redhat- linux-gnu host_alias=x86_64-redhat-linux-gnu 'CFLAGS=-DMAIL_USE_LOCKF -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' LDFLAGS=-Wl,-z,relro PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig' Configured features:XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND DBUS GSETTINGS GLIB NOTIFYACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIBTOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS XWIDGETS LCMS2 Important settings: value of $LC_COLLATE: C value of $LC_NUMERIC: en_US value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: show-paren-mode: t global-display-line- numbers-mode: t display-line-numbers-mode: t electric-pair-mode: t display-time-mode: t tooltip-mode: t global-eldoc-mode: t eldoc- mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t column-number- mode: t line-number-mode: t transient-mark-mode: t Load-path shadows:None found. Features:(shadow sort mail-extr emacsbug message rmc puny dired dired- loaddefsformat-spec rfc822 mml mml-sec epa epg gnus-util rmail rmail- loaddefsmm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utilsmailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail- prsvrmail-utils php-mode advice derived rx edmacro kmacro php- projectmode-local find-func imenu speedbar sb-image ezimage dframe etags xrefproject flymake-proc flymake compile comint ansi-color ring warningsthingatpt add-log cc-langs cc-mode cc-fonts cc-guess cc-menus cc-cmdscc-styles cc-align cc-engine cc-vars cc-defs light-blue-theme parendisplay-line-numbers elec-pair time cus-start cus-load finder- infpackage easymenu epg-config url-handlers url-parse auth-source cl- seqeieio eieio-core cl-macs eieio-loaddefs password-cache url-vars seqbyte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib time- datemule-util tooltip eldoc electric uniquify ediff-hook vc-hookslisp- float-type mwheel term/x-win x-win term/common-win x-dnd tool-bardnd fontset image regexp-opt fringe tabulated-list replace newcommenttext- mode elisp-mode lisp-mode prog-mode register page menu-barrfn-eshadow isearch timer select scroll-bar mouse jit-lock font-locksyntax facemenu font-core term/tty-colors frame cl-generic cham georgianutf-8-lang misc-lang vietnamese tibetan thai tai-viet lao koreanjapanese eucjp-ms cp51932 hebrew greek romanian slovak czech europeanethiopic indian cyrillic chinese composite charscript charpropcase-table epa-hook jka- cmpr-hook help simple abbrev obarray minibuffercl-preloaded nadvice loaddefs button faces cus-face macroexp filestext-properties overlay sha1 md5 base64 format env code-pages mulecustom widget hashtable- print-readable backquote threads dbusbindinotify lcms2 dynamic-setting system-font-setting font-render-settingxwidget-internal move-toolbar gtk x-toolkit x multi-ttymake-network-process emacs) Memory information:((conses 16 167620 9490) (symbols 48 27914 1) (miscs 40 66 106) (strings 32 49620 2522) (string-bytes 1 1461299) (vectors 16 23554) (vector-slots 8 605402 9260) (floats 8 56 61) (intervals 56 307 0) (buffers 992 11)) --=-7/TYRrVaqcFct9L3i5Xl Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable
The issue had been reported to the Emacs StackExchange group using=
 the
following description.  A commentator could replicate it.
-------------------------------------------------------------------=
---
When using a multiple of the "tab-width" value for "sh-basic-=
offset", creating a function using the built-in command "C-c (" removes cha=
racters from the expected result. That being said, I can create a shell fun=
ction by manually typing it. It is just this built-in command, which causes=
 odd behavior.

When "tab-width" and/or "sh-basic-o=
ffset" are not set inside the ".emacs" file or the latter is not a multiple=
 of the former, it works as expected.

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 lo=
cated after I completed the built-in command.

With=
 either variables not defined or not a multiple of one another, the (defaul=
t) result is:
function asdf() {
    |
}
=

With both set to 4, the result is:
function a=
sdf() {}|

With tab-width set to 4 and sh-basic-off=
set to 8, the result is:
function asdf()}|

With both set to 8, the result is:
function asdf}|
<=
br>
With both set to 16 (just for a test), the result is (semanti=
cally a rather amusing):
fu}|

Is this a =
bug or do I need to set another variable to a certain value for it to work?=
 I at least tried the variables stated in this question, but they did not h=
ave any effect at all for this issue.
---------------------------=
-------------------------------------------
Source: 
https://emacs.stack=
exchange.com/q/51324/23319



=
In GNU Emacs 26.2 (build 1, x86_64-redhat-linux-gnu, GTK+ Versio=
n 3.24.8)
 of 2019-04-30 built on buildvm-06.phx2.fedoraproject.o=
rg
Windowing system distributor 'Fedora Project', version 11.0.12=
005000
Recent messages:
Loading /usr/share/emacs/site-l=
isp/site-start.d/autoconf-init.el (source)...done
Loading /usr/sh=
are/emacs/site-lisp/site-start.d/desktop-entry-mode-init.el (source)...done=
Loading time...done
Loading elec-pair...done
Loading display-line-numbers...done
Loading paren...done
For information about GNU Emacs and the GNU system, type C-h C-a.<= pre>
Configured using:
 'configure --build=3Dx86_64=
-redhat-linux-gnu
 --host=3Dx86_64-redhat-linux-gnu --program-pre=
fix=3D
 --disable-dependency-tracking --prefix=3D/usr --exec-pref=
ix=3D/usr
 --bindir=3D/usr/bin --sbindir=3D/usr/sbin --sysconfdir=
=3D/etc
 --datadir=3D/usr/share --includedir=3D/usr/include --lib=
dir=3D/usr/lib64
 --libexecdir=3D/usr/libexec --localstatedir=3D/=
var
 --sharedstatedir=3D/var/lib --mandir=3D/usr/share/man
<= pre> --infodir=3D/usr/share/info --with-dbus --with-gif --with-jpeg --with-= png
 --with-rsvg --with-tiff --with-xft --with-xpm --with-x-toolk=
it=3Dgtk3
 --with-gpm=3Dno --with-xwidgets --with-modules
build_alias=3Dx86_64-redhat-linux-gnu host_alias=3Dx86_64-redhat-linux-= gnu
 'CFLAGS=3D-DMAIL_USE_LOCKF -O2 -g -pipe -Wall -Werror=3Dform=
at-security
 -Wp,-D_FORTIFY_SOURCE=3D2 -Wp,-D_GLIBCXX_ASSERTIONS =
-fexceptions
 -fstack-protector-strong -grecord-gcc-switches
 -specs=3D/usr/lib/rpm/redhat/redhat-hardened-cc1
 -specs=
=3D/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=3Dgeneric
 =
-fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection'
 LDFLAGS=3D-Wl,-z,relro
 PKG_CONFIG_PATH=3D:/usr/lib64/pkgc=
onfig:/usr/share/pkgconfig'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND DBUS GSETTINGS GLIB N=
OTIFY
ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT =
ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS XWIDGE=
TS LCMS2

Important settings:
  value of =
$LC_COLLATE: C
  value of $LC_NUMERIC: en_US
  value of=
 $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=3Dibus
=
  locale-coding-system: utf-8-unix

Major mode: Lis=
p Interaction

Minor modes in effect:
  s=
how-paren-mode: t
  global-display-line-numbers-mode: t
display-line-numbers-mode: t
  electric-pair-mode: t
display-time-mode: t
  tooltip-mode: t
  global-eldo=
c-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-=
bar-mode: t
  file-name-shadow-mode: t
  global-font-lo=
ck-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
line-number-mode: t
  transient-mark-mode: t

<= /pre>
Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny dired=
 dired-loaddefs
format-spec rfc822 mml mml-sec epa epg gnus-util =
rmail rmail-loaddefs
mm-decode mm-bodies mm-encode mail-parse rfc=
2231 mailabbrev gmm-utils
mailheader sendmail rfc2047 rfc2045 iet=
f-drums mm-util mail-prsvr
mail-utils php-mode advice derived rx =
edmacro kmacro php-project
mode-local find-func imenu speedbar sb=
-image ezimage dframe etags xref
project flymake-proc flymake com=
pile comint ansi-color ring warnings
thingatpt add-log cc-langs c=
c-mode cc-fonts cc-guess cc-menus cc-cmds
cc-styles cc-align cc-e=
ngine cc-vars cc-defs light-blue-theme paren
display-line-numbers=
 elec-pair time cus-start cus-load finder-inf
package easymenu ep=
g-config url-handlers url-parse auth-source cl-seq
eieio eieio-co=
re cl-macs eieio-loaddefs password-cache url-vars seq
byte-opt gv=
 bytecomp byte-compile cconv cl-loaddefs cl-lib time-date
mule-ut=
il tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float=
-type mwheel term/x-win x-win term/common-win x-dnd tool-bar
dnd =
fontset image regexp-opt fringe tabulated-list replace newcomment
text-mode elisp-mode lisp-mode prog-mode register page menu-bar
=
rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock
<= pre>syntax facemenu font-core term/tty-colors frame cl-generic cham georgia= n
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korea=
n
japanese eucjp-ms cp51932 hebrew greek romanian slovak czech eu=
ropean
ethiopic indian cyrillic chinese composite charscript char=
prop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray=
 minibuffer
cl-preloaded nadvice loaddefs button faces cus-face m=
acroexp files
text-properties overlay sha1 md5 base64 format env =
code-pages mule
custom widget hashtable-print-readable backquote =
threads dbusbind
inotify lcms2 dynamic-setting system-font-settin=
g font-render-setting
xwidget-internal move-toolbar gtk x-toolkit=
 x multi-tty
make-network-process emacs)

Memory information:
((conses 16 167620 9490)
 (symbols=
 48 27914 1)
 (miscs 40 66 106)
 (strings 32 49620 2522=
)
 (string-bytes 1 1461299)
 (vectors 16 23554)
(vector-slots 8 605402 9260)
 (floats 8 56 61)
 (in=
tervals 56 307 0)
 (buffers 992 11))
--=-7/TYRrVaqcFct9L3i5Xl--