all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* emacs-lisp/cl-*.el and requirement of cl
@ 2008-07-03 21:30 Glenn Morris
  2008-07-03 22:04 ` Miles Bader
  0 siblings, 1 reply; 2+ messages in thread
From: Glenn Morris @ 2008-07-03 21:30 UTC (permalink / raw)
  To: emacs-devel


Does anyone know why emacs-lisp/cl-compat.el does this:

  ;; Require at load-time, but not when compiling cl-compat.
  (or (featurep 'cl) (require 'cl))

rather than just a simple "(require 'cl)"?

Similarly, cl-macs and cl-seq throw errors if loaded without cl being
loaded first. Is there any reason not to just make them require cl?
I know just doing it naively can lead to a recursive require, but that
is easily worked around, eg:


*** cl.el	12 May 2008 01:45:41 -0000	1.63
--- cl.el	3 Jul 2008 21:29:27 -0000
***************
*** 632,648 ****
  
  ;; This goes here so that cl-macs can find it if it loads right now.
  (provide 'cl-19)     ; usage: (require 'cl-19 "cl")
  
  ;; Things to do after byte-compiler is loaded.
- ;; As a side effect, we cause cl-macs to be loaded when compiling, so
- ;; that the compiler-macros defined there will be present.
  
  (defvar cl-hacked-flag nil)
  (defun cl-hack-byte-compiler ()
!   (if (and (not cl-hacked-flag) (fboundp 'byte-compile-file-form))
!       (progn
! 	(setq cl-hacked-flag t)		; Do it first, to prevent recursion.
! 	(cl-compile-time-init))))	; In cl-macs.el.
  
  ;; Try it now in case the compiler has already been loaded.
  (cl-hack-byte-compiler)
--- 632,648 ----
  
  ;; This goes here so that cl-macs can find it if it loads right now.
  (provide 'cl-19)     ; usage: (require 'cl-19 "cl")
+ (provide 'cl)
  
  ;; Things to do after byte-compiler is loaded.
  
  (defvar cl-hacked-flag nil)
  (defun cl-hack-byte-compiler ()
!   (and (not cl-hacked-flag) (fboundp 'byte-compile-file-form)
!        (progn
!          (setq cl-hacked-flag t)  ; Do it first, to prevent recursion.
!          (load "cl-macs" nil t)
!          (run-hooks 'cl-hack-bytecomp-hook))))
  
  ;; Try it now in case the compiler has already been loaded.
  (cl-hack-byte-compiler)




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-07-03 22:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-03 21:30 emacs-lisp/cl-*.el and requirement of cl Glenn Morris
2008-07-03 22:04 ` Miles Bader

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.