From: Nelson Ferreira Date: Fri, 25 Dec 2015 21:40:24 +0000 (-0500) Subject: Segregate aliases to DEFVAR_CONST X-Git-Tag: v22.1.16~7^2~1 X-Git-Url: http://cgit.sxemacs.org/?p=sxemacs;a=commitdiff_plain;h=7ffe58c3287caeb19c08ea91c7a2076a1a0f98e5 Segregate aliases to DEFVAR_CONST * lisp/float-sup.el: Remove alias for pi and e when bigfr is available. These should now be defined in const-aliases, loaded by startup. * lisp/const-aliases.el (pi): Define const as bigfr-pi when bigfr is available. (e): Define as euler when bigfr is available. * lisp/Makefile.am (corelispels): Add const-aliases.el to list of files. * lisp/startup.el (load-init-file): Require new const-aliases to load the consts that cannot be dumped. Signed-off-by: Nelson Ferreira --- diff --git a/lisp/const-aliases.el b/lisp/const-aliases.el new file mode 100644 index 0000000..379d5ca --- /dev/null +++ b/lisp/const-aliases.el @@ -0,0 +1,40 @@ +;;; const-aliases --- define alias for C defconsts to allow let-bind + +;; Copyright (C) 2015 Nelson Ferreira + +;; Author: Nelson Ferreira +;; Maintainer: SXEmacs Development Team +;; Keywords: internal + +;; This file is part of SXEmacs. + +;; SXEmacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; SXEmacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Synched up with: Not synched with FSF. + +;;; Commentary: + +;; The following code is required at startup to define all the +;; necessary defconst alias for C DEFVAR_CONST that we wish to +;; allow let-bind to succeed. + + +;;; Code: + +(when (featurep 'bigfr) + (defconst pi bigfr-pi "The value of Pi (3.1415926...)") + (defconst e euler "The value of e (2.7182818...)")) + +(provide 'const-aliases) + diff --git a/lisp/float-sup.el b/lisp/float-sup.el index 964c408..05dace0 100644 --- a/lisp/float-sup.el +++ b/lisp/float-sup.el @@ -36,10 +36,7 @@ (error "Floating point was disabled at compile time")) ;; define pi and e via math-lib calls. (much less prone to killer typos.) -(if (featurep 'bigfr) - (progn - (defconst pi bigfr-pi "The value of Pi (3.1415926...)") - (defconst e euler "The value of e (2.7182818...)")) +(unless (featurep 'bigfr) (defconst pi (* 4 (atan 1)) "The value of Pi (3.1415926...)") (defconst e (exp 1) "The value of e (2.7182818...)")) diff --git a/lisp/startup.el b/lisp/startup.el index a58eca7..f2ffff6 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -763,6 +763,9 @@ If this is nil, no message will be displayed.") ;;; Load user's init file and default ones. (defun load-init-file () + + (require 'const-aliases) + (run-hooks 'before-init-hook) ;; Run the site-start library if it exists. The point of this file is