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 |
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 |
|
|