/[emacs]/emacs/lisp/mh-e/mh-acros.el
ViewVC logotype

Diff of /emacs/lisp/mh-e/mh-acros.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5.4.1 by miles, Sat Sep 4 09:23:51 2004 UTC revision 1.5.4.2 by miles, Sat Sep 4 09:26:23 2004 UTC
# Line 51  Some versions of `cl' produce code for t Line 51  Some versions of `cl' produce code for t
51  \(setf (gethash ...) ...) that uses functions in `cl' at run time.  This macro  \(setf (gethash ...) ...) that uses functions in `cl' at run time.  This macro
52  recognizes that and loads `cl' where appropriate."  recognizes that and loads `cl' where appropriate."
53    (if (eq (car (macroexpand '(setf (gethash foo bar) baz))) 'cl-puthash)    (if (eq (car (macroexpand '(setf (gethash foo bar) baz))) 'cl-puthash)
54        `(progn        `(require 'cl)
          (require 'cl)  
          ;; Autoloads of CL functions go here...  
          (autoload 'cl-puthash "cl")  
          (autoload 'values "cl")  
          (autoload 'copy-tree "cl"))  
55      `(eval-when-compile (require 'cl))))      `(eval-when-compile (require 'cl))))
56    
57  ;;; Macros to generate correct code for different emacs variants  ;;; Macros to generate correct code for different emacs variants
# Line 121  various structure fields. Lookup `defstr Line 116  various structure fields. Lookup `defstr
116      `(progn      `(progn
117         (defun* ,constructor (&key ,@(mapcar* #'(lambda (x y) (list x y))         (defun* ,constructor (&key ,@(mapcar* #'(lambda (x y) (list x y))
118                                               field-names field-init-forms))                                               field-names field-init-forms))
119           (list ,@field-names))           (list (quote ,struct-name) ,@field-names))
120         (defun ,predicate (arg)         (defun ,predicate (arg)
121           (and (consp arg) (eql (length arg) ,(length fields))))           (and (consp arg) (eq (car arg) (quote ,struct-name))))
122         ,@(loop for x from 0         ,@(loop for x from 1
123                 for y in field-names                 for y in field-names
124                 collect `(defmacro ,(intern (format "%s%s" conc-name y)) (z)                 collect `(defmacro ,(intern (format "%s%s" conc-name y)) (z)
125                            (list 'nth ,x z)))                            (list 'nth ,x z)))
126         (quote ,struct-name))))         (quote ,struct-name))))
127    
128    (defadvice require (around mh-prefer-el activate)
129      "Modify `require' to load uncompiled MH-E files."
130      (or (featurep (ad-get-arg 0))
131          (and (string-match "^mh-" (symbol-name (ad-get-arg 0)))
132               (load (format "%s.el" (ad-get-arg 0)) t t))
133          ad-do-it))
134    
135  (provide 'mh-acros)  (provide 'mh-acros)
136    

Legend:
Removed from v.1.5.4.1  
changed lines
  Added in v.1.5.4.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26