From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sebastian Miele Subject: Handling of org-edit-src-content-indentation Date: Sun, 06 Oct 2019 15:40:13 +0000 Message-ID: <87lftxj31e.fsf@gmail.com> Reply-To: sebastian.miele@gmail.com Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:54169) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iH8du-0000Lc-Pe for emacs-orgmode@gnu.org; Sun, 06 Oct 2019 11:40:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iH8dt-0006mR-MQ for emacs-orgmode@gnu.org; Sun, 06 Oct 2019 11:40:18 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:43367) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iH8dt-0006lx-Gt for emacs-orgmode@gnu.org; Sun, 06 Oct 2019 11:40:17 -0400 Received: by mail-wr1-x429.google.com with SMTP id j18so11553559wrq.10 for ; Sun, 06 Oct 2019 08:40:16 -0700 (PDT) Received: from tisch ([2a02:908:175c:4260:5ffc:7882:6024:ca5b]) by smtp.gmail.com with ESMTPSA id y14sm20559188wrd.84.2019.10.06.08.40.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Oct 2019 08:40:14 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org Dear fellows! GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.10) of 2019-08-29 Org mode version 9.2.6 (release_9.2.6-544-gd215c3 @ /home/w/borg/emacs/org/lisp/) The variable org-edit-src-content-indentation has a default value of 2. Buffer-local values for that variable currently are not respected when using org-edit-src-code. Buffer-local values for this variable are set in e.g. worg/.dir-locals.el. The bug can be fixed by changing org-edit-src-content-indentation into (with-current-buffer (marker-buffer org-src--beg-marker) org-edit-src-content-indentation) in the definition of org-src--contents-for-write-back. However, the general patterns in the org-src.el suggest, that something similar to (defvar-local org-src--preserve-indentation nil) (put 'org-src--preserve-indentation 'permanent-local t) should be introduced, set up, and used. But except following the pattern, I see no advantage in the latter approach, even two slight disadvantages. The first beeing that it uses more lines of code, and the second being so minor and opinionated that I don't mention it. Which route shall I take when preparing a patch? Best wishes Sebastian