aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaroly Lorentey2005-06-26 21:12:57 +0000
committerKaroly Lorentey2005-06-26 21:12:57 +0000
commitd836b39b818551c04c7e598176d3f26be7abfa5e (patch)
tree51bad97e4eeb9af7e1e00646a324a38e33466beb
parent4ea81208d4c43df774e540a603be8f68cb470466 (diff)
parentc3bf675dd1caa64c514dcac38e2d21c64597f9ff (diff)
downloademacs-d836b39b818551c04c7e598176d3f26be7abfa5e.tar.gz
emacs-d836b39b818551c04c7e598176d3f26be7abfa5e.zip
Merged from miles@gnu.org--gnu-2005 (patch 447-448)
Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-447 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-448 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-360
-rw-r--r--admin/FOR-RELEASE32
-rw-r--r--etc/NEWS4
-rw-r--r--etc/PROBLEMS14
-rw-r--r--lisp/ChangeLog41
-rw-r--r--lisp/cus-face.el1
-rw-r--r--lisp/emacs-lisp/lisp-mode.el4
-rw-r--r--lisp/facemenu.el7
-rw-r--r--lisp/faces.el5
-rw-r--r--lisp/gnus/ChangeLog5
-rw-r--r--lisp/gnus/gnus-art.el2
-rw-r--r--lisp/jka-compr.el10
-rw-r--r--lisp/progmodes/gud.el10
-rw-r--r--lisp/replace.el6
-rw-r--r--lisp/simple.el14
-rw-r--r--lisp/subr.el27
-rw-r--r--lisp/wid-edit.el38
-rw-r--r--lisp/window.el34
-rw-r--r--lispref/ChangeLog21
-rw-r--r--lispref/display.texi10
-rw-r--r--lispref/makefile.w32-in2
-rw-r--r--lispref/numbers.texi19
-rw-r--r--lispref/objects.texi6
-rw-r--r--lispref/windows.texi10
-rw-r--r--man/ChangeLog12
-rw-r--r--man/display.texi5
-rw-r--r--man/makefile.w32-in41
-rw-r--r--src/ChangeLog51
-rw-r--r--src/dispextern.h2
-rw-r--r--src/eval.c71
-rw-r--r--src/fileio.c57
-rw-r--r--src/lread.c17
-rw-r--r--src/macfns.c2
-rw-r--r--src/s/ms-w32.h1
-rw-r--r--src/w32.c8
-rw-r--r--src/w32fns.c2
-rw-r--r--src/xdisp.c75
-rw-r--r--src/xfns.c2
37 files changed, 482 insertions, 186 deletions
diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE
index ce878fc173f..c28608068ba 100644
--- a/admin/FOR-RELEASE
+++ b/admin/FOR-RELEASE
@@ -14,6 +14,8 @@ has to be set to nil: when t, it can leak memory and cause other problems.
14** Check for widow and orphan lines in manuals; 14** Check for widow and orphan lines in manuals;
15make sure all the pages really look ok in the manual as formatted. 15make sure all the pages really look ok in the manual as formatted.
16 16
17** Update facemenu-unlisted-faces, adding whatever other
18face name prefixes should be in it for good results.
17 19
18* NEW FEATURES 20* NEW FEATURES
19 21
@@ -43,6 +45,36 @@ invalid pointer from string_free_list.
43 45
44* BUGS 46* BUGS
45 47
48** Bug in ebrowse
49
50Date: Fri, 27 May 2005 17:35:48 +0200
51From: Markus Gritsch <gritsch@iue.tuwien.ac.at>
52
53the C++ header file which led to the problematic BROWSE file reads
54
55namespace test {
56 class Base
57 {
58 };
59
60 class B : public Base
61 {
62 };
63}
64
65class A : public test::Base
66{
67};
68
69The *Tree* is then displayed as
70
71 *Globals*
72 test
73 test::Base
74 test::B
75
76The class A seems to be missing.
77
46** Ange-ftp should ignore irrelevant IPv6 errors: 78** Ange-ftp should ignore irrelevant IPv6 errors:
47 79
48Message-Id: <4121-Tue23Mar2004165249+0100-piet@cs.uu.nl> 80Message-Id: <4121-Tue23Mar2004165249+0100-piet@cs.uu.nl>
diff --git a/etc/NEWS b/etc/NEWS
index 618da3e801a..eab25b25864 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -4097,6 +4097,7 @@ return window edges in units of pixels, rather than columns and lines.
4097+++ 4097+++
4098*** The new macro `with-selected-window' temporarily switches the 4098*** The new macro `with-selected-window' temporarily switches the
4099selected window without impacting the order of `buffer-list'. 4099selected window without impacting the order of `buffer-list'.
4100It saves and restores the current buffer, too.
4100 4101
4101+++ 4102+++
4102*** `select-window' takes an optional second argument NORECORD. 4103*** `select-window' takes an optional second argument NORECORD.
@@ -4106,7 +4107,8 @@ This is like `switch-to-buffer'.
4106+++ 4107+++
4107*** `save-selected-window' now saves and restores the selected window 4108*** `save-selected-window' now saves and restores the selected window
4108of every frame. This way, it restores everything that can be changed 4109of every frame. This way, it restores everything that can be changed
4109by calling `select-window'. 4110by calling `select-window'. It also saves and restores the current
4111buffer.
4110 4112
4111+++ 4113+++
4112*** `set-window-buffer' has an optional argument KEEP-MARGINS. 4114*** `set-window-buffer' has an optional argument KEEP-MARGINS.
diff --git a/etc/PROBLEMS b/etc/PROBLEMS
index 3bca366ef26..5b0c4e5eee7 100644
--- a/etc/PROBLEMS
+++ b/etc/PROBLEMS
@@ -961,6 +961,20 @@ xmodmap command to the xdm setup script for that display.
961 961
962Use the shell command `xset bc' to make the old X Menu package work. 962Use the shell command `xset bc' to make the old X Menu package work.
963 963
964*** C-SPC fails to work on Fedora GNU/Linux.
965
966Fedora Core 4 steals the C-SPC key by default for the `iiimx' program
967which is the input method for some languages. It blocks Emacs users
968from using the C-SPC key for `set-mark-command'.
969
970One solutions is to remove the `<Ctrl>space' from the `Iiimx' file
971which can be found in the `/usr/lib/X11/app-defaults' directory.
972However, that requires root access.
973
974Another is to specify `Emacs*useXIM: false' in your X resources.
975
976Another is to build Emacs with the `--without-xim' configure option.
977
964*** M-SPC seems to be ignored as input. 978*** M-SPC seems to be ignored as input.
965 979
966See if your X server is set up to use this as a command 980See if your X server is set up to use this as a command
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index d850358c01e..4efa62aa2c3 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,13 +1,48 @@
12005-06-25 Luc Teirlinck <teirllm@auburn.edu>
2
3 * faces.el (facep): Doc fix.
4
52005-06-25 Richard M. Stallman <rms@gnu.org>
6
7 * facemenu.el (facemenu-enable-faces-p): New function.
8 (facemenu-background-menu, facemenu-foreground-menu)
9 (facemenu-face-menu): Add menu-enable property.
10
11 * jka-compr.el (jka-compr-insert-file-contents):
12 Special handling if cannot find the uncompression program.
13
14 * cus-face.el (custom-face-attributes): Add autoload.
15
16 * emacs-lisp/lisp-mode.el (lisp-mode-variables):
17 Bind comment-indent-function locally.
18
19 * window.el (save-selected-window): Use save-current-buffer.
20
21 * subr.el (with-selected-window): Use save-current-buffer.
22
23 * progmodes/gud.el (gud-filter): Simplify using with-selected-window
24 and with-current-buffer.
25
262005-06-24 Richard M. Stallman <rms@gnu.org>
27
28 * simple.el (line-move-1): Fix previous change.
29
302005-06-24 Juanma Barranquero <lekktu@gmail.com>
31
32 * replace.el (occur-1): Set `buffer-read-only' and the
33 buffer-modified flag before running `occur-hook' to protect
34 against unintentional buffer switches that can lead to data loss.
35
12005-06-24 Nick Roberts <nickrob@snap.net.nz> 362005-06-24 Nick Roberts <nickrob@snap.net.nz>
2 37
3 * progmodes/gud.el (gud-tooltip-print-command): Indent properly. 38 * progmodes/gud.el (gud-tooltip-print-command): Indent properly.
4 (gud-gdb-marker-filter): Use font-lock-warning-face for any 39 (gud-gdb-marker-filter): Use font-lock-warning-face for any
5 initial error. 40 initial error.
6 41
7 * progmodes/gdb-ui.el (gdb-send): Remove warning face from errors 42 * progmodes/gdb-ui.el (gdb-send): Remove warning face from errors
8 after fresh input. 43 after fresh input.
9 (gdb-var-create-handler): Put name of expression in quotes. 44 (gdb-var-create-handler): Put name of expression in quotes.
10 45
112005-06-23 Luc Teirlinck <teirllm@auburn.edu> 462005-06-23 Luc Teirlinck <teirllm@auburn.edu>
12 47
13 * emacs-lisp/ring.el (ring-elements): Make it return a list of the 48 * emacs-lisp/ring.el (ring-elements): Make it return a list of the
@@ -532,7 +567,7 @@
532 567
533 * progmodes/gdb-ui.el (menu): Re-order menu items. 568 * progmodes/gdb-ui.el (menu): Re-order menu items.
534 (gdb-tooltip-print): Respect tooltip-use-echo-area. 569 (gdb-tooltip-print): Respect tooltip-use-echo-area.
535 570
536 * progmodes/gud.el (tooltip-use-echo-area): Remove alias. 571 * progmodes/gud.el (tooltip-use-echo-area): Remove alias.
537 Define in tooltip.el. 572 Define in tooltip.el.
538 (gud-tooltip-process-output): Respect tooltip-use-echo-area. 573 (gud-tooltip-process-output): Respect tooltip-use-echo-area.
diff --git a/lisp/cus-face.el b/lisp/cus-face.el
index 1a8cce0473a..3a3631cdd7e 100644
--- a/lisp/cus-face.el
+++ b/lisp/cus-face.el
@@ -62,6 +62,7 @@
62 62
63;;; Face attributes. 63;;; Face attributes.
64 64
65;;;###autoload
65(defconst custom-face-attributes 66(defconst custom-face-attributes
66 '((:family 67 '((:family
67 (string :tag "Font Family" 68 (string :tag "Font Family"
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index 1ffc33835e9..972fe6bafc8 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -202,6 +202,8 @@
202 (setq comment-column 40) 202 (setq comment-column 40)
203 ;; Don't get confused by `;' in doc strings when paragraph-filling. 203 ;; Don't get confused by `;' in doc strings when paragraph-filling.
204 (set (make-local-variable 'comment-use-global-state) t) 204 (set (make-local-variable 'comment-use-global-state) t)
205 (make-local-variable 'comment-indent-function)
206 (setq comment-indent-function 'lisp-comment-indent)
205 (make-local-variable 'imenu-generic-expression) 207 (make-local-variable 'imenu-generic-expression)
206 (setq imenu-generic-expression lisp-imenu-generic-expression) 208 (setq imenu-generic-expression lisp-imenu-generic-expression)
207 (make-local-variable 'multibyte-syntax-as-symbol) 209 (make-local-variable 'multibyte-syntax-as-symbol)
@@ -714,7 +716,7 @@ which see."
714 (setq debug-on-error new-value)) 716 (setq debug-on-error new-value))
715 value))))) 717 value)))))
716 718
717 719;; Used for comment-indent-function in Lisp modes.
718(defun lisp-comment-indent () 720(defun lisp-comment-indent ()
719 (if (looking-at "\\s<\\s<\\s<") 721 (if (looking-at "\\s<\\s<\\s<")
720 (current-column) 722 (current-column)
diff --git a/lisp/facemenu.el b/lisp/facemenu.el
index cd3998520a1..57dea40266a 100644
--- a/lisp/facemenu.el
+++ b/lisp/facemenu.el
@@ -162,6 +162,7 @@ when they are created."
162 "Menu keymap for faces.") 162 "Menu keymap for faces.")
163;;;###autoload 163;;;###autoload
164(defalias 'facemenu-face-menu facemenu-face-menu) 164(defalias 'facemenu-face-menu facemenu-face-menu)
165(put 'facemenu-face-menu 'menu-enable '(facemenu-enable-faces-p))
165 166
166;;;###autoload 167;;;###autoload
167(defvar facemenu-foreground-menu 168(defvar facemenu-foreground-menu
@@ -171,6 +172,7 @@ when they are created."
171 "Menu keymap for foreground colors.") 172 "Menu keymap for foreground colors.")
172;;;###autoload 173;;;###autoload
173(defalias 'facemenu-foreground-menu facemenu-foreground-menu) 174(defalias 'facemenu-foreground-menu facemenu-foreground-menu)
175(put 'facemenu-foreground-menu 'menu-enable '(facemenu-enable-faces-p))
174 176
175;;;###autoload 177;;;###autoload
176(defvar facemenu-background-menu 178(defvar facemenu-background-menu
@@ -180,6 +182,11 @@ when they are created."
180 "Menu keymap for background colors.") 182 "Menu keymap for background colors.")
181;;;###autoload 183;;;###autoload
182(defalias 'facemenu-background-menu facemenu-background-menu) 184(defalias 'facemenu-background-menu facemenu-background-menu)
185(put 'facemenu-background-menu 'menu-enable '(facemenu-enable-faces-p))
186
187;;; Condition for enabling menu items that set faces.
188(defun facemenu-enable-faces-p ()
189 (not (and font-lock-mode font-lock-defaults)))
183 190
184;;;###autoload 191;;;###autoload
185(defvar facemenu-special-menu 192(defvar facemenu-special-menu
diff --git a/lisp/faces.el b/lisp/faces.el
index eb8fe15e1c0..4f577d7ff2e 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -204,7 +204,10 @@ If NAME is already a face, it is simply returned."
204;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 204;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
205 205
206(defun facep (face) 206(defun facep (face)
207 "Return non-nil if FACE is a face name." 207 "Return non-nil if FACE is a face name or internal face object.
208Return nil otherwise. A face name can be a string or a symbol.
209An internal face object is a vector of the kind used internally
210to record face data."
208 (internal-lisp-face-p face)) 211 (internal-lisp-face-p face))
209 212
210 213
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index a1128f214cb..b7698350efb 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,8 @@
12005-06-24 Juanma Barranquero <lekktu@gmail.com>
2
3 * gnus-art.el (gnus-article-mode): Set `nobreak-char-display', not
4 `show-nonbreak-escape'.
5
12005-06-23 Lute Kamstra <lute@gnu.org> 62005-06-23 Lute Kamstra <lute@gnu.org>
2 7
3 * gnus-art.el (gnus-article-mode): Use kill-all-local-variables. 8 * gnus-art.el (gnus-article-mode): Use kill-all-local-variables.
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index 56a79951b0c..b92ce8616d5 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -3755,7 +3755,7 @@ commands:
3755 (make-local-variable 'gnus-article-charset) 3755 (make-local-variable 'gnus-article-charset)
3756 (make-local-variable 'gnus-article-ignored-charsets) 3756 (make-local-variable 'gnus-article-ignored-charsets)
3757 ;; Prevent recent Emacsen from displaying non-break space as "\ ". 3757 ;; Prevent recent Emacsen from displaying non-break space as "\ ".
3758 (set (make-local-variable 'show-nonbreak-escape) nil) 3758 (set (make-local-variable 'nobreak-char-display) nil)
3759 (gnus-set-default-directory) 3759 (gnus-set-default-directory)
3760 (buffer-disable-undo) 3760 (buffer-disable-undo)
3761 (setq buffer-read-only t) 3761 (setq buffer-read-only t)
diff --git a/lisp/jka-compr.el b/lisp/jka-compr.el
index ca5e158349d..f282957512c 100644
--- a/lisp/jka-compr.el
+++ b/lisp/jka-compr.el
@@ -474,6 +474,9 @@ There should be no more than seven characters after the final `/'."
474 (delete-region (point) (point-max))) 474 (delete-region (point) (point-max)))
475 (goto-char start)) 475 (goto-char start))
476 (error 476 (error
477 ;; If the file we wanted to uncompress does not exist,
478 ;; handle that according to VISIT as `insert-file-contents'
479 ;; would, maybe signaling the same error it normally would.
477 (if (and (eq (car error-code) 'file-error) 480 (if (and (eq (car error-code) 'file-error)
478 (eq (nth 3 error-code) local-file)) 481 (eq (nth 3 error-code) local-file))
479 (if visit 482 (if visit
@@ -481,6 +484,13 @@ There should be no more than seven characters after the final `/'."
481 (signal 'file-error 484 (signal 'file-error
482 (cons "Opening input file" 485 (cons "Opening input file"
483 (nthcdr 2 error-code)))) 486 (nthcdr 2 error-code))))
487 ;; If the uncompression program can't be found,
488 ;; signal that as a non-file error
489 ;; so that find-file-noselect-1 won't handle it.
490 (if (and (eq (car error-code) 'file-error)
491 (equal (cadr error-code) "Searching for program"))
492 (error "Uncompression program `%s' not found"
493 (nth 3 error-code)))
484 (signal (car error-code) (cdr error-code)))))) 494 (signal (car error-code) (cdr error-code))))))
485 495
486 (and 496 (and
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index c6e85934db4..471d3b308ec 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -2534,16 +2534,12 @@ It is saved for when this flag is not set.")
2534 ;; This must be outside of the save-excursion 2534 ;; This must be outside of the save-excursion
2535 ;; in case the source file is our current buffer. 2535 ;; in case the source file is our current buffer.
2536 (if process-window 2536 (if process-window
2537 (save-selected-window 2537 (with-selected-window
2538 (select-window process-window)
2539 (gud-display-frame)) 2538 (gud-display-frame))
2540 ;; We have to be in the proper buffer, (process-buffer proc), 2539 ;; We have to be in the proper buffer, (process-buffer proc),
2541 ;; but not in a save-excursion, because that would restore point. 2540 ;; but not in a save-excursion, because that would restore point.
2542 (let ((old-buf (current-buffer))) 2541 (with-current-buffer (process-buffer proc)
2543 (set-buffer (process-buffer proc)) 2542 (gud-display-frame))))
2544 (unwind-protect
2545 (gud-display-frame)
2546 (set-buffer old-buf)))))
2547 2543
2548 ;; If we deferred text that arrived during this processing, 2544 ;; If we deferred text that arrived during this processing,
2549 ;; handle it now. 2545 ;; handle it now.
diff --git a/lisp/replace.el b/lisp/replace.el
index d5ccd8723c2..2896ce133de 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -1001,9 +1001,9 @@ See also `multi-occur'."
1001 (display-buffer occur-buf) 1001 (display-buffer occur-buf)
1002 (setq next-error-last-buffer occur-buf)) 1002 (setq next-error-last-buffer occur-buf))
1003 (kill-buffer occur-buf))) 1003 (kill-buffer occur-buf)))
1004 (run-hooks 'occur-hook)) 1004 (setq buffer-read-only t)
1005 (setq buffer-read-only t) 1005 (set-buffer-modified-p nil)
1006 (set-buffer-modified-p nil)))) 1006 (run-hooks 'occur-hook)))))
1007 1007
1008(defun occur-engine-add-prefix (lines) 1008(defun occur-engine-add-prefix (lines)
1009 (mapcar 1009 (mapcar
diff --git a/lisp/simple.el b/lisp/simple.el
index 5d4872e516b..1ee4580144b 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -3446,18 +3446,14 @@ Outline mode sets this."
3446 (when (and (not done) 3446 (when (and (not done)
3447 (not (integerp selective-display)) 3447 (not (integerp selective-display))
3448 (not (line-move-invisible-p (point)))) 3448 (not (line-move-invisible-p (point))))
3449 ;; We avoid vertical-motion when possible
3450 ;; because that has to fontify.
3451 (forward-line 1)
3452 ;; If there are overlays in and around
3453 ;; the text we moved over, we need to be
3454 ;; sophisticated.
3455 (unless (overlays-in (max (1- pos-before) (point-min)) 3449 (unless (overlays-in (max (1- pos-before) (point-min))
3456 (min (1+ (point)) (point-max))) 3450 (min (1+ (point)) (point-max)))
3451 ;; We avoid vertical-motion when possible
3452 ;; because that has to fontify.
3453 (forward-line 1)
3457 (setq line-done t))) 3454 (setq line-done t)))
3458 ;; Otherwise move a more sophisticated way.
3459 ;; (What's the logic behind this code?)
3460 (and (not done) (not line-done) 3455 (and (not done) (not line-done)
3456 ;; Otherwise move a more sophisticated way.
3461 (zerop (vertical-motion 1)) 3457 (zerop (vertical-motion 1))
3462 (if (not noerror) 3458 (if (not noerror)
3463 (signal 'end-of-buffer nil) 3459 (signal 'end-of-buffer nil)
@@ -3477,9 +3473,9 @@ Outline mode sets this."
3477 (when (and (not done) 3473 (when (and (not done)
3478 (not (integerp selective-display)) 3474 (not (integerp selective-display))
3479 (not (line-move-invisible-p (1- (point))))) 3475 (not (line-move-invisible-p (1- (point)))))
3480 (forward-line -1)
3481 (unless (overlays-in (max (1- (point)) (point-min)) 3476 (unless (overlays-in (max (1- (point)) (point-min))
3482 (min (1+ pos-before) (point-max))) 3477 (min (1+ pos-before) (point-max)))
3478 (forward-line -1)
3483 (setq line-done t))) 3479 (setq line-done t)))
3484 (and (not done) (not line-done) 3480 (and (not done) (not line-done)
3485 (zerop (vertical-motion -1)) 3481 (zerop (vertical-motion -1))
diff --git a/lisp/subr.el b/lisp/subr.el
index 113ba4239e0..c7b565d48f5 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -1717,8 +1717,12 @@ See also `with-temp-buffer'."
1717(defmacro with-selected-window (window &rest body) 1717(defmacro with-selected-window (window &rest body)
1718 "Execute the forms in BODY with WINDOW as the selected window. 1718 "Execute the forms in BODY with WINDOW as the selected window.
1719The value returned is the value of the last form in BODY. 1719The value returned is the value of the last form in BODY.
1720This does not alter the buffer list ordering. 1720
1721This function saves and restores the selected window, as well as 1721This macro saves and restores the current buffer, since otherwise
1722its normal operation could potentially make a different
1723buffer current. It does not alter the buffer list ordering.
1724
1725This macro saves and restores the selected window, as well as
1722the selected window in each frame. If the previously selected 1726the selected window in each frame. If the previously selected
1723window of some frame is no longer live at the end of BODY, that 1727window of some frame is no longer live at the end of BODY, that
1724frame's selected window is left alone. If the selected window is 1728frame's selected window is left alone. If the selected window is
@@ -1734,15 +1738,16 @@ See also `with-temp-buffer'."
1734 (save-selected-window-alist 1738 (save-selected-window-alist
1735 (mapcar (lambda (frame) (list frame (frame-selected-window frame))) 1739 (mapcar (lambda (frame) (list frame (frame-selected-window frame)))
1736 (frame-list)))) 1740 (frame-list))))
1737 (unwind-protect 1741 (save-current-buffer
1738 (progn (select-window ,window 'norecord) 1742 (unwind-protect
1739 ,@body) 1743 (progn (select-window ,window 'norecord)
1740 (dolist (elt save-selected-window-alist) 1744 ,@body)
1741 (and (frame-live-p (car elt)) 1745 (dolist (elt save-selected-window-alist)
1742 (window-live-p (cadr elt)) 1746 (and (frame-live-p (car elt))
1743 (set-frame-selected-window (car elt) (cadr elt)))) 1747 (window-live-p (cadr elt))
1744 (if (window-live-p save-selected-window-window) 1748 (set-frame-selected-window (car elt) (cadr elt))))
1745 (select-window save-selected-window-window 'norecord))))) 1749 (if (window-live-p save-selected-window-window)
1750 (select-window save-selected-window-window 'norecord))))))
1746 1751
1747(defmacro with-selected-frame (frame &rest body) 1752(defmacro with-selected-frame (frame &rest body)
1748 "Execute the forms in BODY with FRAME as the selected frame. 1753 "Execute the forms in BODY with FRAME as the selected frame.
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el
index fbd76c6931a..b582ca6854a 100644
--- a/lisp/wid-edit.el
+++ b/lisp/wid-edit.el
@@ -967,28 +967,28 @@ Recommended as a parent keymap for modes using widgets.")
967 (recenter)) 967 (recenter))
968 ) 968 )
969 969
970 (let ((up t) command) 970 (let ((up t) command)
971 ;; Mouse click not on a widget button. Find the global 971 ;; Mouse click not on a widget button. Find the global
972 ;; command to run, and check whether it is bound to an 972 ;; command to run, and check whether it is bound to an
973 ;; up event. 973 ;; up event.
974 (mouse-set-point event) 974 (mouse-set-point event)
975 (if (memq (event-basic-type event) '(mouse-1 down-mouse-1)) 975 (if (memq (event-basic-type event) '(mouse-1 down-mouse-1))
976 (cond ((setq command ;down event
977 (lookup-key widget-global-map [down-mouse-1]))
978 (setq up nil))
979 ((setq command ;up event
980 (lookup-key widget-global-map [mouse-1]))))
981 (cond ((setq command ;down event 976 (cond ((setq command ;down event
982 (lookup-key widget-global-map [down-mouse-2])) 977 (lookup-key widget-global-map [down-mouse-1]))
983 (setq up nil)) 978 (setq up nil))
984 ((setq command ;up event 979 ((setq command ;up event
985 (lookup-key widget-global-map [mouse-2]))))) 980 (lookup-key widget-global-map [mouse-1]))))
986 (when up 981 (cond ((setq command ;down event
987 ;; Don't execute up events twice. 982 (lookup-key widget-global-map [down-mouse-2]))
988 (while (not (widget-button-release-event-p event)) 983 (setq up nil))
989 (setq event (read-event)))) 984 ((setq command ;up event
990 (when command 985 (lookup-key widget-global-map [mouse-2])))))
991 (call-interactively command))))) 986 (when up
987 ;; Don't execute up events twice.
988 (while (not (widget-button-release-event-p event))
989 (setq event (read-event))))
990 (when command
991 (call-interactively command)))))
992 (message "You clicked somewhere weird."))) 992 (message "You clicked somewhere weird.")))
993 993
994(defun widget-button-press (pos &optional event) 994(defun widget-button-press (pos &optional event)
diff --git a/lisp/window.el b/lisp/window.el
index 09fac6c520f..75052f9a5f1 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -40,11 +40,18 @@ unless you explicitly change the size, or Emacs has no other choice.")
40 40
41(defmacro save-selected-window (&rest body) 41(defmacro save-selected-window (&rest body)
42 "Execute BODY, then select the window that was selected before BODY. 42 "Execute BODY, then select the window that was selected before BODY.
43Also restore the selected window of each frame as it was at the start 43The value returned is the value of the last form in BODY.
44of this construct. 44
45However, if a window has become dead, don't get an error, 45This macro saves and restores the current buffer, since otherwise
46just refrain from reselecting it. 46its normal operation could potentially make a different
47Return the value of the last form in BODY." 47buffer current. It does not alter the buffer list ordering.
48
49This macro saves and restores the selected window, as well as
50the selected window in each frame. If the previously selected
51window of some frame is no longer live at the end of BODY, that
52frame's selected window is left alone. If the selected window is
53no longer live, then whatever window is selected at the end of
54BODY remains selected."
48 `(let ((save-selected-window-window (selected-window)) 55 `(let ((save-selected-window-window (selected-window))
49 ;; It is necessary to save all of these, because calling 56 ;; It is necessary to save all of these, because calling
50 ;; select-window changes frame-selected-window for whatever 57 ;; select-window changes frame-selected-window for whatever
@@ -52,14 +59,15 @@ Return the value of the last form in BODY."
52 (save-selected-window-alist 59 (save-selected-window-alist
53 (mapcar (lambda (frame) (list frame (frame-selected-window frame))) 60 (mapcar (lambda (frame) (list frame (frame-selected-window frame)))
54 (frame-list)))) 61 (frame-list))))
55 (unwind-protect 62 (save-current-buffer
56 (progn ,@body) 63 (unwind-protect
57 (dolist (elt save-selected-window-alist) 64 (progn ,@body)
58 (and (frame-live-p (car elt)) 65 (dolist (elt save-selected-window-alist)
59 (window-live-p (cadr elt)) 66 (and (frame-live-p (car elt))
60 (set-frame-selected-window (car elt) (cadr elt)))) 67 (window-live-p (cadr elt))
61 (if (window-live-p save-selected-window-window) 68 (set-frame-selected-window (car elt) (cadr elt))))
62 (select-window save-selected-window-window))))) 69 (if (window-live-p save-selected-window-window)
70 (select-window save-selected-window-window))))))
63 71
64(defun window-body-height (&optional window) 72(defun window-body-height (&optional window)
65 "Return number of lines in window WINDOW for actual buffer text. 73 "Return number of lines in window WINDOW for actual buffer text.
diff --git a/lispref/ChangeLog b/lispref/ChangeLog
index 77d2d961905..6e6e8f4a9ed 100644
--- a/lispref/ChangeLog
+++ b/lispref/ChangeLog
@@ -1,3 +1,24 @@
12005-06-25 Luc Teirlinck <teirllm@auburn.edu>
2
3 * display.texi (Faces): `facep' returns t for strings that are
4 face names.
5
62005-06-25 Richard M. Stallman <rms@gnu.org>
7
8 * objects.texi (Equality Predicates): Clarify meaning of equal.
9
10 * windows.texi (Selecting Windows): save-selected-window
11 and with-selected-window save and restore the current buffer.
12
132005-06-24 Richard M. Stallman <rms@gnu.org>
14
15 * numbers.texi (Float Basics): Explain how to test for NaN,
16 and printing the sign of NaNs.
17
182005-06-24 Eli Zaretskii <eliz@gnu.org>
19
20 * makefile.w32-in (MAKEINFO): Use --force.
21
12005-06-23 Richard M. Stallman <rms@gnu.org> 222005-06-23 Richard M. Stallman <rms@gnu.org>
2 23
3 * display.texi (Face Functions): Correct Texinfo usage. 24 * display.texi (Face Functions): Correct Texinfo usage.
diff --git a/lispref/display.texi b/lispref/display.texi
index aa3284ad0e4..fe0797f1a1c 100644
--- a/lispref/display.texi
+++ b/lispref/display.texi
@@ -1628,12 +1628,12 @@ particular parts of the text or the frame.
1628@cindex face id 1628@cindex face id
1629Each face has its own @dfn{face number}, which distinguishes faces at 1629Each face has its own @dfn{face number}, which distinguishes faces at
1630low levels within Emacs. However, for most purposes, you refer to 1630low levels within Emacs. However, for most purposes, you refer to
1631faces in Lisp programs by their names. 1631faces in Lisp programs by the symbol that names them.
1632 1632
1633@defun facep object 1633@defun facep object
1634This function returns @code{t} if @var{object} is a face name symbol (or 1634This function returns @code{t} if @var{object} is a face name string
1635if it is a vector of the kind used internally to record face data). It 1635or symbol (or if it is a vector of the kind used internally to record
1636returns @code{nil} otherwise. 1636face data). It returns @code{nil} otherwise.
1637@end defun 1637@end defun
1638 1638
1639Each face name is meaningful for all frames, and by default it has the 1639Each face name is meaningful for all frames, and by default it has the
@@ -1795,7 +1795,7 @@ end of a line.
1795 The way to define a new face is with @code{defface}. This creates a 1795 The way to define a new face is with @code{defface}. This creates a
1796kind of customization item (@pxref{Customization}) which the user can 1796kind of customization item (@pxref{Customization}) which the user can
1797customize using the Customization buffer (@pxref{Easy Customization,,, 1797customize using the Customization buffer (@pxref{Easy Customization,,,
1798emacs, The GNU Emacs Manual}). 1798emacs, The GNU Emacs Manual}).
1799 1799
1800@defmac defface face spec doc [keyword value]... 1800@defmac defface face spec doc [keyword value]...
1801This declares @var{face} as a customizable face that defaults 1801This declares @var{face} as a customizable face that defaults
diff --git a/lispref/makefile.w32-in b/lispref/makefile.w32-in
index 248330167b2..0865aa8df58 100644
--- a/lispref/makefile.w32-in
+++ b/lispref/makefile.w32-in
@@ -29,7 +29,7 @@ infodir = $(srcdir)/../info
29# TEX=platex 29# TEX=platex
30TEX=tex 30TEX=tex
31INSTALL_INFO = install-info 31INSTALL_INFO = install-info
32MAKEINFO = makeinfo 32MAKEINFO = makeinfo --force
33 33
34# The environment variable and its value to add $(srcdir) to the path 34# The environment variable and its value to add $(srcdir) to the path
35# searched for TeX input files. 35# searched for TeX input files.
diff --git a/lispref/numbers.texi b/lispref/numbers.texi
index 776251e4933..f7f88248ff1 100644
--- a/lispref/numbers.texi
+++ b/lispref/numbers.texi
@@ -183,21 +183,26 @@ there is no correct answer. For example, @code{(/ 0.0 0.0)} returns a
183NaN. For practical purposes, there's no significant difference between 183NaN. For practical purposes, there's no significant difference between
184different NaN values in Emacs Lisp, and there's no rule for precisely 184different NaN values in Emacs Lisp, and there's no rule for precisely
185which NaN value should be used in a particular case, so Emacs Lisp 185which NaN value should be used in a particular case, so Emacs Lisp
186doesn't try to distinguish them. Here are the read syntaxes for 186doesn't try to distinguish them (but it does report the sign, if you
187these special floating point values: 187print it). Here are the read syntaxes for these special floating
188point values:
188 189
189@table @asis 190@table @asis
190@item positive infinity 191@item positive infinity
191@samp{1.0e+INF} 192@samp{1.0e+INF}
192@item negative infinity 193@item negative infinity
193@samp{-1.0e+INF} 194@samp{-1.0e+INF}
194@item Not-a-number 195@item Not-a-number
195@samp{0.0e+NaN}. 196@samp{0.0e+NaN} or @samp{-0.0e+NaN}.
196@end table 197@end table
197 198
198 In addition, the value @code{-0.0} is distinguishable from ordinary 199 To test whether a floating point value is a NaN, compare it with
199zero in @acronym{IEEE} floating point (although @code{equal} and 200itself using @code{=}. That returns @code{nil} for a NaN, and
200@code{=} consider them equal values). 201@code{t} for any other floating point value.
202
203 The value @code{-0.0} is distinguishable from ordinary zero in
204@acronym{IEEE} floating point, but Emacs Lisp @code{equal} and
205@code{=} consider them equal values.
201 206
202 You can use @code{logb} to extract the binary exponent of a floating 207 You can use @code{logb} to extract the binary exponent of a floating
203point number (or estimate the logarithm of an integer): 208point number (or estimate the logarithm of an integer):
diff --git a/lispref/objects.texi b/lispref/objects.texi
index 93d7c51b08d..4a693f186d6 100644
--- a/lispref/objects.texi
+++ b/lispref/objects.texi
@@ -1820,8 +1820,7 @@ describing the data type.
1820 1820
1821@defun eq object1 object2 1821@defun eq object1 object2
1822This function returns @code{t} if @var{object1} and @var{object2} are 1822This function returns @code{t} if @var{object1} and @var{object2} are
1823the same object, @code{nil} otherwise. The ``same object'' means that a 1823the same object, @code{nil} otherwise.
1824change in one will be reflected by the same change in the other.
1825 1824
1826@code{eq} returns @code{t} if @var{object1} and @var{object2} are 1825@code{eq} returns @code{t} if @var{object1} and @var{object2} are
1827integers with the same value. Also, since symbol names are normally 1826integers with the same value. Also, since symbol names are normally
@@ -1829,7 +1828,8 @@ unique, if the arguments are symbols with the same name, they are
1829@code{eq}. For other types (e.g., lists, vectors, strings), two 1828@code{eq}. For other types (e.g., lists, vectors, strings), two
1830arguments with the same contents or elements are not necessarily 1829arguments with the same contents or elements are not necessarily
1831@code{eq} to each other: they are @code{eq} only if they are the same 1830@code{eq} to each other: they are @code{eq} only if they are the same
1832object. 1831object, meaning that a change in the contents of one will be reflected
1832by the same change in the contents of the other.
1833 1833
1834@example 1834@example
1835@group 1835@group
diff --git a/lispref/windows.texi b/lispref/windows.texi
index d9ecf5db7eb..5a58c31f39a 100644
--- a/lispref/windows.texi
+++ b/lispref/windows.texi
@@ -463,8 +463,8 @@ The return value is @var{window}.
463@defmac save-selected-window forms@dots{} 463@defmac save-selected-window forms@dots{}
464This macro records the selected frame, as well as the selected window 464This macro records the selected frame, as well as the selected window
465of each frame, executes @var{forms} in sequence, then restores the 465of each frame, executes @var{forms} in sequence, then restores the
466earlier selected frame and windows It returns the value of the last 466earlier selected frame and windows. It also saves and restores the
467form in @var{forms}. 467current buffer. It returns the value of the last form in @var{forms}.
468 468
469This macro does not save or restore anything about the sizes, 469This macro does not save or restore anything about the sizes,
470arrangement or contents of windows; therefore, if the @var{forms} 470arrangement or contents of windows; therefore, if the @var{forms}
@@ -478,9 +478,9 @@ the end of @var{forms} remains selected.
478@defmac with-selected-window window forms@dots{} 478@defmac with-selected-window window forms@dots{}
479This macro selects @var{window} (without changing the buffer list), 479This macro selects @var{window} (without changing the buffer list),
480executes @var{forms} in sequence, then restores the previously 480executes @var{forms} in sequence, then restores the previously
481selected window (unless that window is no longer alive). It is similar 481selected window and current buffer. It is just like
482to @code{save-selected-window} except that it explicitly selects 482@code{save-selected-window}, except that it explicitly selects
483@var{window}, without altering the buffer list sequence. 483@var{window}, also without altering the buffer list sequence.
484@end defmac 484@end defmac
485 485
486@cindex finding windows 486@cindex finding windows
diff --git a/man/ChangeLog b/man/ChangeLog
index 6bcbe6dc9e9..1357692cc6c 100644
--- a/man/ChangeLog
+++ b/man/ChangeLog
@@ -1,3 +1,15 @@
12005-06-24 Richard M. Stallman <rms@gnu.org>
2
3 * display.texi (Text Display): Change index entries.
4
52005-06-24 Eli Zaretskii <eliz@gnu.org>
6
7 * makefile.w32-in (MAKEINFO): Use --force.
8 (INFO_TARGETS, DVI_TARGETS): Make identical to the lists in
9 Makefile.in.
10 (gnus.dvi): Use "..." to quote Sed args, so that it works with
11 more shells.
12
12005-06-23 Richard M. Stallman <rms@gnu.org> 132005-06-23 Richard M. Stallman <rms@gnu.org>
2 14
3 * anti.texi (Antinews): Renamed show-nonbreak-escape to 15 * anti.texi (Antinews): Renamed show-nonbreak-escape to
diff --git a/man/display.texi b/man/display.texi
index 7bdd1d5fb59..02854b3d6db 100644
--- a/man/display.texi
+++ b/man/display.texi
@@ -946,8 +946,9 @@ them), otherwise as escape sequences. @xref{Single-Byte Character
946Support}. 946Support}.
947 947
948@vindex nobreak-char-display 948@vindex nobreak-char-display
949@cindex nobreak space, display 949@cindex no-break space, display
950@cindex nobreak hyphen, display 950@cindex no-break hyphen, display
951@cindex soft hyphen, display
951 Some character sets define ``no-break'' versions of the space and 952 Some character sets define ``no-break'' versions of the space and
952hyphen characters, which are used where a line should not be broken. 953hyphen characters, which are used where a line should not be broken.
953Emacs normally displays these characters with special faces 954Emacs normally displays these characters with special faces
diff --git a/man/makefile.w32-in b/man/makefile.w32-in
index d89c77ab5d9..9771be8ef06 100644
--- a/man/makefile.w32-in
+++ b/man/makefile.w32-in
@@ -29,33 +29,28 @@ srcdir=.
29infodir = $(srcdir)/../info 29infodir = $(srcdir)/../info
30 30
31# The makeinfo program is part of the Texinfo distribution. 31# The makeinfo program is part of the Texinfo distribution.
32MAKEINFO = makeinfo 32MAKEINFO = makeinfo --force
33MULTI_INSTALL_INFO = $(srcdir)\..\nt\multi-install-info.bat 33MULTI_INSTALL_INFO = $(srcdir)\..\nt\multi-install-info.bat
34INFO_TARGETS = $(infodir)/emacs $(infodir)/ccmode \ 34INFO_TARGETS = $(infodir)/emacs $(infodir)/emacs-xtra $(infodir)/ccmode \
35 $(infodir)/cl $(infodir)/dired-x \ 35 $(infodir)/cl $(infodir)/dired-x $(infodir)/ediff \
36 $(infodir)/ediff $(infodir)/forms \ 36 $(infodir)/forms $(infodir)/gnus $(infodir)/message \
37 $(infodir)/gnus $(infodir)/info \ 37 $(infodir)/sieve $(infodir)/pgg $(infodir)/emacs-mime \
38 $(infodir)/message $(infodir)/mh-e \ 38 $(infodir)/info $(infodir)/mh-e $(infodir)/reftex \
39 $(infodir)/reftex $(infodir)/sc \ 39 $(infodir)/sc $(infodir)/vip $(infodir)/viper \
40 $(infodir)/vip $(infodir)/viper \ 40 $(infodir)/widget $(infodir)/efaq $(infodir)/ada-mode \
41 $(infodir)/widget $(infodir)/efaq \ 41 $(infodir)/autotype $(infodir)/calc $(infodir)/idlwave \
42 $(infodir)/ada-mode $(infodir)/autotype \ 42 $(infodir)/eudc $(infodir)/ebrowse $(infodir)/pcl-cvs \
43 $(infodir)/calc $(infodir)/idlwave \ 43 $(infodir)/woman $(infodir)/eshell $(infodir)/org \
44 $(infodir)/eudc $(infodir)/ebrowse \ 44 $(infodir)/url $(infodir)/speedbar $(infodir)/tramp \
45 $(infodir)/pcl-cvs $(infodir)/woman \ 45 $(infodir)/ses $(infodir)/smtpmail $(infodir)/flymake
46 $(infodir)/emacs-mime $(infodir)/eshell \
47 $(infodir)/speedbar $(infodir)/tramp \
48 $(infodir)/ses $(infodir)/smtpmail \
49 $(infodir)/flymake $(infodir)/emacs-xtra \
50 $(infodir)/org $(infodir)/url \
51 $(infodir)/pgg $(infodir)/sieve
52DVI_TARGETS = emacs.dvi calc.dvi cc-mode.dvi cl.dvi dired-x.dvi \ 46DVI_TARGETS = emacs.dvi calc.dvi cc-mode.dvi cl.dvi dired-x.dvi \
53 ediff.dvi forms.dvi gnus.dvi message.dvi mh-e.dvi \ 47 ediff.dvi forms.dvi gnus.dvi message.dvi emacs-mime.dvi \
48 gnus.dvi message.dvi sieve.dvi pgg.dvi mh-e.dvi \
54 reftex.dvi sc.dvi vip.dvi viper.dvi widget.dvi faq.dvi \ 49 reftex.dvi sc.dvi vip.dvi viper.dvi widget.dvi faq.dvi \
55 ada-mode.dvi autotype.dvi idlwave.dvi eudc.dvi ebrowse.dvi \ 50 ada-mode.dvi autotype.dvi idlwave.dvi eudc.dvi ebrowse.dvi \
56 org.dvi pcl-cvs.dvi woman.dvi emacs-mime.dvi eshell.dvi \ 51 pcl-cvs.dvi woman.dvi eshell.dvi org.dvi url.dvi \
57 speedbar.dvi tramp.dvi ses.dvi smtpmail.dvi flymake.dvi \ 52 speedbar.dvi tramp.dvi ses.dvi smtpmail.dvi flymake.dvi \
58 emacs-xtra.dvi pgg.dvi sieve.dvi url.dvi 53 emacs-xtra.dvi
59INFOSOURCES = info.texi 54INFOSOURCES = info.texi
60 55
61# The following rule does not work with all versions of `make'. 56# The following rule does not work with all versions of `make'.
@@ -197,7 +192,7 @@ forms.dvi: forms.texi
197$(infodir)/gnus: gnus.texi 192$(infodir)/gnus: gnus.texi
198 $(MAKEINFO) gnus.texi 193 $(MAKEINFO) gnus.texi
199gnus.dvi: gnus.texi 194gnus.dvi: gnus.texi
200 sed -e '/@iflatex/,/@end iflatex/d' $(srcdir)/gnus.texi > gnustmp.texi 195 sed -e "/@iflatex/,/@end iflatex/d" $(srcdir)/gnus.texi > gnustmp.texi
201 $(ENVADD) $(TEXI2DVI) gnustmp.texi 196 $(ENVADD) $(TEXI2DVI) gnustmp.texi
202 cp gnustmp.dvi $*.dvi 197 cp gnustmp.dvi $*.dvi
203 rm gnustmp.* 198 rm gnustmp.*
diff --git a/src/ChangeLog b/src/ChangeLog
index 2ffb3c4959c..046d1a321fe 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,54 @@
12005-06-25 Richard M. Stallman <rms@gnu.org>
2
3 * macfns.c (Fx_show_tip): Pass new arg to try_window.
4
5 * w32fns.c (Fx_show_tip): Pass new arg to try_window.
6
7 * xfns.c (Fx_show_tip): Pass new arg to try_window.
8
9 * xdisp.c (try_window): New arg CHECK_MARGINS. Calls changed.
10 (redisplay_window): Handle try_window reporting point in scroll margin.
11
12 * dispextern.h (try_window): Declare new arg.
13
14 * fileio.c (Fcopy_file): New arg PRESERVE_UID_GID.
15 Use fchmod to copy the file modes.
16 (Frename_file): Don't copy UID and GID here;
17 instead, specify t for PRESERVE_UID_GID when calling Fcopy_file.
18
19 * eval.c (call_debugger): Take full care of extending stack limits
20 to make space for the debugger, and restore the change afterward.
21 Bind debug-on-error to nil.
22 (restore_stack_limits): New subroutine.
23 (Fsignal): Extend specpdl bound along with eval depth bound,
24 for calling edebug. Don't do either one, for calling debugger.
25 (find_handler_clause): Don't bind debug-on-error here.
26 Don't unbind anything either.
27 Temporarily advance max_specpdl_size for calling
28 internal_with_output_to_temp_buffer.
29 (grow_specpdl): Don't alter max_specpdl_size before signaling
30 an error.
31 (syms_of_eval) <max-specpdl-size>: Doc fix.
32
33 * lread.c (read1): 0.0e+NaN should make a "positive" NaN.
34
352005-06-24 Eli Zaretskii <eliz@gnu.org>
36
37 * fileio.c (Frename_file): Undo last change: no need to ifdef away
38 chown on DOS_NT platforms.
39
40 * w32.c (sys_chown): New function.
41
42 * s/ms-w32.h (chown): New; define to sys_chown.
43
442005-06-24 Juanma Barranquero <lekktu@gmail.com>
45
46 * xdisp.c (syms_of_xdisp) <nobreak-char-display>: Doc fix.
47 (syms_of_xdisp) <void-text-area-pointer>: Doc fix.
48
49 * fileio.c (Frename_file)[!DOS_NT]: Don't call chown on
50 MSDOS/Windows.
51
12005-06-23 Richard M. Stallman <rms@gnu.org> 522005-06-23 Richard M. Stallman <rms@gnu.org>
2 53
3 * xdisp.c (get_next_display_element): Finish reversing the tests of 54 * xdisp.c (get_next_display_element): Finish reversing the tests of
diff --git a/src/dispextern.h b/src/dispextern.h
index 3fb4f76a61f..3501d1de1e7 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -2584,7 +2584,7 @@ int line_bottom_y P_ ((struct it *));
2584int display_prop_intangible_p P_ ((Lisp_Object)); 2584int display_prop_intangible_p P_ ((Lisp_Object));
2585void resize_echo_area_exactly P_ ((void)); 2585void resize_echo_area_exactly P_ ((void));
2586int resize_mini_window P_ ((struct window *, int)); 2586int resize_mini_window P_ ((struct window *, int));
2587int try_window P_ ((Lisp_Object, struct text_pos)); 2587int try_window P_ ((Lisp_Object, struct text_pos, int));
2588void window_box P_ ((struct window *, int, int *, int *, int *, int *)); 2588void window_box P_ ((struct window *, int, int *, int *, int *, int *));
2589int window_box_height P_ ((struct window *)); 2589int window_box_height P_ ((struct window *));
2590int window_text_bottom_y P_ ((struct window *)); 2590int window_text_bottom_y P_ ((struct window *));
diff --git a/src/eval.c b/src/eval.c
index 8ad289fd51f..c33021da7b7 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -227,6 +227,18 @@ init_eval ()
227 when_entered_debugger = -1; 227 when_entered_debugger = -1;
228} 228}
229 229
230/* unwind-protect function used by call_debugger. */
231
232static Lisp_Object
233restore_stack_limits (data)
234 Lisp_Object data;
235{
236 max_specpdl_size = XINT (XCAR (data));
237 max_lisp_eval_depth = XINT (XCDR (data));
238}
239
240/* Call the Lisp debugger, giving it argument ARG. */
241
230Lisp_Object 242Lisp_Object
231call_debugger (arg) 243call_debugger (arg)
232 Lisp_Object arg; 244 Lisp_Object arg;
@@ -234,12 +246,22 @@ call_debugger (arg)
234 int debug_while_redisplaying; 246 int debug_while_redisplaying;
235 int count = SPECPDL_INDEX (); 247 int count = SPECPDL_INDEX ();
236 Lisp_Object val; 248 Lisp_Object val;
249 int old_max = max_specpdl_size;
237 250
238 if (lisp_eval_depth + 20 > max_lisp_eval_depth) 251 /* Temporarily bump up the stack limits,
239 max_lisp_eval_depth = lisp_eval_depth + 20; 252 so the debugger won't run out of stack. */
240 253
241 if (specpdl_size + 40 > max_specpdl_size) 254 max_specpdl_size += 1;
242 max_specpdl_size = specpdl_size + 40; 255 record_unwind_protect (restore_stack_limits,
256 Fcons (make_number (old_max),
257 make_number (max_lisp_eval_depth)));
258 max_specpdl_size = old_max;
259
260 if (lisp_eval_depth + 40 > max_lisp_eval_depth)
261 max_lisp_eval_depth = lisp_eval_depth + 40;
262
263 if (SPECPDL_INDEX () + 100 > max_specpdl_size)
264 max_specpdl_size = SPECPDL_INDEX () + 100;
243 265
244#ifdef HAVE_X_WINDOWS 266#ifdef HAVE_X_WINDOWS
245 if (display_hourglass_p) 267 if (display_hourglass_p)
@@ -256,6 +278,7 @@ call_debugger (arg)
256 specbind (intern ("debugger-may-continue"), 278 specbind (intern ("debugger-may-continue"),
257 debug_while_redisplaying ? Qnil : Qt); 279 debug_while_redisplaying ? Qnil : Qt);
258 specbind (Qinhibit_redisplay, Qnil); 280 specbind (Qinhibit_redisplay, Qnil);
281 specbind (Qdebug_on_error, Qnil);
259 282
260#if 0 /* Binding this prevents execution of Lisp code during 283#if 0 /* Binding this prevents execution of Lisp code during
261 redisplay, which necessarily leads to display problems. */ 284 redisplay, which necessarily leads to display problems. */
@@ -1533,7 +1556,16 @@ See also the function `condition-case'. */)
1533 /* This hook is used by edebug. */ 1556 /* This hook is used by edebug. */
1534 if (! NILP (Vsignal_hook_function) 1557 if (! NILP (Vsignal_hook_function)
1535 && ! NILP (error_symbol)) 1558 && ! NILP (error_symbol))
1536 call2 (Vsignal_hook_function, error_symbol, data); 1559 {
1560 /* Edebug takes care of restoring these variables when it exits. */
1561 if (lisp_eval_depth + 20 > max_lisp_eval_depth)
1562 max_lisp_eval_depth = lisp_eval_depth + 20;
1563
1564 if (SPECPDL_INDEX () + 40 > max_specpdl_size)
1565 max_specpdl_size = SPECPDL_INDEX () + 40;
1566
1567 call2 (Vsignal_hook_function, error_symbol, data);
1568 }
1537 1569
1538 conditions = Fget (real_error_symbol, Qerror_conditions); 1570 conditions = Fget (real_error_symbol, Qerror_conditions);
1539 1571
@@ -1555,12 +1587,6 @@ See also the function `condition-case'. */)
1555 { 1587 {
1556 register Lisp_Object clause; 1588 register Lisp_Object clause;
1557 1589
1558 if (lisp_eval_depth + 20 > max_lisp_eval_depth)
1559 max_lisp_eval_depth = lisp_eval_depth + 20;
1560
1561 if (specpdl_size + 40 > max_specpdl_size)
1562 max_specpdl_size = specpdl_size + 40;
1563
1564 clause = find_handler_clause (handlerlist->handler, conditions, 1590 clause = find_handler_clause (handlerlist->handler, conditions,
1565 error_symbol, data, &debugger_value); 1591 error_symbol, data, &debugger_value);
1566 1592
@@ -1673,7 +1699,11 @@ skip_debugger (conditions, data)
1673 = SIG is nil, and DATA is (SYMBOL . REST-OF-DATA). 1699 = SIG is nil, and DATA is (SYMBOL . REST-OF-DATA).
1674 This is for memory-full errors only. 1700 This is for memory-full errors only.
1675 1701
1676 Store value returned from debugger into *DEBUGGER_VALUE_PTR. */ 1702 Store value returned from debugger into *DEBUGGER_VALUE_PTR.
1703
1704 We need to increase max_specpdl_size temporarily around
1705 anything we do that can push on the specpdl, so as not to get
1706 a second error here in case we're handling specpdl overflow. */
1677 1707
1678static Lisp_Object 1708static Lisp_Object
1679find_handler_clause (handlers, conditions, sig, data, debugger_value_ptr) 1709find_handler_clause (handlers, conditions, sig, data, debugger_value_ptr)
@@ -1691,7 +1721,6 @@ find_handler_clause (handlers, conditions, sig, data, debugger_value_ptr)
1691 || !NILP (Vdebug_on_signal)) /* This says call debugger even if 1721 || !NILP (Vdebug_on_signal)) /* This says call debugger even if
1692 there is a handler. */ 1722 there is a handler. */
1693 { 1723 {
1694 int count = SPECPDL_INDEX ();
1695 int debugger_called = 0; 1724 int debugger_called = 0;
1696 Lisp_Object sig_symbol, combined_data; 1725 Lisp_Object sig_symbol, combined_data;
1697 /* This is set to 1 if we are handling a memory-full error, 1726 /* This is set to 1 if we are handling a memory-full error,
@@ -1713,6 +1742,7 @@ find_handler_clause (handlers, conditions, sig, data, debugger_value_ptr)
1713 1742
1714 if (wants_debugger (Vstack_trace_on_error, conditions)) 1743 if (wants_debugger (Vstack_trace_on_error, conditions))
1715 { 1744 {
1745 max_specpdl_size++;
1716#ifdef PROTOTYPES 1746#ifdef PROTOTYPES
1717 internal_with_output_to_temp_buffer ("*Backtrace*", 1747 internal_with_output_to_temp_buffer ("*Backtrace*",
1718 (Lisp_Object (*) (Lisp_Object)) Fbacktrace, 1748 (Lisp_Object (*) (Lisp_Object)) Fbacktrace,
@@ -1721,6 +1751,7 @@ find_handler_clause (handlers, conditions, sig, data, debugger_value_ptr)
1721 internal_with_output_to_temp_buffer ("*Backtrace*", 1751 internal_with_output_to_temp_buffer ("*Backtrace*",
1722 Fbacktrace, Qnil); 1752 Fbacktrace, Qnil);
1723#endif 1753#endif
1754 max_specpdl_size--;
1724 } 1755 }
1725 if (! no_debugger 1756 if (! no_debugger
1726 && (EQ (sig_symbol, Qquit) 1757 && (EQ (sig_symbol, Qquit)
@@ -1729,7 +1760,6 @@ find_handler_clause (handlers, conditions, sig, data, debugger_value_ptr)
1729 && ! skip_debugger (conditions, combined_data) 1760 && ! skip_debugger (conditions, combined_data)
1730 && when_entered_debugger < num_nonmacro_input_events) 1761 && when_entered_debugger < num_nonmacro_input_events)
1731 { 1762 {
1732 specbind (Qdebug_on_error, Qnil);
1733 *debugger_value_ptr 1763 *debugger_value_ptr
1734 = call_debugger (Fcons (Qerror, 1764 = call_debugger (Fcons (Qerror,
1735 Fcons (combined_data, Qnil))); 1765 Fcons (combined_data, Qnil)));
@@ -1739,7 +1769,7 @@ find_handler_clause (handlers, conditions, sig, data, debugger_value_ptr)
1739 if (EQ (handlers, Qerror)) 1769 if (EQ (handlers, Qerror))
1740 { 1770 {
1741 if (debugger_called) 1771 if (debugger_called)
1742 return unbind_to (count, Qlambda); 1772 return Qlambda;
1743 return Qt; 1773 return Qt;
1744 } 1774 }
1745 } 1775 }
@@ -3019,13 +3049,8 @@ grow_specpdl ()
3019 if (max_specpdl_size < 400) 3049 if (max_specpdl_size < 400)
3020 max_specpdl_size = 400; 3050 max_specpdl_size = 400;
3021 if (specpdl_size >= max_specpdl_size) 3051 if (specpdl_size >= max_specpdl_size)
3022 { 3052 Fsignal (Qerror,
3023 if (!NILP (Vdebug_on_error)) 3053 Fcons (build_string ("Variable binding depth exceeds max-specpdl-size"), Qnil));
3024 /* Leave room for some specpdl in the debugger. */
3025 max_specpdl_size = specpdl_size + 100;
3026 Fsignal (Qerror,
3027 Fcons (build_string ("Variable binding depth exceeds max-specpdl-size"), Qnil));
3028 }
3029 } 3054 }
3030 specpdl_size *= 2; 3055 specpdl_size *= 2;
3031 if (specpdl_size > max_specpdl_size) 3056 if (specpdl_size > max_specpdl_size)
@@ -3333,7 +3358,7 @@ syms_of_eval ()
3333{ 3358{
3334 DEFVAR_INT ("max-specpdl-size", &max_specpdl_size, 3359 DEFVAR_INT ("max-specpdl-size", &max_specpdl_size,
3335 doc: /* *Limit on number of Lisp variable bindings & unwind-protects. 3360 doc: /* *Limit on number of Lisp variable bindings & unwind-protects.
3336If Lisp code tries to make more than this many at once, 3361If Lisp code tries to increase the total number past this amount,
3337an error is signaled. 3362an error is signaled.
3338You can safely use a value considerably larger than the default value, 3363You can safely use a value considerably larger than the default value,
3339if that proves inconveniently small. However, if you increase it too far, 3364if that proves inconveniently small. However, if you increase it too far,
diff --git a/src/fileio.c b/src/fileio.c
index 075f12ccb21..ac81f73df16 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -2408,7 +2408,7 @@ barf_or_query_if_file_exists (absname, querystring, interactive, statptr, quick)
2408 return; 2408 return;
2409} 2409}
2410 2410
2411DEFUN ("copy-file", Fcopy_file, Scopy_file, 2, 5, 2411DEFUN ("copy-file", Fcopy_file, Scopy_file, 2, 6,
2412 "fCopy file: \nGCopy %s to file: \np\nP", 2412 "fCopy file: \nGCopy %s to file: \np\nP",
2413 doc: /* Copy FILE to NEWNAME. Both args must be strings. 2413 doc: /* Copy FILE to NEWNAME. Both args must be strings.
2414If NEWNAME names a directory, copy FILE there. 2414If NEWNAME names a directory, copy FILE there.
@@ -2428,9 +2428,13 @@ for an existing file with the same name. If MUSTBENEW is `excl',
2428that means to get an error if the file already exists; never overwrite. 2428that means to get an error if the file already exists; never overwrite.
2429If MUSTBENEW is neither nil nor `excl', that means ask for 2429If MUSTBENEW is neither nil nor `excl', that means ask for
2430confirmation before overwriting, but do go ahead and overwrite the file 2430confirmation before overwriting, but do go ahead and overwrite the file
2431if the user confirms. */) 2431if the user confirms.
2432 (file, newname, ok_if_already_exists, keep_time, mustbenew) 2432
2433If PRESERVE-UID-GID is non-nil, we try to transfer the
2434uid and gid of FILE to NEWNAME. */)
2435 (file, newname, ok_if_already_exists, keep_time, mustbenew, preserve_uid_gid)
2433 Lisp_Object file, newname, ok_if_already_exists, keep_time, mustbenew; 2436 Lisp_Object file, newname, ok_if_already_exists, keep_time, mustbenew;
2437 Lisp_Object preserve_uid_gid;
2434{ 2438{
2435 int ifd, ofd, n; 2439 int ifd, ofd, n;
2436 char buf[16 * 1024]; 2440 char buf[16 * 1024];
@@ -2572,6 +2576,26 @@ if the user confirms. */)
2572 report_file_error ("I/O error", Fcons (newname, Qnil)); 2576 report_file_error ("I/O error", Fcons (newname, Qnil));
2573 immediate_quit = 0; 2577 immediate_quit = 0;
2574 2578
2579 /* Preserve the owner and group, if requested. */
2580 if (input_file_statable_p && ! NILP (preserve_uid_gid))
2581 fchown (ofd, st.st_uid, st.st_gid);
2582
2583 if (input_file_statable_p)
2584 {
2585#ifndef MSDOS
2586 fchmod (ofd, st.st_mode & 07777);
2587#else /* MSDOS */
2588#if defined (__DJGPP__) && __DJGPP__ > 1
2589 /* In DJGPP v2.0 and later, fstat usually returns true file mode bits,
2590 and if it can't, it tells so. Otherwise, under MSDOS we usually
2591 get only the READ bit, which will make the copied file read-only,
2592 so it's better not to chmod at all. */
2593 if ((_djstat_flags & _STFAIL_WRITEBIT) == 0)
2594 chmod (SDATA (encoded_newname), st.st_mode & 07777);
2595#endif /* DJGPP version 2 or newer */
2596#endif /* MSDOS */
2597 }
2598
2575 /* Closing the output clobbers the file times on some systems. */ 2599 /* Closing the output clobbers the file times on some systems. */
2576 if (emacs_close (ofd) < 0) 2600 if (emacs_close (ofd) < 0)
2577 report_file_error ("I/O error", Fcons (newname, Qnil)); 2601 report_file_error ("I/O error", Fcons (newname, Qnil));
@@ -2589,18 +2613,6 @@ if the user confirms. */)
2589 Fcons (build_string ("Cannot set file date"), 2613 Fcons (build_string ("Cannot set file date"),
2590 Fcons (newname, Qnil))); 2614 Fcons (newname, Qnil)));
2591 } 2615 }
2592#ifndef MSDOS
2593 chmod (SDATA (encoded_newname), st.st_mode & 07777);
2594#else /* MSDOS */
2595#if defined (__DJGPP__) && __DJGPP__ > 1
2596 /* In DJGPP v2.0 and later, fstat usually returns true file mode bits,
2597 and if it can't, it tells so. Otherwise, under MSDOS we usually
2598 get only the READ bit, which will make the copied file read-only,
2599 so it's better not to chmod at all. */
2600 if ((_djstat_flags & _STFAIL_WRITEBIT) == 0)
2601 chmod (SDATA (encoded_newname), st.st_mode & 07777);
2602#endif /* DJGPP version 2 or newer */
2603#endif /* MSDOS */
2604 } 2616 }
2605 2617
2606 emacs_close (ifd); 2618 emacs_close (ifd);
@@ -2777,7 +2789,6 @@ This is what happens in interactive use with M-x. */)
2777 { 2789 {
2778 if (errno == EXDEV) 2790 if (errno == EXDEV)
2779 { 2791 {
2780 struct stat data;
2781#ifdef S_IFLNK 2792#ifdef S_IFLNK
2782 symlink_target = Ffile_symlink_p (file); 2793 symlink_target = Ffile_symlink_p (file);
2783 if (! NILP (symlink_target)) 2794 if (! NILP (symlink_target))
@@ -2785,15 +2796,11 @@ This is what happens in interactive use with M-x. */)
2785 NILP (ok_if_already_exists) ? Qnil : Qt); 2796 NILP (ok_if_already_exists) ? Qnil : Qt);
2786 else 2797 else
2787#endif 2798#endif
2788 Fcopy_file (file, newname, 2799 Fcopy_file (file, newname,
2789 /* We have already prompted if it was an integer, 2800 /* We have already prompted if it was an integer,
2790 so don't have copy-file prompt again. */ 2801 so don't have copy-file prompt again. */
2791 NILP (ok_if_already_exists) ? Qnil : Qt, 2802 NILP (ok_if_already_exists) ? Qnil : Qt,
2792 Qt, Qnil); 2803 Qt, Qnil, Qt);
2793
2794 /* Preserve owner and group, if possible (if we are root). */
2795 if (stat (SDATA (encoded_file), &data) >= 0)
2796 chown (SDATA (encoded_file), data.st_uid, data.st_gid);
2797 2804
2798 Fdelete_file (file); 2805 Fdelete_file (file);
2799 } 2806 }
diff --git a/src/lread.c b/src/lread.c
index 773696ed946..f02252fe475 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -2596,6 +2596,23 @@ read1 (readcharfun, pch, first_in_list)
2596 break; 2596 break;
2597 case 'N': 2597 case 'N':
2598 value = zero / zero; 2598 value = zero / zero;
2599
2600 /* If that made a "negative" NaN, negate it. */
2601
2602 {
2603 int i;
2604 union { double d; char c[sizeof (double)]; } u_data, u_minus_zero;
2605
2606 u_data.d = value;
2607 u_minus_zero.d = - 0.0;
2608 for (i = 0; i < sizeof (double); i++)
2609 if (u_data.c[i] & u_minus_zero.c[i])
2610 {
2611 value = - value;
2612 break;
2613 }
2614 }
2615 /* Now VALUE is a positive NaN. */
2599 break; 2616 break;
2600 default: 2617 default:
2601 value = atof (read_buffer + negative); 2618 value = atof (read_buffer + negative);
diff --git a/src/macfns.c b/src/macfns.c
index da1afa13bd8..d0e97e15f69 100644
--- a/src/macfns.c
+++ b/src/macfns.c
@@ -4088,7 +4088,7 @@ Text larger than the specified size is clipped. */)
4088 clear_glyph_matrix (w->desired_matrix); 4088 clear_glyph_matrix (w->desired_matrix);
4089 clear_glyph_matrix (w->current_matrix); 4089 clear_glyph_matrix (w->current_matrix);
4090 SET_TEXT_POS (pos, BEGV, BEGV_BYTE); 4090 SET_TEXT_POS (pos, BEGV, BEGV_BYTE);
4091 try_window (FRAME_ROOT_WINDOW (f), pos); 4091 try_window (FRAME_ROOT_WINDOW (f), pos, 0);
4092 4092
4093 /* Compute width and height of the tooltip. */ 4093 /* Compute width and height of the tooltip. */
4094 width = height = 0; 4094 width = height = 0;
diff --git a/src/s/ms-w32.h b/src/s/ms-w32.h
index 998c1f7cf05..10e3bfe3a5a 100644
--- a/src/s/ms-w32.h
+++ b/src/s/ms-w32.h
@@ -311,6 +311,7 @@ Boston, MA 02111-1307, USA. */
311#define chdir sys_chdir 311#define chdir sys_chdir
312#undef chmod 312#undef chmod
313#define chmod sys_chmod 313#define chmod sys_chmod
314#define chown sys_chown
314#undef close 315#undef close
315#define close sys_close 316#define close sys_close
316#undef creat 317#undef creat
diff --git a/src/w32.c b/src/w32.c
index 1bb4a91ff03..1585b3eaf1e 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -1898,6 +1898,14 @@ sys_chmod (const char * path, int mode)
1898} 1898}
1899 1899
1900int 1900int
1901sys_chown (const char *path, uid_t owner, gid_t group)
1902{
1903 if (sys_chmod (path, _S_IREAD) == -1) /* check if file exists */
1904 return -1;
1905 return 0;
1906}
1907
1908int
1901sys_creat (const char * path, int mode) 1909sys_creat (const char * path, int mode)
1902{ 1910{
1903 return _creat (map_w32_filename (path, NULL), mode); 1911 return _creat (map_w32_filename (path, NULL), mode);
diff --git a/src/w32fns.c b/src/w32fns.c
index e9af1b8ce2f..36131f2d1d8 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -7586,7 +7586,7 @@ Text larger than the specified size is clipped. */)
7586 clear_glyph_matrix (w->desired_matrix); 7586 clear_glyph_matrix (w->desired_matrix);
7587 clear_glyph_matrix (w->current_matrix); 7587 clear_glyph_matrix (w->current_matrix);
7588 SET_TEXT_POS (pos, BEGV, BEGV_BYTE); 7588 SET_TEXT_POS (pos, BEGV, BEGV_BYTE);
7589 try_window (FRAME_ROOT_WINDOW (f), pos); 7589 try_window (FRAME_ROOT_WINDOW (f), pos, 0);
7590 7590
7591 /* Compute width and height of the tooltip. */ 7591 /* Compute width and height of the tooltip. */
7592 width = height = 0; 7592 width = height = 0;
diff --git a/src/xdisp.c b/src/xdisp.c
index e92c3e9b1ce..1fc5a8b277c 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -7594,7 +7594,7 @@ display_echo_area_1 (a1, a2, a3, a4)
7594 clear_glyph_matrix (w->desired_matrix); 7594 clear_glyph_matrix (w->desired_matrix);
7595 XSETWINDOW (window, w); 7595 XSETWINDOW (window, w);
7596 SET_TEXT_POS (start, BEG, BEG_BYTE); 7596 SET_TEXT_POS (start, BEG, BEG_BYTE);
7597 try_window (window, start); 7597 try_window (window, start, 0);
7598 7598
7599 return window_height_changed_p; 7599 return window_height_changed_p;
7600} 7600}
@@ -11573,7 +11573,7 @@ try_scrolling (window, just_this_one_p, scroll_conservatively,
11573 11573
11574 /* Display the window. Give up if new fonts are loaded, or if point 11574 /* Display the window. Give up if new fonts are loaded, or if point
11575 doesn't appear. */ 11575 doesn't appear. */
11576 if (!try_window (window, startp)) 11576 if (!try_window (window, startp, 0))
11577 rc = SCROLLING_NEED_LARGER_MATRICES; 11577 rc = SCROLLING_NEED_LARGER_MATRICES;
11578 else if (w->cursor.vpos < 0) 11578 else if (w->cursor.vpos < 0)
11579 { 11579 {
@@ -12178,6 +12178,7 @@ redisplay_window (window, just_this_one_p)
12178 { 12178 {
12179 /* We set this later on if we have to adjust point. */ 12179 /* We set this later on if we have to adjust point. */
12180 int new_vpos = -1; 12180 int new_vpos = -1;
12181 int val;
12181 12182
12182 w->force_start = Qnil; 12183 w->force_start = Qnil;
12183 w->vscroll = 0; 12184 w->vscroll = 0;
@@ -12211,12 +12212,16 @@ redisplay_window (window, just_this_one_p)
12211 12212
12212 /* Redisplay, then check if cursor has been set during the 12213 /* Redisplay, then check if cursor has been set during the
12213 redisplay. Give up if new fonts were loaded. */ 12214 redisplay. Give up if new fonts were loaded. */
12214 if (!try_window (window, startp)) 12215 val = try_window (window, startp, 1);
12216 if (!val)
12215 { 12217 {
12216 w->force_start = Qt; 12218 w->force_start = Qt;
12217 clear_glyph_matrix (w->desired_matrix); 12219 clear_glyph_matrix (w->desired_matrix);
12218 goto need_larger_matrices; 12220 goto need_larger_matrices;
12219 } 12221 }
12222 /* Point was outside the scroll margins. */
12223 if (val < 0)
12224 new_vpos = window_box_height (w) / 2;
12220 12225
12221 if (w->cursor.vpos < 0 && !w->frozen_window_start_p) 12226 if (w->cursor.vpos < 0 && !w->frozen_window_start_p)
12222 { 12227 {
@@ -12259,7 +12264,7 @@ redisplay_window (window, just_this_one_p)
12259 && !NILP (current_buffer->mark_active)) 12264 && !NILP (current_buffer->mark_active))
12260 { 12265 {
12261 clear_glyph_matrix (w->desired_matrix); 12266 clear_glyph_matrix (w->desired_matrix);
12262 if (!try_window (window, startp)) 12267 if (!try_window (window, startp, 0))
12263 goto need_larger_matrices; 12268 goto need_larger_matrices;
12264 } 12269 }
12265 } 12270 }
@@ -12349,7 +12354,11 @@ redisplay_window (window, just_this_one_p)
12349 = try_window_reusing_current_matrix (w))) 12354 = try_window_reusing_current_matrix (w)))
12350 { 12355 {
12351 IF_DEBUG (debug_method_add (w, "1")); 12356 IF_DEBUG (debug_method_add (w, "1"));
12352 try_window (window, startp); 12357 if (try_window (window, startp, 1) < 0)
12358 /* -1 means we need to scroll.
12359 0 means we need new matrices, but fonts_changed_p
12360 is set in that case, so we will detect it below. */
12361 goto try_to_scroll;
12353 } 12362 }
12354 12363
12355 if (fonts_changed_p) 12364 if (fonts_changed_p)
@@ -12479,7 +12488,7 @@ redisplay_window (window, just_this_one_p)
12479 || MINI_WINDOW_P (w) 12488 || MINI_WINDOW_P (w)
12480 || !(used_current_matrix_p 12489 || !(used_current_matrix_p
12481 = try_window_reusing_current_matrix (w))) 12490 = try_window_reusing_current_matrix (w)))
12482 try_window (window, startp); 12491 try_window (window, startp, 0);
12483 12492
12484 /* If new fonts have been loaded (due to fontsets), give up. We 12493 /* If new fonts have been loaded (due to fontsets), give up. We
12485 have to start a new redisplay since we need to re-adjust glyph 12494 have to start a new redisplay since we need to re-adjust glyph
@@ -12499,13 +12508,13 @@ redisplay_window (window, just_this_one_p)
12499 { 12508 {
12500 clear_glyph_matrix (w->desired_matrix); 12509 clear_glyph_matrix (w->desired_matrix);
12501 move_it_by_lines (&it, 1, 0); 12510 move_it_by_lines (&it, 1, 0);
12502 try_window (window, it.current.pos); 12511 try_window (window, it.current.pos, 0);
12503 } 12512 }
12504 else if (PT < IT_CHARPOS (it)) 12513 else if (PT < IT_CHARPOS (it))
12505 { 12514 {
12506 clear_glyph_matrix (w->desired_matrix); 12515 clear_glyph_matrix (w->desired_matrix);
12507 move_it_by_lines (&it, -1, 0); 12516 move_it_by_lines (&it, -1, 0);
12508 try_window (window, it.current.pos); 12517 try_window (window, it.current.pos, 0);
12509 } 12518 }
12510 else 12519 else
12511 { 12520 {
@@ -12691,14 +12700,18 @@ redisplay_window (window, just_this_one_p)
12691 12700
12692 12701
12693/* Build the complete desired matrix of WINDOW with a window start 12702/* Build the complete desired matrix of WINDOW with a window start
12694 buffer position POS. Value is non-zero if successful. It is zero 12703 buffer position POS.
12695 if fonts were loaded during redisplay which makes re-adjusting 12704
12696 glyph matrices necessary. */ 12705 Value is 1 if successful. It is zero if fonts were loaded during
12706 redisplay which makes re-adjusting glyph matrices necessary, and -1
12707 if point would appear in the scroll margins.
12708 (We check that only if CHECK_MARGINS is nonzero. */
12697 12709
12698int 12710int
12699try_window (window, pos) 12711try_window (window, pos, check_margins)
12700 Lisp_Object window; 12712 Lisp_Object window;
12701 struct text_pos pos; 12713 struct text_pos pos;
12714 int check_margins;
12702{ 12715{
12703 struct window *w = XWINDOW (window); 12716 struct window *w = XWINDOW (window);
12704 struct it it; 12717 struct it it;
@@ -12723,6 +12736,30 @@ try_window (window, pos)
12723 return 0; 12736 return 0;
12724 } 12737 }
12725 12738
12739 /* Don't let the cursor end in the scroll margins. */
12740 if (check_margins)
12741 {
12742 int this_scroll_margin, cursor_height;
12743
12744 this_scroll_margin = max (0, scroll_margin);
12745 this_scroll_margin = min (this_scroll_margin, WINDOW_TOTAL_LINES (w) / 4);
12746 this_scroll_margin *= FRAME_LINE_HEIGHT (it.f);
12747 cursor_height = MATRIX_ROW (w->desired_matrix, w->cursor.vpos)->height;
12748
12749 if ((w->cursor.y < this_scroll_margin
12750 && CHARPOS (pos) > BEGV)
12751 /* Old redisplay didn't take scroll margin into account at the bottom,
12752 but then global-hl-line-mode doesn't scroll. KFS 2004-06-14 */
12753 || (w->cursor.y + (make_cursor_line_fully_visible_p
12754 ? cursor_height + this_scroll_margin
12755 : 1)) > it.last_visible_y)
12756 {
12757 w->cursor.vpos = -1;
12758 clear_glyph_matrix (w->desired_matrix);
12759 return -1;
12760 }
12761 }
12762
12726 /* If bottom moved off end of frame, change mode line percentage. */ 12763 /* If bottom moved off end of frame, change mode line percentage. */
12727 if (XFASTINT (w->window_end_pos) <= 0 12764 if (XFASTINT (w->window_end_pos) <= 0
12728 && Z != IT_CHARPOS (it)) 12765 && Z != IT_CHARPOS (it))
@@ -21667,7 +21704,7 @@ note_mouse_highlight (f, x, y)
21667 /* If we were displaying active text in another window, clear that. 21704 /* If we were displaying active text in another window, clear that.
21668 Also clear if we move out of text area in same window. */ 21705 Also clear if we move out of text area in same window. */
21669 if (! EQ (window, dpyinfo->mouse_face_window) 21706 if (! EQ (window, dpyinfo->mouse_face_window)
21670 || (part != ON_TEXT && part != ON_MODE_LINE && part != ON_HEADER_LINE 21707 || (part != ON_TEXT && part != ON_MODE_LINE && part != ON_HEADER_LINE
21671 && !NILP (dpyinfo->mouse_face_window))) 21708 && !NILP (dpyinfo->mouse_face_window)))
21672 clear_mouse_face (dpyinfo); 21709 clear_mouse_face (dpyinfo);
21673 21710
@@ -22894,17 +22931,17 @@ The face used for trailing whitespace is `trailing-whitespace'. */);
22894 22931
22895 DEFVAR_LISP ("nobreak-char-display", &Vnobreak_char_display, 22932 DEFVAR_LISP ("nobreak-char-display", &Vnobreak_char_display,
22896 doc: /* *Control highlighting of nobreak space and soft hyphen. 22933 doc: /* *Control highlighting of nobreak space and soft hyphen.
22897t means highlight the character itself (for nobreak space, 22934A value of t means highlight the character itself (for nobreak space,
22898use face `nobreak-space'. 22935use face `nobreak-space').
22899nil means no highlighting. 22936A value of nil means no highlighting.
22900other values mean display the escape glyph followed by an ordinary 22937Other values mean display the escape glyph followed by an ordinary
22901space or ordinary hyphen. */); 22938space or ordinary hyphen. */);
22902 Vnobreak_char_display = Qt; 22939 Vnobreak_char_display = Qt;
22903 22940
22904 DEFVAR_LISP ("void-text-area-pointer", &Vvoid_text_area_pointer, 22941 DEFVAR_LISP ("void-text-area-pointer", &Vvoid_text_area_pointer,
22905 doc: /* *The pointer shape to show in void text areas. 22942 doc: /* *The pointer shape to show in void text areas.
22906Nil means to show the text pointer. Other options are `arrow', `text', 22943A value of nil means to show the text pointer. Other options are `arrow',
22907`hand', `vdrag', `hdrag', `modeline', and `hourglass'. */); 22944`text', `hand', `vdrag', `hdrag', `modeline', and `hourglass'. */);
22908 Vvoid_text_area_pointer = Qarrow; 22945 Vvoid_text_area_pointer = Qarrow;
22909 22946
22910 DEFVAR_LISP ("inhibit-redisplay", &Vinhibit_redisplay, 22947 DEFVAR_LISP ("inhibit-redisplay", &Vinhibit_redisplay,
diff --git a/src/xfns.c b/src/xfns.c
index 44e1dbae0c2..2910d0f3cd4 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -5101,7 +5101,7 @@ Text larger than the specified size is clipped. */)
5101 clear_glyph_matrix (w->desired_matrix); 5101 clear_glyph_matrix (w->desired_matrix);
5102 clear_glyph_matrix (w->current_matrix); 5102 clear_glyph_matrix (w->current_matrix);
5103 SET_TEXT_POS (pos, BEGV, BEGV_BYTE); 5103 SET_TEXT_POS (pos, BEGV, BEGV_BYTE);
5104 try_window (FRAME_ROOT_WINDOW (f), pos); 5104 try_window (FRAME_ROOT_WINDOW (f), pos, 0);
5105 5105
5106 /* Compute width and height of the tooltip. */ 5106 /* Compute width and height of the tooltip. */
5107 width = height = 0; 5107 width = height = 0;