From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id GApbKOJXmGIWDQEAbAwnHQ (envelope-from ) for ; Thu, 02 Jun 2022 08:25:38 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id QLgvKOJXmGLUQAAAauVa8A (envelope-from ) for ; Thu, 02 Jun 2022 08:25:38 +0200 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 1F60212868 for ; Thu, 2 Jun 2022 08:25:38 +0200 (CEST) Received: from localhost ([::1]:32788 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nweH1-0002Hs-HA for larch@yhetil.org; Thu, 02 Jun 2022 02:25:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47156) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nweFN-0002Hi-RQ for emacs-orgmode@gnu.org; Thu, 02 Jun 2022 02:23:53 -0400 Received: from relay8-d.mail.gandi.net ([2001:4b98:dc4:8::228]:57729) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nweFL-0004Ll-Mc for emacs-orgmode@gnu.org; Thu, 02 Jun 2022 02:23:53 -0400 Received: (Authenticated sender: pe@7d.nz) by mail.gandi.net (Postfix) with ESMTPSA id DC0A81BF20D; Thu, 2 Jun 2022 06:23:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=7d.nz; s=gm1; t=1654151026; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ufvvbJIxkhN6Hgy2N5lpRsRAFdqNkxmy8/BdZ/EUrDY=; b=KXlndtjgU7C2GXi8UcKiVJoWS0uebHjfpfwManYhuDoIgVxxPAbFseTSf1prVnUITlF2qn bCUvpf6s0kjvc04idkAc1cfeQjR/0K7gJ7BA75NEh0/5E2MvRwFeflYtTH4F98aGRFjcTg QvQiHTfGJRxcBdYVQ5ozR3jW7Gxdvx+xigw3YjI81VwW5DqbeRQFhPkHYNhIDIyxr7PlHw a+dDtTjjQW/LnuzeoHJtT0FGKCxvOlKbBrlDrK4hZjJ1GhheN16q541YJIINIxdxBCxAob eLubnWEMZjSXcjvDRyPO8l/RZqjdvBl0JB+q2B4Pi+zA58zkTDYh2f/wuEilrg== Message-ID: Date: Thu, 2 Jun 2022 08:24:22 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: # Comments export Content-Language: en-US To: Ypo , Samuel Wales Cc: Timothy , emacs-orgmode@gnu.org References: <875ylpzmoh.fsf@gmail.com> <63167d83-ce29-f7d9-eeaf-38573b2b4205@gmail.com> <874k19zloo.fsf@gmail.com> From: Phil Estival In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2001:4b98:dc4:8::228; envelope-from=pe@7d.nz; helo=relay8-d.mail.gandi.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, NICE_REPLY_A=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 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 X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1654151138; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=ufvvbJIxkhN6Hgy2N5lpRsRAFdqNkxmy8/BdZ/EUrDY=; b=hOHzpN+UUL+LaXR+CMxFC+bSf5aHizAhQW/zTOZsRp9z5xag67qYqu9grA0ijG8UInt8rN n8Y+vSDOBvbs4xq84D6xYAcvmC4QKV+LAAdgNHMmjY5ppSFOdf2WAL2gENtJRccIdSMj69 vgSXs/DS5L3B7OFILqJR4J9DKMxrhtOlcO2X/7YfRoT0L+xP75UzG+Gc+5OvhkLl6NxJ85 G6sxrI/erF8EfMvImNp5DNN0a6p4rO4Cp1KaGn6tHipk8KcqrIIhmJnX3bvuD5UwM6tMYr 3klMeQ/RJAV1grkBflPP0KGcWvgPRfPA2v4jMqPwFLHCCxnE4cVs6ZDE+7EG5g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1654151138; a=rsa-sha256; cv=none; b=OrCCo4bMEKvdtz3QPXEVccmmv1G2vkEQsy1CjaC0vNWe3f/29C2LlW0+Ix/Mic2J0kVwmF xsg/m1PvYcCkw5gOkYIE4QsvuWMUMYhWVQDvV2TvIeQ1FT/oSDcoQkPZQwDxors4K5eFmo xYdcXg7RUMIosBZHCbSK9TbODgIpBTdFrbri6oPfAd+/AbjRCk+DxEjZPgi5Y9R8J64PG6 c8/6jNNfpNyV/G0s2tizHl8EvpNQ2FR/AjSUcUL907lv+b3wjCJ4WllMOyH8NQwU6/7pVE +g9dTR+a+UgUNBmSmPLF3OTdhYWwysTy9fCLLWAYWPT+9iWoAtvpZjfKWIm0fA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=7d.nz header.s=gm1 header.b=KXlndtjg; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -8.33 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=7d.nz header.s=gm1 header.b=KXlndtjg; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 1F60212868 X-Spam-Score: -8.33 X-Migadu-Scanner: scn0.migadu.com X-TUID: bAF2vdrPetIZ On 29/05/2022 à 02:46, Ypo wrote: > > I wanted to export my # comments so I could > share my notes with more people, using HTML > export. I would export all of them. > Ypo, As it is very close to what you're asking, here I'm suggesting how to export # comments in org, as to the HTML and % comments to the latex backends. Modifying Org sources instead of providing a peripheral mechanism may be considered as unorthodox, but it's not difficult at all and the modifications to remove the censorship over comments are small. ox.el: add a customization option to export comments #+begin_src elisp (defcustom org-export--with-comments nil   "Non-nil means provides comments to the backends"   :group 'org-export-general   :type 'boolean   :safe #'booleanp) #+end_src Let comments flow to exporters when this option is active #+begin_src elisp (defun org-export--skip-p (datum options selected excluded)   [...]     (cl-case (org-element-type datum)     ((comment comment-block)      (if org-export--with-comments nil ;; do not skip comments and comment blocks.        ;; Skip all comments and comment blocks.  Make to keep maximum        ;; number of blank lines around the comment so as to preserve        ;; local structure of the document upon interpreting it back into        ;; Org syntax.        (let* ((previous (org-export-get-previous-element datum options))            (before (or (org-element-property :post-blank previous) 0))            (after (or (org-element-property :post-blank datum) 0)))           (when previous         (org-element-put-property previous :post-blank (max before after 0)))         t)))     [...] #+end_src ox-html.el: modify the backend derivation to add a comment transcoder #+begin_src elisp (org-export-define-backend 'html   '(...     (clock . org-html-clock)     (code . org-html-code)     (comment . org-html-comment)     ... #+end_src ox-html.el: declare the additional transcoder: #+begin_src elisp ;;;; Comment (defun org-html-comment (comment _contents info)   "Transcode COMMENT from Org to HTML. CONTENTS is nil.  INFO is a plist holding contextual information."   (concat "