From mboxrd@z Thu Jan 1 00:00:00 1970 From: "N. Raghavendra" Subject: Re: org-babel-do-load-languages Date: Thu, 03 May 2018 19:24:35 +0530 Message-ID: <876044q1yc.fsf@gmail.com> References: <87d0ydq95m.fsf@gmail.com> <87zi1gsx9i.fsf@gmail.com> Reply-To: "N. Raghavendra" Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42284) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fEEh5-0000N4-1B for emacs-orgmode@gnu.org; Thu, 03 May 2018 09:54:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fEEgy-000558-OK for emacs-orgmode@gnu.org; Thu, 03 May 2018 09:54:47 -0400 Received: from mail-pg0-x230.google.com ([2607:f8b0:400e:c05::230]:41379) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fEEgy-00054v-Ex for emacs-orgmode@gnu.org; Thu, 03 May 2018 09:54:40 -0400 Received: by mail-pg0-x230.google.com with SMTP id m21-v6so13197380pgv.8 for ; Thu, 03 May 2018 06:54:40 -0700 (PDT) Received: from riemann ([14.139.59.140]) by smtp.gmail.com with ESMTPSA id e126sm28405982pfh.5.2018.05.03.06.54.37 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 May 2018 06:54:38 -0700 (PDT) In-Reply-To: <87zi1gsx9i.fsf@gmail.com> (Aaron Ecay's message of "Thu, 03 May 2018 14:07:37 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org At 2018-05-03T14:07:37+01:00, Aaron Ecay wrote: > It=CA=BCs an unusual function indeed. That=CA=BCs because it is used as = the :set > function for the defcustom org-babel-load-languages; see the info > documentation (info "(elisp) Variable Definitions"). Thank you for explaining. I still think it would be better to avoid unexplained parameters in the user-level function org-babel-do-load-languages. I wonder if something like ------------------------------------------------------------ (defun org-babel-do-load-languages (languages) "Load languages as specified by LANGUAGES. LANGUAGES must be a list, each element of which is of the form (LANG . ACTIVE), where LANG is the identifier of a supported language, and ACTIVE is either t, for loading LANG, or nil, for unloading LANG. For a list of the supported languages and their identifiers, see the Info node `(Org)Languages'." (setq-default org-babel-load-languages languages) (dolist (pair org-babel-load-languages) (let ((active (cdr pair)) (lang (symbol-name (car pair)))) (if active (require (intern (concat "ob-" lang))) (funcall 'fmakunbound (intern (concat "org-babel-execute:" lang))) (funcall 'fmakunbound (intern (concat "org-babel-expand-body:" lang))))))) (defcustom org-babel-load-languages '((emacs-lisp . t)) ... :set #'(lambda (sym value) (ignore sym) (org-babel-do-load-languages value)) ...) ------------------------------------------------------------ looks reasonable. Raghu. -- N. Raghavendra , http://www.retrotexts.net/ Harish-Chandra Research Institute, http://www.hri.res.in/