From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id H7RCEaBBHGGgBwAAgWs5BA (envelope-from ) for ; Wed, 18 Aug 2021 01:09:20 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id WLluDKBBHGF6IwAA1q6Kng (envelope-from ) for ; Tue, 17 Aug 2021 23:09:20 +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 63084F663 for ; Wed, 18 Aug 2021 01:09:19 +0200 (CEST) Received: from localhost ([::1]:35244 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mG8Cs-0004hr-Da for larch@yhetil.org; Tue, 17 Aug 2021 19:09:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35292) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mG8CS-0004h3-AE for emacs-orgmode@gnu.org; Tue, 17 Aug 2021 19:08:52 -0400 Received: from mail.ptlnet.com ([94.229.138.130]:63908) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mG8CP-0008QV-RL for emacs-orgmode@gnu.org; Tue, 17 Aug 2021 19:08:52 -0400 Received: from notlocalhost ([10.9.0.1]) by mail.ptlnet.com (8.15.2/8.15.2) with ESMTP id 17HN8jNR019593; Wed, 18 Aug 2021 00:08:46 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=precedence.co.uk; s=mail; t=1629241726; bh=XNSWOxWyyuO9wqdb19rOKRYr0EKD6JhXE/IVBMicnlU=; h=From:To:Cc:Subject:Date; b=BTfqcvMZlrzPYdUl2N+336L2+LVz8oPnrd/oxnFgyys2kZfgLQrMpOWriF9zTA9mZ v1cx12hKnhNa8rEXvpJp+ZH/CznIiuCNXt5POZUOA4B92PkMjtjvB/Mwsnk4qSBwwm 1MWoOxuRvno5Xpap/EdUZzzStlnMaPkYtJdH/YAw= From: Morgan Willcock To: emacs-orgmode@gnu.org Subject: [PATCH] ox-ascii.el: Fix justify when `indent-tabs-mode' is non-nil Date: Wed, 18 Aug 2021 00:07:35 +0100 Message-Id: <20210817230735.13336-1-mwillcock@precedence.co.uk> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (mail.ptlnet.com [192.168.10.250]); Wed, 18 Aug 2021 00:08:46 +0100 (BST) Received-SPF: pass client-ip=94.229.138.130; envelope-from=mwillcock@precedence.co.uk; helo=mail.ptlnet.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.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, RCVD_IN_DNSWL_LOW=-0.7, 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: , Cc: Morgan Willcock 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=1629241759; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=Hi2bGfY9CZUdYDnJ7YsvpyGzrh5kDc8jIFeQwXwqfPo=; b=O3pstmUO+ga6o0crmLoEPa89cMQHLtdPI/3axRjHAlbe/7dwkCMEKT7tVOX0uAWDmddZvF qQ30NQevLOJ/xKg3IJTQMBERDJotH/kp/mnmpx8UVd0stedtRIPmtBjjAEORZ2rrcWUaZY hLNynzZNpur+g18Mlr0Fli7hAgME3l4HcXbus5RF5JmegLC7ALb+ekRC7N/e2GRv+NPS+P cGAGvKrH9lJeGzhz2bg9Q59DLOI/VukLRvxBCfmLL/W3ZRLSoVM+2fI8FwR2RF2CBV9l99 UMTFbDOFYpLMKU8YETc1I7Mx+kBAtAogpi+TTOCmxTWGLMb3d5M2IdRAFT3+Fg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1629241759; a=rsa-sha256; cv=none; b=eK69Ng0G2CWGQvG1Z1FO9KBD7ZxrQQatO7Z8dEXai0vhLgkOT64XhB3z7IXcG5f+8E5XJh lyvetKfABTM/3BJpbfQUTuEmbMGSmR1t+wtryWpCRwDcL360No3sWRgtg9eiAY55nDcFVy RzclDIYjLdEQM+X8tmWZ+PJNnYsgD6hB4Yxsxux3dOtCoe6mWOxM1pNdc7uF/tG2WjeJ8k Pw3Wvl8P+w/f/Jyukmv7KglHUQ3nGFp6KkcbTEhqhVWKJfam8aCvbv2h74oQ90f1Hvcqmc 1UmHpptF7JbDL6WWBc7OrPNYI3yijD1HqXX6n2a8ONtzMwv9TjTF5WMFzXGInA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=precedence.co.uk header.s=mail header.b=BTfqcvMZ; 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: 1.88 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=precedence.co.uk header.s=mail header.b=BTfqcvMZ; dmarc=pass (policy=none) header.from=precedence.co.uk; 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: 63084F663 X-Spam-Score: 1.88 X-Migadu-Scanner: scn1.migadu.com X-TUID: 7v5bH444dy7N * lisp/ox-ascii.el (org-ascii--justify-lines): Ensure that `indent-tabs-mode' is nil when applying indentation to justify lines. This prevents tab characters from appearing in the export when `indent-tabs-mode' still has its default value of t. TINYCHANGE --- Hi, I've attached a patch to fix an issue where tab characters are generated by the ASCII exporter when `indent-tabs-mode' has its default value of t. Here is a simple test case which generates tabs with 'emacs -Q': (with-temp-buffer (insert "#+TITLE: My Title\n" "#+OPTIONS: author:nil\n" "#+OPTIONS: toc:nil\n") (org-mode) (org-ascii-export-as-ascii) (with-current-buffer "*Org ASCII Export*" (buffer-string))) I haven't gone through the FSF copyright assignment process but I'm assuming this is OK based on the line count. Thanks, Morgan lisp/ox-ascii.el | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lisp/ox-ascii.el b/lisp/ox-ascii.el index d1762d41c..176542661 100644 --- a/lisp/ox-ascii.el +++ b/lisp/ox-ascii.el @@ -480,6 +480,9 @@ HOW determines the type of justification: it can be `left', (insert s) (goto-char (point-min)) (let ((fill-column text-width) + ;; Ensure that `indent-tabs-mode' is nil so that indentation + ;; will always be achieved using spaces rather than tabs. + (indent-tabs-mode nil) ;; Disable `adaptive-fill-mode' so it doesn't prevent ;; filling lines matching `adaptive-fill-regexp'. (adaptive-fill-mode nil)) -- 2.30.2