From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id SIHrCUdBil+gBgAA0tVLHw (envelope-from ) for ; Sat, 17 Oct 2020 00:56:39 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id oFi7BUdBil+DYgAAbx9fmQ (envelope-from ) for ; Sat, 17 Oct 2020 00:56:39 +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 799CA94051B for ; Sat, 17 Oct 2020 00:56:38 +0000 (UTC) Received: from localhost ([::1]:45642 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kTaWR-0003lG-Vy for larch@yhetil.org; Fri, 16 Oct 2020 20:56:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46654) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kTaVx-0003l7-CF for emacs-orgmode@gnu.org; Fri, 16 Oct 2020 20:56:05 -0400 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]:36883) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kTaVv-0006VC-8u for emacs-orgmode@gnu.org; Fri, 16 Oct 2020 20:56:05 -0400 Received: by mail-pj1-x1033.google.com with SMTP id hk7so2408934pjb.2 for ; Fri, 16 Oct 2020 17:56:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:references:user-agent:from:to:cc:subject:reply-to :in-reply-to:date:mime-version:content-transfer-encoding; bh=yQtg1wCf2i7BmCQCp8yRaW7/Ikw3FJtyqKK5UWBHi80=; b=Lh0Jpbav3L9ZSTs742NnPhDlvcrVmre1QCZRtuGUNlpo2UYCihqhq1qQGopfGcRc7C WegFnHYfqzEMZDHggqKwHu/AW61tUlA59vhMeYDi/yO3L3ry3gpNzHSJfcbnFJTfX7kV cvBLpz4V6z02rjoL0j6/2uR5umL+oNplSIF2Z2ULTHVSxdlhECg/E4Li6V2fIyDMy0Pw 6XjAPXJ0WDRFQClDIwyDsMkTZ25Ef7OYvhdZFCjJ3StI76b4MN7emHXGS1EZYAfg+wfz Bu/7lxKPL1SRCahBdl4qZvN+PdbW7N3ldVFO4q6tHKMA8nPUPrXq30+bpIq6ATSbuxtl pYmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:references:user-agent:from:to:cc :subject:reply-to:in-reply-to:date:mime-version :content-transfer-encoding; bh=yQtg1wCf2i7BmCQCp8yRaW7/Ikw3FJtyqKK5UWBHi80=; b=URPrxPSerO2kb7SXntmYvJsombuJSr8xrYfxv+Nt199JS8CCZDti4DD5BEExuwdgNA vJWuDUnWruHYyfQ8LssNnHDuZvjpSuqJkooS1eAoSd1iYR8haik6KZ1/4KuIZEcMQuTf ynX3AJatNlQsLbu1C7dWGmigio85RL7EWt/pJD0JuYlr0H5YcgpjOvzXlW4kOxyEYVuG bRJRxZ7cps/eESHtfYqfkg0wlmD1sc9AG15Igjy22bg7I5ritOd4o5yHH/hWMqyxcBnK cWmIKv/M4s098IjHh2OAYj4zcqCVjzY+KPNkNRQAcdWXDfPLwhj53fjXuFo7KoqvtvyR IFmA== X-Gm-Message-State: AOAM532u1QxtyQaRLO5da0pMEv9PGq4ZKukFBqx8/gzCA1Ausu9/G/nm Toe/06SqSZ3+aCXQem0fWw== X-Google-Smtp-Source: ABdhPJxKPIzE0Rkg6kOitpuzLKpFQVqOPUYn1Lqqu10ALM/J5V4cLi5//m2czZF+AlFRS5nYfDVpqQ== X-Received: by 2002:a17:902:8f82:b029:d4:bf4f:13da with SMTP id z2-20020a1709028f82b02900d4bf4f13damr6659481plo.40.1602896161688; Fri, 16 Oct 2020 17:56:01 -0700 (PDT) Received: from dark.localdomain ([183.246.144.122]) by smtp.gmail.com with ESMTPSA id q8sm4049773pfg.118.2020.10.16.17.56.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Oct 2020 17:56:01 -0700 (PDT) Message-ID: <5f8a4121.1c69fb81.48bc2.944e@mx.google.com> X-Google-Original-Message-ID: <87o8l1fz6v.fsf@numbchild@gmail.com> Received: by dark.localdomain (Postfix, from userid 1000) id 221B43C024E; Sat, 17 Oct 2020 08:55:52 +0800 (CST) References: <5f892a7b.1c69fb81.c0551.2f2e@mx.google.com> <87y2k599ya.fsf@gmail.com> User-agent: mu4e 1.5.5; emacs 28.0.50 From: stardiviner To: Jeremie Juste Subject: Re: [Share] collect some idea about auto eval code when TAB expand headline In-reply-to: <87y2k599ya.fsf@gmail.com> Date: Sat, 17 Oct 2020 08:55:52 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::1033; envelope-from=numbchild@gmail.com; helo=mail-pj1-x1033.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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: , Reply-To: numbchild@gmail.com Cc: Org Mode Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=gmail.com header.s=20161025 header.b=Lh0Jpbav; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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-Spam-Score: 0.09 X-TUID: daiAuHQ+/4xd Jeremie Juste writes: > Hello, > > I don't see very clearly how you want to use the code. > (It might well be because of my lack of skills) > > Could you give a usage example? Aha, I forget to copy an example here. It looks like this. #+begin_src org ,* =E3=80=8A=E4=B8=89=E7=94=9F=E4=B8=89=E4=B8=96 =E5=8D=81=E9=87=8C=E6=A1= =83=E8=8A=B1=E3=80=8B :LOG:TV: :PROPERTIES: :EVAL: src_sh{mpg123 "=E4=B8=89=E7=94=9F=E4=B8=89=E4=B8=96 =E5=8D=81=E9= =87=8C=E6=A1=83=E8=8A=B1/=E6=9D=A8=E5=AE=97=E7=BA=AC =E5=BC=A0=E7=A2=A7=E6= =99=A8 - =E5=87=89=E5=87=89.mp3"}=20 :END: #+end_src > > Best regards, > > Jeremie > > > On Friday, 16 Oct 2020 at 13:01, stardiviner wrote: >> I write an elisp config for Org Mode to auto evaluate inline source bloc= k in property "EVAL". >> >> #+begin_src emacs-lisp >> (defcustom org-property-eval-keywords-list '("EVAL") >> "A list of property keywords for evaluate code." >> :type 'list >> :safe #'listp >> :group 'org) >> >> (defun org-property-eval-code (&optional state) >> "Evaluate Org inline source block in property value." >> (when (memq state '(children subtree)) >> (if-let ((inline-src-block (org-entry-get nil "EVAL" nil))) >> (with-temp-buffer >> (insert inline-src-block) >> (goto-char (point-min)) >> (require 'ob-async nil t) >> (setq-local org-babel-default-inline-header-args >> '((:results . "silent") (:async . t))) >> (let* ((context (org-element-context)) >> (src-block-info (org-babel-get-src-block-info nil conte= xt)) >> (type (org-element-type context))) >> (when (eq type 'inline-src-block) >> ;; ob-async: `org-babel-execute-src-block:async' >> (org-babel-execute-src-block nil src-block-info))))))) >> >> (add-hook 'org-cycle-hook #'org-property-eval-code) >> #+end_src >> >> A question: >> >> How to get all property keywords under headline? I want to use ~member~ = to detect >> whether property keywords has member in defined custom list >> ~org-property-eval-keywords-list~. >> >> Second question: >> >> Do you have any good idea or suggest about this? >> >> Thanks for sharing your idea. --=20 [ stardiviner ] I try to make every word tell the meaning that I want to express. Blog: https://stardiviner.github.io/ IRC(freenode): stardiviner, Matrix: stardiviner GPG: F09F650D7D674819892591401B5DF1C95AE89AC3