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 oH4NGk6pul6KZAAA0tVLHw (envelope-from ) for ; Tue, 12 May 2020 13:49:02 +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 2HqcLlypul4uFgAAbx9fmQ (envelope-from ) for ; Tue, 12 May 2020 13:49:16 +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 3BC61940FD7 for ; Tue, 12 May 2020 13:49:14 +0000 (UTC) Received: from localhost ([::1]:36784 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYVHU-0008KJ-Ft for larch@yhetil.org; Tue, 12 May 2020 09:49:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50586) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYVH8-0008KC-0U for emacs-orgmode@gnu.org; Tue, 12 May 2020 09:48:50 -0400 Received: from [183.249.138.107] (port=9407 helo=dark.localdomain) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYVH3-0004SY-Sl for emacs-orgmode@gnu.org; Tue, 12 May 2020 09:48:49 -0400 Received: by dark.localdomain (Postfix, from userid 1000) id E042F2415D5; Tue, 12 May 2020 21:48:36 +0800 (HKT) References: <87mu6hsgtm.fsf@gmail.com> <87y2q0ynkq.fsf@nicolasgoaziou.fr> User-agent: mu4e 1.4; emacs 28.0.50 From: stardiviner To: Nicolas Goaziou Subject: Re: [RFC] Let Org Mode's completion support all Babel header arguments In-reply-to: <87y2q0ynkq.fsf@nicolasgoaziou.fr> Date: Tue, 12 May 2020 21:48:36 +0800 Message-ID: <87d079s1qj.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Host-Lookup-Failed: Reverse DNS lookup failed for 183.249.138.107 (deferred) Received-SPF: softfail client-ip=183.249.138.107; envelope-from=numbchild@gmail.com; helo=dark.localdomain X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/12 09:48:37 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: 15 X-Spam_score: 1.5 X-Spam_bar: + X-Spam_report: (1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FREEMAIL_FROM=0.001, NML_ADSP_CUSTOM_MED=0.9, RDNS_NONE=0.793, SPF_SOFTFAIL=0.665, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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 X-Spam-Score: -0.51 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" 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-Scan-Result: default: False [-0.51 / 13.00]; HAS_REPLYTO(0.00)[numbchild@gmail.com]; GENERIC_REPUTATION(0.00)[-0.54003283835668]; DWL_DNSWL_FAIL(0.00)[209.51.188.17:server fail]; R_SPF_ALLOW(-0.20)[+ip4:209.51.188.0/24:c]; FREEMAIL_FROM(0.00)[gmail.com]; HAS_ATTACHMENT(0.00)[]; REPLYTO_ADDR_EQ_FROM(0.00)[]; R_MISSING_CHARSET(2.50)[]; RCVD_COUNT_THREE(0.00)[4]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.50)[cached: eggs.gnu.org]; RCPT_COUNT_TWO(0.00)[2]; MAILLIST(-0.20)[mailman]; SIGNED_PGP(-2.00)[]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RCVD_IN_DNSWL_FAIL(0.00)[209.51.188.17:server fail]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:22989, ipnet:209.51.188.0/24, country:US]; MID_RHS_MATCH_FROM(0.00)[]; TAGGED_FROM(0.00)[larch=yhetil.org]; ARC_NA(0.00)[]; IP_REPUTATION_HAM(0.00)[asn: 22989(0.06), country: US(-0.00), ip: 209.51.188.17(-0.54)]; FROM_NEQ_ENVFROM(0.00)[numbchild@gmail.com,emacs-orgmode-bounces@gnu.org]; FROM_HAS_DN(0.00)[]; URIBL_BLOCKED(0.00)[nicolasgoaziou.fr:email,stardiviner.github.io:url]; MIME_GOOD(-0.20)[multipart/signed,multipart/mixed,text/plain,text/x-patch]; FREEMAIL_REPLYTO(0.00)[gmail.com]; HAS_LIST_UNSUB(-0.01)[]; MIME_TRACE(0.00)[0:+,1:+,2:+,3:+,4:~]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.51.188.17:from]; FORGED_SENDER_MAILLIST(0.00)[]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : SPF not aligned (relaxed), No valid DKIM,none] X-TUID: uOg7ejMZfVM7 --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Nicolas Goaziou writes: > Hello, > > stardiviner writes: > >> I found Org Mode's completion (from ~completion-at-point-functions~ whic= h is >> provided by ~pcomplete-completions-at-point~) can complete in bellowing = places >> (the "|" represent cursor point): > > [...] > >> So I think Org Mode need an union API to manage those keywords. WDYT? > > pcomplete certainly needs some love. > > There is already `org-babel-common-header-args-w-values' and > `org-babel-header-args:LANG'. You may want to look into > `org-lint-wrong-header-value' to check how they are used. > > Regards, I found library "org-pcomplete.el" and check it out, I combined the header arguments retrieve mechanism from command ~org-babel-insert-header-arg~. Pu= t it into ~pcomplete/org-mode/block-option/src~. Not org-pcomplete.el on Babel h= eader arguments works perfect. I attached the patch. =2D-=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 =20=20=20=20=20=20 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-org-pcomplete.el-improve-header-arguments-completion.patch Content-Transfer-Encoding: quoted-printable From=20540f79db180aca95b0e202230c85e592b4fc579c Mon Sep 17 00:00:00 2001 From: stardiviner Date: Tue, 12 May 2020 21:44:04 +0800 Subject: [PATCH] org-pcomplete.el: improve header arguments completion * lisp/org-pcomplete.el (pcomplete/org-mode/block-option/src): Make it complete real all available header arguments like command `org-babel-insert-header-arg'. =2D-- lisp/org-pcomplete.el | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/lisp/org-pcomplete.el b/lisp/org-pcomplete.el index 28b40fadd..d9c301bd0 100644 =2D-- a/lisp/org-pcomplete.el +++ b/lisp/org-pcomplete.el @@ -418,11 +418,16 @@ (defun pcomplete/org-mode/block-option/src () (symbol-plist 'org-babel-load-languages) 'custom-type))))))) =2D (while (pcomplete-here =2D '("-n" "-r" "-l" =2D ":cache" ":colnames" ":comments" ":dir" ":eval" ":exports" =2D ":file" ":hlines" ":no-expand" ":noweb" ":results" ":rownames" =2D ":session" ":shebang" ":tangle" ":tangle-mode" ":var")))) + (let* ((info (org-babel-get-src-block-info 'light)) + (lang (car info)) + (lang-headers (intern (concat "org-babel-header-args:" lang))) + (headers (org-babel-combine-header-arg-lists + org-babel-common-header-args-w-values + (when (boundp lang-headers) (eval lang-headers t))))) + (while (pcomplete-here + (mapcar + (lambda (arg) (concat ":" (symbol-name (car arg)))) + headers))))) =20 (defun pcomplete/org-mode/block-option/clocktable () "Complete keywords in a clocktable line." =2D-=20 2.26.2 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl66qTQUHG51bWJjaGls ZEBnbWFpbC5jb20ACgkQG13xyVromsNJ/ggAhP7C4P5iZ7qZsTFFPwIdycaGXGQX 5s7av9Zh9Z0Xbg0/hkaVCRftdzWyVfVNG8Jor+jPd71RoLyg/8xFfpXWGEKM/Lzj EaGUpV2IFeQK8baYRTm33k3NB20G/yAoO8+/MWU11v9odWk4vjdW5hsirBut1OBK 0bH+jc7xEZRVRN9Eki5KEG17NsXODByWPMv7QwfkurhmvAIlz9DhLax/xNMCOZmE RFjYeVHth/ojuScVyKoPQhtvtYIBirx7e2fNfnQa+5lHCB2cytbMjJrzmKpn8loK 3dm7NhvJcVNsW/IfbjoZ9dxlOIzlheoJqJsVhUTddL/3n4HVPfsXniQhXg== =LSaw -----END PGP SIGNATURE----- --==-=-=--