Merge from emacs--devo--0

Patches applied:

 * emacs--devo--0  (patch 698-710)

   - Update from CVS
   - Merge from gnus--rel--5.10

 * gnus--rel--5.10  (patch 216)

   - Update from CVS

Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-196
This commit is contained in:
Miles Bader 2007-04-24 21:56:25 +00:00
commit 991a760232
231 changed files with 4286 additions and 5169 deletions

View file

@ -557,8 +557,20 @@
;; Otherwise, no args can be considered to be for-effect,
;; even if the called function is for-effect, because we
;; don't know anything about that function.
(cons fn (mapcar 'byte-optimize-form (cdr form)))))))
(let ((args (mapcar #'byte-optimize-form (cdr form))))
(if (and (get fn 'pure)
(byte-optimize-all-constp args))
(list 'quote (apply fn (mapcar #'eval args)))
(cons fn args)))))))
(defun byte-optimize-all-constp (list)
"Non-nil iff all elements of LIST satisfy `byte-compile-constp'."
(let ((constant t))
(while (and list constant)
(unless (byte-compile-constp (car list))
(setq constant nil))
(setq list (cdr list)))
constant))
(defun byte-optimize-form (form &optional for-effect)
"The source-level pass of the optimizer."
@ -1117,26 +1129,6 @@
(byte-optimize-predicate form))
form))
;; Avoid having to write forward-... with a negative arg for speed.
;; Fixme: don't be limited to constant args.
(put 'backward-char 'byte-optimizer 'byte-optimize-backward-char)
(defun byte-optimize-backward-char (form)
(cond ((and (= 2 (safe-length form))
(numberp (nth 1 form)))
(list 'forward-char (eval (- (nth 1 form)))))
((= 1 (safe-length form))
'(forward-char -1))
(t form)))
(put 'backward-word 'byte-optimizer 'byte-optimize-backward-word)
(defun byte-optimize-backward-word (form)
(cond ((and (= 2 (safe-length form))
(numberp (nth 1 form)))
(list 'forward-word (eval (- (nth 1 form)))))
((= 1 (safe-length form))
'(forward-word -1))
(t form)))
;; Fixme: delete-char -> delete-region (byte-coded)
;; optimize string-as-unibyte, string-as-multibyte, string-make-unibyte,
;; string-make-multibyte for constant args.
@ -1266,6 +1258,18 @@
(setq side-effect-and-error-free-fns (cdr side-effect-and-error-free-fns)))
nil)
;; pure functions are side-effect free functions whose values depend
;; only on their arguments. For these functions, calls with constant
;; arguments can be evaluated at compile time. This may shift run time
;; errors to compile time.
(let ((pure-fns
'(concat symbol-name regexp-opt regexp-quote string-to-syntax)))
(while pure-fns
(put (car pure-fns) 'pure t)
(setq pure-fns (cdr pure-fns)))
nil)
(defun byte-compile-splice-in-already-compiled-code (form)
;; form is (byte-code "..." [...] n)

View file

@ -3149,6 +3149,8 @@ That command is designed for interactive use only" fn))
;; more complicated compiler macros
(byte-defop-compiler char-before)
(byte-defop-compiler backward-char)
(byte-defop-compiler backward-word)
(byte-defop-compiler list)
(byte-defop-compiler concat)
(byte-defop-compiler fset)
@ -3162,10 +3164,31 @@ That command is designed for interactive use only" fn))
(defun byte-compile-char-before (form)
(cond ((= 2 (length form))
(byte-compile-form `(char-after (1- ,(nth 1 form)))))
((= 1 (length form))
(byte-compile-form '(char-after (1- (point)))))
(t (byte-compile-subr-wrong-args form "0-1"))))
(byte-compile-form (list 'char-after (if (numberp (nth 1 form))
(1- (nth 1 form))
`(1- ,(nth 1 form))))))
((= 1 (length form))
(byte-compile-form '(char-after (1- (point)))))
(t (byte-compile-subr-wrong-args form "0-1"))))
;; backward-... ==> forward-... with negated argument.
(defun byte-compile-backward-char (form)
(cond ((= 2 (length form))
(byte-compile-form (list 'forward-char (if (numberp (nth 1 form))
(- (nth 1 form))
`(- ,(nth 1 form))))))
((= 1 (length form))
(byte-compile-form '(forward-char -1)))
(t (byte-compile-subr-wrong-args form "0-1"))))
(defun byte-compile-backward-word (form)
(cond ((= 2 (length form))
(byte-compile-form (list 'forward-word (if (numberp (nth 1 form))
(- (nth 1 form))
`(- ,(nth 1 form))))))
((= 1 (length form))
(byte-compile-form '(forward-word -1)))
(t (byte-compile-subr-wrong-args form "0-1"))))
(defun byte-compile-list (form)
(let ((count (length (cdr form))))

View file

@ -327,11 +327,12 @@ call another major mode in their body."
(make-variable-buffer-local ',MODE-major-mode)
;; The actual global minor-mode
(define-minor-mode ,global-mode
,(format "Toggle %s in every buffer.
,(format "Toggle %s in every possible buffer.
With prefix ARG, turn %s on if and only if ARG is positive.
%s is actually not turned on in every buffer but only in those
in which `%s' turns it on."
pretty-name pretty-global-name pretty-name turn-on)
%s is enabled in all buffers where `%s' would do it.
See `%s' for more information on %s."
pretty-name pretty-global-name pretty-name turn-on
mode pretty-name)
:global t ,@group ,@(nreverse extra-keywords)
;; Setup hook to handle future mode changes and new buffers.

View file

@ -364,31 +364,39 @@ Return the result of the last expression in BODY."
(defun edebug-pop-to-buffer (buffer &optional window)
;; Like pop-to-buffer, but select window where BUFFER was last shown.
;; Select WINDOW if it provided and it still exists. Otherwise,
;; Select WINDOW if it is provided and still exists. Otherwise,
;; if buffer is currently shown in several windows, choose one.
;; Otherwise, find a new window, possibly splitting one.
(setq window (if (and (windowp window) (edebug-window-live-p window)
(eq (window-buffer window) buffer))
window
(if (eq (window-buffer (selected-window)) buffer)
(selected-window)
(edebug-get-buffer-window buffer))))
(if window
(select-window window)
(if (one-window-p)
(split-window))
;; (message "next window: %s" (next-window)) (sit-for 1)
(if (eq (get-buffer-window edebug-trace-buffer) (next-window))
;; Don't select trace window
nil
(select-window (next-window))))
(set-window-buffer (selected-window) buffer)
(set-window-hscroll (selected-window) 0);; should this be??
(setq window
(cond
((and (windowp window) (edebug-window-live-p window)
(eq (window-buffer window) buffer))
window)
((eq (window-buffer (selected-window)) buffer)
;; Selected window already displays BUFFER.
(selected-window))
((edebug-get-buffer-window buffer))
((one-window-p 'nomini)
;; When there's one window only, split it.
(split-window))
((let ((trace-window (get-buffer-window edebug-trace-buffer)))
(catch 'found
(dolist (elt (window-list nil 'nomini))
(unless (or (eq elt (selected-window)) (eq elt trace-window)
(window-dedicated-p elt))
;; Found a non-dedicated window not showing
;; `edebug-trace-buffer', use it.
(throw 'found elt))))))
;; All windows are dedicated or show `edebug-trace-buffer', split
;; selected one.
(t (split-window))))
(select-window window)
(set-window-buffer window buffer)
(set-window-hscroll window 0);; should this be??
;; Selecting the window does not set the buffer until command loop.
;;(set-buffer buffer)
)
(defun edebug-get-displayed-buffer-points ()
;; Return a list of buffer point pairs, for all displayed buffers.
(let (list)