1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

Further GV/CL cleanups.

* lisp/emacs-lisp/gv.el (gv-get): Autoload functions to find their
gv-expander.
(gv--defun-declaration): New function.
(defun-declarations-alist): Use it.
(gv-define-modify-macro, gv-pushnew!, gv-inc!, gv-dec!): Remove.
(gv-place): Autoload.
* lisp/emacs-lisp/cl.el (cl--dotimes, cl--dolist): Remember subr.el's
original definition of dotimes and dolist.
* lisp/emacs-lisp/cl-macs.el (cl-expr-access-order): Remove unused.
(cl-dolist, cl-dotimes): Use `dolist' and `dotimes'.
* lisp/emacs-lisp/cl-lib.el: Move gv handlers from cl-macs to here.
(cl-fifth, cl-sixth, cl-seventh, cl-eighth)
(cl-ninth, cl-tenth): Move gv handler to the function's definition.
* lisp/emacs-lisp/cl-extra.el (cl-subseq, cl-get, cl-getf): Move gv handler
to the function's definition.
* lisp/Makefile.in (COMPILE_FIRST): Re-order to speed it up by about 50%.
* lisp/window.el:
* lisp/files.el:
* lisp/faces.el:
* lisp/env.el: Don't use CL.
This commit is contained in:
Stefan Monnier 2012-06-22 17:24:54 -04:00
parent d35af63cd6
commit 36cec983d4
15 changed files with 447 additions and 327 deletions

View file

@ -1,3 +1,27 @@
2012-06-22 Stefan Monnier <monnier@iro.umontreal.ca>
Further GV/CL cleanups.
* emacs-lisp/gv.el (gv-get): Autoload functions to find their
gv-expander.
(gv--defun-declaration): New function.
(defun-declarations-alist): Use it.
(gv-define-modify-macro, gv-pushnew!, gv-inc!, gv-dec!): Remove.
(gv-place): Autoload.
* emacs-lisp/cl.el (cl--dotimes, cl--dolist): Remember subr.el's
original definition of dotimes and dolist.
* emacs-lisp/cl-macs.el (cl-expr-access-order): Remove unused.
(cl-dolist, cl-dotimes): Use `dolist' and `dotimes'.
* emacs-lisp/cl-lib.el: Move gv handlers from cl-macs to here.
(cl-fifth, cl-sixth, cl-seventh, cl-eighth)
(cl-ninth, cl-tenth): Move gv handler to the function's definition.
* emacs-lisp/cl-extra.el (cl-subseq, cl-get, cl-getf): Move gv handler
to the function's definition.
* Makefile.in (COMPILE_FIRST): Re-order to speed it up by about 50%.
* window.el:
* files.el:
* faces.el:
* env.el: Don't use CL.
2012-06-22 Paul Eggert <eggert@cs.ucla.edu> 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
Support higher-resolution time stamps (Bug#9000). Support higher-resolution time stamps (Bug#9000).

View file

@ -92,13 +92,17 @@ BIG_STACK_OPTS = --eval "(setq max-lisp-eval-depth $(BIG_STACK_DEPTH))"
BYTE_COMPILE_FLAGS = $(BIG_STACK_OPTS) $(BYTE_COMPILE_EXTRA_FLAGS) BYTE_COMPILE_FLAGS = $(BIG_STACK_OPTS) $(BYTE_COMPILE_EXTRA_FLAGS)
# Files to compile before others during a bootstrap. This is done to # Files to compile before others during a bootstrap. This is done to
# speed up the bootstrap process. # speed up the bootstrap process. They're ordered by size, so we use
# the slowest-compiler on the smallest file and move to larger files as the
# compiler gets faster. `autoload.elc' comes last because it is not used by
# the compiler (so its compilation does not speed up subsequent compilations),
# it's only placed here so as to speed up generation of the loaddefs.el file.
COMPILE_FIRST = \ COMPILE_FIRST = \
$(lisp)/emacs-lisp/bytecomp.elc \
$(lisp)/emacs-lisp/byte-opt.elc \
$(lisp)/emacs-lisp/macroexp.elc \ $(lisp)/emacs-lisp/macroexp.elc \
$(lisp)/emacs-lisp/cconv.elc \ $(lisp)/emacs-lisp/cconv.elc \
$(lisp)/emacs-lisp/byte-opt.elc \
$(lisp)/emacs-lisp/bytecomp.elc \
$(lisp)/emacs-lisp/autoload.elc $(lisp)/emacs-lisp/autoload.elc
# The actual Emacs command run in the targets below. # The actual Emacs command run in the targets below.

View file

@ -523,6 +523,10 @@ This sets the values of: `cl-most-positive-float', `cl-most-negative-float',
"Return the subsequence of SEQ from START to END. "Return the subsequence of SEQ from START to END.
If END is omitted, it defaults to the length of the sequence. If END is omitted, it defaults to the length of the sequence.
If START or END is negative, it counts from the end." If START or END is negative, it counts from the end."
(declare (gv-setter
(lambda (new)
`(progn (cl-replace ,seq ,new :start1 ,start :end1 ,end)
,new))))
(if (stringp seq) (substring seq start end) (if (stringp seq) (substring seq start end)
(let (len) (let (len)
(and end (< end 0) (setq end (+ end (setq len (length seq))))) (and end (< end 0) (setq end (+ end (setq len (length seq)))))
@ -587,7 +591,8 @@ If START or END is negative, it counts from the end."
(defun cl-get (sym tag &optional def) (defun cl-get (sym tag &optional def)
"Return the value of SYMBOL's PROPNAME property, or DEFAULT if none. "Return the value of SYMBOL's PROPNAME property, or DEFAULT if none.
\n(fn SYMBOL PROPNAME &optional DEFAULT)" \n(fn SYMBOL PROPNAME &optional DEFAULT)"
(declare (compiler-macro cl--compiler-macro-get)) (declare (compiler-macro cl--compiler-macro-get)
(gv-setter (lambda (store) `(put ,sym ,tag ,store))))
(or (get sym tag) (or (get sym tag)
(and def (and def
;; Make sure `def' is really absent as opposed to set to nil. ;; Make sure `def' is really absent as opposed to set to nil.
@ -602,6 +607,15 @@ If START or END is negative, it counts from the end."
"Search PROPLIST for property PROPNAME; return its value or DEFAULT. "Search PROPLIST for property PROPNAME; return its value or DEFAULT.
PROPLIST is a list of the sort returned by `symbol-plist'. PROPLIST is a list of the sort returned by `symbol-plist'.
\n(fn PROPLIST PROPNAME &optional DEFAULT)" \n(fn PROPLIST PROPNAME &optional DEFAULT)"
(declare (gv-expander
(lambda (do)
(gv-letplace (getter setter) plist
(macroexp-let2 nil k tag
(macroexp-let2 nil d def
(funcall do `(cl-getf ,getter ,k ,d)
(lambda (v)
(funcall setter
`(cl--set-getf ,getter ,k ,v))))))))))
(setplist '--cl-getf-symbol-- plist) (setplist '--cl-getf-symbol-- plist)
(or (get '--cl-getf-symbol-- tag) (or (get '--cl-getf-symbol-- tag)
;; Originally we called cl-get here, ;; Originally we called cl-get here,

View file

@ -378,26 +378,32 @@ SEQ, this is like `mapcar'. With several, it is like the Common Lisp
(defsubst cl-fifth (x) (defsubst cl-fifth (x)
"Return the fifth element of the list X." "Return the fifth element of the list X."
(declare (gv-setter (lambda (store) `(setcar (nthcdr 4 ,x) ,store))))
(nth 4 x)) (nth 4 x))
(defsubst cl-sixth (x) (defsubst cl-sixth (x)
"Return the sixth element of the list X." "Return the sixth element of the list X."
(declare (gv-setter (lambda (store) `(setcar (nthcdr 5 ,x) ,store))))
(nth 5 x)) (nth 5 x))
(defsubst cl-seventh (x) (defsubst cl-seventh (x)
"Return the seventh element of the list X." "Return the seventh element of the list X."
(declare (gv-setter (lambda (store) `(setcar (nthcdr 6 ,x) ,store))))
(nth 6 x)) (nth 6 x))
(defsubst cl-eighth (x) (defsubst cl-eighth (x)
"Return the eighth element of the list X." "Return the eighth element of the list X."
(declare (gv-setter (lambda (store) `(setcar (nthcdr 7 ,x) ,store))))
(nth 7 x)) (nth 7 x))
(defsubst cl-ninth (x) (defsubst cl-ninth (x)
"Return the ninth element of the list X." "Return the ninth element of the list X."
(declare (gv-setter (lambda (store) `(setcar (nthcdr 8 ,x) ,store))))
(nth 8 x)) (nth 8 x))
(defsubst cl-tenth (x) (defsubst cl-tenth (x)
"Return the tenth element of the list X." "Return the tenth element of the list X."
(declare (gv-setter (lambda (store) `(setcar (nthcdr 9 ,x) ,store))))
(nth 9 x)) (nth 9 x))
(defun cl-caaar (x) (defun cl-caaar (x)
@ -612,6 +618,108 @@ If ALIST is non-nil, the new pairs are prepended to it."
(nconc (cl-mapcar 'cons keys values) alist)) (nconc (cl-mapcar 'cons keys values) alist))
;;; Generalized variables.
;; These used to be in cl-macs.el since all macros that use them (like setf)
;; were autoloaded from cl-macs.el. But now that setf, push, and pop are in
;; core Elisp, they need to either be right here or be autoloaded via
;; cl-loaddefs.el, which is more trouble than it is worth.
;; Some more Emacs-related place types.
(gv-define-simple-setter buffer-file-name set-visited-file-name t)
(gv-define-setter buffer-modified-p (flag &optional buf)
`(with-current-buffer ,buf
(set-buffer-modified-p ,flag)))
(gv-define-simple-setter buffer-name rename-buffer t)
(gv-define-setter buffer-string (store)
`(progn (erase-buffer) (insert ,store)))
(gv-define-simple-setter buffer-substring cl--set-buffer-substring)
(gv-define-simple-setter current-buffer set-buffer)
(gv-define-simple-setter current-case-table set-case-table)
(gv-define-simple-setter current-column move-to-column t)
(gv-define-simple-setter current-global-map use-global-map t)
(gv-define-setter current-input-mode (store)
`(progn (apply #'set-input-mode ,store) ,store))
(gv-define-simple-setter current-local-map use-local-map t)
(gv-define-simple-setter current-window-configuration
set-window-configuration t)
(gv-define-simple-setter default-file-modes set-default-file-modes t)
(gv-define-simple-setter documentation-property put)
(gv-define-setter face-background (x f &optional s)
`(set-face-background ,f ,x ,s))
(gv-define-setter face-background-pixmap (x f &optional s)
`(set-face-background-pixmap ,f ,x ,s))
(gv-define-setter face-font (x f &optional s) `(set-face-font ,f ,x ,s))
(gv-define-setter face-foreground (x f &optional s)
`(set-face-foreground ,f ,x ,s))
(gv-define-setter face-underline-p (x f &optional s)
`(set-face-underline-p ,f ,x ,s))
(gv-define-simple-setter file-modes set-file-modes t)
(gv-define-simple-setter frame-height set-screen-height t)
(gv-define-simple-setter frame-parameters modify-frame-parameters t)
(gv-define-simple-setter frame-visible-p cl--set-frame-visible-p)
(gv-define-simple-setter frame-width set-screen-width t)
(gv-define-simple-setter getenv setenv t)
(gv-define-simple-setter get-register set-register)
(gv-define-simple-setter global-key-binding global-set-key)
(gv-define-simple-setter local-key-binding local-set-key)
(gv-define-simple-setter mark set-mark t)
(gv-define-simple-setter mark-marker set-mark t)
(gv-define-simple-setter marker-position set-marker t)
(gv-define-setter mouse-position (store scr)
`(set-mouse-position ,scr (car ,store) (cadr ,store)
(cddr ,store)))
(gv-define-simple-setter point goto-char)
(gv-define-simple-setter point-marker goto-char t)
(gv-define-setter point-max (store)
`(progn (narrow-to-region (point-min) ,store) ,store))
(gv-define-setter point-min (store)
`(progn (narrow-to-region ,store (point-max)) ,store))
(gv-define-setter read-mouse-position (store scr)
`(set-mouse-position ,scr (car ,store) (cdr ,store)))
(gv-define-simple-setter screen-height set-screen-height t)
(gv-define-simple-setter screen-width set-screen-width t)
(gv-define-simple-setter selected-window select-window)
(gv-define-simple-setter selected-screen select-screen)
(gv-define-simple-setter selected-frame select-frame)
(gv-define-simple-setter standard-case-table set-standard-case-table)
(gv-define-simple-setter syntax-table set-syntax-table)
(gv-define-simple-setter visited-file-modtime set-visited-file-modtime t)
(gv-define-setter window-height (store)
`(progn (enlarge-window (- ,store (window-height))) ,store))
(gv-define-setter window-width (store)
`(progn (enlarge-window (- ,store (window-width)) t) ,store))
(gv-define-simple-setter x-get-secondary-selection x-own-secondary-selection t)
(gv-define-simple-setter x-get-selection x-own-selection t)
;; More complex setf-methods.
;; This is a hack that allows (setf (eq a 7) B) to mean either
;; (setq a 7) or (setq a nil) depending on whether B is nil or not.
;; This is useful when you have control over the PLACE but not over
;; the VALUE, as is the case in define-minor-mode's :variable.
;; It turned out that :variable needed more flexibility anyway, so
;; this doesn't seem too useful now.
(gv-define-expander eq
(lambda (do place val)
(gv-letplace (getter setter) place
(macroexp-let2 nil val val
(funcall do `(eq ,getter ,val)
(lambda (v)
`(cond
(,v ,(funcall setter val))
((eq ,getter ,val) ,(funcall setter `(not ,val))))))))))
(gv-define-expander substring
(lambda (do place from &optional to)
(gv-letplace (getter setter) place
(macroexp-let2 nil start from
(macroexp-let2 nil end to
(funcall do `(substring ,getter ,start ,end)
(lambda (v)
(funcall setter `(cl--set-substring
,getter ,start ,end ,v)))))))))
;;; Miscellaneous. ;;; Miscellaneous.
;;;###autoload ;;;###autoload

