From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jonas Bernoulli Subject: Disable indent-tabs-mode in org-src buffers if appropriate Date: Wed, 26 Jul 2017 16:37:17 +0200 Message-ID: <87tw1zl0wy.fsf@bernoul.li> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36699) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1daNRE-0003z9-T5 for emacs-orgmode@gnu.org; Wed, 26 Jul 2017 10:37:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1daNRA-0002mR-NL for emacs-orgmode@gnu.org; Wed, 26 Jul 2017 10:37:24 -0400 Received: from mail.hostpark.net ([212.243.197.30]:57096) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1daNRA-0002kp-GZ for emacs-orgmode@gnu.org; Wed, 26 Jul 2017 10:37:20 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.hostpark.net (Postfix) with ESMTP id 5443B16576 for ; Wed, 26 Jul 2017 16:37:18 +0200 (CEST) Received: from mail.hostpark.net ([127.0.0.1]) by localhost (mail0.hostpark.net [127.0.0.1]) (amavisd-new, port 10124) with ESMTP id F0-rQTR1cJnJ for ; Wed, 26 Jul 2017 16:37:17 +0200 (CEST) Received: from desktop (77-58-214-193.dclient.hispeed.ch [77.58.214.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.hostpark.net (Postfix) with ESMTPSA id DD97E164B4 for ; Wed, 26 Jul 2017 16:37:17 +0200 (CEST) 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-org list Me again, For the most part Org now honors the file-local value of `indent-tabs-mode' as set in an Org file. When that value is `nil' and a buffer used to edit a source block from that file contains lines that begin with tabs, then those tabs are being replaced with spaces before the text is written back into the Org file. So far so good. Unfortunately inside the buffer used to edit the source block `indent-tabs-mode' is not disabled when appropriate. That doesn't matter that much since it is just a transient buffer, but it is still distracting. I suggest that you fix that by adding the following at the appropriate place in `org-src--edit-element': (when (= source-tab-width 0) (setq indent-tabs-mode nil)) Thanks, Jonas