From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id YAB6B6DZ9WUoVAAA62LTzQ:P1 (envelope-from ) for ; Sat, 16 Mar 2024 18:40:48 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id YAB6B6DZ9WUoVAAA62LTzQ (envelope-from ) for ; Sat, 16 Mar 2024 18:40:48 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=CSVgaeDM; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1710610848; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=fXLmEAbcVnBeUi5lQpYJcErv79K6pzHN+YqPX+/eWhM=; b=o5ksYpL+URiSHuQnPqaz6UtMOSktmfT3HYBsJMynswmqCDJ+POcTWcYOQEU7SZUkVKUtCy ISngZALJxllmt6HYTqw3SuQLzvbSp+i3hSm0mzQiGUMy3khECK7lTXQvErn8/7KxA9KK19 9MCnNZX9aUoT6vEPKod7QqPJ7AV9maQ1O/653tophAPMlu8E4v+U7rePSXMFtXHyvFs2Eq CyRHuQuef1ti2ztBCNzNU0/mjeC7iK6DkCCpDSYogKXOidP9JCYz9iaTEzUBqEJuJtx0n2 6qBgw5a4FgxnMnb2GHr7dDw57wExPxDAhyyiT/n6wcVMmHBMqqXYdc0BdYn+UQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=CSVgaeDM; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=key1; d=yhetil.org; t=1710610848; a=rsa-sha256; cv=none; b=giGQK6uMyTJJMEC4GSZSKxUhiwTmTo/pMevOGsQqVoJ+nZHy8IMgDleB9YodeQcnrD0U36 Ee+2iQ+8dQsjVHyEK0qjzfoJ3OYQjf7wTR9hPNk2KZJNvLWTHRjSjunpzB48c60yaZ1eKj Y1ZO7WUx96Rl8OCurSUhEtpIjeMVv8nVTN7YyJWqn0ndYZcSNnPrfNNcvGzOJP5o2SxsID ve5LddXfROsgd5XE+8STlx1no14A4wYUBICv75drMF3IBpTLa6rZU82VFkOlEHel2dGh6t fnFrYbB9do3htaxWlNtA+AgmRe8XB/+aJB8y7jw1wgrnROtf+GRcoFj8fEsLKg== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id C1A3B656BB for ; Sat, 16 Mar 2024 18:40:47 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rlY0d-0003Zq-5i; Sat, 16 Mar 2024 13:39:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rlY0a-0003ZN-1T for emacs-orgmode@gnu.org; Sat, 16 Mar 2024 13:39:48 -0400 Received: from mail-oa1-x2c.google.com ([2001:4860:4864:20::2c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rlY0X-0008SG-VG for emacs-orgmode@gnu.org; Sat, 16 Mar 2024 13:39:47 -0400 Received: by mail-oa1-x2c.google.com with SMTP id 586e51a60fabf-21e45ece781so2060940fac.0 for ; Sat, 16 Mar 2024 10:39:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710610784; x=1711215584; darn=gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=fXLmEAbcVnBeUi5lQpYJcErv79K6pzHN+YqPX+/eWhM=; b=CSVgaeDMuURQ7N6F6+0SGU8VOohdbDp8d3FBgrf5rFnrr7bQ+n4NCk6kU40sUltx60 Uqa6CJnPVa2pJ7qpP9N7L4/ulHjzNr1akk8tERkQBihpv2RiohPDDqnoqs16jqeBPd+g oOMchjSmjaO5FcZEUvZNkHa80XDlbCXZ1AHnehnDoVHoRbeg3F83OFpN/GQ0n+M/L2X4 f0b2/oiDsrZH7+uKDhlMxiJc+IcgQnXuSK+uuENrbpJ/VerRp8Dq29izKh0mdUiw+rqs 0eewjBzT63qp25bbNZVKWY8dH7fF4LQcGN7QE7xHwaFwQ1cziOO5h5ApDrR1iqYyzktX ruvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710610784; x=1711215584; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=fXLmEAbcVnBeUi5lQpYJcErv79K6pzHN+YqPX+/eWhM=; b=CYocZU7vyL1YueYu7gIEeLI7su3BkG/UriR4lJW8IbAMLcMOSHXBHZ7VizCk6znrSC XnKpkiDmBIqAGfqVKz7jgP5DKLzxmfh1zkM+OWZraicb0Op+qio11Kxqr+enXgBmpjpf 80r9vM0XLsGP6OSaAwguA/7e+Aza46Kx/7u612Xc5XLu1rF6evkMoODuqezWRy0aTQTv CLGiZQsiljHPMPj8HfvxVg/1xb9JzoppPVvnK6pePzIz/K6ha4FvVh98oDVfWlUlkZTe ZsmjnXZQ7yqIl96gjXi1h4Gkz85gF3cBR101zMuG4CtFnyHdTwQ1Czwe3Hl4s9Q9+yKY EwbQ== X-Gm-Message-State: AOJu0YyP3TDs5cH7Pw6h5xuzlldi8UYfPPUUo+CXvmnnahye32+CGWPT k0TmI+q9shVCpjMPL3OJIZYJMyi3ttV3+woZURn/GTVDqhLszYWgJyYQWDS3zGJfyc2Miay3gYQ CNz6c8aEx0JSxF6ddRyy/yFkrNWk= X-Google-Smtp-Source: AGHT+IGwpAjCrHCPlRIyAuD/zLgS5q/VPIqfohUVszBA3jDk5lSVlwcB6ejm1g7rhjdMPP7dMgG9s+5tgKSJEIkeWM8= X-Received: by 2002:a05:6870:c394:b0:220:9c89:98e5 with SMTP id g20-20020a056870c39400b002209c8998e5mr7835423oao.18.1710610784144; Sat, 16 Mar 2024 10:39:44 -0700 (PDT) MIME-Version: 1.0 References: <871q8ajyxq.fsf@localhost> <87jzm2ignl.fsf@localhost> In-Reply-To: <87jzm2ignl.fsf@localhost> From: Rudi C Date: Sat, 16 Mar 2024 21:09:07 +0330 Message-ID: Subject: Re: Forcing tab-width to be 8 makes using Python source blocks very difficult To: Ihor Radchenko Cc: emacs-orgmode@gnu.org Content-Type: multipart/alternative; boundary="0000000000002356d90613ca9caa" Received-SPF: pass client-ip=2001:4860:4864:20::2c; envelope-from=rudiwillalwaysloveyou@gmail.com; helo=mail-oa1-x2c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -8.08 X-Spam-Score: -8.08 X-Migadu-Queue-Id: C1A3B656BB X-Migadu-Scanner: mx13.migadu.com X-TUID: rOW4w0pYtfVB --0000000000002356d90613ca9caa Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks, I don't have any problems now, so we can consider this closed. On Sat, Mar 16, 2024 at 2:32=E2=80=AFPM Ihor Radchenko wrote: > Rudi C writes: > > > ... runs `evil-shift-right`, which > > indents the selected region by the `evil-shift-width` amount. > > `evil-shift-width` is set based on `tab-width`. > > Are you sure? > I am looking at > https://github.com/emacs-evil/evil/blob/master/evil-vars.el#L175 > and it appears that `evil-shift-width' has nothing to do with > `tab-width'. It is a customization with default value of 4. > > Also, do note that `evil-shift-width' in python code blocks may break > things when the code block itself is also indented. Org mode normally > discards this common indentation and takes care about distinguishing > (and not merging!) the tabs belonging to the code itself and the > tabs/spaces that are used to indent the whole code block: > > This whole code block is indented > #+begin_src python > def foo(): > if True: > return 1; > #+end_src > > Indentation in Org mode blocks can be tricky and generic editing > commands may not cut it. Org mode itself does the indentation using the > code block's major mode in a separate buffer in order to keep things > consistent. > > > ... I solved this specific > > problem by overriding `evil-shift-width` using a timer in an org-mode > hook. > > The delay introduced by the timer was necessary, as something kept > > overriding my settings. Perhaps the magic machinery that sets `tab-widt= h` > > in the source blocks can also set `evil-shift-width`. The best-case > > scenario would be to have a list of variables that need to be set from > > their major-mode buffer in the source blocks. > > Why not simply setting `evil-shift-width' to 4? > > >> May you please provide a detailed example where 8 spaces causes issues= ? > > > > My lists are still indenting with 2 spaces, so I am not actually seeing= 8 > > spaces. I have no idea why that is, but I very much like the 2-space > > indentation. > > > > ``` > > - a > > - b > > ``` > > > > I see 4 spaces in numerical lists, which again, I have no idea about: > > > > ``` > > 1. hi > > 2. hi > > 3. hi > > ``` > > Org mode aligns child sub-lists with parent item text. So, "-" is right > below "a" and "2." is right below "hi". List depth is not defined by the > absolute number of spaces/tabs. > See https://orgmode.org/manual/Plain-Lists.html > > -- > Ihor Radchenko // yantar92, > Org mode contributor, > Learn more about Org mode at . > Support Org development at , > or support my work at > --0000000000002356d90613ca9caa Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks, I don't have any problems now, so we can consi= der this closed.

On Sat, Mar 16, 2024 at 2:32=E2=80=AFPM Ihor Radchenko <= yantar92@posteo.net> wrote:
Rudi C <rudiwillalwa= ysloveyou@gmail.com> writes:

> ... runs `evil-shift-right`, which
> indents the selected region by the `evil-shift-width` amount.
> `evil-shift-width` is set based on `tab-width`.

Are you sure?
I am looking at
https://github.com/emacs-evil/evil/b= lob/master/evil-vars.el#L175
and it appears that `evil-shift-width' has nothing to do with
`tab-width'. It is a customization with default value of 4.

Also, do note that `evil-shift-width' in python code blocks may break things when the code block itself is also indented. Org mode normally
discards this common indentation and takes care about distinguishing
(and not merging!) the tabs belonging to the code itself and the
tabs/spaces that are used to indent the whole code block:

=C2=A0 =C2=A0 =C2=A0This whole code block is indented
=C2=A0 =C2=A0 =C2=A0#+begin_src python
=C2=A0 =C2=A0 =C2=A0def foo():
=C2=A0 =C2=A0 =C2=A0 =C2=A0if True:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return 1;
=C2=A0 =C2=A0 =C2=A0#+end_src

Indentation in Org mode blocks can be tricky and generic editing
commands may not cut it. Org mode itself does the indentation using the
code block's major mode in a separate buffer in order to keep things consistent.

> ... I solved this specific
> problem by overriding `evil-shift-width` using a timer in an org-mode = hook.
> The delay introduced by the timer was necessary, as something kept
> overriding my settings. Perhaps the magic machinery that sets `tab-wid= th`
> in the source blocks can also set `evil-shift-width`. The best-case > scenario would be to have a list of variables that need to be set from=
> their major-mode buffer in the source blocks.

Why not simply setting `evil-shift-width' to 4?

>> May you please provide a detailed example where 8 spaces causes is= sues?
>
> My lists are still indenting with 2 spaces, so I am not actually seein= g 8
> spaces. I have no idea why that is, but I very much like the 2-space > indentation.
>
> ```
> - a
>=C2=A0 =C2=A0- b
> ```
>
> I see 4 spaces in numerical lists, which again, I have no idea about:<= br> >
> ```
> 1. hi
>=C2=A0 =C2=A0 2. hi
>=C2=A0 =C2=A0 =C2=A0 =C2=A03. hi
> ```

Org mode aligns child sub-lists with parent item text. So, "-" is= right
below "a" and "2." is right below "hi". List = depth is not defined by the
absolute number of spaces/tabs.
See https://orgmode.org/manual/Plain-Lists.html

--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,=
or support my work at <https://liberapay.com/yantar92>
--0000000000002356d90613ca9caa--