emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: D <d.williams@posteo.net>
To: emacs-orgmode@gnu.org
Subject: strange/cryptic org variables
Date: Thu, 23 Jan 2020 20:16:27 +0100	[thread overview]
Message-ID: <42f14e78-d544-423b-f87c-24ee04f8d796@posteo.net> (raw)

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

             reply	other threads:[~2020-01-23 19:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-23 19:16 D [this message]
2020-01-25 16:41 ` strange/cryptic org variables Kyle Meyer
2020-01-25 18:25 ` Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=42f14e78-d544-423b-f87c-24ee04f8d796@posteo.net \
    --to=d.williams@posteo.net \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).