From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.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 oPCzEB0daGJ6CAAAbAwnHQ (envelope-from ) for ; Tue, 26 Apr 2022 18:26:05 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id WLq+EB0daGLpXAAA9RJhRA (envelope-from ) for ; Tue, 26 Apr 2022 18:26:05 +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 DD84711012 for ; Tue, 26 Apr 2022 18:26:04 +0200 (CEST) Received: from localhost ([::1]:46656 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1njO0p-0005zf-FV for larch@yhetil.org; Tue, 26 Apr 2022 12:26:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43342) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1njO0G-0005xE-Hl for emacs-orgmode@gnu.org; Tue, 26 Apr 2022 12:25:28 -0400 Received: from mail-vs1-xe2e.google.com ([2607:f8b0:4864:20::e2e]:41768) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1njO0E-0002jN-5F for emacs-orgmode@gnu.org; Tue, 26 Apr 2022 12:25:28 -0400 Received: by mail-vs1-xe2e.google.com with SMTP id w124so9294787vsb.8 for ; Tue, 26 Apr 2022 09:25:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=MLjuaCe6jrgcY6T1PdHR0rt2mMEUeoRSydvH83xQnXo=; b=g1vbyhosVubximqXxjmrWxJ8C6u4eXGDFdUEBzMbI2HKXrpgpXYe1zRdH4220y4udC 53LGbik9jmYLUevYI1unOtATe9lpIMlXfp9GGBxIgFVBehmmF/fXgfjcsjo+FtIJ4Edl bzlq7iVPZnZOgQt+t/NT+78eEH2rYTUftENeXIYNm0S+6n+EcyWm9zKXfL1eRMzhu6fh vwbb0LUfGuP2ZZ/z3+NQ3TJdNgr9dsce7tBbTniVtI5u69TT4ckqFoy4+zJt9CvBFLu3 GrMHT7/Ezas/SKqPVlmilCHbQ+f/40AEBx+g2U8gMBVujqrnEZc8oz6/1q/dDh2VGtG1 h84Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=MLjuaCe6jrgcY6T1PdHR0rt2mMEUeoRSydvH83xQnXo=; b=sxRJxxNKbrHLfZ5ykLneWi9wYyBuywKbNjTrSbQJyK/mCW4rc0bajBI6w7vvYk7Dje Avjg5H/Djk1lDLIDygPXudQRkHXRbc8RapuPqRhVEIk9J82POZIeOTisMxu5bhUH+LCX b4i4RL9l2/BW2/l0dwT90NV4UBpk1WM9zsosWmfUCxC9k7Fra7I6pK5YFjH88Vi+iPWC aRIALgyzw4D+gjz/On+1UOsC2kpTuEoiqQYwPQqdR6H1ePZ76dEygkW6lcK3R1BtG5d4 uztH3oFSME401TeDw3vK/PdafakxMTfXI+dwgIELd6/1SRGrlqPa/CcFTiYuchBVCjs9 ju7Q== X-Gm-Message-State: AOAM532kZXVHcVWTQoIpt7wHnP+0f/5pemIx9cZX95Tussr2xuwEhdQB 0UeM4InG0qY/zH5v+TknwV+DXRJaKgvbbZFSdVS3wr8LWOQ= X-Google-Smtp-Source: ABdhPJz2GHBkfZRUKJPn+vzy1WcwqNbbjbEZKcLPoW5pJF1Ls0zxsQwGXNP62MqbtLKjIBv98nqOBB8RPh8qD6+mnvc= X-Received: by 2002:a05:6102:3e21:b0:32a:ba4:debf with SMTP id j33-20020a0561023e2100b0032a0ba4debfmr6774760vsv.70.1650990324946; Tue, 26 Apr 2022 09:25:24 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Tim Visher Date: Tue, 26 Apr 2022 12:24:48 -0400 Message-ID: Subject: Re: Automatically use Heading Content as EXPORT_FILE_NAME? To: Emacs Org Mode mailing list Content-Type: multipart/alternative; boundary="000000000000d89bc205dd912331" Received-SPF: pass client-ip=2607:f8b0:4864:20::e2e; envelope-from=tim.visher@gmail.com; helo=mail-vs1-xe2e.google.com 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, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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=1650990364; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=MLjuaCe6jrgcY6T1PdHR0rt2mMEUeoRSydvH83xQnXo=; b=MFZGBVKiwx3PWlVgYaD5Yp2+ZuVECFZOC/24KB7eUz1EsBDEcQg52i/AjSUUy6FiSu0e8/ +KRomCoPEX7pMDZ2pbEaSfUcQ9Rv9TecPUag0wzsiV/QN2FVL1tQapbWdbu7LnXXbcfIgu 8r2RVJoSCcioprsPJH1JiD2TFy9WRwHBP1GW/HLbSqxJ74geY1byks67S1sGfvKfEELQ8G Ca/mjog0YsHp/+z5/slQWlzzeEFQ9F2eyfv6E/tq3Bd2yl24IJtKWC06DiGR4XPgynctfb PFXGlwEQAMyPLoE3AszEmBYK8TY4U/0Ypj1aFEQXfVRsj5nGNxgl5ePkiGnusw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1650990364; a=rsa-sha256; cv=none; b=g0JIjbITE0Ij0d0QMLQXc4snKaPgSACfhoiQ1ZKznxu4yvBd+iCQL2ViZ8EM4QzT5tgR+a +ZtqW0xVVKBdcnkLsTGaItY3+pqlGLP8GBRxZzXb3ihscWJGoNEwOeFlov0km1z2jKvYhA pu0kvaGKhiVIGZJ2eb9BsLjKMyzreNbKYn1etmcmGDU4n8hH3IRrA4EJO6Xiu3bVfAcQPA baTkUjP3z+BywuN7lML2GE2dl9+PACMcwjV4DOV6hR74qrhp9Bakmb8rcfX6KQCDrk0PoQ y7YVvy3/l69cjLbHUNeSMaWhtvm+nmsPgWMgBnnO9ja1j4rqqR1tc6S5lQYbqA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=g1vbyhos; dmarc=pass (policy=none) header.from=gmail.com; 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: -4.81 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=g1vbyhos; dmarc=pass (policy=none) header.from=gmail.com; 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: DD84711012 X-Spam-Score: -4.81 X-Migadu-Scanner: scn0.migadu.com X-TUID: I3hUZZwlPXB0 --000000000000d89bc205dd912331 Content-Type: text/plain; charset="UTF-8" On Tue, Apr 26, 2022 at 11:54 AM Tim Visher wrote: > I'm currently going to hack around it I think by simply making a function > that updates the EXPORT_FILE_NAME property with the current heading text. > That's something like ``` (defun timvisher-org-set-export_file_name-property-to-heading-text () (interactive) (org-set-property "EXPORT_FILE_NAME" (let ((stripped-heading (replace-regexp-in-string "[^-A-Za-z0-9_.~#+ ]" "" (substring-no-properties (org-get-heading t t t t))))) (substring-no-properties stripped-heading 0 (min (length stripped-heading) 250))))) ``` --000000000000d89bc205dd912331 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Tue, Apr 26, 2022 at 11:54 AM Tim Visher &= lt;tim.visher@gmail.com> wro= te:
I'm currently going to hack around it I think by simply makin= g a function that updates the EXPORT_FILE_NAME property with the current he= ading text.

That's some= thing like

```
(defu= n timvisher-org-set-export_file_name-property-to-heading-text
=C2=A0 =C2= =A0 ()
=C2=A0 (interactive)
=C2=A0 (org-set-property
=C2=A0 =C2=A0= "EXPORT_FILE_NAME"
=C2=A0 =C2=A0(let ((stripped-heading
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (replace-regexp-in-string
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0"[^-A-Za-z0-9_.~#+ ]"
=C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0""
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0(substring-no-properties (org-get-heading t t t t)))))
=C2=A0 = =C2=A0 =C2=A0(substring-no-properties
=C2=A0 =C2=A0 =C2=A0 stripped-head= ing
=C2=A0 =C2=A0 =C2=A0 0
=C2= =A0 =C2=A0 =C2=A0 (min (length stripped-heading) 250)))))
= ```
--000000000000d89bc205dd912331--