aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoakim Verona2012-06-19 19:19:07 +0200
committerJoakim Verona2012-06-19 19:19:07 +0200
commitabef2047941f87ae4baa34b3a8675de4d0068b7a (patch)
tree63042e6c3037100412816200e03c04affc7fe071
parent58a90697e8f15a2722100ac489df200ad31d3086 (diff)
parent68f12411893785de1cfc2c24ec36059e49af5d55 (diff)
downloademacs-abef2047941f87ae4baa34b3a8675de4d0068b7a.tar.gz
emacs-abef2047941f87ae4baa34b3a8675de4d0068b7a.zip
upstream
-rw-r--r--doc/lispref/ChangeLog6
-rw-r--r--doc/lispref/functions.texi18
-rw-r--r--doc/lispref/macros.texi9
-rw-r--r--etc/NEWS4
-rw-r--r--lisp/ChangeLog38
-rw-r--r--lisp/emacs-lisp/byte-run.el4
-rw-r--r--lisp/emacs-lisp/pcase.el32
-rw-r--r--lisp/emulation/edt.el24
-rw-r--r--lisp/gnus/ChangeLog4
-rw-r--r--lisp/gnus/gnus-win.el4
-rw-r--r--lisp/minibuffer.el5
-rw-r--r--lisp/progmodes/python.el42
-rw-r--r--lisp/subr.el27
-rw-r--r--lisp/window.el22
-rw-r--r--src/ChangeLog53
-rw-r--r--src/bytecode.c18
-rw-r--r--src/data.c15
-rw-r--r--src/frame.c36
-rw-r--r--src/term.c22
-rw-r--r--src/xdisp.c62
20 files changed, 301 insertions, 144 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 0439cf2be57..89efb5c6255 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,9 @@
12012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * functions.texi (Defining Functions):
4 * macros.texi (Defining Macros): Un-define the return value of `defun',
5 `defmacro' and `defalias'.
6
12012-06-17 Chong Yidong <cyd@gnu.org> 72012-06-17 Chong Yidong <cyd@gnu.org>
2 8
3 * elisp.texi: Remove urlcolor setting. 9 * elisp.texi: Remove urlcolor setting.
diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi
index 5fba243f65f..ab2789b5e6d 100644
--- a/doc/lispref/functions.texi
+++ b/doc/lispref/functions.texi
@@ -530,8 +530,7 @@ defines the symbol @var{name} as a function that looks like this:
530@end example 530@end example
531 531
532@code{defun} stores this lambda expression in the function cell of 532@code{defun} stores this lambda expression in the function cell of
533@var{name}. It returns the value @var{name}, but usually we ignore this 533@var{name}. Its return value is @emph{undefined}.
534value.
535 534
536As described previously, @var{argument-list} is a list of argument 535As described previously, @var{argument-list} is a list of argument
537names and may include the keywords @code{&optional} and @code{&rest}. 536names and may include the keywords @code{&optional} and @code{&rest}.
@@ -543,9 +542,6 @@ Here are some examples:
543@example 542@example
544@group 543@group
545(defun foo () 5) 544(defun foo () 5)
546 @result{} foo
547@end group
548@group
549(foo) 545(foo)
550 @result{} 5 546 @result{} 5
551@end group 547@end group
@@ -553,9 +549,6 @@ Here are some examples:
553@group 549@group
554(defun bar (a &optional b &rest c) 550(defun bar (a &optional b &rest c)
555 (list a b c)) 551 (list a b c))
556 @result{} bar
557@end group
558@group
559(bar 1 2 3 4 5) 552(bar 1 2 3 4 5)
560 @result{} (1 2 (3 4 5)) 553 @result{} (1 2 (3 4 5))
561@end group 554@end group
@@ -576,7 +569,6 @@ Here are some examples:
576 (forward-word 1) 569 (forward-word 1)
577 (backward-char 1) 570 (backward-char 1)
578 (capitalize-word 1)) 571 (capitalize-word 1))
579 @result{} capitalize-backwards
580@end group 572@end group
581@end example 573@end example
582 574
@@ -593,7 +585,7 @@ redefinition from unintentional redefinition.
593@anchor{Definition of defalias} 585@anchor{Definition of defalias}
594This special form defines the symbol @var{name} as a function, with 586This special form defines the symbol @var{name} as a function, with
595definition @var{definition} (which can be any valid Lisp function). 587definition @var{definition} (which can be any valid Lisp function).
596It returns @var{definition}. 588Its return value is @emph{undefined}.
597 589
598If @var{docstring} is non-@code{nil}, it becomes the function 590If @var{docstring} is non-@code{nil}, it becomes the function
599documentation of @var{name}. Otherwise, any documentation provided by 591documentation of @var{name}. Otherwise, any documentation provided by
@@ -1015,9 +1007,6 @@ function.
1015@example 1007@example
1016@group 1008@group
1017(defun bar (n) (+ n 2)) 1009(defun bar (n) (+ n 2))
1018 @result{} bar
1019@end group
1020@group
1021(symbol-function 'bar) 1010(symbol-function 'bar)
1022 @result{} (lambda (n) (+ n 2)) 1011 @result{} (lambda (n) (+ n 2))
1023@end group 1012@end group
@@ -1063,9 +1052,6 @@ subsequent attempt to access this cell will cause a
1063@example 1052@example
1064@group 1053@group
1065(defun foo (x) x) 1054(defun foo (x) x)
1066 @result{} foo
1067@end group
1068@group
1069(foo 1) 1055(foo 1)
1070 @result{}1 1056 @result{}1
1071@end group 1057@end group
diff --git a/doc/lispref/macros.texi b/doc/lispref/macros.texi
index b9b0e03c65a..efe298bf647 100644
--- a/doc/lispref/macros.texi
+++ b/doc/lispref/macros.texi
@@ -113,7 +113,6 @@ uses this feature.
113@group 113@group
114(defmacro inc (var) 114(defmacro inc (var)
115 (list 'setq var (list '1+ var))) 115 (list 'setq var (list '1+ var)))
116 @result{} inc
117@end group 116@end group
118 117
119@group 118@group
@@ -124,7 +123,6 @@ uses this feature.
124@group 123@group
125(defmacro inc2 (var1 var2) 124(defmacro inc2 (var1 var2)
126 (list 'progn (list 'inc var1) (list 'inc var2))) 125 (list 'progn (list 'inc var1) (list 'inc var2)))
127 @result{} inc2
128@end group 126@end group
129 127
130@group 128@group
@@ -207,9 +205,8 @@ like this:
207@end example 205@end example
208 206
209(Note that the @sc{cdr} of this list is a function---a lambda expression.) 207(Note that the @sc{cdr} of this list is a function---a lambda expression.)
210This macro object is stored in the function cell of @var{name}. The 208This macro object is stored in the function cell of @var{name}. Its return
211value returned by evaluating the @code{defmacro} form is @var{name}, but 209value is @emph{undefined}.
212usually we ignore this value.
213 210
214The shape and meaning of @var{argument-list} is the same as in a 211The shape and meaning of @var{argument-list} is the same as in a
215function, and the keywords @code{&rest} and @code{&optional} may be used 212function, and the keywords @code{&rest} and @code{&optional} may be used
@@ -342,7 +339,6 @@ For example, (for i from 1 to 10 do (print i))."
342 (cons (list '<= var final) 339 (cons (list '<= var final)
343 (append body (list (list 'inc var))))))) 340 (append body (list (list 'inc var)))))))
344@end group 341@end group
345@result{} for
346 342
347@group 343@group
348(for i from 1 to 3 do 344(for i from 1 to 3 do
@@ -512,7 +508,6 @@ it. Here is an example:
512@group 508@group
513(defmacro foo (a) 509(defmacro foo (a)
514 (list 'setq (eval a) t)) 510 (list 'setq (eval a) t))
515 @result{} foo
516@end group 511@end group
517@group 512@group
518(setq x 'b) 513(setq x 'b)
diff --git a/etc/NEWS b/etc/NEWS
index c469c7951ed..a2f3b95fe41 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -429,6 +429,8 @@ still be supported for Emacs 24.x.
429 429
430* Lisp changes in Emacs 24.2 430* Lisp changes in Emacs 24.2
431 431
432** The return value of `defalias' has changed and is now undefined.
433
432** `defun' also accepts a (declare DECLS) form, like `defmacro'. 434** `defun' also accepts a (declare DECLS) form, like `defmacro'.
433The interpretation of the DECLS is determined by `defun-declarations-alist'. 435The interpretation of the DECLS is determined by `defun-declarations-alist'.
434 436
@@ -471,6 +473,8 @@ is detected.
471Emacs now supports mouse highlight, help-echo (in the echo area), and 473Emacs now supports mouse highlight, help-echo (in the echo area), and
472mouse-autoselect-window. 474mouse-autoselect-window.
473 475
476** New function `tty-top-frame' returns the topmost frame of a text terminal.
477
474 478
475* Installation Changes in Emacs 24.1 479* Installation Changes in Emacs 24.1
476 480
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 2bd92de45e7..5eac93fa444 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,41 @@
12012-06-19 Glenn Morris <rgm@gnu.org>
2
3 * progmodes/python.el (python-mode): Derive from prog-mode.
4
52012-06-19 Kevin Gallagher <Kevin.Gallagher@boeing.com>
6
7 * emulation/edt.el (edt-default-menu-bar-update-buffers)
8 (edt-user-menu-bar-update-buffers): New functions.
9 (edt-default-emulation-setup, edt-user-emulation-setup): Use them.
10
112012-06-19 Chong Yidong <cyd@gnu.org>
12
13 * subr.el (with-selected-window): Preserve the selected window's
14 terminal's top-frame (Bug#4702).
15
16 * window.el (save-selected-window): Likewise.
17
182012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
19
20 * progmodes/python.el (python-rx-constituents): Move backquote.
21 (python-skeleton-define, python-define-auxiliary-skeleton):
22 Use `declare'.
23
242012-06-18 Michael Albinus <michael.albinus@gmx.de>
25
26 * minibuffer.el (read-file-name-default): Revert the patch from
27 2012-06-17.
28
292012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
30
31 * emacs-lisp/pcase.el (pcase--expand): Warn for unused pattern.
32 (pcase--u1, pcase--q1): Don't use apply-partially.
33
342012-06-18 Glenn Morris <rgm@gnu.org>
35
36 * progmodes/python.el (python-proc, python-buffer)
37 (python-send-receive, python-send-string): Fix obsolete versions.
38
12012-06-18 Martin Rudalics <rudalics@gmx.at> 392012-06-18 Martin Rudalics <rudalics@gmx.at>
2 40
3 * window.el (special-display-p): Completely remove stringp 41 * window.el (special-display-p): Completely remove stringp
diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el
index 635eef93d96..925d275386f 100644
--- a/lisp/emacs-lisp/byte-run.el
+++ b/lisp/emacs-lisp/byte-run.el
@@ -123,7 +123,8 @@ the list ARGS... as it appears in the expression,
123and the result should be a form to be evaluated instead of the original. 123and the result should be a form to be evaluated instead of the original.
124DECL is a declaration, optional, of the form (declare DECLS...) where 124DECL is a declaration, optional, of the form (declare DECLS...) where
125DECLS is a list of elements of the form (PROP . VALUES). These are 125DECLS is a list of elements of the form (PROP . VALUES). These are
126interpreted according to `macro-declarations-alist'." 126interpreted according to `macro-declarations-alist'.
127The return value is undefined."
127 (if (stringp docstring) nil 128 (if (stringp docstring) nil
128 (if decl (setq body (cons decl body))) 129 (if decl (setq body (cons decl body)))
129 (setq decl docstring) 130 (setq decl docstring)
@@ -158,6 +159,7 @@ See also the function `interactive'.
158DECL is a declaration, optional, of the form (declare DECLS...) where 159DECL is a declaration, optional, of the form (declare DECLS...) where
159DECLS is a list of elements of the form (PROP . VALUES). These are 160DECLS is a list of elements of the form (PROP . VALUES). These are
160interpreted according to `defun-declarations-alist'. 161interpreted according to `defun-declarations-alist'.
162The return value is undefined.
161 163
162\(fn NAME ARGLIST &optional DOCSTRING DECL &rest BODY)" 164\(fn NAME ARGLIST &optional DOCSTRING DECL &rest BODY)"
163 ;; We can't just have `decl' as an &optional argument, because we need 165 ;; We can't just have `decl' as an &optional argument, because we need
diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el
index 81cffae04bf..f91a1645e21 100644
--- a/lisp/emacs-lisp/pcase.el
+++ b/lisp/emacs-lisp/pcase.el
@@ -237,7 +237,8 @@ of the form (UPAT EXP)."
237 ;; the branch to a separate function. 237 ;; the branch to a separate function.
238 (let ((bsym 238 (let ((bsym
239 (make-symbol (format "pcase-%d" (length defs))))) 239 (make-symbol (format "pcase-%d" (length defs)))))
240 (push `(,bsym (lambda ,(mapcar #'car prevvars) ,@code)) defs) 240 (push `(,bsym (lambda ,(mapcar #'car prevvars) ,@code))
241 defs)
241 (setcar res 'funcall) 242 (setcar res 'funcall)
242 (setcdr res (cons bsym (mapcar #'cdr prevvars))) 243 (setcdr res (cons bsym (mapcar #'cdr prevvars)))
243 (setcar (cddr prev) bsym) 244 (setcar (cddr prev) bsym)
@@ -255,17 +256,26 @@ of the form (UPAT EXP)."
255 ;; FIXME: But if some of `prevvars' are not in `vars' we 256 ;; FIXME: But if some of `prevvars' are not in `vars' we
256 ;; should remove them from `prevvars'! 257 ;; should remove them from `prevvars'!
257 `(funcall ,res ,@args))))))) 258 `(funcall ,res ,@args)))))))
259 (used-cases ())
258 (main 260 (main
259 (pcase--u 261 (pcase--u
260 (mapcar (lambda (case) 262 (mapcar (lambda (case)
261 `((match ,val . ,(car case)) 263 `((match ,val . ,(car case))
262 ,(apply-partially 264 ,(lambda (vars)
263 (if (pcase--small-branch-p (cdr case)) 265 (unless (memq case used-cases)
264 ;; Don't bother sharing multiple 266 ;; Keep track of the cases that are used.
265 ;; occurrences of this leaf since it's small. 267 (push case used-cases))
266 #'pcase-codegen codegen) 268 (funcall
267 (cdr case)))) 269 (if (pcase--small-branch-p (cdr case))
270 ;; Don't bother sharing multiple
271 ;; occurrences of this leaf since it's small.
272 #'pcase-codegen codegen)
273 (cdr case)
274 vars))))
268 cases)))) 275 cases))))
276 (dolist (case cases)
277 (unless (or (memq case used-cases) (eq (car case) 'dontcare))
278 (message "Redundant pcase pattern: %S" (car case))))
269 (macroexp-let* defs main)))) 279 (macroexp-let* defs main))))
270 280
271(defun pcase-codegen (code vars) 281(defun pcase-codegen (code vars)
@@ -566,7 +576,7 @@ Otherwise, it defers to REST which is a list of branches of the form
566 (if (eq (car upat) 'pred) (put sym 'pcase-used t)) 576 (if (eq (car upat) 'pred) (put sym 'pcase-used t))
567 (let* ((splitrest 577 (let* ((splitrest
568 (pcase--split-rest 578 (pcase--split-rest
569 sym (apply-partially #'pcase--split-pred upat) rest)) 579 sym (lambda (pat) (pcase--split-pred upat pat)) rest))
570 (then-rest (car splitrest)) 580 (then-rest (car splitrest))
571 (else-rest (cdr splitrest))) 581 (else-rest (cdr splitrest)))
572 (pcase--if (if (and (eq (car upat) 'pred) (symbolp (cadr upat))) 582 (pcase--if (if (and (eq (car upat) 'pred) (symbolp (cadr upat)))
@@ -636,7 +646,7 @@ Otherwise, it defers to REST which is a list of branches of the form
636 (let* ((elems (mapcar 'cadr (cdr upat))) 646 (let* ((elems (mapcar 'cadr (cdr upat)))
637 (splitrest 647 (splitrest
638 (pcase--split-rest 648 (pcase--split-rest
639 sym (apply-partially #'pcase--split-member elems) rest)) 649 sym (lambda (pat) (pcase--split-member elems pat)) rest))
640 (then-rest (car splitrest)) 650 (then-rest (car splitrest))
641 (else-rest (cdr splitrest))) 651 (else-rest (cdr splitrest)))
642 (put sym 'pcase-used t) 652 (put sym 'pcase-used t)
@@ -693,7 +703,7 @@ Otherwise, it defers to REST which is a list of branches of the form
693 (symd (make-symbol "xcdr")) 703 (symd (make-symbol "xcdr"))
694 (splitrest (pcase--split-rest 704 (splitrest (pcase--split-rest
695 sym 705 sym
696 (apply-partially #'pcase--split-consp syma symd) 706 (lambda (pat) (pcase--split-consp syma symd pat))
697 rest)) 707 rest))
698 (then-rest (car splitrest)) 708 (then-rest (car splitrest))
699 (else-rest (cdr splitrest)) 709 (else-rest (cdr splitrest))
@@ -716,7 +726,7 @@ Otherwise, it defers to REST which is a list of branches of the form
716 (pcase--u else-rest)))) 726 (pcase--u else-rest))))
717 ((or (integerp qpat) (symbolp qpat) (stringp qpat)) 727 ((or (integerp qpat) (symbolp qpat) (stringp qpat))
718 (let* ((splitrest (pcase--split-rest 728 (let* ((splitrest (pcase--split-rest
719 sym (apply-partially 'pcase--split-equal qpat) rest)) 729 sym (lambda (pat) (pcase--split-equal qpat pat)) rest))
720 (then-rest (car splitrest)) 730 (then-rest (car splitrest))
721 (else-rest (cdr splitrest))) 731 (else-rest (cdr splitrest)))
722 (pcase--if (cond 732 (pcase--if (cond
diff --git a/lisp/emulation/edt.el b/lisp/emulation/edt.el
index fbb2359ca1f..dbd13a01a8b 100644
--- a/lisp/emulation/edt.el
+++ b/lisp/emulation/edt.el
@@ -2071,6 +2071,20 @@ created."
2071 (setq transient-mark-mode edt-orig-transient-mark-mode)) 2071 (setq transient-mark-mode edt-orig-transient-mark-mode))
2072 (message "Original key bindings restored; EDT Emulation disabled")) 2072 (message "Original key bindings restored; EDT Emulation disabled"))
2073 2073
2074(defun edt-default-menu-bar-update-buffers ()
2075 ;; Update edt-default-global-map with latest copy of
2076 ;; `global-buffers-menu-map' each time `menu-bar-update-buffers'
2077 ;; updates global-map.
2078 (define-key edt-default-global-map [menu-bar buffer]
2079 (cons "Buffers" global-buffers-menu-map)))
2080
2081(defun edt-user-menu-bar-update-buffers ()
2082 ;; We need to update edt-user-global-map with latest copy of
2083 ;; `global-buffers-menu-map' each time `menu-bar-update-buffers'
2084 ;; updates global-map.
2085 (define-key edt-user-global-map [menu-bar buffer]
2086 (cons "Buffers" global-buffers-menu-map)))
2087
2074(defun edt-default-emulation-setup (&optional user-setup) 2088(defun edt-default-emulation-setup (&optional user-setup)
2075 "Setup emulation of DEC's EDT editor. 2089 "Setup emulation of DEC's EDT editor.
2076Optional argument USER-SETUP non-nil means called from function 2090Optional argument USER-SETUP non-nil means called from function
@@ -2110,10 +2124,8 @@ Optional argument USER-SETUP non-nil means called from function
2110 (progn 2124 (progn
2111 (fset 'edt-emulation-on (symbol-function 'edt-select-default-global-map)) 2125 (fset 'edt-emulation-on (symbol-function 'edt-select-default-global-map))
2112 (edt-select-default-global-map))) 2126 (edt-select-default-global-map)))
2113 ;; We need to share `global-buffers-menu-map' with the saved global 2127 ;; Keep the menu bar Buffers menu up-to-date in edt-default-global-map.
2114 ;; keymap, because `menu-bar-update-buffers' directly changes it. 2128 (add-hook 'menu-bar-update-hook 'edt-default-menu-bar-update-buffers))
2115 (define-key (current-global-map) [menu-bar buffer]
2116 (cons "Buffers" global-buffers-menu-map)))
2117 2129
2118(defun edt-user-emulation-setup () 2130(defun edt-user-emulation-setup ()
2119 "Setup user custom emulation of DEC's EDT editor." 2131 "Setup user custom emulation of DEC's EDT editor."
@@ -2134,7 +2146,9 @@ Optional argument USER-SETUP non-nil means called from function
2134 ;; See Info node `edt' for more details, and sample edt-user.el file. 2146 ;; See Info node `edt' for more details, and sample edt-user.el file.
2135 (if (fboundp 'edt-setup-user-bindings) 2147 (if (fboundp 'edt-setup-user-bindings)
2136 (edt-setup-user-bindings)) 2148 (edt-setup-user-bindings))
2137 (edt-select-user-global-map)) 2149 (edt-select-user-global-map)
2150 ;; Keep the menu bar Buffers menu up-to-date in edt-user-global-map.
2151 (add-hook 'menu-bar-update-hook 'edt-user-menu-bar-update-buffers))
2138 2152
2139(defun edt-select-default-global-map() 2153(defun edt-select-default-global-map()
2140 "Select default EDT emulation key bindings." 2154 "Select default EDT emulation key bindings."
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 9d9a86ca406..0923ed4db96 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,7 @@
12012-06-18 Nelson Ferreira <nelson.ferreira@ieee.org> (tiny change)
2
3 * gnus-win.el (gnus-configure-frame): Pass an arg to window-dedicated-p.
4
12012-06-17 Toke Høiland-Jørgensen <toke@toke.dk> (tiny change) 52012-06-17 Toke Høiland-Jørgensen <toke@toke.dk> (tiny change)
2 6
3 * nnmaildir.el (nnmaildir-request-expire-articles): Ensure that `time' 7 * nnmaildir.el (nnmaildir-request-expire-articles): Ensure that `time'
diff --git a/lisp/gnus/gnus-win.el b/lisp/gnus/gnus-win.el
index efe2a319854..bd9ea10fdc4 100644
--- a/lisp/gnus/gnus-win.el
+++ b/lisp/gnus/gnus-win.el
@@ -273,7 +273,9 @@ See the Gnus manual for an explanation of the syntax used.")
273 (cond 273 (cond
274 ((eq buf (window-buffer (selected-window))) 274 ((eq buf (window-buffer (selected-window)))
275 (set-buffer buf)) 275 (set-buffer buf))
276 ((eq t (window-dedicated-p)) 276 ((eq t (window-dedicated-p
277 ;; XEmacs version of `window-dedicated-p' requires it.
278 (selected-window)))
277 ;; If the window is hard-dedicated, we have a problem because 279 ;; If the window is hard-dedicated, we have a problem because
278 ;; we just can't do what we're asked. But signaling an error, 280 ;; we just can't do what we're asked. But signaling an error,
279 ;; like `switch-to-buffer' would do, is not an option because 281 ;; like `switch-to-buffer' would do, is not an option because
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index e4453afe046..a084ed9fb4d 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -461,7 +461,7 @@ for use at QPOS."
461 (last (last completions))) 461 (last (last completions)))
462 (when (consp last) (setcdr last nil)) 462 (when (consp last) (setcdr last nil))
463 completions)) 463 completions))
464 464
465 ((eq action 'completion--unquote) 465 ((eq action 'completion--unquote)
466 (let ((ustring (funcall unquote string)) 466 (let ((ustring (funcall unquote string))
467 (uprefix (funcall unquote (substring string 0 pred)))) 467 (uprefix (funcall unquote (substring string 0 pred))))
@@ -2335,8 +2335,7 @@ See `read-file-name' for the meaning of the arguments."
2335 (if (consp default-filename) 2335 (if (consp default-filename)
2336 (mapcar 'abbreviate-file-name default-filename) 2336 (mapcar 'abbreviate-file-name default-filename)
2337 (abbreviate-file-name default-filename)))) 2337 (abbreviate-file-name default-filename))))
2338 (let ((non-essential t) 2338 (let ((insdef (cond
2339 (insdef (cond
2340 ((and insert-default-directory (stringp dir)) 2339 ((and insert-default-directory (stringp dir))
2341 (if initial 2340 (if initial
2342 (cons (minibuffer--double-dollars (concat dir initial)) 2341 (cons (minibuffer--double-dollars (concat dir initial))
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index dfa72a3084a..a43dc1eb1d3 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -1,4 +1,4 @@
1;;; python.el --- Python's flying circus support for Emacs 1;;; python.el --- Python's flying circus support for Emacs -*- coding: utf-8 -*-
2 2
3;; Copyright (C) 2003-2012 Free Software Foundation, Inc. 3;; Copyright (C) 2003-2012 Free Software Foundation, Inc.
4 4
@@ -308,29 +308,31 @@
308 308
309(eval-when-compile 309(eval-when-compile
310 (defconst python-rx-constituents 310 (defconst python-rx-constituents
311 (list 311 `((block-start . ,(rx symbol-start
312 `(block-start . ,(rx symbol-start
313 (or "def" "class" "if" "elif" "else" "try" 312 (or "def" "class" "if" "elif" "else" "try"
314 "except" "finally" "for" "while" "with") 313 "except" "finally" "for" "while" "with")
315 symbol-end)) 314 symbol-end))
316 `(decorator . ,(rx line-start (* space) ?@ (any letter ?_) 315 (decorator . ,(rx line-start (* space) ?@ (any letter ?_)
317 (* (any word ?_)))) 316 (* (any word ?_))))
318 `(defun . ,(rx symbol-start (or "def" "class") symbol-end)) 317 (defun . ,(rx symbol-start (or "def" "class") symbol-end))
319 `(if-name-main . ,(rx line-start "if" (+ space) "__name__" 318 (if-name-main . ,(rx line-start "if" (+ space) "__name__"
320 (+ space) "==" (+ space) 319 (+ space) "==" (+ space)
321 (any ?' ?\") "__main__" (any ?' ?\") 320 (any ?' ?\") "__main__" (any ?' ?\")
322 (* space) ?:)) 321 (* space) ?:))
323 `(symbol-name . ,(rx (any letter ?_) (* (any word ?_)))) 322 (symbol-name . ,(rx (any letter ?_) (* (any word ?_))))
324 `(open-paren . ,(rx (or "{" "[" "("))) 323 (open-paren . ,(rx (or "{" "[" "(")))
325 `(close-paren . ,(rx (or "}" "]" ")"))) 324 (close-paren . ,(rx (or "}" "]" ")")))
326 `(simple-operator . ,(rx (any ?+ ?- ?/ ?& ?^ ?~ ?| ?* ?< ?> ?= ?%))) 325 (simple-operator . ,(rx (any ?+ ?- ?/ ?& ?^ ?~ ?| ?* ?< ?> ?= ?%)))
327 `(not-simple-operator . ,(rx 326 ;; FIXME: rx should support (not simple-operator).
327 (not-simple-operator . ,(rx
328 (not 328 (not
329 (any ?+ ?- ?/ ?& ?^ ?~ ?| ?* ?< ?> ?= ?%)))) 329 (any ?+ ?- ?/ ?& ?^ ?~ ?| ?* ?< ?> ?= ?%))))
330 `(operator . ,(rx (or "+" "-" "/" "&" "^" "~" "|" "*" "<" ">" 330 ;; FIXME: Use regexp-opt.
331 (operator . ,(rx (or "+" "-" "/" "&" "^" "~" "|" "*" "<" ">"
331 "=" "%" "**" "//" "<<" ">>" "<=" "!=" 332 "=" "%" "**" "//" "<<" ">>" "<=" "!="
332 "==" ">=" "is" "not"))) 333 "==" ">=" "is" "not")))
333 `(assignment-operator . ,(rx (or "=" "+=" "-=" "*=" "/=" "//=" "%=" "**=" 334 ;; FIXME: Use regexp-opt.
335 (assignment-operator . ,(rx (or "=" "+=" "-=" "*=" "/=" "//=" "%=" "**="
334 ">>=" "<<=" "&=" "^=" "|=")))) 336 ">>=" "<<=" "&=" "^=" "|="))))
335 "Additional Python specific sexps for `python-rx'")) 337 "Additional Python specific sexps for `python-rx'"))
336 338
@@ -1569,10 +1571,10 @@ there for compatibility with CEDET.")
1569 (get-buffer-process proc-buffer-name))) 1571 (get-buffer-process proc-buffer-name)))
1570 1572
1571(define-obsolete-function-alias 1573(define-obsolete-function-alias
1572 'python-proc 'python-shell-internal-get-or-create-process "23.3") 1574 'python-proc 'python-shell-internal-get-or-create-process "24.2")
1573 1575
1574(define-obsolete-variable-alias 1576(define-obsolete-variable-alias
1575 'python-buffer 'python-shell-internal-buffer "23.3") 1577 'python-buffer 'python-shell-internal-buffer "24.2")
1576 1578
1577(defun python-shell-send-string (string &optional process msg) 1579(defun python-shell-send-string (string &optional process msg)
1578 "Send STRING to inferior Python PROCESS. 1580 "Send STRING to inferior Python PROCESS.
@@ -1627,10 +1629,10 @@ Returns the output. See `python-shell-send-string-no-output'."
1627 (python-shell-internal-get-or-create-process) nil)) 1629 (python-shell-internal-get-or-create-process) nil))
1628 1630
1629(define-obsolete-function-alias 1631(define-obsolete-function-alias
1630 'python-send-receive 'python-shell-internal-send-string "23.3") 1632 'python-send-receive 'python-shell-internal-send-string "24.2")
1631 1633
1632(define-obsolete-function-alias 1634(define-obsolete-function-alias
1633 'python-send-string 'python-shell-internal-send-string "23.3") 1635 'python-send-string 'python-shell-internal-send-string "24.2")
1634 1636
1635(defun python-shell-send-region (start end) 1637(defun python-shell-send-region (start end)
1636 "Send the region delimited by START and END to inferior Python process." 1638 "Send the region delimited by START and END to inferior Python process."
@@ -2146,6 +2148,7 @@ the if condition."
2146 "Define a `python-mode' skeleton using NAME DOC and SKEL. 2148 "Define a `python-mode' skeleton using NAME DOC and SKEL.
2147The skeleton will be bound to python-skeleton-NAME and will 2149The skeleton will be bound to python-skeleton-NAME and will
2148be added to `python-mode-abbrev-table'." 2150be added to `python-mode-abbrev-table'."
2151 (declare (indent 2))
2149 (let* ((name (symbol-name name)) 2152 (let* ((name (symbol-name name))
2150 (function-name (intern (concat "python-skeleton-" name)))) 2153 (function-name (intern (concat "python-skeleton-" name))))
2151 `(progn 2154 `(progn
@@ -2156,11 +2159,11 @@ be added to `python-mode-abbrev-table'."
2156 ,(or doc 2159 ,(or doc
2157 (format "Insert %s statement." name)) 2160 (format "Insert %s statement." name))
2158 ,@skel)))) 2161 ,@skel))))
2159(put 'python-skeleton-define 'lisp-indent-function 2)
2160 2162
2161(defmacro python-define-auxiliary-skeleton (name doc &optional &rest skel) 2163(defmacro python-define-auxiliary-skeleton (name doc &optional &rest skel)
2162 "Define a `python-mode' auxiliary skeleton using NAME DOC and SKEL. 2164 "Define a `python-mode' auxiliary skeleton using NAME DOC and SKEL.
2163The skeleton will be bound to python-skeleton-NAME." 2165The skeleton will be bound to python-skeleton-NAME."
2166 (declare (indent 2))
2164 (let* ((name (symbol-name name)) 2167 (let* ((name (symbol-name name))
2165 (function-name (intern (concat "python-skeleton--" name))) 2168 (function-name (intern (concat "python-skeleton--" name)))
2166 (msg (format 2169 (msg (format
@@ -2176,7 +2179,6 @@ The skeleton will be bound to python-skeleton-NAME."
2176 (unless (y-or-n-p ,msg) 2179 (unless (y-or-n-p ,msg)
2177 (signal 'quit t)) 2180 (signal 'quit t))
2178 ,@skel))) 2181 ,@skel)))
2179(put 'python-define-auxiliary-skeleton 'lisp-indent-function 2)
2180 2182
2181(python-define-auxiliary-skeleton else nil) 2183(python-define-auxiliary-skeleton else nil)
2182 2184
@@ -2800,7 +2802,7 @@ Optional argument DIRECTION defines the direction to move to."
2800 2802
2801 2803
2802;;;###autoload 2804;;;###autoload
2803(define-derived-mode python-mode fundamental-mode "Python" 2805(define-derived-mode python-mode prog-mode "Python"
2804 "Major mode for editing Python files. 2806 "Major mode for editing Python files.
2805 2807
2806\\{python-mode-map} 2808\\{python-mode-map}
diff --git a/lisp/subr.el b/lisp/subr.el
index 473cc3efddd..ba9b06d495b 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -3011,24 +3011,29 @@ the buffer list ordering."
3011 (declare (indent 1) (debug t)) 3011 (declare (indent 1) (debug t))
3012 ;; Most of this code is a copy of save-selected-window. 3012 ;; Most of this code is a copy of save-selected-window.
3013 `(let* ((save-selected-window-destination ,window) 3013 `(let* ((save-selected-window-destination ,window)
3014 (save-selected-window-frame
3015 (window-frame save-selected-window-destination))
3014 (save-selected-window-window (selected-window)) 3016 (save-selected-window-window (selected-window))
3015 ;; Selecting a window on another frame changes not only the 3017 ;; Selecting a window on another frame also changes that
3016 ;; selected-window but also the frame-selected-window of the 3018 ;; frame's frame-selected-window. We must save&restore it.
3017 ;; destination frame. So we need to save&restore it.
3018 (save-selected-window-other-frame 3019 (save-selected-window-other-frame
3019 (unless (eq (selected-frame) 3020 (unless (eq (selected-frame) save-selected-window-frame)
3020 (window-frame save-selected-window-destination)) 3021 (frame-selected-window save-selected-window-frame)))
3021 (frame-selected-window 3022 (save-selected-window-top-frame
3022 (window-frame save-selected-window-destination))))) 3023 (unless (eq (selected-frame) save-selected-window-frame)
3024 (tty-top-frame save-selected-window-frame))))
3023 (save-current-buffer 3025 (save-current-buffer
3024 (unwind-protect 3026 (unwind-protect
3025 (progn (select-window save-selected-window-destination 'norecord) 3027 (progn (select-window save-selected-window-destination 'norecord)
3026 ,@body) 3028 ,@body)
3027 ;; First reset frame-selected-window. 3029 ;; First reset frame-selected-window.
3028 (if (window-live-p save-selected-window-other-frame) 3030 (when (window-live-p save-selected-window-other-frame)
3029 ;; We don't use set-frame-selected-window because it does not 3031 ;; We don't use set-frame-selected-window because it does not
3030 ;; pass the `norecord' argument to Fselect_window. 3032 ;; pass the `norecord' argument to Fselect_window.
3031 (select-window save-selected-window-other-frame 'norecord)) 3033 (select-window save-selected-window-other-frame 'norecord)
3034 (and (frame-live-p save-selected-window-top-frame)
3035 (not (eq (tty-top-frame) save-selected-window-top-frame))
3036 (select-frame save-selected-window-top-frame 'norecord)))
3032 ;; Then reset the actual selected-window. 3037 ;; Then reset the actual selected-window.
3033 (when (window-live-p save-selected-window-window) 3038 (when (window-live-p save-selected-window-window)
3034 (select-window save-selected-window-window 'norecord)))))) 3039 (select-window save-selected-window-window 'norecord))))))
diff --git a/lisp/window.el b/lisp/window.el
index 6ea882d1ea2..7c3fe1a082f 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -47,12 +47,24 @@ order of recently selected windows and the buffer list ordering
47are not altered by this macro (unless they are altered in BODY)." 47are not altered by this macro (unless they are altered in BODY)."
48 (declare (indent 0) (debug t)) 48 (declare (indent 0) (debug t))
49 `(let ((save-selected-window-window (selected-window)) 49 `(let ((save-selected-window-window (selected-window))
50 ;; It is necessary to save all of these, because calling 50 ;; We save and restore all frames' selected windows, because
51 ;; select-window changes frame-selected-window for whatever 51 ;; `select-window' can change the frame-selected-window of
52 ;; frame that window is in. 52 ;; whatever frame that window is in. Each text terminal's
53 ;; top-frame is preserved by putting it last in the list.
53 (save-selected-window-alist 54 (save-selected-window-alist
54 (mapcar (lambda (frame) (cons frame (frame-selected-window frame))) 55 (apply 'append
55 (frame-list)))) 56 (mapcar (lambda (terminal)
57 (let ((frames (frames-on-display-list terminal))
58 (top-frame (tty-top-frame terminal))
59 alist)
60 (if top-frame
61 (setq frames
62 (cons top-frame
63 (delq top-frame frames))))
64 (dolist (f frames)
65 (push (cons f (frame-selected-window f))
66 alist))))
67 (terminal-list)))))
56 (save-current-buffer 68 (save-current-buffer
57 (unwind-protect 69 (unwind-protect
58 (progn ,@body) 70 (progn ,@body)
diff --git a/src/ChangeLog b/src/ChangeLog
index 9a239de5b99..16fcbb07522 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,8 +1,37 @@
12012-06-19 Chong Yidong <cyd@gnu.org>
2
3 * frame.c (delete_frame): When selecting a frame on a different
4 text terminal, do not alter the terminal's top-frame.
5
6 * xdisp.c (format_mode_line_unwind_data): Record the target
7 frame's selected window and its terminal's top-frame.
8 (unwind_format_mode_line): Restore them.
9 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
10 Callers changed.
11 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
12 since tty frames can be explicitly named.
13 (prepare_menu_bars): Likewise.
14
15 * term.c (Ftty_top_frame): New function.
16
172012-06-18 Paul Eggert <eggert@cs.ucla.edu>
18
19 Port byte-code-meter to modern targets.
20 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
21 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
22 CHECK_LISP_OBJECT_TYPE reported by Dmitry Andropov in
23 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
24 (METER_1, METER_2): Simplify.
25
262012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
27
28 * data.c (Fdefalias): Return `symbol' (bug#11686).
29
12012-06-18 Martin Rudalics <rudalics@gmx.at> 302012-06-18 Martin Rudalics <rudalics@gmx.at>
2 31
3 * buffer.c (Fkill_buffer): Don't throw an error when the buffer 32 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
4 gets killed during executing of this function (Bug#11665). Try 33 gets killed during executing of this function (Bug#11665).
5 to always return Qt when the buffer has been actually killed. 34 Try to always return Qt when the buffer has been actually killed.
6 (Vkill_buffer_query_functions): In doc-string say that functions 35 (Vkill_buffer_query_functions): In doc-string say that functions
7 run by this hook should not change the current buffer. 36 run by this hook should not change the current buffer.
8 37
@@ -56,8 +85,8 @@
56 (x_draw_glyph_string): Use them. 85 (x_draw_glyph_string): Use them.
57 * xfaces.c (Qline, Qwave): New Lisp objects. 86 * xfaces.c (Qline, Qwave): New Lisp objects.
58 (check_lface_attrs, merge_face_ref) 87 (check_lface_attrs, merge_face_ref)
59 (Finternal_set_lisp_face_attribute, realize_x_face): Handle 88 (Finternal_set_lisp_face_attribute, realize_x_face):
60 wave-style underline face attributes. 89 Handle wave-style underline face attributes.
61 * xterm.c (x_draw_underwave): New function. 90 * xterm.c (x_draw_underwave): New function.
62 (x_draw_glyph_string): Use it. 91 (x_draw_glyph_string): Use it.
63 92
@@ -130,8 +159,8 @@
130 159
1312012-06-16 Eli Zaretskii <eliz@gnu.org> 1602012-06-16 Eli Zaretskii <eliz@gnu.org>
132 161
133 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end. If 162 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
134 all the glyphs of the glyph row came from strings, and we have no 163 If all the glyphs of the glyph row came from strings, and we have no
135 cursor positioning clues, put the cursor on the first glyph of the 164 cursor positioning clues, put the cursor on the first glyph of the
136 row. 165 row.
137 (handle_face_prop): Use chunk-relative overlay string index when 166 (handle_face_prop): Use chunk-relative overlay string index when
@@ -164,8 +193,8 @@
164 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined. 193 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
165 (INTTYPEBITS): New macro, for clarity. 194 (INTTYPEBITS): New macro, for clarity.
166 (INTMASK, MOST_POSITIVE_FIXNUM): Use it. 195 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
167 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P): Simplify 196 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
168 now that USE_LSB_TAG is always defined. 197 Simplify now that USE_LSB_TAG is always defined.
169 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast. 198 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
170 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler. 199 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
171 200
@@ -183,11 +212,11 @@
183 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct 212 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
184 instead of union. 213 instead of union.
185 (XLI, XIL): Define. 214 (XLI, XIL): Define.
186 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG): Use 215 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
187 them. 216 Use them.
188 * emacs.c (gdb_use_struct): Renamed from gdb_use_union. 217 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
189 * .gdbinit: Check gdb_use_struct instead of gdb_use_union. 218 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
190 * alloc.c (widen_to_Lisp_Object): Removed. 219 * alloc.c (widen_to_Lisp_Object): Remove.
191 (mark_memory): Use XIL instead of widen_to_Lisp_Object. 220 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
192 * frame.c (delete_frame): Remove outdated comment. 221 * frame.c (delete_frame): Remove outdated comment.
193 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking 222 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
diff --git a/src/bytecode.c b/src/bytecode.c
index 2e6ee3d4445..9c7a3fa30cf 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -58,21 +58,21 @@ by Hallvard:
58#ifdef BYTE_CODE_METER 58#ifdef BYTE_CODE_METER
59 59
60Lisp_Object Qbyte_code_meter; 60Lisp_Object Qbyte_code_meter;
61#define METER_2(code1, code2) \ 61#define METER_2(code1, code2) AREF (AREF (Vbyte_code_meter, code1), code2)
62 XFASTINT (XVECTOR (XVECTOR (Vbyte_code_meter)->contents[(code1)]) \ 62#define METER_1(code) METER_2 (0, code)
63 ->contents[(code2)])
64
65#define METER_1(code) METER_2 (0, (code))
66 63
67#define METER_CODE(last_code, this_code) \ 64#define METER_CODE(last_code, this_code) \
68{ \ 65{ \
69 if (byte_metering_on) \ 66 if (byte_metering_on) \
70 { \ 67 { \
71 if (METER_1 (this_code) < MOST_POSITIVE_FIXNUM) \ 68 if (XFASTINT (METER_1 (this_code)) < MOST_POSITIVE_FIXNUM) \
72 METER_1 (this_code)++; \ 69 XSETFASTINT (METER_1 (this_code), \
70 XFASTINT (METER_1 (this_code)) + 1); \
73 if (last_code \ 71 if (last_code \
74 && METER_2 (last_code, this_code) < MOST_POSITIVE_FIXNUM) \ 72 && (XFASTINT (METER_2 (last_code, this_code)) \
75 METER_2 (last_code, this_code)++; \ 73 < MOST_POSITIVE_FIXNUM)) \
74 XSETFASTINT (METER_2 (last_code, this_code), \
75 XFASTINT (METER_2 (last_code, this_code)) + 1); \
76 } \ 76 } \
77} 77}
78 78
diff --git a/src/data.c b/src/data.c
index 4449977dbe0..2aa27e65d77 100644
--- a/src/data.c
+++ b/src/data.c
@@ -637,8 +637,9 @@ DEFUN ("fset", Ffset, Sfset, 2, 2, 0,
637 Fput (symbol, Qautoload, XCDR (function)); 637 Fput (symbol, Qautoload, XCDR (function));
638 638
639 XSYMBOL (symbol)->function = definition; 639 XSYMBOL (symbol)->function = definition;
640 /* Handle automatic advice activation */ 640 /* Handle automatic advice activation. */
641 if (CONSP (XSYMBOL (symbol)->plist) && !NILP (Fget (symbol, Qad_advice_info))) 641 if (CONSP (XSYMBOL (symbol)->plist)
642 && !NILP (Fget (symbol, Qad_advice_info)))
642 { 643 {
643 call2 (Qad_activate_internal, symbol, Qnil); 644 call2 (Qad_activate_internal, symbol, Qnil);
644 definition = XSYMBOL (symbol)->function; 645 definition = XSYMBOL (symbol)->function;
@@ -647,11 +648,12 @@ DEFUN ("fset", Ffset, Sfset, 2, 2, 0,
647} 648}
648 649
649DEFUN ("defalias", Fdefalias, Sdefalias, 2, 3, 0, 650DEFUN ("defalias", Fdefalias, Sdefalias, 2, 3, 0,
650 doc: /* Set SYMBOL's function definition to DEFINITION, and return DEFINITION. 651 doc: /* Set SYMBOL's function definition to DEFINITION.
651Associates the function with the current load file, if any. 652Associates the function with the current load file, if any.
652The optional third argument DOCSTRING specifies the documentation string 653The optional third argument DOCSTRING specifies the documentation string
653for SYMBOL; if it is omitted or nil, SYMBOL uses the documentation string 654for SYMBOL; if it is omitted or nil, SYMBOL uses the documentation string
654determined by DEFINITION. */) 655determined by DEFINITION.
656The return value is undefined. */)
655 (register Lisp_Object symbol, Lisp_Object definition, Lisp_Object docstring) 657 (register Lisp_Object symbol, Lisp_Object definition, Lisp_Object docstring)
656{ 658{
657 CHECK_SYMBOL (symbol); 659 CHECK_SYMBOL (symbol);
@@ -666,7 +668,10 @@ determined by DEFINITION. */)
666 LOADHIST_ATTACH (Fcons (Qdefun, symbol)); 668 LOADHIST_ATTACH (Fcons (Qdefun, symbol));
667 if (!NILP (docstring)) 669 if (!NILP (docstring))
668 Fput (symbol, Qfunction_documentation, docstring); 670 Fput (symbol, Qfunction_documentation, docstring);
669 return definition; 671 /* We used to return `definition', but now that `defun' and `defmacro' expand
672 to a call to `defalias', we return `symbol' for backward compatibility
673 (bug#11686). */
674 return symbol;
670} 675}
671 676
672DEFUN ("setplist", Fsetplist, Ssetplist, 2, 2, 0, 677DEFUN ("setplist", Fsetplist, Ssetplist, 2, 2, 0,
diff --git a/src/frame.c b/src/frame.c
index 39d26ded5a6..fc52b07923d 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -630,8 +630,8 @@ DEFUN ("make-terminal-frame", Fmake_terminal_frame, Smake_terminal_frame,
630 doc: /* Create an additional terminal frame, possibly on another terminal. 630 doc: /* Create an additional terminal frame, possibly on another terminal.
631This function takes one argument, an alist specifying frame parameters. 631This function takes one argument, an alist specifying frame parameters.
632 632
633You can create multiple frames on a single text-only terminal, but 633You can create multiple frames on a single text terminal, but only one
634only one of them (the selected terminal frame) is actually displayed. 634of them (the selected terminal frame) is actually displayed.
635 635
636In practice, generally you don't need to specify any parameters, 636In practice, generally you don't need to specify any parameters,
637except when you want to create a new frame on another terminal. 637except when you want to create a new frame on another terminal.
@@ -865,8 +865,8 @@ something to select a different frame, or until the next time
865this function is called. If you are using a window system, the 865this function is called. If you are using a window system, the
866previously selected frame may be restored as the selected frame 866previously selected frame may be restored as the selected frame
867when returning to the command loop, because it still may have 867when returning to the command loop, because it still may have
868the window system's input focus. On a text-only terminal, the 868the window system's input focus. On a text terminal, the next
869next redisplay will display FRAME. 869redisplay will display FRAME.
870 870
871This function returns FRAME, or nil if FRAME has been deleted. */) 871This function returns FRAME, or nil if FRAME has been deleted. */)
872 (Lisp_Object frame, Lisp_Object norecord) 872 (Lisp_Object frame, Lisp_Object norecord)
@@ -1254,7 +1254,17 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
1254 FOR_EACH_FRAME (tail, frame1) 1254 FOR_EACH_FRAME (tail, frame1)
1255 { 1255 {
1256 if (! EQ (frame, frame1) && FRAME_LIVE_P (XFRAME (frame1))) 1256 if (! EQ (frame, frame1) && FRAME_LIVE_P (XFRAME (frame1)))
1257 break; 1257 {
1258 /* Do not change a text terminal's top-frame. */
1259 struct frame *f1 = XFRAME (frame1);
1260 if (FRAME_TERMCAP_P (f1) || FRAME_MSDOS_P (f1))
1261 {
1262 Lisp_Object top_frame = FRAME_TTY (f1)->top_frame;
1263 if (!EQ (top_frame, frame))
1264 frame1 = top_frame;
1265 }
1266 break;
1267 }
1258 } 1268 }
1259 } 1269 }
1260#ifdef NS_IMPL_COCOA 1270#ifdef NS_IMPL_COCOA
@@ -1730,8 +1740,8 @@ usually not displayed at all, even in a window system's \"taskbar\".
1730Normally you may not make FRAME invisible if all other frames are invisible, 1740Normally you may not make FRAME invisible if all other frames are invisible,
1731but if the second optional argument FORCE is non-nil, you may do so. 1741but if the second optional argument FORCE is non-nil, you may do so.
1732 1742
1733This function has no effect on text-only terminal frames. Such frames 1743This function has no effect on text terminal frames. Such frames are
1734are always considered visible, whether or not they are currently being 1744always considered visible, whether or not they are currently being
1735displayed in the terminal. */) 1745displayed in the terminal. */)
1736 (Lisp_Object frame, Lisp_Object force) 1746 (Lisp_Object frame, Lisp_Object force)
1737{ 1747{
@@ -1743,12 +1753,6 @@ displayed in the terminal. */)
1743 if (NILP (force) && !other_visible_frames (XFRAME (frame))) 1753 if (NILP (force) && !other_visible_frames (XFRAME (frame)))
1744 error ("Attempt to make invisible the sole visible or iconified frame"); 1754 error ("Attempt to make invisible the sole visible or iconified frame");
1745 1755
1746#if 0 /* This isn't logically necessary, and it can do GC. */
1747 /* Don't let the frame remain selected. */
1748 if (EQ (frame, selected_frame))
1749 do_switch_frame (next_frame (frame, Qt), 0, 0, Qnil)
1750#endif
1751
1752 /* Don't allow minibuf_window to remain on a deleted frame. */ 1756 /* Don't allow minibuf_window to remain on a deleted frame. */
1753 if (EQ (XFRAME (frame)->minibuffer_window, minibuf_window)) 1757 if (EQ (XFRAME (frame)->minibuffer_window, minibuf_window))
1754 { 1758 {
@@ -1816,7 +1820,7 @@ Return nil if FRAME was made invisible, via `make-frame-invisible'.
1816On graphical displays, invisible frames are not updated and are 1820On graphical displays, invisible frames are not updated and are
1817usually not displayed at all, even in a window system's \"taskbar\". 1821usually not displayed at all, even in a window system's \"taskbar\".
1818 1822
1819If FRAME is a text-only terminal frame, this always returns t. 1823If FRAME is a text terminal frame, this always returns t.
1820Such frames are always considered visible, whether or not they are 1824Such frames are always considered visible, whether or not they are
1821currently being displayed on the terminal. */) 1825currently being displayed on the terminal. */)
1822 (Lisp_Object frame) 1826 (Lisp_Object frame)
@@ -1872,7 +1876,7 @@ doesn't support multiple overlapping frames, this function selects FRAME. */)
1872 f = XFRAME (frame); 1876 f = XFRAME (frame);
1873 1877
1874 if (FRAME_TERMCAP_P (f)) 1878 if (FRAME_TERMCAP_P (f))
1875 /* On a text-only terminal select FRAME. */ 1879 /* On a text terminal select FRAME. */
1876 Fselect_frame (frame, Qnil); 1880 Fselect_frame (frame, Qnil);
1877 else 1881 else
1878 /* Do like the documentation says. */ 1882 /* Do like the documentation says. */
@@ -2493,7 +2497,7 @@ not the menu bar).
2493In a graphical version with no toolkit, it includes both the tool bar 2497In a graphical version with no toolkit, it includes both the tool bar
2494and menu bar. 2498and menu bar.
2495 2499
2496For a text-only terminal, it includes the menu bar. In this case, the 2500For a text terminal, it includes the menu bar. In this case, the
2497result is really in characters rather than pixels (i.e., is identical 2501result is really in characters rather than pixels (i.e., is identical
2498to `frame-height'). */) 2502to `frame-height'). */)
2499 (Lisp_Object frame) 2503 (Lisp_Object frame)
diff --git a/src/term.c b/src/term.c
index 3a41552c02e..5f807181199 100644
--- a/src/term.c
+++ b/src/term.c
@@ -2132,7 +2132,7 @@ DEFUN ("tty-display-color-p", Ftty_display_color_p, Stty_display_color_p,
2132 2132
2133TERMINAL can be a terminal object, a frame, or nil (meaning the 2133TERMINAL can be a terminal object, a frame, or nil (meaning the
2134selected frame's terminal). This function always returns nil if 2134selected frame's terminal). This function always returns nil if
2135TERMINAL does not refer to a text-only terminal. */) 2135TERMINAL does not refer to a text terminal. */)
2136 (Lisp_Object terminal) 2136 (Lisp_Object terminal)
2137{ 2137{
2138 struct terminal *t = get_tty_terminal (terminal, 0); 2138 struct terminal *t = get_tty_terminal (terminal, 0);
@@ -2149,7 +2149,7 @@ DEFUN ("tty-display-color-cells", Ftty_display_color_cells,
2149 2149
2150TERMINAL can be a terminal object, a frame, or nil (meaning the 2150TERMINAL can be a terminal object, a frame, or nil (meaning the
2151selected frame's terminal). This function always returns 0 if 2151selected frame's terminal). This function always returns 0 if
2152TERMINAL does not refer to a text-only terminal. */) 2152TERMINAL does not refer to a text terminal. */)
2153 (Lisp_Object terminal) 2153 (Lisp_Object terminal)
2154{ 2154{
2155 struct terminal *t = get_tty_terminal (terminal, 0); 2155 struct terminal *t = get_tty_terminal (terminal, 0);
@@ -2371,7 +2371,7 @@ no effect if used on a non-tty terminal.
2371 2371
2372TERMINAL can be a terminal object, a frame or nil (meaning the 2372TERMINAL can be a terminal object, a frame or nil (meaning the
2373selected frame's terminal). This function always returns nil if 2373selected frame's terminal). This function always returns nil if
2374TERMINAL does not refer to a text-only terminal. */) 2374TERMINAL does not refer to a text terminal. */)
2375 (Lisp_Object terminal) 2375 (Lisp_Object terminal)
2376{ 2376{
2377 struct terminal *t = get_terminal (terminal, 1); 2377 struct terminal *t = get_terminal (terminal, 1);
@@ -2381,6 +2381,21 @@ TERMINAL does not refer to a text-only terminal. */)
2381 return Qnil; 2381 return Qnil;
2382} 2382}
2383 2383
2384DEFUN ("tty-top-frame", Ftty_top_frame, Stty_top_frame, 0, 1, 0,
2385 doc: /* Return the topmost terminal frame on TERMINAL.
2386TERMINAL can be a terminal object, a frame or nil (meaning the
2387selected frame's terminal). This function returns nil if TERMINAL
2388does not refer to a text terminal. Otherwise, it returns the
2389top-most frame on the text terminal. */)
2390 (Lisp_Object terminal)
2391{
2392 struct terminal *t = get_terminal (terminal, 1);
2393
2394 if (t->type == output_termcap)
2395 return t->display_info.tty->top_frame;
2396 return Qnil;
2397}
2398
2384 2399
2385 2400
2386DEFUN ("suspend-tty", Fsuspend_tty, Ssuspend_tty, 0, 1, 0, 2401DEFUN ("suspend-tty", Fsuspend_tty, Ssuspend_tty, 0, 1, 0,
@@ -3638,6 +3653,7 @@ bigger, or it may make it blink, or it may do nothing at all. */);
3638 defsubr (&Stty_no_underline); 3653 defsubr (&Stty_no_underline);
3639 defsubr (&Stty_type); 3654 defsubr (&Stty_type);
3640 defsubr (&Scontrolling_tty_p); 3655 defsubr (&Scontrolling_tty_p);
3656 defsubr (&Stty_top_frame);
3641 defsubr (&Ssuspend_tty); 3657 defsubr (&Ssuspend_tty);
3642 defsubr (&Sresume_tty); 3658 defsubr (&Sresume_tty);
3643#ifdef HAVE_GPM 3659#ifdef HAVE_GPM
diff --git a/src/xdisp.c b/src/xdisp.c
index 1353b4e1184..87e079f8ab1 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -8410,9 +8410,9 @@ move_it_in_display_line_to (struct it *it,
8410 /* On graphical terminals, newlines may 8410 /* On graphical terminals, newlines may
8411 "overflow" into the fringe if 8411 "overflow" into the fringe if
8412 overflow-newline-into-fringe is non-nil. 8412 overflow-newline-into-fringe is non-nil.
8413 On text-only terminals, newlines may 8413 On text terminals, newlines may overflow
8414 overflow into the last glyph on the 8414 into the last glyph on the display
8415 display line.*/ 8415 line.*/
8416 if (!FRAME_WINDOW_P (it->f) 8416 if (!FRAME_WINDOW_P (it->f)
8417 || IT_OVERFLOW_NEWLINE_INTO_FRINGE (it)) 8417 || IT_OVERFLOW_NEWLINE_INTO_FRINGE (it))
8418 { 8418 {
@@ -10875,7 +10875,8 @@ static Lisp_Object mode_line_string_face_prop;
10875static Lisp_Object Vmode_line_unwind_vector; 10875static Lisp_Object Vmode_line_unwind_vector;
10876 10876
10877static Lisp_Object 10877static Lisp_Object
10878format_mode_line_unwind_data (struct buffer *obuf, 10878format_mode_line_unwind_data (struct frame *target_frame,
10879 struct buffer *obuf,
10879 Lisp_Object owin, 10880 Lisp_Object owin,
10880 int save_proptrans) 10881 int save_proptrans)
10881{ 10882{
@@ -10887,7 +10888,7 @@ format_mode_line_unwind_data (struct buffer *obuf,
10887 Vmode_line_unwind_vector = Qnil; 10888 Vmode_line_unwind_vector = Qnil;
10888 10889
10889 if (NILP (vector)) 10890 if (NILP (vector))
10890 vector = Fmake_vector (make_number (8), Qnil); 10891 vector = Fmake_vector (make_number (10), Qnil);
10891 10892
10892 ASET (vector, 0, make_number (mode_line_target)); 10893 ASET (vector, 0, make_number (mode_line_target));
10893 ASET (vector, 1, make_number (MODE_LINE_NOPROP_LEN (0))); 10894 ASET (vector, 1, make_number (MODE_LINE_NOPROP_LEN (0)));
@@ -10902,6 +10903,15 @@ format_mode_line_unwind_data (struct buffer *obuf,
10902 tmp = Qnil; 10903 tmp = Qnil;
10903 ASET (vector, 6, tmp); 10904 ASET (vector, 6, tmp);
10904 ASET (vector, 7, owin); 10905 ASET (vector, 7, owin);
10906 if (target_frame)
10907 {
10908 /* Similarly to `with-selected-window', if the operation selects
10909 a window on another frame, we must restore that frame's
10910 selected window, and (for a tty) the top-frame. */
10911 ASET (vector, 8, target_frame->selected_window);
10912 if (FRAME_TERMCAP_P (target_frame))
10913 ASET (vector, 9, FRAME_TTY (target_frame)->top_frame);
10914 }
10905 10915
10906 return vector; 10916 return vector;
10907} 10917}
@@ -10909,6 +10919,10 @@ format_mode_line_unwind_data (struct buffer *obuf,
10909static Lisp_Object 10919static Lisp_Object
10910unwind_format_mode_line (Lisp_Object vector) 10920unwind_format_mode_line (Lisp_Object vector)
10911{ 10921{
10922 Lisp_Object old_window = AREF (vector, 7);
10923 Lisp_Object target_frame_window = AREF (vector, 8);
10924 Lisp_Object old_top_frame = AREF (vector, 9);
10925
10912 mode_line_target = XINT (AREF (vector, 0)); 10926 mode_line_target = XINT (AREF (vector, 0));
10913 mode_line_noprop_ptr = mode_line_noprop_buf + XINT (AREF (vector, 1)); 10927 mode_line_noprop_ptr = mode_line_noprop_buf + XINT (AREF (vector, 1));
10914 mode_line_string_list = AREF (vector, 2); 10928 mode_line_string_list = AREF (vector, 2);
@@ -10917,9 +10931,26 @@ unwind_format_mode_line (Lisp_Object vector)
10917 mode_line_string_face = AREF (vector, 4); 10931 mode_line_string_face = AREF (vector, 4);
10918 mode_line_string_face_prop = AREF (vector, 5); 10932 mode_line_string_face_prop = AREF (vector, 5);
10919 10933
10920 if (!NILP (AREF (vector, 7))) 10934 /* Select window before buffer, since it may change the buffer. */
10921 /* Select window before buffer, since it may change the buffer. */ 10935 if (!NILP (old_window))
10922 Fselect_window (AREF (vector, 7), Qt); 10936 {
10937 /* If the operation that we are unwinding had selected a window
10938 on a different frame, reset its frame-selected-window. For a
10939 text terminal, reset its top-frame if necessary. */
10940 if (!NILP (target_frame_window))
10941 {
10942 Lisp_Object frame
10943 = WINDOW_FRAME (XWINDOW (target_frame_window));
10944
10945 if (!EQ (frame, WINDOW_FRAME (XWINDOW (old_window))))
10946 Fselect_window (target_frame_window, Qt);
10947
10948 if (!NILP (old_top_frame) && !EQ (old_top_frame, frame))
10949 Fselect_frame (old_top_frame, Qt);
10950 }
10951
10952 Fselect_window (old_window, Qt);
10953 }
10923 10954
10924 if (!NILP (AREF (vector, 6))) 10955 if (!NILP (AREF (vector, 6)))
10925 { 10956 {
@@ -10990,8 +11021,6 @@ store_mode_line_noprop (const char *string, int field_width, int precision)
10990 Frame Titles 11021 Frame Titles
10991 ***********************************************************************/ 11022 ***********************************************************************/
10992 11023
10993#ifdef HAVE_WINDOW_SYSTEM
10994
10995/* Set the title of FRAME, if it has changed. The title format is 11024/* Set the title of FRAME, if it has changed. The title format is
10996 Vicon_title_format if FRAME is iconified, otherwise it is 11025 Vicon_title_format if FRAME is iconified, otherwise it is
10997 frame_title_format. */ 11026 frame_title_format. */
@@ -11035,7 +11064,7 @@ x_consider_frame_title (Lisp_Object frame)
11035 mode_line_noprop_buf; then display the title. */ 11064 mode_line_noprop_buf; then display the title. */
11036 record_unwind_protect (unwind_format_mode_line, 11065 record_unwind_protect (unwind_format_mode_line,
11037 format_mode_line_unwind_data 11066 format_mode_line_unwind_data
11038 (current_buffer, selected_window, 0)); 11067 (f, current_buffer, selected_window, 0));
11039 11068
11040 Fselect_window (f->selected_window, Qt); 11069 Fselect_window (f->selected_window, Qt);
11041 set_buffer_internal_1 (XBUFFER (XWINDOW (f->selected_window)->buffer)); 11070 set_buffer_internal_1 (XBUFFER (XWINDOW (f->selected_window)->buffer));
@@ -11062,10 +11091,6 @@ x_consider_frame_title (Lisp_Object frame)
11062 } 11091 }
11063} 11092}
11064 11093
11065#endif /* not HAVE_WINDOW_SYSTEM */
11066
11067
11068
11069 11094
11070/*********************************************************************** 11095/***********************************************************************
11071 Menu Bars 11096 Menu Bars
@@ -11092,7 +11117,6 @@ prepare_menu_bars (void)
11092 /* Update all frame titles based on their buffer names, etc. We do 11117 /* Update all frame titles based on their buffer names, etc. We do
11093 this before the menu bars so that the buffer-menu will show the 11118 this before the menu bars so that the buffer-menu will show the
11094 up-to-date frame titles. */ 11119 up-to-date frame titles. */
11095#ifdef HAVE_WINDOW_SYSTEM
11096 if (windows_or_buffers_changed || update_mode_lines) 11120 if (windows_or_buffers_changed || update_mode_lines)
11097 { 11121 {
11098 Lisp_Object tail, frame; 11122 Lisp_Object tail, frame;
@@ -11105,7 +11129,6 @@ prepare_menu_bars (void)
11105 x_consider_frame_title (frame); 11129 x_consider_frame_title (frame);
11106 } 11130 }
11107 } 11131 }
11108#endif /* HAVE_WINDOW_SYSTEM */
11109 11132
11110 /* Update the menu bar item lists, if appropriate. This has to be 11133 /* Update the menu bar item lists, if appropriate. This has to be
11111 done before any actual redisplay or generation of display lines. */ 11134 done before any actual redisplay or generation of display lines. */
@@ -20230,7 +20253,7 @@ display_mode_line (struct window *w, enum face_id face_id, Lisp_Object format)
20230 it.paragraph_embedding = L2R; 20253 it.paragraph_embedding = L2R;
20231 20254
20232 record_unwind_protect (unwind_format_mode_line, 20255 record_unwind_protect (unwind_format_mode_line,
20233 format_mode_line_unwind_data (NULL, Qnil, 0)); 20256 format_mode_line_unwind_data (NULL, NULL, Qnil, 0));
20234 20257
20235 mode_line_target = MODE_LINE_DISPLAY; 20258 mode_line_target = MODE_LINE_DISPLAY;
20236 20259
@@ -20931,7 +20954,8 @@ are the selected window and the WINDOW's buffer). */)
20931 and set that to nil so that we don't alter the outer value. */ 20954 and set that to nil so that we don't alter the outer value. */
20932 record_unwind_protect (unwind_format_mode_line, 20955 record_unwind_protect (unwind_format_mode_line,
20933 format_mode_line_unwind_data 20956 format_mode_line_unwind_data
20934 (old_buffer, selected_window, 1)); 20957 (XFRAME (WINDOW_FRAME (XWINDOW (window))),
20958 old_buffer, selected_window, 1));
20935 mode_line_proptrans_alist = Qnil; 20959 mode_line_proptrans_alist = Qnil;
20936 20960
20937 Fselect_window (window, Qt); 20961 Fselect_window (window, Qt);