diff options
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/cl-extra.el | 14 | ||||
-rw-r--r-- | lisp/emacs-lisp/cl-loaddefs.el | 26 | ||||
-rw-r--r-- | lisp/emacs-lisp/cl.el | 54 | ||||
-rw-r--r-- | lisp/emacs-lisp/derived.el | 2 | ||||
-rw-r--r-- | lisp/emacs-lisp/easy-mmode.el | 11 |
5 files changed, 73 insertions, 34 deletions
diff --git a/lisp/emacs-lisp/cl-extra.el b/lisp/emacs-lisp/cl-extra.el index 7468a0237cf..8ea58b2e07c 100644 --- a/lisp/emacs-lisp/cl-extra.el +++ b/lisp/emacs-lisp/cl-extra.el @@ -480,17 +480,13 @@ If STATE is t, return a new state object seeded from the time of day." (and (numberp res) (/= res (/ res 2)) res)) (arith-error nil))) -(defvar most-positive-float) -(defvar most-negative-float) -(defvar least-positive-float) -(defvar least-negative-float) -(defvar least-positive-normalized-float) -(defvar least-negative-normalized-float) -(defvar float-epsilon) -(defvar float-negative-epsilon) - ;;;###autoload (defun cl-float-limits () + "Initialize the Common Lisp floating-point parameters. +This sets the values of: `most-positive-float', `most-negative-float', +`least-positive-float', `least-negative-float', `float-epsilon', +`float-negative-epsilon', `least-positive-normalized-float', and +`least-negative-normalized-float'." (or most-positive-float (not (numberp '2e1)) (let ((x '2e0) y z) ;; Find maximum exponent (first two loops are optimizations) diff --git a/lisp/emacs-lisp/cl-loaddefs.el b/lisp/emacs-lisp/cl-loaddefs.el index d6512306ad1..1cd953d9e18 100644 --- a/lisp/emacs-lisp/cl-loaddefs.el +++ b/lisp/emacs-lisp/cl-loaddefs.el @@ -10,7 +10,7 @@ ;;;;;; ceiling* floor* isqrt lcm gcd cl-progv-before cl-set-frame-visible-p ;;;;;; cl-map-overlays cl-map-intervals cl-map-keymap-recursively ;;;;;; notevery notany every some mapcon mapcan mapl maplist map -;;;;;; cl-mapcar-many equalp coerce) "cl-extra" "cl-extra.el" "26339d9571f9485bf34fa6d2ae38fc84") +;;;;;; cl-mapcar-many equalp coerce) "cl-extra" "cl-extra.el" "15a5e127e1c9c9c3d1f398963b66cde7") ;;; Generated autoloads from cl-extra.el (autoload 'coerce "cl-extra" "\ @@ -28,7 +28,7 @@ strings case-insensitively. \(fn X Y)" nil nil) (autoload 'cl-mapcar-many "cl-extra" "\ -Not documented + \(fn CL-FUNC CL-SEQS)" nil nil) @@ -84,27 +84,27 @@ Return true if PREDICATE is false of some element of SEQ or SEQs. (defalias 'cl-map-keymap 'map-keymap) (autoload 'cl-map-keymap-recursively "cl-extra" "\ -Not documented + \(fn CL-FUNC-REC CL-MAP &optional CL-BASE)" nil nil) (autoload 'cl-map-intervals "cl-extra" "\ -Not documented + \(fn CL-FUNC &optional CL-WHAT CL-PROP CL-START CL-END)" nil nil) (autoload 'cl-map-overlays "cl-extra" "\ -Not documented + \(fn CL-FUNC &optional CL-BUFFER CL-START CL-END CL-ARG)" nil nil) (autoload 'cl-set-frame-visible-p "cl-extra" "\ -Not documented + \(fn FRAME VAL)" nil nil) (autoload 'cl-progv-before "cl-extra" "\ -Not documented + \(fn SYMS VALUES)" nil nil) @@ -180,7 +180,11 @@ Return t if OBJECT is a random-state object. \(fn OBJECT)" nil nil) (autoload 'cl-float-limits "cl-extra" "\ -Not documented +Initialize the Common Lisp floating-point parameters. +This sets the values of: `most-positive-float', `most-negative-float', +`least-positive-float', `least-negative-float', `float-epsilon', +`float-negative-epsilon', `least-positive-normalized-float', and +`least-negative-normalized-float'. \(fn)" nil nil) @@ -228,12 +232,12 @@ PROPLIST is a list of the sort returned by `symbol-plist'. \(fn PROPLIST PROPNAME &optional DEFAULT)" nil nil) (autoload 'cl-set-getf "cl-extra" "\ -Not documented + \(fn PLIST TAG VAL)" nil nil) (autoload 'cl-do-remf "cl-extra" "\ -Not documented + \(fn PLIST TAG)" nil nil) @@ -267,7 +271,7 @@ This also does some trivial optimizations to make the form prettier. \(fn FORM &optional ENV)" nil nil) (autoload 'cl-prettyexpand "cl-extra" "\ -Not documented + \(fn FORM &optional FULL)" nil nil) diff --git a/lisp/emacs-lisp/cl.el b/lisp/emacs-lisp/cl.el index 526475eb1bd..16eb31c1209 100644 --- a/lisp/emacs-lisp/cl.el +++ b/lisp/emacs-lisp/cl.el @@ -333,15 +333,51 @@ always returns nil." (defvar *random-state* (vector 'cl-random-state-tag -1 30 (cl-random-time))) -;; The following are actually set by cl-float-limits. -(defconst most-positive-float nil) -(defconst most-negative-float nil) -(defconst least-positive-float nil) -(defconst least-negative-float nil) -(defconst least-positive-normalized-float nil) -(defconst least-negative-normalized-float nil) -(defconst float-epsilon nil) -(defconst float-negative-epsilon nil) +(defconst most-positive-float nil + "The largest value that a Lisp float can hold. +If your system supports infinities, this is the largest finite value. +For IEEE machines, this is approximately 1.79e+308. +Call `cl-float-limits' to set this.") + +(defconst most-negative-float nil + "The largest negative value that a Lisp float can hold. +This is simply -`most-positive-float'. +Call `cl-float-limits' to set this.") + +(defconst least-positive-float nil + "The smallest value greater than zero that a Lisp float can hold. +For IEEE machines, it is about 4.94e-324 if denormals are supported, +or 2.22e-308 if they are not. +Call `cl-float-limits' to set this.") + +(defconst least-negative-float nil + "The smallest value less than zero that a Lisp float can hold. +This is simply -`least-positive-float'. +Call `cl-float-limits' to set this.") + +(defconst least-positive-normalized-float nil + "The smallest normalized Lisp float greater than zero. +This is the smallest value for which IEEE denormalization does not lose +precision. For IEEE machines, this value is about 2.22e-308. +For machines that do not support the concept of denormalization +and gradual underflow, this constant equals `least-positive-float'. +Call `cl-float-limits' to set this.") + +(defconst least-negative-normalized-float nil + "The smallest normalized Lisp float less than zero. +This is simply -`least-positive-normalized-float'. +Call `cl-float-limits' to set this.") + +(defconst float-epsilon nil + "The smallest positive float that adds to 1.0 to give a distinct value. +Adding a number less than this to 1.0 returns 1.0 due to roundoff. +For IEEE machines, epsilon is about 2.22e-16. +Call `cl-float-limits' to set this.") + +(defconst float-negative-epsilon nil + "The smallest positive float that subtracts from 1.0 to give a distinct value. +For IEEE machines, it is about 1.11e-16. +Call `cl-float-limits' to set this.") ;;; Sequence functions. diff --git a/lisp/emacs-lisp/derived.el b/lisp/emacs-lisp/derived.el index 81932f9940a..55ea102ed2a 100644 --- a/lisp/emacs-lisp/derived.el +++ b/lisp/emacs-lisp/derived.el @@ -230,7 +230,7 @@ No problems result if this variable is not bound. ; Run the parent. (delay-mode-hooks - (,(or parent 'fundamental-mode)) + (,(or parent 'kill-all-local-variables)) ; Identify the child mode. (setq major-mode (quote ,child)) (setq mode-name ,name) diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el index b1cb0615e43..bf9f2c9d6ed 100644 --- a/lisp/emacs-lisp/easy-mmode.el +++ b/lisp/emacs-lisp/easy-mmode.el @@ -94,8 +94,9 @@ Optional LIGHTER is displayed in the modeline when the mode is on. Optional KEYMAP is the default keymap bound to the mode keymap. If non-nil, it should be a variable name (whose value is a keymap), or an expression that returns either a keymap or a list of - arguments for `easy-mmode-define-keymap'. If KEYMAP is not a symbol, - this also defines the variable MODE-map. + arguments for `easy-mmode-define-keymap'. If you supply a KEYMAP + argument that is not a symbol, this macro defines the variable + MODE-map and gives it the value that KEYMAP specifies. BODY contains code to execute each time the mode is enabled or disabled. It is executed after toggling the mode, and before running MODE-hook. @@ -367,11 +368,13 @@ See `%s' for more information on %s." (progn (add-hook 'after-change-major-mode-hook ',MODE-enable-in-buffers) - (add-hook 'fundamental-mode-hook ',MODE-enable-in-buffers) + (add-hook 'change-major-mode-after-body-hook + ',MODE-enable-in-buffers) (add-hook 'find-file-hook ',MODE-check-buffers) (add-hook 'change-major-mode-hook ',MODE-cmhh)) (remove-hook 'after-change-major-mode-hook ',MODE-enable-in-buffers) - (remove-hook 'fundamental-mode-hook ',MODE-enable-in-buffers) + (remove-hook 'change-major-mode-after-body-hook + ',MODE-enable-in-buffers) (remove-hook 'find-file-hook ',MODE-check-buffers) (remove-hook 'change-major-mode-hook ',MODE-cmhh)) |