View file

@ -11,7 +11,7 @@
;;;;;; cl--set-frame-visible-p cl--map-overlays cl--map-intervals ;;;;;; cl--set-frame-visible-p cl--map-overlays cl--map-intervals
;;;;;; cl--map-keymap-recursively cl-notevery cl-notany cl-every ;;;;;; cl--map-keymap-recursively cl-notevery cl-notany cl-every
;;;;;; cl-some cl-mapcon cl-mapcan cl-mapl cl-maplist cl-map cl--mapcar-many ;;;;;; cl-some cl-mapcon cl-mapcan cl-mapl cl-maplist cl-map cl--mapcar-many
;;;;;; cl-equalp cl-coerce) "cl-extra" "cl-extra.el" "edc8a08741d81c74be36b27664d3555a") ;;;;;; cl-equalp cl-coerce) "cl-extra" "cl-extra.el" "25963dec757a527e3be3ba7f7abc49ee")
;;; Generated autoloads from cl-extra.el ;;; Generated autoloads from cl-extra.el
(autoload 'cl-coerce "cl-extra" "\ (autoload 'cl-coerce "cl-extra" "\
@ -265,7 +265,7 @@ Remove from SYMBOL's plist the property PROPNAME and its value.
;;;;;; cl-return cl-block cl-etypecase cl-typecase cl-ecase cl-case ;;;;;; cl-return cl-block cl-etypecase cl-typecase cl-ecase cl-case
;;;;;; cl-load-time-value cl-eval-when cl-destructuring-bind cl-function ;;;;;; cl-load-time-value cl-eval-when cl-destructuring-bind cl-function
;;;;;; cl-defmacro cl-defun cl-gentemp cl-gensym) "cl-macs" "cl-macs.el" ;;;;;; cl-defmacro cl-defun cl-gentemp cl-gensym) "cl-macs" "cl-macs.el"
;;;;;; "e37cb1001378ce1d677b67760fb6994b") ;;;;;; "66d8d151a97f91a79ebe3d1a9d699483")
;;; Generated autoloads from cl-macs.el ;;; Generated autoloads from cl-macs.el
(autoload 'cl-gensym "cl-macs" "\ (autoload 'cl-gensym "cl-macs" "\

View file

@ -110,20 +110,6 @@
(defun cl--const-expr-val (x) (defun cl--const-expr-val (x)
(and (macroexp-const-p x) (if (consp x) (nth 1 x) x))) (and (macroexp-const-p x) (if (consp x) (nth 1 x) x)))
(defun cl-expr-access-order (x v)
;; This apparently tries to return nil iff the expression X evaluates
;; the variables V in the same order as they appear in V (so as to
;; be able to replace those vars with the expressions they're bound
;; to).
;; FIXME: This is very naive, it doesn't even check to see if those
;; variables appear more than once.
(if (macroexp-const-p x) v
(if (consp x)
(progn
(while (setq x (cdr x)) (setq v (cl-expr-access-order (car x) v)))
v)
(if (eq x (car v)) (cdr v) '(t)))))
(defun cl--expr-contains (x y) (defun cl--expr-contains (x y)
"Count number of times X refers to Y. Return nil for 0 times." "Count number of times X refers to Y. Return nil for 0 times."
;; FIXME: This is naive, and it will cl-count Y as referred twice in ;; FIXME: This is naive, and it will cl-count Y as referred twice in
@ -1489,30 +1475,9 @@ An implicit nil block is established around the loop.
\(fn (VAR LIST [RESULT]) BODY...)" \(fn (VAR LIST [RESULT]) BODY...)"
(declare (debug ((symbolp form &optional form) cl-declarations body))) (declare (debug ((symbolp form &optional form) cl-declarations body)))
(let ((temp (make-symbol "--cl-dolist-temp--"))) `(cl-block nil
;; FIXME: Copy&pasted from subr.el. (,(if (eq 'cl-dolist (symbol-function 'dolist)) 'cl--dolist 'dolist)
`(cl-block nil ,spec ,@body)))
;; This is not a reliable test, but it does not matter because both
;; semantics are acceptable, tho one is slightly faster with dynamic
;; scoping and the other is slightly faster (and has cleaner semantics)
;; with lexical scoping.
,(if lexical-binding
`(let ((,temp ,(nth 1 spec)))
(while ,temp
(let ((,(car spec) (car ,temp)))
,@body
(setq ,temp (cdr ,temp))))
,@(if (cdr (cdr spec))
;; FIXME: This let often leads to "unused var" warnings.
`((let ((,(car spec) nil)) ,@(cdr (cdr spec))))))
`(let ((,temp ,(nth 1 spec))
,(car spec))
(while ,temp
(setq ,(car spec) (car ,temp))
,@body
(setq ,temp (cdr ,temp)))
,@(if (cdr (cdr spec))
`((setq ,(car spec) nil) ,@(cddr spec))))))))
;;;###autoload ;;;###autoload
(defmacro cl-dotimes (spec &rest body) (defmacro cl-dotimes (spec &rest body)
@ -1523,30 +1488,9 @@ nil.
\(fn (VAR COUNT [RESULT]) BODY...)" \(fn (VAR COUNT [RESULT]) BODY...)"
(declare (debug cl-dolist)) (declare (debug cl-dolist))
(let ((temp (make-symbol "--cl-dotimes-temp--")) `(cl-block nil
(end (nth 1 spec))) (,(if (eq 'cl-dotimes (symbol-function 'dotimes)) 'cl--dotimes 'dotimes)
;; FIXME: Copy&pasted from subr.el. ,spec ,@body)))
`(cl-block nil
;; This is not a reliable test, but it does not matter because both
;; semantics are acceptable, tho one is slightly faster with dynamic
;; scoping and the other has cleaner semantics.
,(if lexical-binding
(let ((counter '--dotimes-counter--))
`(let ((,temp ,end)
(,counter 0))
(while (< ,counter ,temp)
(let ((,(car spec) ,counter))
,@body)
(setq ,counter (1+ ,counter)))
,@(if (cddr spec)
;; FIXME: This let often leads to "unused var" warnings.
`((let ((,(car spec) ,counter)) ,@(cddr spec))))))
`(let ((,temp ,end)
(,(car spec) 0))
(while (< ,(car spec) ,temp)
,@body
(cl-incf ,(car spec)))
,@(cdr (cdr spec)))))))
;;;###autoload ;;;###autoload
(defmacro cl-do-symbols (spec &rest body) (defmacro cl-do-symbols (spec &rest body)
@ -1730,7 +1674,7 @@ by EXPANSION, and (setq NAME ...) will act like (setf EXPANSION ...).
(declare (indent 1) (debug ((&rest (symbol sexp)) cl-declarations body))) (declare (indent 1) (debug ((&rest (symbol sexp)) cl-declarations body)))
(cond (cond
((cdr bindings) ((cdr bindings)
`(cl-symbol-macrolet (,(car bindings)) `(cl-symbol-macrolet (,(car bindings))
(cl-symbol-macrolet ,(cdr bindings) ,@body))) (cl-symbol-macrolet ,(cdr bindings) ,@body)))
((null bindings) (macroexp-progn body)) ((null bindings) (macroexp-progn body))
(t (t
@ -1740,8 +1684,8 @@ by EXPANSION, and (setq NAME ...) will act like (setf EXPANSION ...).
(fset 'macroexpand #'cl--sm-macroexpand) (fset 'macroexpand #'cl--sm-macroexpand)
;; FIXME: For N bindings, this will traverse `body' N times! ;; FIXME: For N bindings, this will traverse `body' N times!
(macroexpand-all (cons 'progn body) (macroexpand-all (cons 'progn body)
(cons (list (symbol-name (caar bindings)) (cons (list (symbol-name (caar bindings))
(cl-cadar bindings)) (cl-cadar bindings))
macroexpand-all-environment))) macroexpand-all-environment)))
(fset 'macroexpand previous-macroexpand)))))) (fset 'macroexpand previous-macroexpand))))))
@ -1864,130 +1808,6 @@ See Info node `(cl)Declarations' for details."
;;; Generalized variables.
;;; Some standard place types from Common Lisp.
(gv-define-setter cl-get (store x y &optional d) `(put ,x ,y ,store))
(gv-define-setter cl-subseq (new seq start &optional end)
`(progn (cl-replace ,seq ,new :start1 ,start :end1 ,end) ,new))
;;; Various car/cdr aliases. Note that `cadr' is handled specially.
(gv-define-setter cl-fourth (store x) `(setcar (cl-cdddr ,x) ,store))
(gv-define-setter cl-fifth (store x) `(setcar (nthcdr 4 ,x) ,store))
(gv-define-setter cl-sixth (store x) `(setcar (nthcdr 5 ,x) ,store))
(gv-define-setter cl-seventh (store x) `(setcar (nthcdr 6 ,x) ,store))
(gv-define-setter cl-eighth (store x) `(setcar (nthcdr 7 ,x) ,store))
(gv-define-setter cl-ninth (store x) `(setcar (nthcdr 8 ,x) ,store))
(gv-define-setter cl-tenth (store x) `(setcar (nthcdr 9 ,x) ,store))
;;; Some more Emacs-related place types.
(gv-define-simple-setter buffer-file-name set-visited-file-name t)
(gv-define-setter buffer-modified-p (flag &optional buf)
`(with-current-buffer ,buf
(set-buffer-modified-p ,flag)))
(gv-define-simple-setter buffer-name rename-buffer t)
(gv-define-setter buffer-string (store)
`(progn (erase-buffer) (insert ,store)))
(gv-define-simple-setter buffer-substring cl--set-buffer-substring)
(gv-define-simple-setter current-buffer set-buffer)
(gv-define-simple-setter current-case-table set-case-table)
(gv-define-simple-setter current-column move-to-column t)
(gv-define-simple-setter current-global-map use-global-map t)
(gv-define-setter current-input-mode (store)
`(progn (apply #'set-input-mode ,store) ,store))
(gv-define-simple-setter current-local-map use-local-map t)
(gv-define-simple-setter current-window-configuration set-window-configuration t)
(gv-define-simple-setter default-file-modes set-default-file-modes t)
(gv-define-simple-setter documentation-property put)
(gv-define-setter face-background (x f &optional s) `(set-face-background ,f ,x ,s))
(gv-define-setter face-background-pixmap (x f &optional s)
`(set-face-background-pixmap ,f ,x ,s))
(gv-define-setter face-font (x f &optional s) `(set-face-font ,f ,x ,s))
(gv-define-setter face-foreground (x f &optional s) `(set-face-foreground ,f ,x ,s))
(gv-define-setter face-underline-p (x f &optional s)
`(set-face-underline-p ,f ,x ,s))
(gv-define-simple-setter file-modes set-file-modes t)
(gv-define-simple-setter frame-height set-screen-height t)
(gv-define-simple-setter frame-parameters modify-frame-parameters t)
(gv-define-simple-setter frame-visible-p cl--set-frame-visible-p)
(gv-define-simple-setter frame-width set-screen-width t)
(gv-define-simple-setter getenv setenv t)
(gv-define-simple-setter get-register set-register)
(gv-define-simple-setter global-key-binding global-set-key)
(gv-define-simple-setter local-key-binding local-set-key)
(gv-define-simple-setter mark set-mark t)
(gv-define-simple-setter mark-marker set-mark t)
(gv-define-simple-setter marker-position set-marker t)
(gv-define-setter mouse-position (store scr)
`(set-mouse-position ,scr (car ,store) (cadr ,store)
(cddr ,store)))
(gv-define-simple-setter point goto-char)
(gv-define-simple-setter point-marker goto-char t)
(gv-define-setter point-max (store)
`(progn (narrow-to-region (point-min) ,store) ,store))
(gv-define-setter point-min (store)
`(progn (narrow-to-region ,store (point-max)) ,store))
(gv-define-setter read-mouse-position (store scr)
`(set-mouse-position ,scr (car ,store) (cdr ,store)))
(gv-define-simple-setter screen-height set-screen-height t)
(gv-define-simple-setter screen-width set-screen-width t)
(gv-define-simple-setter selected-window select-window)
(gv-define-simple-setter selected-screen select-screen)
(gv-define-simple-setter selected-frame select-frame)
(gv-define-simple-setter standard-case-table set-standard-case-table)
(gv-define-simple-setter syntax-table set-syntax-table)
(gv-define-simple-setter visited-file-modtime set-visited-file-modtime t)
(gv-define-setter window-height (store)
`(progn (enlarge-window (- ,store (window-height))) ,store))
(gv-define-setter window-width (store)
`(progn (enlarge-window (- ,store (window-width)) t) ,store))
(gv-define-simple-setter x-get-secondary-selection x-own-secondary-selection t)
(gv-define-simple-setter x-get-selection x-own-selection t)
;;; More complex setf-methods.
;; This is a hack that allows (setf (eq a 7) B) to mean either
;; (setq a 7) or (setq a nil) depending on whether B is nil or not.
;; This is useful when you have control over the PLACE but not over
;; the VALUE, as is the case in define-minor-mode's :variable.
;; It turned out that :variable needed more flexibility anyway, so
;; this doesn't seem too useful now.
(gv-define-expander eq
(lambda (do place val)
(gv-letplace (getter setter) place
(macroexp-let2 nil val val
(funcall do `(eq ,getter ,val)
(lambda (v)
`(cond
(,v ,(funcall setter val))
((eq ,getter ,val) ,(funcall setter `(not ,val))))))))))
(gv-define-expander nthcdr
(lambda (do n place)
(macroexp-let2 nil idx n
(gv-letplace (getter setter) place
(funcall do `(nthcdr ,idx ,getter)
(lambda (v) `(if (<= ,idx 0) ,(funcall setter v)
(setcdr (nthcdr (1- ,idx) ,getter) ,v))))))))
(gv-define-expander cl-getf
(lambda (do place tag &optional def)
(gv-letplace (getter setter) place
(macroexp-let2 nil k tag
(macroexp-let2 nil d def
(funcall do `(cl-getf ,getter ,k ,d)
(lambda (v) (funcall setter `(cl--set-getf ,getter ,k ,v)))))))))
(gv-define-expander substring
(lambda (do place from &optional to)
(gv-letplace (getter setter) place
(macroexp-let2 nil start from
(macroexp-let2 nil end to
(funcall do `(substring ,getter ,start ,end)
(lambda (v)
(funcall setter `(cl--set-substring
,getter ,start ,end ,v)))))))))
;;; The standard modify macros. ;;; The standard modify macros.
;; `setf' is now part of core Elisp, defined in gv.el. ;; `setf' is now part of core Elisp, defined in gv.el.
@ -2571,8 +2391,6 @@ surrounded by (cl-block NAME ...).
;; Compile-time optimizations for some functions defined in this package. ;; Compile-time optimizations for some functions defined in this package.
;; Note that cl.el arranges to force cl-macs to be loaded at compile-time,
;; mainly to make sure these macros will be present.
(defun cl--compiler-macro-member (form a list &rest keys) (defun cl--compiler-macro-member (form a list &rest keys)
(let ((test (and (= (length keys) 2) (eq (car keys) :test) (let ((test (and (= (length keys) 2) (eq (car keys) :test)

View file

@ -107,6 +107,14 @@
)) ))
(defvaralias var (intern (format "cl-%s" var)))) (defvaralias var (intern (format "cl-%s" var))))
;; Before overwriting subr.el's `dotimes' and `dolist', let's remember
;; them under a different name, so we can use them in our implementation
;; of `dotimes' and `dolist'.
(unless (fboundp 'cl--dotimes)
(defalias 'cl--dotimes (symbol-function 'dotimes) "The non-CL `dotimes'."))
(unless (fboundp 'cl--dolist)
(defalias 'cl--dolist (symbol-function 'dolist) "The non-CL `dolist'."))
(dolist (fun '( (dolist (fun '(
(get* . cl-get) (get* . cl-get)
(random* . cl-random) (random* . cl-random)
@ -501,6 +509,10 @@ Unlike `flet', this macro is fully compliant with the Common Lisp standard.
;; not 100% compatible: not worth the trouble to add them to cl-lib.el, but we ;; not 100% compatible: not worth the trouble to add them to cl-lib.el, but we
;; still to support old users of cl.el. ;; still to support old users of cl.el.
;; FIXME: `letf' is unsatisfactory because it does not really "restore" the
;; previous state. If the getter/setter loses information, that info is
;; not recovered.
(defun cl--letf (bindings simplebinds binds body) (defun cl--letf (bindings simplebinds binds body)
;; It's not quite clear what the semantics of let! should be. ;; It's not quite clear what the semantics of let! should be.
;; E.g. in (let! ((PLACE1 VAL1) (PLACE2 VAL2)) BODY), while it's clear ;; E.g. in (let! ((PLACE1 VAL1) (PLACE2 VAL2)) BODY), while it's clear
@ -581,7 +593,9 @@ the PLACE is not modified before executing BODY.
(declare (indent 1) (debug letf)) (declare (indent 1) (debug letf))
(cl--letf* bindings body)) (cl--letf* bindings body))
(defun cl--gv-adapt (cl-gv do) ;FIXME: needed during setf expansion! (defun cl--gv-adapt (cl-gv do)
;; This function is used by all .elc files that use define-setf-expander and
;; were compiled with Emacs>=24.2.
(let ((vars (nth 0 cl-gv)) (let ((vars (nth 0 cl-gv))
(vals (nth 1 cl-gv)) (vals (nth 1 cl-gv))
(binds ()) (binds ())
@ -774,7 +788,5 @@ from ARGLIST using FUNC: (define-modify-macro incf (&optional (n 1)) +)"
,store))) ,store)))
(list accessor temp)))) (list accessor temp))))
;; FIXME: More candidates: define-modify-macro, define-setf-expander.
(provide 'cl) (provide 'cl)
;;; cl.el ends here ;;; cl.el ends here

View file

@ -53,12 +53,6 @@
;; `gv-letplace' macro) is actually much easier and more elegant than the old ;; `gv-letplace' macro) is actually much easier and more elegant than the old
;; approach which is clunky and often leads to unreadable code. ;; approach which is clunky and often leads to unreadable code.
;; FIXME: `let!' is unsatisfactory because it does not really "restore" the
;; previous state. If the getter/setter loses information, that info is
;; not recovered.
;; FIXME: Add to defun-declarations-alist.
;; Food for thought: the syntax of places does not actually conflict with the ;; Food for thought: the syntax of places does not actually conflict with the
;; pcase patterns. The `cons' gv works just like a `(,a . ,b) pcase ;; pcase patterns. The `cons' gv works just like a `(,a . ,b) pcase
;; pattern, and actually the `logand' gv is even closer since it should ;; pattern, and actually the `logand' gv is even closer since it should
@ -91,6 +85,13 @@ DO must return an Elisp expression."
(funcall do place (lambda (v) `(setq ,place ,v))) (funcall do place (lambda (v) `(setq ,place ,v)))
(let* ((head (car place)) (let* ((head (car place))
(gf (get head 'gv-expander))) (gf (get head 'gv-expander)))
;; Autoload the head, if applicable, since that might define
;; `gv-expander'.
(when (and (null gf) (fboundp head)
(eq 'autoload (car-safe (symbol-function head))))
(with-demoted-errors
(load (nth 1 (symbol-function head)) 'noerror 'nomsg)
(setq gf (get head 'gv-expander))))
(if gf (apply gf do (cdr place)) (if gf (apply gf do (cdr place))
(let ((me (macroexpand place ;FIXME: expand one step at a time! (let ((me (macroexpand place ;FIXME: expand one step at a time!
;; (append macroexpand-all-environment ;; (append macroexpand-all-environment
@ -139,23 +140,30 @@ arguments as NAME. DO is a function as defined in `gv-get'."
;; cleanly without affecting the running Emacs. ;; cleanly without affecting the running Emacs.
`(eval-and-compile (put ',name 'gv-expander ,handler))) `(eval-and-compile (put ',name 'gv-expander ,handler)))
;; (eval-and-compile ;;;###autoload
;; (defun gv--defun-declaration (name args handler) (defun gv--defun-declaration (symbol name args handler &optional fix)
;; (pcase handler `(progn
;; (`(lambda (,do) . ,body) ;; No need to autoload this part, since gv-get will auto-load the
;; `(gv-define-expander ,name (lambda (,do ,@args) ,@body))) ;; function's definition before checking the `gv-expander' property.
;; ;; (`(expand ,expander) `(gv-define-expand ,name ,expander)) :autoload-end
;; ;; FIXME: If `setter' is a lambda, give it a name rather ,(pcase (cons symbol handler)
;; ;; than duplicate it at each setf use. (`(gv-expander . (lambda (,do) . ,body))
;; (`(setter ,setter) `(gv-define-simple-setter ,name ,setter)) `(gv-define-expander ,name (lambda (,do ,@args) ,@body)))
;; (`(setter (,arg) . ,body) (`(gv-expander . ,(pred symbolp))
;; `(gv-define-setter ,name (,arg ,@args) ,@body)) `(gv-define-expander ,name #',handler))
;; ;; FIXME: Should we prefer gv-define-simple-setter in this case? (`(gv-setter . (lambda (,store) . ,body))
;; ;;((pred symbolp) `(gv-define-expander ,name #',handler)) `(gv-define-setter ,name (,store ,@args) ,@body))
;; (_ (message "Unknown gv-expander declaration %S" handler) nil))) (`(gv-setter . ,(pred symbolp))
`(gv-define-simple-setter ,name ,handler ,fix))
;; (`(expand ,expander) `(gv-define-expand ,name ,expander))
(_ (message "Unknown %s declaration %S" symbol handler) nil))))
;; (push `(gv-expander ,#'gv--defun-declaration) defun-declarations-alist) ;;;###autoload
;; ) (push `(gv-expander ,(apply-partially #'gv--defun-declaration 'gv-expander))
defun-declarations-alist)
;;;###autoload
(push `(gv-setter ,(apply-partially #'gv--defun-declaration 'gv-setter))
defun-declarations-alist)
;; (defmacro gv-define-expand (name expander) ;; (defmacro gv-define-expand (name expander)
;; "Use EXPANDER to handle NAME as a generalized var. ;; "Use EXPANDER to handle NAME as a generalized var.
@ -212,24 +220,6 @@ so as to preserve the semantics of `setf'."
`(gv-define-setter ,name (val &rest args) `(gv-define-setter ,name (val &rest args)
,(if fix-return `(list 'prog1 val ,set-call) set-call)))) ,(if fix-return `(list 'prog1 val ,set-call) set-call))))
;;; CL compatibility.
(defmacro gv-define-modify-macro (name arglist func &optional doc)
(let* ((args (copy-sequence arglist))
(rest (memq '&rest args)))
(setq args (delq '&optional (delq '&rest args)))
`(defmacro ,name (place ,@arglist)
,doc
(gv-letplace (getter setter) place
(macroexp-let2 nil v
,(list '\`
(append (list func ',getter)
(mapcar (lambda (arg) (list '\, arg)) args)
(if rest (list (list '\,@ (cadr rest))))))
(funcall setter v))))))
(gv-define-simple-setter gv--tree-get gv--tree-set)
;;; Typical operations on generalized variables. ;;; Typical operations on generalized variables.
;;;###autoload ;;;###autoload
@ -251,32 +241,35 @@ The return value is the last VAL in the list.
(while args (push `(setf ,(pop args) ,(pop args)) sets)) (while args (push `(setf ,(pop args) ,(pop args)) sets))
(cons 'progn (nreverse sets))))) (cons 'progn (nreverse sets)))))
(defmacro gv-pushnew! (val place) ;; (defmacro gv-pushnew! (val place)
"Like `gv-push!' but only adds VAL if it's not yet in PLACE. ;; "Like `gv-push!' but only adds VAL if it's not yet in PLACE.
Presence is checked with `member'. ;; Presence is checked with `member'.
The return value is unspecified." ;; The return value is unspecified."
(declare (debug (form gv-place))) ;; (declare (debug (form gv-place)))
(macroexp-let2 macroexp-copyable-p v val ;; (macroexp-let2 macroexp-copyable-p v val
(gv-letplace (getter setter) place ;; (gv-letplace (getter setter) place
`(if (member ,v ,getter) nil ;; `(if (member ,v ,getter) nil
,(funcall setter `(cons ,v ,getter)))))) ;; ,(funcall setter `(cons ,v ,getter))))))
(defmacro gv-inc! (place &optional val)
"Increment PLACE by VAL (default to 1)."
(declare (debug (gv-place &optional form)))
(gv-letplace (getter setter) place
(funcall setter `(+ ,getter ,(or val 1)))))
(defmacro gv-dec! (place &optional val) ;; (defmacro gv-inc! (place &optional val)
"Decrement PLACE by VAL (default to 1)." ;; "Increment PLACE by VAL (default to 1)."
(declare (debug (gv-place &optional form))) ;; (declare (debug (gv-place &optional form)))
(gv-letplace (getter setter) place ;; (gv-letplace (getter setter) place
(funcall setter `(- ,getter ,(or val 1))))) ;; (funcall setter `(+ ,getter ,(or val 1)))))
;; (defmacro gv-dec! (place &optional val)
;; "Decrement PLACE by VAL (default to 1)."
;; (declare (debug (gv-place &optional form)))
;; (gv-letplace (getter setter) place
;; (funcall setter `(- ,getter ,(or val 1)))))
;; For Edebug, the idea is to let Edebug instrument gv-places just like it does ;; For Edebug, the idea is to let Edebug instrument gv-places just like it does
;; for normal expressions, and then give it a gv-expander to DTRT. ;; for normal expressions, and then give it a gv-expander to DTRT.
;; Maybe this should really be in edebug.el rather than here. ;; Maybe this should really be in edebug.el rather than here.
;; Autoload this `put' since a user might use C-u C-M-x on an expression
;; containing a non-trivial `push' even before gv.el was loaded.
;;;###autoload
(put 'gv-place 'edebug-form-spec 'edebug-match-form) (put 'gv-place 'edebug-form-spec 'edebug-match-form)
;; CL did the equivalent of: ;; CL did the equivalent of:
;;(gv-define-expand edebug-after (lambda (before index place) place)) ;;(gv-define-expand edebug-after (lambda (before index place) place))

View file

@ -34,8 +34,6 @@
;;; Code: ;;; Code:
(eval-when-compile (require 'cl))
;; History list for environment variable names. ;; History list for environment variable names.
(defvar read-envvar-name-history nil) (defvar read-envvar-name-history nil)

View file

@ -25,9 +25,6 @@
;;; Code: ;;; Code:
(eval-when-compile
(require 'cl))
(defcustom term-file-prefix (purecopy "term/") (defcustom term-file-prefix (purecopy "term/")
"If non-nil, Emacs startup performs terminal-specific initialization. "If non-nil, Emacs startup performs terminal-specific initialization.
It does this by: (load (concat term-file-prefix (getenv \"TERM\"))) It does this by: (load (concat term-file-prefix (getenv \"TERM\")))
@ -996,28 +993,28 @@ Value is an alist of (NAME . VALUE) if ATTRIBUTE expects a value out
of a set of discrete values. Value is `integerp' if ATTRIBUTE expects of a set of discrete values. Value is `integerp' if ATTRIBUTE expects
an integer value." an integer value."
(let ((valid (let ((valid
(case attribute (pcase attribute
(:family (`:family
(if (window-system frame) (if (window-system frame)
(mapcar (lambda (x) (cons x x)) (mapcar (lambda (x) (cons x x))
(font-family-list)) (font-family-list))
;; Only one font on TTYs. ;; Only one font on TTYs.
(list (cons "default" "default")))) (list (cons "default" "default"))))
(:foundry (`:foundry
(list nil)) (list nil))
(:width (`:width
(mapcar #'(lambda (x) (cons (symbol-name (aref x 1)) (aref x 1))) (mapcar #'(lambda (x) (cons (symbol-name (aref x 1)) (aref x 1)))
font-width-table)) font-width-table))
(:weight (`:weight
(mapcar #'(lambda (x) (cons (symbol-name (aref x 1)) (aref x 1))) (mapcar #'(lambda (x) (cons (symbol-name (aref x 1)) (aref x 1)))
font-weight-table)) font-weight-table))
(:slant (`:slant
(mapcar #'(lambda (x) (cons (symbol-name (aref x 1)) (aref x 1))) (mapcar #'(lambda (x) (cons (symbol-name (aref x 1)) (aref x 1)))
font-slant-table)) font-slant-table))
(:inverse-video (`:inverse-video
(mapcar #'(lambda (x) (cons (symbol-name x) x)) (mapcar #'(lambda (x) (cons (symbol-name x) x))
(internal-lisp-face-attribute-values attribute))) (internal-lisp-face-attribute-values attribute)))
((:underline :overline :strike-through :box) ((or `:underline `:overline `:strike-through `:box)
(if (window-system frame) (if (window-system frame)
(nconc (mapcar #'(lambda (x) (cons (symbol-name x) x)) (nconc (mapcar #'(lambda (x) (cons (symbol-name x) x))
(internal-lisp-face-attribute-values attribute)) (internal-lisp-face-attribute-values attribute))
@ -1025,12 +1022,12 @@ an integer value."
(defined-colors frame))) (defined-colors frame)))
(mapcar #'(lambda (x) (cons (symbol-name x) x)) (mapcar #'(lambda (x) (cons (symbol-name x) x))
(internal-lisp-face-attribute-values attribute)))) (internal-lisp-face-attribute-values attribute))))
((:foreground :background) ((or `:foreground `:background)
(mapcar #'(lambda (c) (cons c c)) (mapcar #'(lambda (c) (cons c c))
(defined-colors frame))) (defined-colors frame)))
((:height) (`:height
'integerp) 'integerp)
(:stipple (`:stipple
(and (memq (window-system frame) '(x ns)) ; No stipple on w32 (and (memq (window-system frame) '(x ns)) ; No stipple on w32
(mapcar #'list (mapcar #'list
(apply #'nconc (apply #'nconc
@ -1039,11 +1036,11 @@ an integer value."
(file-directory-p dir) (file-directory-p dir)
(directory-files dir))) (directory-files dir)))
x-bitmap-file-path))))) x-bitmap-file-path)))))
(:inherit (`:inherit
(cons '("none" . nil) (cons '("none" . nil)
(mapcar #'(lambda (c) (cons (symbol-name c) c)) (mapcar #'(lambda (c) (cons (symbol-name c) c))
(face-list)))) (face-list))))
(t (_
(error "Internal error"))))) (error "Internal error")))))
(if (and (listp valid) (not (memq attribute '(:inherit)))) (if (and (listp valid) (not (memq attribute '(:inherit))))
(nconc (list (cons "unspecified" 'unspecified)) valid) (nconc (list (cons "unspecified" 'unspecified)) valid)

View file

@ -28,8 +28,6 @@
;;; Code: ;;; Code:
(eval-when-compile (require 'cl-lib))
(defvar font-lock-keywords) (defvar font-lock-keywords)
(defgroup backup nil (defgroup backup nil
@ -6464,19 +6462,19 @@ only these files will be asked to be saved."
"/" "/"
(substring (car pair) 2))))) (substring (car pair) 2)))))
(setq file-arg-indices (cdr file-arg-indices)))) (setq file-arg-indices (cdr file-arg-indices))))
(cl-case method (pcase method
(identity (car arguments)) (`identity (car arguments))
(add (concat "/:" (apply operation arguments))) (`add (concat "/:" (apply operation arguments)))
(insert-file-contents (`insert-file-contents
(let ((visit (nth 1 arguments))) (let ((visit (nth 1 arguments)))
(prog1 (prog1
(apply operation arguments) (apply operation arguments)
(when (and visit buffer-file-name) (when (and visit buffer-file-name)
(setq buffer-file-name (concat "/:" buffer-file-name)))))) (setq buffer-file-name (concat "/:" buffer-file-name))))))
(unquote-then-quote (`unquote-then-quote
(let ((buffer-file-name (substring buffer-file-name 2))) (let ((buffer-file-name (substring buffer-file-name 2)))
(apply operation arguments))) (apply operation arguments)))
(t (_
(apply operation arguments))))) (apply operation arguments)))))
;; Symbolic modes and read-file-modes. ;; Symbolic modes and read-file-modes.

View file

@ -2712,7 +2712,7 @@ Like `bug-reference-mode', but only buttonize in comments and strings.
;;;;;; batch-byte-compile-if-not-done display-call-tree byte-compile ;;;;;; batch-byte-compile-if-not-done display-call-tree byte-compile
;;;;;; compile-defun byte-compile-file byte-recompile-directory ;;;;;; compile-defun byte-compile-file byte-recompile-directory
;;;;;; byte-force-recompile byte-compile-enable-warning byte-compile-disable-warning) ;;;;;; byte-force-recompile byte-compile-enable-warning byte-compile-disable-warning)
;;;;;; "bytecomp" "emacs-lisp/bytecomp.el" (20451 21087)) ;;;;;; "bytecomp" "emacs-lisp/bytecomp.el" (20452 43334))
;;; Generated autoloads from emacs-lisp/bytecomp.el ;;; Generated autoloads from emacs-lisp/bytecomp.el
(put 'byte-compile-dynamic 'safe-local-variable 'booleanp) (put 'byte-compile-dynamic 'safe-local-variable 'booleanp)
(put 'byte-compile-disable-print-circle 'safe-local-variable 'booleanp) (put 'byte-compile-disable-print-circle 'safe-local-variable 'booleanp)
@ -2978,8 +2978,8 @@ See the documentation for `calculator-mode' for more information.
;;;*** ;;;***
;;;### (autoloads (calendar) "calendar" "calendar/calendar.el" (20432 ;;;### (autoloads (calendar) "calendar" "calendar/calendar.el" (20452
;;;;;; 42254)) ;;;;;; 43334))
;;; Generated autoloads from calendar/calendar.el ;;; Generated autoloads from calendar/calendar.el
(autoload 'calendar "calendar" "\ (autoload 'calendar "calendar" "\
@ -3699,7 +3699,7 @@ See the documentation of `define-ccl-program' for the detail of CCL program.
;;;*** ;;;***
;;;### (autoloads (cconv-closure-convert) "cconv" "emacs-lisp/cconv.el" ;;;### (autoloads (cconv-closure-convert) "cconv" "emacs-lisp/cconv.el"
;;;;;; (20451 21087)) ;;;;;; (20452 43334))
;;; Generated autoloads from emacs-lisp/cconv.el ;;; Generated autoloads from emacs-lisp/cconv.el
(autoload 'cconv-closure-convert "cconv" "\ (autoload 'cconv-closure-convert "cconv" "\
@ -4121,7 +4121,7 @@ For example, the function `case' has an indent property
;;;*** ;;;***
;;;### (autoloads nil "cl-lib" "emacs-lisp/cl-lib.el" (20451 21087)) ;;;### (autoloads nil "cl-lib" "emacs-lisp/cl-lib.el" (20452 55920))
;;; Generated autoloads from emacs-lisp/cl-lib.el ;;; Generated autoloads from emacs-lisp/cl-lib.el
(define-obsolete-variable-alias 'custom-print-functions 'cl-custom-print-functions "24.2") (define-obsolete-variable-alias 'custom-print-functions 'cl-custom-print-functions "24.2")
@ -6409,7 +6409,7 @@ Optional arguments are passed to `dig-invoke'.
;;;*** ;;;***
;;;### (autoloads (dired-mode dired-noselect dired-other-frame dired-other-window ;;;### (autoloads (dired-mode dired-noselect dired-other-frame dired-other-window
;;;;;; dired dired-listing-switches) "dired" "dired.el" (20428 57510)) ;;;;;; dired dired-listing-switches) "dired" "dired.el" (20452 43334))
;;; Generated autoloads from dired.el ;;; Generated autoloads from dired.el
(defvar dired-listing-switches (purecopy "-al") "\ (defvar dired-listing-switches (purecopy "-al") "\
@ -7402,13 +7402,14 @@ See `ebnf-style-database' documentation.
;;;;;; ebrowse-electric-position-menu ebrowse-forward-in-position-stack ;;;;;; ebrowse-electric-position-menu ebrowse-forward-in-position-stack
;;;;;; ebrowse-back-in-position-stack ebrowse-tags-search-member-use ;;;;;; ebrowse-back-in-position-stack ebrowse-tags-search-member-use
;;;;;; ebrowse-tags-query-replace ebrowse-tags-search ebrowse-tags-loop-continue ;;;;;; ebrowse-tags-query-replace ebrowse-tags-search ebrowse-tags-loop-continue
;;;;;; ebrowse-tags-find-definition-other-frame ebrowse-tags-view-definition-other-frame ;;;;;; ebrowse-tags-complete-symbol ebrowse-tags-find-definition-other-frame
;;;;;; ebrowse-tags-find-declaration-other-frame ebrowse-tags-find-definition-other-window ;;;;;; ebrowse-tags-view-definition-other-frame ebrowse-tags-find-declaration-other-frame
;;;;;; ebrowse-tags-view-definition-other-window ebrowse-tags-find-declaration-other-window ;;;;;; ebrowse-tags-find-definition-other-window ebrowse-tags-view-definition-other-window
;;;;;; ebrowse-tags-find-definition ebrowse-tags-view-definition ;;;;;; ebrowse-tags-find-declaration-other-window ebrowse-tags-find-definition
;;;;;; ebrowse-tags-find-declaration ebrowse-tags-view-declaration ;;;;;; ebrowse-tags-view-definition ebrowse-tags-find-declaration
;;;;;; ebrowse-member-mode ebrowse-electric-choose-tree ebrowse-tree-mode) ;;;;;; ebrowse-tags-view-declaration ebrowse-member-mode ebrowse-electric-choose-tree
;;;;;; "ebrowse" "progmodes/ebrowse.el" (20434 28080)) ;;;;;; ebrowse-tree-mode) "ebrowse" "progmodes/ebrowse.el" (20434
;;;;;; 28080))
;;; Generated autoloads from progmodes/ebrowse.el ;;; Generated autoloads from progmodes/ebrowse.el
(autoload 'ebrowse-tree-mode "ebrowse" "\ (autoload 'ebrowse-tree-mode "ebrowse" "\
@ -7483,6 +7484,14 @@ Find definition of member at point in other frame.
\(fn)" t nil) \(fn)" t nil)
(autoload 'ebrowse-tags-complete-symbol "ebrowse" "\
Perform completion on the C++ symbol preceding point.
A second call of this function without changing point inserts the next match.
A call with prefix PREFIX reads the symbol to insert from the minibuffer with
completion.
\(fn PREFIX)" t nil)
(autoload 'ebrowse-tags-loop-continue "ebrowse" "\ (autoload 'ebrowse-tags-loop-continue "ebrowse" "\
Repeat last operation on files in tree. Repeat last operation on files in tree.
FIRST-TIME non-nil means this is not a repetition, but the first time. FIRST-TIME non-nil means this is not a repetition, but the first time.
@ -8770,7 +8779,7 @@ Look at CONFIG and try to expand GROUP.
;;;*** ;;;***
;;;### (autoloads (erc-handle-irc-url erc-tls erc-select-read-args) ;;;### (autoloads (erc-handle-irc-url erc-tls erc erc-select-read-args)
;;;;;; "erc" "erc/erc.el" (20446 34252)) ;;;;;; "erc" "erc/erc.el" (20446 34252))
;;; Generated autoloads from erc/erc.el ;;; Generated autoloads from erc/erc.el
@ -8779,6 +8788,29 @@ Prompt the user for values of nick, server, port, and password.
\(fn)" nil nil) \(fn)" nil nil)
(autoload 'erc "erc" "\
ERC is a powerful, modular, and extensible IRC client.
This function is the main entry point for ERC.
It permits you to select connection parameters, and then starts ERC.
Non-interactively, it takes the keyword arguments
(server (erc-compute-server))
(port (erc-compute-port))
(nick (erc-compute-nick))
password
(full-name (erc-compute-full-name)))
That is, if called with
(erc :server \"irc.freenode.net\" :full-name \"Harry S Truman\")
then the server and full-name will be set to those values, whereas
`erc-compute-port', `erc-compute-nick' and `erc-compute-full-name' will
be invoked for the values of the other parameters.
\(fn &key (server (erc-compute-server)) (port (erc-compute-port)) (nick (erc-compute-nick)) PASSWORD (full-name (erc-compute-full-name)))" t nil)
(defalias 'erc-select 'erc) (defalias 'erc-select 'erc)
(autoload 'erc-tls "erc" "\ (autoload 'erc-tls "erc" "\
@ -9242,10 +9274,27 @@ Add a file to `erc-xdcc-files'.
;;;*** ;;;***
;;;### (autoloads (ert-describe-test ert-run-tests-interactively ;;;### (autoloads (ert-describe-test ert-run-tests-interactively
;;;;;; ert-run-tests-batch-and-exit ert-run-tests-batch) "ert" "emacs-lisp/ert.el" ;;;;;; ert-run-tests-batch-and-exit ert-run-tests-batch ert-deftest)
;;;;;; (20356 35090)) ;;;;;; "ert" "emacs-lisp/ert.el" (20356 35090))
;;; Generated autoloads from emacs-lisp/ert.el ;;; Generated autoloads from emacs-lisp/ert.el
(autoload 'ert-deftest "ert" "\
Define NAME (a symbol) as a test.
BODY is evaluated as a `progn' when the test is run. It should
signal a condition on failure or just return if the test passes.
`should', `should-not' and `should-error' are useful for
assertions in BODY.
Use `ert' to run tests interactively.
Tests that are expected to fail can be marked as such
using :expected-result. See `ert-test-result-type-p' for a
description of valid values for RESULT-TYPE.
\(fn NAME () [DOCSTRING] [:expected-result RESULT-TYPE] [:tags '(TAG...)] BODY...)" nil (quote macro))
(put 'ert-deftest 'lisp-indent-function 2) (put 'ert-deftest 'lisp-indent-function 2)
(put 'ert-info 'lisp-indent-function 1) (put 'ert-info 'lisp-indent-function 1)
@ -9966,8 +10015,8 @@ Edit the hotlist of directory servers in a specialized buffer.
;;;*** ;;;***
;;;### (autoloads (ewoc-create) "ewoc" "emacs-lisp/ewoc.el" (20451 ;;;### (autoloads (ewoc-create) "ewoc" "emacs-lisp/ewoc.el" (20452
;;;;;; 21087)) ;;;;;; 43334))
;;; Generated autoloads from emacs-lisp/ewoc.el ;;; Generated autoloads from emacs-lisp/ewoc.el
(autoload 'ewoc-create "ewoc" "\ (autoload 'ewoc-create "ewoc" "\
@ -12691,8 +12740,8 @@ it if ARG is omitted or nil.
;;;*** ;;;***
;;;### (autoloads (setf gv-define-simple-setter gv-define-setter ;;;### (autoloads (setf gv-define-simple-setter gv-define-setter
;;;;;; gv-define-expander gv-letplace gv-get) "gv" "emacs-lisp/gv.el" ;;;;;; gv--defun-declaration gv-define-expander gv-letplace gv-get)
;;;;;; (20451 34840)) ;;;;;; "gv" "emacs-lisp/gv.el" (20452 56419))
;;; Generated autoloads from emacs-lisp/gv.el ;;; Generated autoloads from emacs-lisp/gv.el
(autoload 'gv-get "gv" "\ (autoload 'gv-get "gv" "\
@ -12732,6 +12781,15 @@ arguments as NAME. DO is a function as defined in `gv-get'.
(put 'gv-define-expander 'lisp-indent-function '1) (put 'gv-define-expander 'lisp-indent-function '1)
(autoload 'gv--defun-declaration "gv" "\
\(fn SYMBOL NAME ARGS HANDLER &optional FIX)" nil nil)
(push `(gv-expander ,(apply-partially #'gv--defun-declaration 'gv-expander)) defun-declarations-alist)
(push `(gv-setter ,(apply-partially #'gv--defun-declaration 'gv-setter)) defun-declarations-alist)
(autoload 'gv-define-setter "gv" "\ (autoload 'gv-define-setter "gv" "\
Define a setter method for generalized variable NAME. Define a setter method for generalized variable NAME.
This macro is an easy-to-use substitute for `gv-define-expander' that works This macro is an easy-to-use substitute for `gv-define-expander' that works
@ -12767,6 +12825,8 @@ The return value is the last VAL in the list.
\(fn PLACE VAL PLACE VAL ...)" nil t) \(fn PLACE VAL PLACE VAL ...)" nil t)
(put 'gv-place 'edebug-form-spec 'edebug-match-form)
;;;*** ;;;***
;;;### (autoloads (handwrite) "handwrite" "play/handwrite.el" (20318 ;;;### (autoloads (handwrite) "handwrite" "play/handwrite.el" (20318
@ -14004,12 +14064,97 @@ You may also want to set `hfy-page-header' and `hfy-page-footer'.
\(fn SRCDIR DSTDIR &optional F-EXT L-EXT)" t nil) \(fn SRCDIR DSTDIR &optional F-EXT L-EXT)" t nil)
;;;*** ;;;***
;;;### (autoloads (define-ibuffer-filter define-ibuffer-op define-ibuffer-sorter
;;;;;; define-ibuffer-column) "ibuf-macs" "ibuf-macs.el" (20412
;;;;;; 11425))
;;; Generated autoloads from ibuf-macs.el
(autoload 'define-ibuffer-column "ibuf-macs" "\
Define a column SYMBOL for use with `ibuffer-formats'.
BODY will be called with `buffer' bound to the buffer object, and
`mark' bound to the current mark on the buffer. The original ibuffer
buffer will be bound to `ibuffer-buf'.
If NAME is given, it will be used as a title for the column.
Otherwise, the title will default to a capitalized version of the
SYMBOL's name. PROPS is a plist of additional properties to add to
the text, such as `mouse-face'. And SUMMARIZER, if given, is a
function which will be passed a list of all the strings in its column;
it should return a string to display at the bottom.
If HEADER-MOUSE-MAP is given, it will be used as a keymap for the
title of the column.
Note that this macro expands into a `defun' for a function named
ibuffer-make-column-NAME. If INLINE is non-nil, then the form will be
inlined into the compiled format versions. This means that if you
change its definition, you should explicitly call
`ibuffer-recompile-formats'.
\(fn SYMBOL (&key NAME INLINE PROPS SUMMARIZER) &rest BODY)" nil (quote macro))
(autoload 'define-ibuffer-sorter "ibuf-macs" "\
Define a method of sorting named NAME.
DOCUMENTATION is the documentation of the function, which will be called
`ibuffer-do-sort-by-NAME'.
DESCRIPTION is a short string describing the sorting method.
For sorting, the forms in BODY will be evaluated with `a' bound to one
buffer object, and `b' bound to another. BODY should return a non-nil
value if and only if `a' is \"less than\" `b'.
\(fn NAME DOCUMENTATION (&key DESCRIPTION) &rest BODY)" nil (quote macro))
(autoload 'define-ibuffer-op "ibuf-macs" "\
Generate a function which operates on a buffer.
OP becomes the name of the function; if it doesn't begin with
`ibuffer-do-', then that is prepended to it.
When an operation is performed, this function will be called once for
each marked buffer, with that buffer current.
ARGS becomes the formal parameters of the function.
DOCUMENTATION becomes the docstring of the function.
INTERACTIVE becomes the interactive specification of the function.
MARK describes which type of mark (:deletion, or nil) this operation
uses. :deletion means the function operates on buffers marked for
deletion, otherwise it acts on normally marked buffers.
MODIFIER-P describes how the function modifies buffers. This is used
to set the modification flag of the Ibuffer buffer itself. Valid
values are:
nil - the function never modifiers buffers
t - the function it always modifies buffers
:maybe - attempt to discover this information by comparing the
buffer's modification flag.
DANGEROUS is a boolean which should be set if the user should be
prompted before performing this operation.
OPSTRING is a string which will be displayed to the user after the
operation is complete, in the form:
\"Operation complete; OPSTRING x buffers\"
ACTIVE-OPSTRING is a string which will be displayed to the user in a
confirmation message, in the form:
\"Really ACTIVE-OPSTRING x buffers?\"
COMPLEX means this function is special; see the source code of this
macro for exactly what it does.
\(fn OP ARGS DOCUMENTATION (&key INTERACTIVE MARK MODIFIER-P DANGEROUS OPSTRING ACTIVE-OPSTRING COMPLEX) &rest BODY)" nil (quote macro))
(autoload 'define-ibuffer-filter "ibuf-macs" "\
Define a filter named NAME.
DOCUMENTATION is the documentation of the function.
READER is a form which should read a qualifier from the user.
DESCRIPTION is a short string describing the filter.
BODY should contain forms which will be evaluated to test whether or
not a particular buffer should be displayed or not. The forms in BODY
will be evaluated with BUF bound to the buffer object, and QUALIFIER
bound to the current value of the filter.
\(fn NAME DOCUMENTATION (&key READER DESCRIPTION) &rest BODY)" nil (quote macro))
;;;*** ;;;***
;;;### (autoloads nil "ibuf-macs" "ibuf-macs.el" (20412 11425))
;;; Generated autoloads from ibuf-macs.el
;;;### (autoloads (ibuffer ibuffer-other-window ibuffer-list-buffers) ;;;### (autoloads (ibuffer ibuffer-other-window ibuffer-list-buffers)
;;;;;; "ibuffer" "ibuffer.el" (20412 11425)) ;;;;;; "ibuffer" "ibuffer.el" (20412 11425))
;;; Generated autoloads from ibuffer.el ;;; Generated autoloads from ibuffer.el
@ -14104,8 +14249,8 @@ buffer `*icalendar-errors*'.
;;;*** ;;;***
;;;### (autoloads (icomplete-mode) "icomplete" "icomplete.el" (20318 ;;;### (autoloads (icomplete-mode) "icomplete" "icomplete.el" (20452
;;;;;; 5885)) ;;;;;; 44311))
;;; Generated autoloads from icomplete.el ;;; Generated autoloads from icomplete.el
(defvar icomplete-mode nil "\ (defvar icomplete-mode nil "\
@ -16891,7 +17036,7 @@ A major mode to edit m4 macro files.
;;;*** ;;;***
;;;### (autoloads (macroexpand-all) "macroexp" "emacs-lisp/macroexp.el" ;;;### (autoloads (macroexpand-all) "macroexp" "emacs-lisp/macroexp.el"
;;;;;; (20451 34676)) ;;;;;; (20452 43334))
;;; Generated autoloads from emacs-lisp/macroexp.el ;;; Generated autoloads from emacs-lisp/macroexp.el
(autoload 'macroexpand-all "macroexp" "\ (autoload 'macroexpand-all "macroexp" "\
@ -21489,7 +21634,7 @@ Check if KEY is in the cache.
;;;*** ;;;***
;;;### (autoloads (pcase-let pcase-let* pcase) "pcase" "emacs-lisp/pcase.el" ;;;### (autoloads (pcase-let pcase-let* pcase) "pcase" "emacs-lisp/pcase.el"
;;;;;; (20451 34853)) ;;;;;; (20452 43334))
;;; Generated autoloads from emacs-lisp/pcase.el ;;; Generated autoloads from emacs-lisp/pcase.el
(autoload 'pcase "pcase" "\ (autoload 'pcase "pcase" "\
@ -21608,8 +21753,8 @@ Completion for GNU/Linux `mount'.
;;;*** ;;;***
;;;### (autoloads (pcomplete/rpm) "pcmpl-rpm" "pcmpl-rpm.el" (20373 ;;;### (autoloads (pcomplete/rpm) "pcmpl-rpm" "pcmpl-rpm.el" (20452
;;;;;; 41604)) ;;;;;; 43334))
;;; Generated autoloads from pcmpl-rpm.el ;;; Generated autoloads from pcmpl-rpm.el
(autoload 'pcomplete/rpm "pcmpl-rpm" "\ (autoload 'pcomplete/rpm "pcmpl-rpm" "\
@ -23262,7 +23407,8 @@ of each directory.
;;;### (autoloads (quickurl-list quickurl-list-mode quickurl-edit-urls ;;;### (autoloads (quickurl-list quickurl-list-mode quickurl-edit-urls
;;;;;; quickurl-browse-url-ask quickurl-browse-url quickurl-add-url ;;;;;; quickurl-browse-url-ask quickurl-browse-url quickurl-add-url
;;;;;; quickurl-ask) "quickurl" "net/quickurl.el" (20356 35090)) ;;;;;; quickurl-ask quickurl) "quickurl" "net/quickurl.el" (20356
;;;;;; 35090))
;;; Generated autoloads from net/quickurl.el ;;; Generated autoloads from net/quickurl.el
(defconst quickurl-reread-hook-postfix "\n;; Local Variables:\n;; eval: (progn (require 'quickurl) (add-hook 'local-write-file-hooks (lambda () (quickurl-read) nil)))\n;; End:\n" "\ (defconst quickurl-reread-hook-postfix "\n;; Local Variables:\n;; eval: (progn (require 'quickurl) (add-hook 'local-write-file-hooks (lambda () (quickurl-read) nil)))\n;; End:\n" "\
@ -23276,6 +23422,15 @@ To make use of this do something like:
in your ~/.emacs (after loading/requiring quickurl).") in your ~/.emacs (after loading/requiring quickurl).")
(autoload 'quickurl "quickurl" "\
Insert a URL based on LOOKUP.
If not supplied LOOKUP is taken to be the word at point in the current
buffer, this default action can be modified via
`quickurl-grab-lookup-function'.
\(fn &optional LOOKUP)" t nil)
(autoload 'quickurl-ask "quickurl" "\ (autoload 'quickurl-ask "quickurl" "\
Insert a URL, with `completing-read' prompt, based on LOOKUP. Insert a URL, with `completing-read' prompt, based on LOOKUP.
@ -24785,8 +24940,8 @@ enclosed in `(and ...)'.
;;;*** ;;;***
;;;### (autoloads (savehist-mode) "savehist" "savehist.el" (20318 ;;;### (autoloads (savehist-mode) "savehist" "savehist.el" (20452
;;;;;; 5885)) ;;;;;; 43636))
;;; Generated autoloads from savehist.el ;;; Generated autoloads from savehist.el
(defvar savehist-mode nil "\ (defvar savehist-mode nil "\
@ -32255,7 +32410,7 @@ this is equivalent to `display-warning', using
;;;*** ;;;***
;;;### (autoloads (wdired-change-to-wdired-mode) "wdired" "wdired.el" ;;;### (autoloads (wdired-change-to-wdired-mode) "wdired" "wdired.el"
;;;;;; (20244 35516)) ;;;;;; (20452 43334))
;;; Generated autoloads from wdired.el ;;; Generated autoloads from wdired.el
(autoload 'wdired-change-to-wdired-mode "wdired" "\ (autoload 'wdired-change-to-wdired-mode "wdired" "\
@ -32850,7 +33005,7 @@ Default MODIFIER is 'shift.
;;;*** ;;;***
;;;### (autoloads (winner-mode winner-mode) "winner" "winner.el" ;;;### (autoloads (winner-mode winner-mode) "winner" "winner.el"
;;;;;; (20244 35516)) ;;;;;; (20452 43334))
;;; Generated autoloads from winner.el ;;; Generated autoloads from winner.el
(defvar winner-mode nil "\ (defvar winner-mode nil "\
@ -33379,7 +33534,7 @@ Zone out, completely.
;;;;;; "vc/ediff-ptch.el" "vc/ediff-vers.el" "vc/ediff-wind.el" ;;;;;; "vc/ediff-ptch.el" "vc/ediff-vers.el" "vc/ediff-wind.el"
;;;;;; "vc/pcvs-info.el" "vc/pcvs-parse.el" "vc/pcvs-util.el" "vc/vc-dav.el" ;;;;;; "vc/pcvs-info.el" "vc/pcvs-parse.el" "vc/pcvs-util.el" "vc/vc-dav.el"
;;;;;; "vcursor.el" "vt-control.el" "vt100-led.el" "w32-fns.el" ;;;;;; "vcursor.el" "vt-control.el" "vt100-led.el" "w32-fns.el"
;;;;;; "w32-vars.el" "x-dnd.el") (20451 34928 615251)) ;;;;;; "w32-vars.el" "x-dnd.el") (20452 56581 711508))
;;;*** ;;;***

