emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why shouldn't we have a #if .... #else .... #endif construct in Emac


From: Ihor Radchenko
Subject: Re: Why shouldn't we have a #if .... #else .... #endif construct in Emacs Lisp?
Date: Wed, 20 Sep 2023 12:59:32 +0000

Richard Stallman <rms@gnu.org> writes:

> As I understand it, the proposal was to handle at compile time
> certain conditionals at _top-level_ in the source file being compiled.
> Things like
>
> (if (fboundp 'whatever)
>   ...conditional-code...)
>
> However, what you've shown is a conditional inside a function definition
> that is part of org-mode -- right?

You are right. Though we also have top-level instances of `fboundp' in
Org that should not be optimized away during compile time.

In particular, ol-w3m.el in Org has

(when (and (boundp 'w3m-mode-map)
           (keymapp w3m-mode-map))
  (define-key w3m-mode-map "\C-c\C-x\M-w" 'org-w3m-copy-for-org-mode)
  (define-key w3m-mode-map "\C-c\C-x\C-w" 'org-w3m-copy-for-org-mode))

w3m-mode-map is only available when w3m package is installed, which can
happen after Org mode is compiled.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]