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 iFjpNWhCHmFpmwAAgWs5BA (envelope-from ) for ; Thu, 19 Aug 2021 13:37:12 +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 WJm5MWhCHmGGTwAA1q6Kng (envelope-from ) for ; Thu, 19 Aug 2021 11:37:12 +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 46A171B81F for ; Thu, 19 Aug 2021 13:37:12 +0200 (CEST) Received: from localhost ([::1]:60454 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mGgMB-0004Iv-BR for larch@yhetil.org; Thu, 19 Aug 2021 07:37:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56454) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mG7ZW-0006PK-Fg for emacs-orgmode@gnu.org; Tue, 17 Aug 2021 18:28:38 -0400 Received: from mail.ptlnet.com ([94.229.138.130]:65023) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mG7ZR-0006AQ-Fy for emacs-orgmode@gnu.org; Tue, 17 Aug 2021 18:28:37 -0400 Received: from notlocalhost ([10.9.0.1]) by mail.ptlnet.com (8.15.2/8.15.2) with ESMTP id 17HMSM4b006795; Tue, 17 Aug 2021 23:28:22 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=precedence.co.uk; s=mail; t=1629239303; bh=XNSWOxWyyuO9wqdb19rOKRYr0EKD6JhXE/IVBMicnlU=; h=From:To:Cc:Subject:Date; b=OyqKiB03lbLBDj/1h7XhhW6HSzCLxDRA+ciduGqB1X7WGLJIw1ZHydDzg7OrvwucF AizVM2TjyPjv4pxBWWLWrFvYL0OxA1X6FCGFc80D1BUMCh2c/wzBkDsXmQzFimDd06 kCAeBZcPqPgNy86GucOogQZtvMb9C2W/Pp+cW7xw= From: Morgan Willcock To: emacs-orgmode@gnu.org Subject: [PATCH] ox-ascii.el: Fix justify when `indent-tabs-mode' is non-nil Date: Tue, 17 Aug 2021 23:28:01 +0100 Message-Id: <20210817222801.12867-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]); Tue, 17 Aug 2021 23:28:23 +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-Mailman-Approved-At: Thu, 19 Aug 2021 07:36:42 -0400 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=1629373032; 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=NA2cETFwTyNOE7GvwpFPuqsEBtQk+JnFDcEsuqUqZi+ortWkmCOjc7uK6ifFlYnQje0bAH T9RRFtNoe3vuqYeaygurDeBUAsY5eiTi0mk7qDWU2iCYeVByWI755xCt/zSkPip6DiDnmZ tAUzaTQAOdCaLSkJNcpiLQI0h3R1QuWMzlyyuTVD4fKOjQbUdneEEhXmvX6Okbc3MSYzCM rnbPlyzSnrNdw/9BmZQO0isrzguIVbdZBWNV4/LWraOfJRov6gvqPNYTQb30CZMN6/kh+7 X3uD+Aw5Yz7c5p45/hv+9UGyoGcqIU6mPZ6JpWm6A3htK3qtxMumlZVx5Kz72A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1629373032; a=rsa-sha256; cv=none; b=PSPH7NYfxGNEOMEAJSJq4My04tl1fMhMoQDCnbUYdMnfzd1Tfw0xCnRKoKAFcPijn2C0jY 7GqUzo4gBKvnOcZwjVjkBl4BVVeaDRT9VSlMMz+PGD3mnSF0CFs1q8rH5LB+HOhr0QVnIx 4ow2EPT6UCb72cEyK8gLG2Zhb5uqlo9gYiFFB8/kan72sY/vS4xqOwjdzqpFKUsixJ0CBI 6O08Za7HhCH9fg6Rc+n8Ms8PCYd6BkspBFrRiPdezCgr2pfsslqdlNukMb5tIZ+DKYlvWk 3c8eYDceS3kPeODJlJiK1Gb5RRdhHKWD8S+KBmVSYbg7oNWtzuIFmAF1tMAAHw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=precedence.co.uk header.s=mail header.b=OyqKiB03; 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: 2.88 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=precedence.co.uk header.s=mail header.b=OyqKiB03; 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: 46A171B81F X-Spam-Score: 2.88 X-Migadu-Scanner: scn0.migadu.com X-TUID: Eojf8uG7rXow * 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