View file

@ -123,8 +123,8 @@ altering `command-line-args-left' to remove them.")
"Default directory to use for command line arguments. "Default directory to use for command line arguments.
This is normally copied from `default-directory' when Emacs starts.") This is normally copied from `default-directory' when Emacs starts.")
;;; This is here, rather than in x-win.el, so that we can ignore these ;; This is here, rather than in x-win.el, so that we can ignore these
;;; options when we are not using X. ;; options when we are not using X.
(defconst command-line-x-option-alist (defconst command-line-x-option-alist
'(("-bw" 1 x-handle-numeric-switch border-width) '(("-bw" 1 x-handle-numeric-switch border-width)
("-d" 1 x-handle-display) ("-d" 1 x-handle-display)

View file

@ -272,6 +272,7 @@ the return value (nil if RESULT is omitted).
"Do not evaluate any arguments and return nil. "Do not evaluate any arguments and return nil.
Treated as a declaration when used at the right place in a Treated as a declaration when used at the right place in a
`defmacro' form. \(See Info anchor `(elisp)Definition of declare'.)" `defmacro' form. \(See Info anchor `(elisp)Definition of declare'.)"
;; FIXME: edebug spec should pay attention to defun-declarations-alist.
nil) nil)
)) ))

View file

@ -28,8 +28,6 @@
;;; Code: ;;; Code:
(eval-when-compile (require 'cl))
(defmacro save-selected-window (&rest body) (defmacro save-selected-window (&rest body)
"Execute BODY, then select the previously selected window. "Execute BODY, then select the previously selected window.
The value returned is the value of the last form in BODY. The value returned is the value of the last form in BODY.
@ -2557,7 +2555,7 @@ This may be a useful alternative binding for \\[delete-other-windows]
(while (not (eq (setq w (next-window w 1)) window)) (while (not (eq (setq w (next-window w 1)) window))
(let ((e (window-edges w))) (let ((e (window-edges w)))
(when (and (= (car e) (car edges)) (when (and (= (car e) (car edges))
(= (caddr e) (caddr edges))) (= (nth 2 e) (nth 2 edges)))
(push w delenda)))) (push w delenda))))
(mapc 'delete-window delenda))) (mapc 'delete-window delenda)))