From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id aFcQMpoHil/+KgAA0tVLHw (envelope-from ) for ; Fri, 16 Oct 2020 20:50:34 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id GFfCLZoHil+5dwAA1q6Kng (envelope-from ) for ; Fri, 16 Oct 2020 20:50:34 +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 49F8794051E for ; Fri, 16 Oct 2020 20:50:34 +0000 (UTC) Received: from localhost ([::1]:37780 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kTWgL-0003WB-5m for larch@yhetil.org; Fri, 16 Oct 2020 16:50:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57356) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kTWbM-0001Ls-1o for emacs-orgmode@gnu.org; Fri, 16 Oct 2020 16:45:28 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:33635) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kTWbJ-0001xB-Bp for emacs-orgmode@gnu.org; Fri, 16 Oct 2020 16:45:23 -0400 Received: by mail-wr1-x433.google.com with SMTP id b8so4521718wrn.0 for ; Fri, 16 Oct 2020 13:45:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=gBARPVw7V231mbYLZVmlzpi8wNF6A0Sz1Ev9jLouxpc=; b=nqrNLUZnL7X9JPgJrk05C/nMhLC4Bt+wJK7a7czbuEgy13bTk+Uhj27PDhngc3wZLh tGOsVzwjLfo43rza8prECTGyi6QPLL1di977WRBRgM1l21Y1572CpsQbS4F42Voxfsdu eVwOqKz2w8+O0+BgjEZRR2f5kRNrDmDeS0bGc716/fxBbB53huHMzAY/+/k7JZ1mFbJH q2IIvgmIFrUpZFFABNHazXtTYGwow66VbOl3yxp5JgXI+3g0OuTPCPd56/fn+kCSAKms O2VnyNcOVXOg7HHwMmYEZYG+UTBKYB+Q77f38nId1RWLzwHc/isOyfQO03xvHgQ15d4R n/sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=gBARPVw7V231mbYLZVmlzpi8wNF6A0Sz1Ev9jLouxpc=; b=bn+4VVyg7aXErlAjPgEoKfISFZR0v6i57iEi/wW2NZhhUe15PUq7ZcZ+lRdcfN4n/o ZdAzHg+eczgszK2TYFn8Ae9JYjWjHukCk/mowqnH8o/UAokkb6n9ZY1KHIIMOGjSE7Jj 6VIsQreuhgPUDLoBWeIOHtAe6jRiHqEs0rwpWN+6rkApyOfpnXIEUX8l3Q+6ow1sNYy9 5lADCuYulToDk73zc+4/CKl6DRrW+41D5479ebQ9vTmPPzB/NPGRxL2jgrUbWnFZIlmo qf5g+KId6Hd6ChNzDetDgnnETOig3g6epaCREhYLRC2rCMbEqsdT+NyoxCbi7dK3kAyK 7x7w== X-Gm-Message-State: AOAM533UfmQqoU9EczpqiMQaUU4rXX1ZBNTviC3RvlPcPvEZP/wjPo31 nS4JTZINBf2F1xVS8SydKqB6bqT2ybs= X-Google-Smtp-Source: ABdhPJxmf213Mg99ba6SrAJZO93vg6Suwqy04qjwe64cEWZUR+6NRGVE4HW4bInKcpnF6ybmlM37+A== X-Received: by 2002:a5d:5482:: with SMTP id h2mr6063485wrv.165.1602881118963; Fri, 16 Oct 2020 13:45:18 -0700 (PDT) Received: from freegnu (24.183.22.109.rev.sfr.net. [109.22.183.24]) by smtp.gmail.com with ESMTPSA id a82sm4280666wmc.44.2020.10.16.13.45.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Oct 2020 13:45:18 -0700 (PDT) From: Jeremie Juste To: stardiviner Subject: Re: [Share] collect some idea about auto eval code when TAB expand headline References: <5f892a7b.1c69fb81.c0551.2f2e@mx.google.com> Date: Fri, 16 Oct 2020 22:45:17 +0200 In-Reply-To: <5f892a7b.1c69fb81.c0551.2f2e@mx.google.com> (stardiviner's message of "Fri, 16 Oct 2020 13:01:21 +0800") Message-ID: <87y2k599ya.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=jeremiejuste@gmail.com; helo=mail-wr1-x433.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, 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: , 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=pass header.d=gmail.com header.s=20161025 header.b=nqrNLUZn; dmarc=pass (policy=none) header.from=gmail.com; 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: -1.71 X-TUID: 7a0zkI8GZphp 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? 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 block 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 context)) > (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.