From mboxrd@z Thu Jan 1 00:00:00 1970 From: D Subject: strange/cryptic org variables Date: Thu, 23 Jan 2020 20:16:27 +0100 Message-ID: <42f14e78-d544-423b-f87c-24ee04f8d796@posteo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:58558) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iuhxy-0004Ya-FA for emacs-orgmode@gnu.org; Thu, 23 Jan 2020 14:16:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iuhxx-0006X9-9U for emacs-orgmode@gnu.org; Thu, 23 Jan 2020 14:16:34 -0500 Received: from mout02.posteo.de ([185.67.36.66]:35159) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iuhxw-0006RG-QS for emacs-orgmode@gnu.org; Thu, 23 Jan 2020 14:16:33 -0500 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 27E452400FC for ; Thu, 23 Jan 2020 20:16:29 +0100 (CET) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 483X7c4N1Rz9rxj for ; Thu, 23 Jan 2020 20:16:28 +0100 (CET) Content-Language: en-US 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-mx.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org Hello, org.el seems to define three weird variables: org-m, org-l and org-f (see below). Two of these variables (l and f) are used exclusively in org-level-face, while m is not used anywhere in the code. They don't appear to be used in the other source files, either. Is there a particular reason for them being accessible outside of the function? They seem oddly.. exposed. Or is it some kind of performance reason? Here's the code in question, taken from Version 9.1.9, L6531 onward: (defvar org-m nil) (defvar org-l nil) (defvar org-f nil) (defun org-get-level-face (n) "Get the right face for match N in font-lock matching of headlines." (setq org-l (- (match-end 2) (match-beginning 1) 1)) (when org-odd-levels-only (setq org-l (1+ (/ org-l 2)))) (if org-cycle-level-faces (setq org-f (nth (% (1- org-l) org-n-level-faces) org-level-faces)) (setq org-f (nth (1- (min org-l org-n-level-faces)) org-level-faces))) (cond ((eq n 1) (if org-hide-leading-stars 'org-hide org-f)) ((eq n 2) org-f) (t (unless org-level-color-stars-only org-f)))) Cheers, DW