[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>
- Re: Why shouldn't we have a #if .... #else .... #endif construct in Emacs Lisp?, (continued)
- Re: Why shouldn't we have a #if .... #else .... #endif construct in Emacs Lisp?, Alan Mackenzie, 2023/09/06
- Re: Why shouldn't we have a #if .... #else .... #endif construct in Emacs Lisp?, Richard Stallman, 2023/09/08
- Re: Why shouldn't we have a #if .... #else .... #endif construct in Emacs Lisp?, Ihor Radchenko, 2023/09/09
- Re: Why shouldn't we have a #if .... #else .... #endif construct in Emacs Lisp?, Richard Stallman, 2023/09/09
- Re: Why shouldn't we have a #if .... #else .... #endif construct in Emacs Lisp?, Ihor Radchenko, 2023/09/10
- Re: Why shouldn't we have a #if .... #else .... #endif construct in Emacs Lisp?, Richard Stallman, 2023/09/13
- Re: Why shouldn't we have a #if .... #else .... #endif construct in Emacs Lisp?,
Ihor Radchenko <=
Re: Why shouldn't we have a #if .... #else .... #endif construct in Emacs Lisp?, Ulrich Mueller, 2023/09/05