From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id IE3AIsBmiWBHIwAAgWs5BA (envelope-from ) for ; Wed, 28 Apr 2021 15:44:32 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id UBtiHsBmiWBcXwAAbx9fmQ (envelope-from ) for ; Wed, 28 Apr 2021 13:44:32 +0000 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 E26D325D76 for ; Wed, 28 Apr 2021 15:44:31 +0200 (CEST) Received: from localhost ([::1]:56916 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lbkUL-0004I8-Ep for larch@yhetil.org; Wed, 28 Apr 2021 09:44:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56768) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lbkO6-0008Vq-PJ for emacs-orgmode@gnu.org; Wed, 28 Apr 2021 09:37:59 -0400 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]:38720) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lbkO5-0005Fc-2S for emacs-orgmode@gnu.org; Wed, 28 Apr 2021 09:37:58 -0400 Received: by mail-ej1-x636.google.com with SMTP id r12so94683383ejr.5 for ; Wed, 28 Apr 2021 06:37:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=iyda2xIJd1ok5VQ4WFJXseJl1g0ZD9k1Y1vwn3aj37M=; b=E236K2YNMmbGj1TKstLBSbj/93w8/QTTD+Y/244vGCExAkx8cLQ9C7A6zwL33GUiZF ZqJR/jlu64TIhaCCp4ictQ7TCVyYiz6qIIKZpz6Z0/lG5hkQw5B4a5bqUHwCpZVW1gSo Fn3xCfU36rf415J5t4HFHKuBk7UEa2BrBNztvppUVx5c1Y3VplFNYrMMIJ5k1spKYQ5X dCDJ+wDKDcrgz8mqjZ463udkad0yx8vmot+pZxahmJNIU9iOgstjiibswdUUm3QtbmO6 2yjda9bP+AMftfZXy2+kchEae/eRMq7KjgLyJ3blO0oi7EK31wRgPjZ8MTZmo5jXXDKa Vd/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding:content-language; bh=iyda2xIJd1ok5VQ4WFJXseJl1g0ZD9k1Y1vwn3aj37M=; b=Dx4JS31v26DMDXFvgrxjtIgcTiEQhjyxuT07kst8t7tCOLy++H9a6nv8YsnfGHt+z9 bfG+s+P3qYValdVGuEM5ReqU892YtUiAz6NSQwjQogxwYojeOVedshHrnjXUSaRFDozU 4Reg3erO51gtAmSHRPPrNoedvlNjWAdQVat0ZvQFPLLmeTu864/Ig+JtVRMY+nLC/PIe 8RhMZ3XiDPSvopuwYEMj3LZypB2CETM7BmHm19MRKciYBEuewp4r0bQP3/UkPUw7jh5d 4yPzL2ATtbJLEcA7AwLelgBV6vb0N/lUly7XDm/GQAMxDr6SFngGx2hAntzk3fY1alhB 0W4Q== X-Gm-Message-State: AOAM5332AoXpHtCPpm1JMuIpb5RdUENPg12nsq+GQSYRM6bDkzAu9KHb SeBs87+QD03lLLb1aV9ESinCyDWs2JYf X-Google-Smtp-Source: ABdhPJwrL8DWpy82xA4vKIc0yoyPKqnB6FMoNIWvlJ71yLhMgFmYTlTwqn7jeYdtYYAmIZSTnR8JNQ== X-Received: by 2002:a17:906:52d7:: with SMTP id w23mr2402187ejn.451.1619617075089; Wed, 28 Apr 2021 06:37:55 -0700 (PDT) Received: from ?IPv6:2a02:ab88:2583:c80:bcab:ccda:e40:8c6a? ([2a02:ab88:2583:c80:bcab:ccda:e40:8c6a]) by smtp.gmail.com with ESMTPSA id n15sm1971998eje.118.2021.04.28.06.37.54 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 28 Apr 2021 06:37:54 -0700 (PDT) To: emacs-orgmode@gnu.org From: =?UTF-8?Q?D=c3=a1vid_Jakab?= Subject: Bug: org-edit-special indents inline latex [9.5 (nil @ /home/david/.emacs.d/.local/straight/build-27.2/org-mode/)] Message-ID: <0f961d3b-a4ef-fbbf-ab16-7ff1af8b2070@gmail.com> Date: Wed, 28 Apr 2021 15:37:54 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.9.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::636; envelope-from=djakab314@gmail.com; helo=mail-ej1-x636.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 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" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1619617472; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=iyda2xIJd1ok5VQ4WFJXseJl1g0ZD9k1Y1vwn3aj37M=; b=qC2NxlB4xTyIdqK9lvTvcN6plFHwGjSWMerKD95Gzgt8R6akueV4Rd0oVL831lEgnk91Zv sIlwI6PHiUtsdAUEkS/nGDV59h3D3GcZ7Wz/Pt1BTAHiv4BbcMv8fcen6j+ALqSsX3XL+X xybxK3wcOcskIymGGy2dhrw+IZGG76y6NDqrBNrBzkZM1f4Zyjy3oBOBBevVwoj2iSFcie xxgpcKe1nKrruxnuzkBOWjUw+LJERZ7ttKnm0+ZTTH7kHwoL6Sgl0CZlVrg0MHm9HlcVKD rY5C9HLsdYKGff0CZHRdBKiIPhRNpO8T/NFuGT8QOHWRgbkStDkq6/xxSRUpww== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1619617472; a=rsa-sha256; cv=none; b=eEs1tluQDTMMNjFU83PFATsYuL+cp9NKC5tri7pUi3wpB2Ip+ACS4HHoZWSItfHAaK2A7q jwHXEI/worukVa5TRfcbXXYTdvCBJ1d4Af/Ez2931hPYQQ5Y9sfK8xqwno+ZJaSKiECp5f /p4HJY8ekNPGw7ljpMWfCZzVEOIbXxMX878J/JcgqcRo2SAmyn4s0+TZHvb4QghcQaZeiW d9g36F64z4pbs40FLsCPytniq8xuWSjg0jtqHqbfOdLDu0eOKEU2jI/GCEujWE766I6bcM eFpbpOGTgQu6cMhdzDBNH6yNyf9kO4ecUt5RdAVLK5heY3XF15coXizXN2gsoQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=E236K2YN; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -3.15 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=E236K2YN; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: E26D325D76 X-Spam-Score: -3.15 X-Migadu-Scanner: scn0.migadu.com X-TUID: 1kBrUquoi7Jx Remember to cover the basics, that is, what you expected to happen and what in fact did happen.  You don't know how to make a good report?  See      https://orgmode.org/manual/Feedback.html#Feedback Your bug report will be posted to the Org mailing list. ------------------------------------------------------------------------ Emacs  : GNU Emacs 27.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.27, cairo version 1.17.4)  of 2021-03-26 Package: Org mode version 9.5 (nil @ /home/david/.emacs.d/.local/straight/build-27.2/org-mode/) When using org-edit-special to edit inline latex, i.e., equations between \( and \), in an org-mode buffer, a number of spaces may get inserted before \( after the latex editing minibuffer is closed. It seems like the number of extra spaces defaults to the indentation of the line in which the inline math is located. This behavior makes complete sense for code blocks and latex environments, but I can't see a use case in which it should be applied to inline math. It looks like the option to edit inline math with org-edit-special was added only recently, so this could be a bug that noone noticed yet. I looked at the code that does things and it seems the variable that controls the indentation of the parts edited in the minibuffer is a buffer-local variable org-src--preserve-indentation. Setting a default value to it has no effect because it gets overwritten internally in the function org-src--edit-element. There is a variable with a similar name org-src-preserve-indentation that is supposed to set by the user, but it has no effect specifically in the case of latex fragments because org-src--edit-element contains the code:   (let* (...          (preserve-ind           (and (memq type '(example-block src-block))            (or (org-element-property :preserve-indent datum)                org-src-preserve-indentation))) ...)  ... (setq org-src--preserve-indentation preserve-ind) So the user is only allowed to turn off org-edit-special messing with the indentation if he is an an example-block or src-block. I hacked in a fix modifying org-src--edit-element by replacing (memq type '(example-block src-block)) with (memq type '(example-block src-block latex-fragment)) and setting org-src-preserve-indentation. This seems to have solved the issue, but I believe the function shouldn't even be trying to indent inline math in the first place.