diff options
author | Karoly Lorentey <lorentey@elte.hu> | 2005-06-26 21:12:57 +0000 |
---|---|---|
committer | Karoly Lorentey <lorentey@elte.hu> | 2005-06-26 21:12:57 +0000 |
commit | d836b39b818551c04c7e598176d3f26be7abfa5e (patch) | |
tree | 51bad97e4eeb9af7e1e00646a324a38e33466beb | |
parent | 4ea81208d4c43df774e540a603be8f68cb470466 (diff) | |
parent | c3bf675dd1caa64c514dcac38e2d21c64597f9ff (diff) | |
download | emacs-d836b39b818551c04c7e598176d3f26be7abfa5e.tar.gz |
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
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. ** Check for widow and orphan lines in manuals; make sure all the pages really look ok in the manual as formatted. +** Update facemenu-unlisted-faces, adding whatever other +face name prefixes should be in it for good results. * NEW FEATURES @@ -43,6 +45,36 @@ invalid pointer from string_free_list. * BUGS +** Bug in ebrowse + +Date: Fri, 27 May 2005 17:35:48 +0200 +From: Markus Gritsch <gritsch@iue.tuwien.ac.at> + +the C++ header file which led to the problematic BROWSE file reads + +namespace test { + class Base + { + }; + + class B : public Base + { + }; +} + +class A : public test::Base +{ +}; + +The *Tree* is then displayed as + + *Globals* + test + test::Base + test::B + +The class A seems to be missing. + ** Ange-ftp should ignore irrelevant IPv6 errors: Message-Id: <4121-Tue23Mar2004165249+0100-piet@cs.uu.nl> @@ -4097,6 +4097,7 @@ return window edges in units of pixels, rather than columns and lines. +++ *** The new macro `with-selected-window' temporarily switches the selected window without impacting the order of `buffer-list'. +It saves and restores the current buffer, too. +++ *** `select-window' takes an optional second argument NORECORD. @@ -4106,7 +4107,8 @@ This is like `switch-to-buffer'. +++ *** `save-selected-window' now saves and restores the selected window of every frame. This way, it restores everything that can be changed -by calling `select-window'. +by calling `select-window'. It also saves and restores the current +buffer. +++ *** `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. Use the shell command `xset bc' to make the old X Menu package work. +*** C-SPC fails to work on Fedora GNU/Linux. + +Fedora Core 4 steals the C-SPC key by default for the `iiimx' program +which is the input method for some languages. It blocks Emacs users +from using the C-SPC key for `set-mark-command'. + +One solutions is to remove the `<Ctrl>space' from the `Iiimx' file +which can be found in the `/usr/lib/X11/app-defaults' directory. +However, that requires root access. + +Another is to specify `Emacs*useXIM: false' in your X resources. + +Another is to build Emacs with the `--without-xim' configure option. + *** M-SPC seems to be ignored as input. See 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 @@ +2005-06-25 Luc Teirlinck <teirllm@auburn.edu> + + * faces.el (facep): Doc fix. + +2005-06-25 Richard M. Stallman <rms@gnu.org> + + * facemenu.el (facemenu-enable-faces-p): New function. + (facemenu-background-menu, facemenu-foreground-menu) + (facemenu-face-menu): Add menu-enable property. + + * jka-compr.el (jka-compr-insert-file-contents): + Special handling if cannot find the uncompression program. + + * cus-face.el (custom-face-attributes): Add autoload. + + * emacs-lisp/lisp-mode.el (lisp-mode-variables): + Bind comment-indent-function locally. + + * window.el (save-selected-window): Use save-current-buffer. + + * subr.el (with-selected-window): Use save-current-buffer. + + * progmodes/gud.el (gud-filter): Simplify using with-selected-window + and with-current-buffer. + +2005-06-24 Richard M. Stallman <rms@gnu.org> + + * simple.el (line-move-1): Fix previous change. + +2005-06-24 Juanma Barranquero <lekktu@gmail.com> + + * replace.el (occur-1): Set `buffer-read-only' and the + buffer-modified flag before running `occur-hook' to protect + against unintentional buffer switches that can lead to data loss. + 2005-06-24 Nick Roberts <nickrob@snap.net.nz> * progmodes/gud.el (gud-tooltip-print-command): Indent properly. (gud-gdb-marker-filter): Use font-lock-warning-face for any initial error. - + * progmodes/gdb-ui.el (gdb-send): Remove warning face from errors after fresh input. (gdb-var-create-handler): Put name of expression in quotes. - + 2005-06-23 Luc Teirlinck <teirllm@auburn.edu> * emacs-lisp/ring.el (ring-elements): Make it return a list of the @@ -532,7 +567,7 @@ * progmodes/gdb-ui.el (menu): Re-order menu items. (gdb-tooltip-print): Respect tooltip-use-echo-area. - + * progmodes/gud.el (tooltip-use-echo-area): Remove alias. Define in tooltip.el. (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 @@ ;;; Face attributes. +;;;###autoload (defconst custom-face-attributes '((:family (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 @@ (setq comment-column 40) ;; Don't get confused by `;' in doc strings when paragraph-filling. (set (make-local-variable 'comment-use-global-state) t) + (make-local-variable 'comment-indent-function) + (setq comment-indent-function 'lisp-comment-indent) (make-local-variable 'imenu-generic-expression) (setq imenu-generic-expression lisp-imenu-generic-expression) (make-local-variable 'multibyte-syntax-as-symbol) @@ -714,7 +716,7 @@ which see." (setq debug-on-error new-value)) value))))) - +;; Used for comment-indent-function in Lisp modes. (defun lisp-comment-indent () (if (looking-at "\\s<\\s<\\s<") (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." "Menu keymap for faces.") ;;;###autoload (defalias 'facemenu-face-menu facemenu-face-menu) +(put 'facemenu-face-menu 'menu-enable '(facemenu-enable-faces-p)) ;;;###autoload (defvar facemenu-foreground-menu @@ -171,6 +172,7 @@ when they are created." "Menu keymap for foreground colors.") ;;;###autoload (defalias 'facemenu-foreground-menu facemenu-foreground-menu) +(put 'facemenu-foreground-menu 'menu-enable '(facemenu-enable-faces-p)) ;;;###autoload (defvar facemenu-background-menu @@ -180,6 +182,11 @@ when they are created." "Menu keymap for background colors.") ;;;###autoload (defalias 'facemenu-background-menu facemenu-background-menu) +(put 'facemenu-background-menu 'menu-enable '(facemenu-enable-faces-p)) + +;;; Condition for enabling menu items that set faces. +(defun facemenu-enable-faces-p () + (not (and font-lock-mode font-lock-defaults))) ;;;###autoload (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." ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun facep (face) - "Return non-nil if FACE is a face name." + "Return non-nil if FACE is a face name or internal face object. +Return nil otherwise. A face name can be a string or a symbol. +An internal face object is a vector of the kind used internally +to record face data." (internal-lisp-face-p face)) 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 @@ +2005-06-24 Juanma Barranquero <lekktu@gmail.com> + + * gnus-art.el (gnus-article-mode): Set `nobreak-char-display', not + `show-nonbreak-escape'. + 2005-06-23 Lute Kamstra <lute@gnu.org> * 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: (make-local-variable 'gnus-article-charset) (make-local-variable 'gnus-article-ignored-charsets) ;; Prevent recent Emacsen from displaying non-break space as "\ ". - (set (make-local-variable 'show-nonbreak-escape) nil) + (set (make-local-variable 'nobreak-char-display) nil) (gnus-set-default-directory) (buffer-disable-undo) (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 `/'." (delete-region (point) (point-max))) (goto-char start)) (error + ;; If the file we wanted to uncompress does not exist, + ;; handle that according to VISIT as `insert-file-contents' + ;; would, maybe signaling the same error it normally would. (if (and (eq (car error-code) 'file-error) (eq (nth 3 error-code) local-file)) (if visit @@ -481,6 +484,13 @@ There should be no more than seven characters after the final `/'." (signal 'file-error (cons "Opening input file" (nthcdr 2 error-code)))) + ;; If the uncompression program can't be found, + ;; signal that as a non-file error + ;; so that find-file-noselect-1 won't handle it. + (if (and (eq (car error-code) 'file-error) + (equal (cadr error-code) "Searching for program")) + (error "Uncompression program `%s' not found" + (nth 3 error-code))) (signal (car error-code) (cdr error-code)))))) (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.") ;; This must be outside of the save-excursion ;; in case the source file is our current buffer. (if process-window - (save-selected-window - (select-window process-window) + (with-selected-window (gud-display-frame)) ;; We have to be in the proper buffer, (process-buffer proc), ;; but not in a save-excursion, because that would restore point. - (let ((old-buf (current-buffer))) - (set-buffer (process-buffer proc)) - (unwind-protect - (gud-display-frame) - (set-buffer old-buf))))) + (with-current-buffer (process-buffer proc) + (gud-display-frame)))) ;; If we deferred text that arrived during this processing, ;; 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'." (display-buffer occur-buf) (setq next-error-last-buffer occur-buf)) (kill-buffer occur-buf))) - (run-hooks 'occur-hook)) - (setq buffer-read-only t) - (set-buffer-modified-p nil)))) + (setq buffer-read-only t) + (set-buffer-modified-p nil) + (run-hooks 'occur-hook))))) (defun occur-engine-add-prefix (lines) (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." (when (and (not done) (not (integerp selective-display)) (not (line-move-invisible-p (point)))) - ;; We avoid vertical-motion when possible - ;; because that has to fontify. - (forward-line 1) - ;; If there are overlays in and around - ;; the text we moved over, we need to be - ;; sophisticated. (unless (overlays-in (max (1- pos-before) (point-min)) (min (1+ (point)) (point-max))) + ;; We avoid vertical-motion when possible + ;; because that has to fontify. + (forward-line 1) (setq line-done t))) - ;; Otherwise move a more sophisticated way. - ;; (What's the logic behind this code?) (and (not done) (not line-done) + ;; Otherwise move a more sophisticated way. (zerop (vertical-motion 1)) (if (not noerror) (signal 'end-of-buffer nil) @@ -3477,9 +3473,9 @@ Outline mode sets this." (when (and (not done) (not (integerp selective-display)) (not (line-move-invisible-p (1- (point))))) - (forward-line -1) (unless (overlays-in (max (1- (point)) (point-min)) (min (1+ pos-before) (point-max))) + (forward-line -1) (setq line-done t))) (and (not done) (not line-done) (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'." (defmacro with-selected-window (window &rest body) "Execute the forms in BODY with WINDOW as the selected window. The value returned is the value of the last form in BODY. -This does not alter the buffer list ordering. -This function saves and restores the selected window, as well as + +This macro saves and restores the current buffer, since otherwise +its normal operation could potentially make a different +buffer current. It does not alter the buffer list ordering. + +This macro saves and restores the selected window, as well as the selected window in each frame. If the previously selected window of some frame is no longer live at the end of BODY, that frame's selected window is left alone. If the selected window is @@ -1734,15 +1738,16 @@ See also `with-temp-buffer'." (save-selected-window-alist (mapcar (lambda (frame) (list frame (frame-selected-window frame))) (frame-list)))) - (unwind-protect - (progn (select-window ,window 'norecord) - ,@body) - (dolist (elt save-selected-window-alist) - (and (frame-live-p (car elt)) - (window-live-p (cadr elt)) - (set-frame-selected-window (car elt) (cadr elt)))) - (if (window-live-p save-selected-window-window) - (select-window save-selected-window-window 'norecord))))) + (save-current-buffer + (unwind-protect + (progn (select-window ,window 'norecord) + ,@body) + (dolist (elt save-selected-window-alist) + (and (frame-live-p (car elt)) + (window-live-p (cadr elt)) + (set-frame-selected-window (car elt) (cadr elt)))) + (if (window-live-p save-selected-window-window) + (select-window save-selected-window-window 'norecord)))))) (defmacro with-selected-frame (frame &rest body) "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.") (recenter)) ) - (let ((up t) command) - ;; Mouse click not on a widget button. Find the global - ;; command to run, and check whether it is bound to an - ;; up event. - (mouse-set-point event) - (if (memq (event-basic-type event) '(mouse-1 down-mouse-1)) - (cond ((setq command ;down event - (lookup-key widget-global-map [down-mouse-1])) - (setq up nil)) - ((setq command ;up event - (lookup-key widget-global-map [mouse-1])))) + (let ((up t) command) + ;; Mouse click not on a widget button. Find the global + ;; command to run, and check whether it is bound to an + ;; up event. + (mouse-set-point event) + (if (memq (event-basic-type event) '(mouse-1 down-mouse-1)) (cond ((setq command ;down event - (lookup-key widget-global-map [down-mouse-2])) + (lookup-key widget-global-map [down-mouse-1])) (setq up nil)) ((setq command ;up event - (lookup-key widget-global-map [mouse-2]))))) - (when up - ;; Don't execute up events twice. - (while (not (widget-button-release-event-p event)) - (setq event (read-event)))) - (when command - (call-interactively command))))) + (lookup-key widget-global-map [mouse-1])))) + (cond ((setq command ;down event + (lookup-key widget-global-map [down-mouse-2])) + (setq up nil)) + ((setq command ;up event + (lookup-key widget-global-map [mouse-2]))))) + (when up + ;; Don't execute up events twice. + (while (not (widget-button-release-event-p event)) + (setq event (read-event)))) + (when command + (call-interactively command))))) (message "You clicked somewhere weird."))) (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.") (defmacro save-selected-window (&rest body) "Execute BODY, then select the window that was selected before BODY. -Also restore the selected window of each frame as it was at the start -of this construct. -However, if a window has become dead, don't get an error, -just refrain from reselecting it. -Return the value of the last form in BODY." +The value returned is the value of the last form in BODY. + +This macro saves and restores the current buffer, since otherwise +its normal operation could potentially make a different +buffer current. It does not alter the buffer list ordering. + +This macro saves and restores the selected window, as well as +the selected window in each frame. If the previously selected +window of some frame is no longer live at the end of BODY, that +frame's selected window is left alone. If the selected window is +no longer live, then whatever window is selected at the end of +BODY remains selected." `(let ((save-selected-window-window (selected-window)) ;; It is necessary to save all of these, because calling ;; select-window changes frame-selected-window for whatever @@ -52,14 +59,15 @@ Return the value of the last form in BODY." (save-selected-window-alist (mapcar (lambda (frame) (list frame (frame-selected-window frame))) (frame-list)))) - (unwind-protect - (progn ,@body) - (dolist (elt save-selected-window-alist) - (and (frame-live-p (car elt)) - (window-live-p (cadr elt)) - (set-frame-selected-window (car elt) (cadr elt)))) - (if (window-live-p save-selected-window-window) - (select-window save-selected-window-window))))) + (save-current-buffer + (unwind-protect + (progn ,@body) + (dolist (elt save-selected-window-alist) + (and (frame-live-p (car elt)) + (window-live-p (cadr elt)) + (set-frame-selected-window (car elt) (cadr elt)))) + (if (window-live-p save-selected-window-window) + (select-window save-selected-window-window)))))) (defun window-body-height (&optional window) "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 @@ +2005-06-25 Luc Teirlinck <teirllm@auburn.edu> + + * display.texi (Faces): `facep' returns t for strings that are + face names. + +2005-06-25 Richard M. Stallman <rms@gnu.org> + + * objects.texi (Equality Predicates): Clarify meaning of equal. + + * windows.texi (Selecting Windows): save-selected-window + and with-selected-window save and restore the current buffer. + +2005-06-24 Richard M. Stallman <rms@gnu.org> + + * numbers.texi (Float Basics): Explain how to test for NaN, + and printing the sign of NaNs. + +2005-06-24 Eli Zaretskii <eliz@gnu.org> + + * makefile.w32-in (MAKEINFO): Use --force. + 2005-06-23 Richard M. Stallman <rms@gnu.org> * 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. @cindex face id Each face has its own @dfn{face number}, which distinguishes faces at low levels within Emacs. However, for most purposes, you refer to -faces in Lisp programs by their names. +faces in Lisp programs by the symbol that names them. @defun facep object -This function returns @code{t} if @var{object} is a face name symbol (or -if it is a vector of the kind used internally to record face data). It -returns @code{nil} otherwise. +This function returns @code{t} if @var{object} is a face name string +or symbol (or if it is a vector of the kind used internally to record +face data). It returns @code{nil} otherwise. @end defun Each face name is meaningful for all frames, and by default it has the @@ -1795,7 +1795,7 @@ end of a line. The way to define a new face is with @code{defface}. This creates a kind of customization item (@pxref{Customization}) which the user can customize using the Customization buffer (@pxref{Easy Customization,,, -emacs, The GNU Emacs Manual}). +emacs, The GNU Emacs Manual}). @defmac defface face spec doc [keyword value]... This 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 # TEX=platex TEX=tex INSTALL_INFO = install-info -MAKEINFO = makeinfo +MAKEINFO = makeinfo --force # The environment variable and its value to add $(srcdir) to the path # 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 NaN. For practical purposes, there's no significant difference between different NaN values in Emacs Lisp, and there's no rule for precisely which NaN value should be used in a particular case, so Emacs Lisp -doesn't try to distinguish them. Here are the read syntaxes for -these special floating point values: +doesn't try to distinguish them (but it does report the sign, if you +print it). Here are the read syntaxes for these special floating +point values: @table @asis @item positive infinity @samp{1.0e+INF} @item negative infinity @samp{-1.0e+INF} -@item Not-a-number -@samp{0.0e+NaN}. +@item Not-a-number +@samp{0.0e+NaN} or @samp{-0.0e+NaN}. @end table - In addition, the value @code{-0.0} is distinguishable from ordinary -zero in @acronym{IEEE} floating point (although @code{equal} and -@code{=} consider them equal values). + To test whether a floating point value is a NaN, compare it with +itself using @code{=}. That returns @code{nil} for a NaN, and +@code{t} for any other floating point value. + + The value @code{-0.0} is distinguishable from ordinary zero in +@acronym{IEEE} floating point, but Emacs Lisp @code{equal} and +@code{=} consider them equal values. You can use @code{logb} to extract the binary exponent of a floating point 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. @defun eq object1 object2 This function returns @code{t} if @var{object1} and @var{object2} are -the same object, @code{nil} otherwise. The ``same object'' means that a -change in one will be reflected by the same change in the other. +the same object, @code{nil} otherwise. @code{eq} returns @code{t} if @var{object1} and @var{object2} are integers 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 @code{eq}. For other types (e.g., lists, vectors, strings), two arguments with the same contents or elements are not necessarily @code{eq} to each other: they are @code{eq} only if they are the same -object. +object, meaning that a change in the contents of one will be reflected +by the same change in the contents of the other. @example @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}. @defmac save-selected-window forms@dots{} This macro records the selected frame, as well as the selected window of each frame, executes @var{forms} in sequence, then restores the -earlier selected frame and windows It returns the value of the last -form in @var{forms}. +earlier selected frame and windows. It also saves and restores the +current buffer. It returns the value of the last form in @var{forms}. This macro does not save or restore anything about the sizes, arrangement or contents of windows; therefore, if the @var{forms} @@ -478,9 +478,9 @@ the end of @var{forms} remains selected. @defmac with-selected-window window forms@dots{} This macro selects @var{window} (without changing the buffer list), executes @var{forms} in sequence, then restores the previously -selected window (unless that window is no longer alive). It is similar -to @code{save-selected-window} except that it explicitly selects -@var{window}, without altering the buffer list sequence. +selected window and current buffer. It is just like +@code{save-selected-window}, except that it explicitly selects +@var{window}, also without altering the buffer list sequence. @end defmac @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 @@ +2005-06-24 Richard M. Stallman <rms@gnu.org> + + * display.texi (Text Display): Change index entries. + +2005-06-24 Eli Zaretskii <eliz@gnu.org> + + * makefile.w32-in (MAKEINFO): Use --force. + (INFO_TARGETS, DVI_TARGETS): Make identical to the lists in + Makefile.in. + (gnus.dvi): Use "..." to quote Sed args, so that it works with + more shells. + 2005-06-23 Richard M. Stallman <rms@gnu.org> * 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 Support}. @vindex nobreak-char-display -@cindex nobreak space, display -@cindex nobreak hyphen, display +@cindex no-break space, display +@cindex no-break hyphen, display +@cindex soft hyphen, display Some character sets define ``no-break'' versions of the space and hyphen characters, which are used where a line should not be broken. Emacs 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=. infodir = $(srcdir)/../info # The makeinfo program is part of the Texinfo distribution. -MAKEINFO = makeinfo +MAKEINFO = makeinfo --force MULTI_INSTALL_INFO = $(srcdir)\..\nt\multi-install-info.bat -INFO_TARGETS = $(infodir)/emacs $(infodir)/ccmode \ - $(infodir)/cl $(infodir)/dired-x \ - $(infodir)/ediff $(infodir)/forms \ - $(infodir)/gnus $(infodir)/info \ - $(infodir)/message $(infodir)/mh-e \ - $(infodir)/reftex $(infodir)/sc \ - $(infodir)/vip $(infodir)/viper \ - $(infodir)/widget $(infodir)/efaq \ - $(infodir)/ada-mode $(infodir)/autotype \ - $(infodir)/calc $(infodir)/idlwave \ - $(infodir)/eudc $(infodir)/ebrowse \ - $(infodir)/pcl-cvs $(infodir)/woman \ - $(infodir)/emacs-mime $(infodir)/eshell \ - $(infodir)/speedbar $(infodir)/tramp \ - $(infodir)/ses $(infodir)/smtpmail \ - $(infodir)/flymake $(infodir)/emacs-xtra \ - $(infodir)/org $(infodir)/url \ - $(infodir)/pgg $(infodir)/sieve +INFO_TARGETS = $(infodir)/emacs $(infodir)/emacs-xtra $(infodir)/ccmode \ + $(infodir)/cl $(infodir)/dired-x $(infodir)/ediff \ + $(infodir)/forms $(infodir)/gnus $(infodir)/message \ + $(infodir)/sieve $(infodir)/pgg $(infodir)/emacs-mime \ + $(infodir)/info $(infodir)/mh-e $(infodir)/reftex \ + $(infodir)/sc $(infodir)/vip $(infodir)/viper \ + $(infodir)/widget $(infodir)/efaq $(infodir)/ada-mode \ + $(infodir)/autotype $(infodir)/calc $(infodir)/idlwave \ + $(infodir)/eudc $(infodir)/ebrowse $(infodir)/pcl-cvs \ + $(infodir)/woman $(infodir)/eshell $(infodir)/org \ + $(infodir)/url $(infodir)/speedbar $(infodir)/tramp \ + $(infodir)/ses $(infodir)/smtpmail $(infodir)/flymake DVI_TARGETS = emacs.dvi calc.dvi cc-mode.dvi cl.dvi dired-x.dvi \ - ediff.dvi forms.dvi gnus.dvi message.dvi mh-e.dvi \ + ediff.dvi forms.dvi gnus.dvi message.dvi emacs-mime.dvi \ + gnus.dvi message.dvi sieve.dvi pgg.dvi mh-e.dvi \ reftex.dvi sc.dvi vip.dvi viper.dvi widget.dvi faq.dvi \ ada-mode.dvi autotype.dvi idlwave.dvi eudc.dvi ebrowse.dvi \ - org.dvi pcl-cvs.dvi woman.dvi emacs-mime.dvi eshell.dvi \ + pcl-cvs.dvi woman.dvi eshell.dvi org.dvi url.dvi \ speedbar.dvi tramp.dvi ses.dvi smtpmail.dvi flymake.dvi \ - emacs-xtra.dvi pgg.dvi sieve.dvi url.dvi + emacs-xtra.dvi INFOSOURCES = info.texi # The following rule does not work with all versions of `make'. @@ -197,7 +192,7 @@ forms.dvi: forms.texi $(infodir)/gnus: gnus.texi $(MAKEINFO) gnus.texi gnus.dvi: gnus.texi - sed -e '/@iflatex/,/@end iflatex/d' $(srcdir)/gnus.texi > gnustmp.texi + sed -e "/@iflatex/,/@end iflatex/d" $(srcdir)/gnus.texi > gnustmp.texi $(ENVADD) $(TEXI2DVI) gnustmp.texi cp gnustmp.dvi $*.dvi rm gnustmp.* diff --git a/src/ChangeLog b/src/ChangeLog index 2ffb3c4959c..046d1a321fe 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,54 @@ +2005-06-25 Richard M. Stallman <rms@gnu.org> + + * macfns.c (Fx_show_tip): Pass new arg to try_window. + + * w32fns.c (Fx_show_tip): Pass new arg to try_window. + + * xfns.c (Fx_show_tip): Pass new arg to try_window. + + * xdisp.c (try_window): New arg CHECK_MARGINS. Calls changed. + (redisplay_window): Handle try_window reporting point in scroll margin. + + * dispextern.h (try_window): Declare new arg. + + * fileio.c (Fcopy_file): New arg PRESERVE_UID_GID. + Use fchmod to copy the file modes. + (Frename_file): Don't copy UID and GID here; + instead, specify t for PRESERVE_UID_GID when calling Fcopy_file. + + * eval.c (call_debugger): Take full care of extending stack limits + to make space for the debugger, and restore the change afterward. + Bind debug-on-error to nil. + (restore_stack_limits): New subroutine. + (Fsignal): Extend specpdl bound along with eval depth bound, + for calling edebug. Don't do either one, for calling debugger. + (find_handler_clause): Don't bind debug-on-error here. + Don't unbind anything either. + Temporarily advance max_specpdl_size for calling + internal_with_output_to_temp_buffer. + (grow_specpdl): Don't alter max_specpdl_size before signaling + an error. + (syms_of_eval) <max-specpdl-size>: Doc fix. + + * lread.c (read1): 0.0e+NaN should make a "positive" NaN. + +2005-06-24 Eli Zaretskii <eliz@gnu.org> + + * fileio.c (Frename_file): Undo last change: no need to ifdef away + chown on DOS_NT platforms. + + * w32.c (sys_chown): New function. + + * s/ms-w32.h (chown): New; define to sys_chown. + +2005-06-24 Juanma Barranquero <lekktu@gmail.com> + + * xdisp.c (syms_of_xdisp) <nobreak-char-display>: Doc fix. + (syms_of_xdisp) <void-text-area-pointer>: Doc fix. + + * fileio.c (Frename_file)[!DOS_NT]: Don't call chown on + MSDOS/Windows. + 2005-06-23 Richard M. Stallman <rms@gnu.org> * 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 *)); int display_prop_intangible_p P_ ((Lisp_Object)); void resize_echo_area_exactly P_ ((void)); int resize_mini_window P_ ((struct window *, int)); -int try_window P_ ((Lisp_Object, struct text_pos)); +int try_window P_ ((Lisp_Object, struct text_pos, int)); void window_box P_ ((struct window *, int, int *, int *, int *, int *)); int window_box_height P_ ((struct window *)); int 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 () when_entered_debugger = -1; } +/* unwind-protect function used by call_debugger. */ + +static Lisp_Object +restore_stack_limits (data) + Lisp_Object data; +{ + max_specpdl_size = XINT (XCAR (data)); + max_lisp_eval_depth = XINT (XCDR (data)); +} + +/* Call the Lisp debugger, giving it argument ARG. */ + Lisp_Object call_debugger (arg) Lisp_Object arg; @@ -234,12 +246,22 @@ call_debugger (arg) int debug_while_redisplaying; int count = SPECPDL_INDEX (); Lisp_Object val; + int old_max = max_specpdl_size; - if (lisp_eval_depth + 20 > max_lisp_eval_depth) - max_lisp_eval_depth = lisp_eval_depth + 20; + /* Temporarily bump up the stack limits, + so the debugger won't run out of stack. */ - if (specpdl_size + 40 > max_specpdl_size) - max_specpdl_size = specpdl_size + 40; + max_specpdl_size += 1; + record_unwind_protect (restore_stack_limits, + Fcons (make_number (old_max), + make_number (max_lisp_eval_depth))); + max_specpdl_size = old_max; + + if (lisp_eval_depth + 40 > max_lisp_eval_depth) + max_lisp_eval_depth = lisp_eval_depth + 40; + + if (SPECPDL_INDEX () + 100 > max_specpdl_size) + max_specpdl_size = SPECPDL_INDEX () + 100; #ifdef HAVE_X_WINDOWS if (display_hourglass_p) @@ -256,6 +278,7 @@ call_debugger (arg) specbind (intern ("debugger-may-continue"), debug_while_redisplaying ? Qnil : Qt); specbind (Qinhibit_redisplay, Qnil); + specbind (Qdebug_on_error, Qnil); #if 0 /* Binding this prevents execution of Lisp code during redisplay, which necessarily leads to display problems. */ @@ -1533,7 +1556,16 @@ See also the function `condition-case'. */) /* This hook is used by edebug. */ if (! NILP (Vsignal_hook_function) && ! NILP (error_symbol)) - call2 (Vsignal_hook_function, error_symbol, data); + { + /* Edebug takes care of restoring these variables when it exits. */ + if (lisp_eval_depth + 20 > max_lisp_eval_depth) + max_lisp_eval_depth = lisp_eval_depth + 20; + + if (SPECPDL_INDEX () + 40 > max_specpdl_size) + max_specpdl_size = SPECPDL_INDEX () + 40; + + call2 (Vsignal_hook_function, error_symbol, data); + } conditions = Fget (real_error_symbol, Qerror_conditions); @@ -1555,12 +1587,6 @@ See also the function `condition-case'. */) { register Lisp_Object clause; - if (lisp_eval_depth + 20 > max_lisp_eval_depth) - max_lisp_eval_depth = lisp_eval_depth + 20; - - if (specpdl_size + 40 > max_specpdl_size) - max_specpdl_size = specpdl_size + 40; - clause = find_handler_clause (handlerlist->handler, conditions, error_symbol, data, &debugger_value); @@ -1673,7 +1699,11 @@ skip_debugger (conditions, data) = SIG is nil, and DATA is (SYMBOL . REST-OF-DATA). This is for memory-full errors only. - Store value returned from debugger into *DEBUGGER_VALUE_PTR. */ + Store value returned from debugger into *DEBUGGER_VALUE_PTR. + + We need to increase max_specpdl_size temporarily around + anything we do that can push on the specpdl, so as not to get + a second error here in case we're handling specpdl overflow. */ static Lisp_Object find_handler_clause (handlers, conditions, sig, data, debugger_value_ptr) @@ -1691,7 +1721,6 @@ find_handler_clause (handlers, conditions, sig, data, debugger_value_ptr) || !NILP (Vdebug_on_signal)) /* This says call debugger even if there is a handler. */ { - int count = SPECPDL_INDEX (); int debugger_called = 0; Lisp_Object sig_symbol, combined_data; /* 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) if (wants_debugger (Vstack_trace_on_error, conditions)) { + max_specpdl_size++; #ifdef PROTOTYPES internal_with_output_to_temp_buffer ("*Backtrace*", (Lisp_Object (*) (Lisp_Object)) Fbacktrace, @@ -1721,6 +1751,7 @@ find_handler_clause (handlers, conditions, sig, data, debugger_value_ptr) internal_with_output_to_temp_buffer ("*Backtrace*", Fbacktrace, Qnil); #endif + max_specpdl_size--; } if (! no_debugger && (EQ (sig_symbol, Qquit) @@ -1729,7 +1760,6 @@ find_handler_clause (handlers, conditions, sig, data, debugger_value_ptr) && ! skip_debugger (conditions, combined_data) && when_entered_debugger < num_nonmacro_input_events) { - specbind (Qdebug_on_error, Qnil); *debugger_value_ptr = call_debugger (Fcons (Qerror, Fcons (combined_data, Qnil))); @@ -1739,7 +1769,7 @@ find_handler_clause (handlers, conditions, sig, data, debugger_value_ptr) if (EQ (handlers, Qerror)) { if (debugger_called) - return unbind_to (count, Qlambda); + return Qlambda; return Qt; } } @@ -3019,13 +3049,8 @@ grow_specpdl () if (max_specpdl_size < 400) max_specpdl_size = 400; if (specpdl_size >= max_specpdl_size) - { - if (!NILP (Vdebug_on_error)) - /* Leave room for some specpdl in the debugger. */ - max_specpdl_size = specpdl_size + 100; - Fsignal (Qerror, - Fcons (build_string ("Variable binding depth exceeds max-specpdl-size"), Qnil)); - } + Fsignal (Qerror, + Fcons (build_string ("Variable binding depth exceeds max-specpdl-size"), Qnil)); } specpdl_size *= 2; if (specpdl_size > max_specpdl_size) @@ -3333,7 +3358,7 @@ syms_of_eval () { DEFVAR_INT ("max-specpdl-size", &max_specpdl_size, doc: /* *Limit on number of Lisp variable bindings & unwind-protects. -If Lisp code tries to make more than this many at once, +If Lisp code tries to increase the total number past this amount, an error is signaled. You can safely use a value considerably larger than the default value, if 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) return; } -DEFUN ("copy-file", Fcopy_file, Scopy_file, 2, 5, +DEFUN ("copy-file", Fcopy_file, Scopy_file, 2, 6, "fCopy file: \nGCopy %s to file: \np\nP", doc: /* Copy FILE to NEWNAME. Both args must be strings. If NEWNAME names a directory, copy FILE there. @@ -2428,9 +2428,13 @@ for an existing file with the same name. If MUSTBENEW is `excl', that means to get an error if the file already exists; never overwrite. If MUSTBENEW is neither nil nor `excl', that means ask for confirmation before overwriting, but do go ahead and overwrite the file -if the user confirms. */) - (file, newname, ok_if_already_exists, keep_time, mustbenew) +if the user confirms. + +If PRESERVE-UID-GID is non-nil, we try to transfer the +uid and gid of FILE to NEWNAME. */) + (file, newname, ok_if_already_exists, keep_time, mustbenew, preserve_uid_gid) Lisp_Object file, newname, ok_if_already_exists, keep_time, mustbenew; + Lisp_Object preserve_uid_gid; { int ifd, ofd, n; char buf[16 * 1024]; @@ -2572,6 +2576,26 @@ if the user confirms. */) report_file_error ("I/O error", Fcons (newname, Qnil)); immediate_quit = 0; + /* Preserve the owner and group, if requested. */ + if (input_file_statable_p && ! NILP (preserve_uid_gid)) + fchown (ofd, st.st_uid, st.st_gid); + + if (input_file_statable_p) + { +#ifndef MSDOS + fchmod (ofd, st.st_mode & 07777); +#else /* MSDOS */ +#if defined (__DJGPP__) && __DJGPP__ > 1 + /* In DJGPP v2.0 and later, fstat usually returns true file mode bits, + and if it can't, it tells so. Otherwise, under MSDOS we usually + get only the READ bit, which will make the copied file read-only, + so it's better not to chmod at all. */ + if ((_djstat_flags & _STFAIL_WRITEBIT) == 0) + chmod (SDATA (encoded_newname), st.st_mode & 07777); +#endif /* DJGPP version 2 or newer */ +#endif /* MSDOS */ + } + /* Closing the output clobbers the file times on some systems. */ if (emacs_close (ofd) < 0) report_file_error ("I/O error", Fcons (newname, Qnil)); @@ -2589,18 +2613,6 @@ if the user confirms. */) Fcons (build_string ("Cannot set file date"), Fcons (newname, Qnil))); } -#ifndef MSDOS - chmod (SDATA (encoded_newname), st.st_mode & 07777); -#else /* MSDOS */ -#if defined (__DJGPP__) && __DJGPP__ > 1 - /* In DJGPP v2.0 and later, fstat usually returns true file mode bits, - and if it can't, it tells so. Otherwise, under MSDOS we usually - get only the READ bit, which will make the copied file read-only, - so it's better not to chmod at all. */ - if ((_djstat_flags & _STFAIL_WRITEBIT) == 0) - chmod (SDATA (encoded_newname), st.st_mode & 07777); -#endif /* DJGPP version 2 or newer */ -#endif /* MSDOS */ } emacs_close (ifd); @@ -2777,7 +2789,6 @@ This is what happens in interactive use with M-x. */) { if (errno == EXDEV) { - struct stat data; #ifdef S_IFLNK symlink_target = Ffile_symlink_p (file); if (! NILP (symlink_target)) @@ -2785,15 +2796,11 @@ This is what happens in interactive use with M-x. */) NILP (ok_if_already_exists) ? Qnil : Qt); else #endif - Fcopy_file (file, newname, - /* We have already prompted if it was an integer, - so don't have copy-file prompt again. */ - NILP (ok_if_already_exists) ? Qnil : Qt, - Qt, Qnil); - - /* Preserve owner and group, if possible (if we are root). */ - if (stat (SDATA (encoded_file), &data) >= 0) - chown (SDATA (encoded_file), data.st_uid, data.st_gid); + Fcopy_file (file, newname, + /* We have already prompted if it was an integer, + so don't have copy-file prompt again. */ + NILP (ok_if_already_exists) ? Qnil : Qt, + Qt, Qnil, Qt); Fdelete_file (file); } 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) break; case 'N': value = zero / zero; + + /* If that made a "negative" NaN, negate it. */ + + { + int i; + union { double d; char c[sizeof (double)]; } u_data, u_minus_zero; + + u_data.d = value; + u_minus_zero.d = - 0.0; + for (i = 0; i < sizeof (double); i++) + if (u_data.c[i] & u_minus_zero.c[i]) + { + value = - value; + break; + } + } + /* Now VALUE is a positive NaN. */ break; default: 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. */) clear_glyph_matrix (w->desired_matrix); clear_glyph_matrix (w->current_matrix); SET_TEXT_POS (pos, BEGV, BEGV_BYTE); - try_window (FRAME_ROOT_WINDOW (f), pos); + try_window (FRAME_ROOT_WINDOW (f), pos, 0); /* Compute width and height of the tooltip. */ 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. */ #define chdir sys_chdir #undef chmod #define chmod sys_chmod +#define chown sys_chown #undef close #define close sys_close #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) } int +sys_chown (const char *path, uid_t owner, gid_t group) +{ + if (sys_chmod (path, _S_IREAD) == -1) /* check if file exists */ + return -1; + return 0; +} + +int sys_creat (const char * path, int mode) { 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. */) clear_glyph_matrix (w->desired_matrix); clear_glyph_matrix (w->current_matrix); SET_TEXT_POS (pos, BEGV, BEGV_BYTE); - try_window (FRAME_ROOT_WINDOW (f), pos); + try_window (FRAME_ROOT_WINDOW (f), pos, 0); /* Compute width and height of the tooltip. */ 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) clear_glyph_matrix (w->desired_matrix); XSETWINDOW (window, w); SET_TEXT_POS (start, BEG, BEG_BYTE); - try_window (window, start); + try_window (window, start, 0); return window_height_changed_p; } @@ -11573,7 +11573,7 @@ try_scrolling (window, just_this_one_p, scroll_conservatively, /* Display the window. Give up if new fonts are loaded, or if point doesn't appear. */ - if (!try_window (window, startp)) + if (!try_window (window, startp, 0)) rc = SCROLLING_NEED_LARGER_MATRICES; else if (w->cursor.vpos < 0) { @@ -12178,6 +12178,7 @@ redisplay_window (window, just_this_one_p) { /* We set this later on if we have to adjust point. */ int new_vpos = -1; + int val; w->force_start = Qnil; w->vscroll = 0; @@ -12211,12 +12212,16 @@ redisplay_window (window, just_this_one_p) /* Redisplay, then check if cursor has been set during the redisplay. Give up if new fonts were loaded. */ - if (!try_window (window, startp)) + val = try_window (window, startp, 1); + if (!val) { w->force_start = Qt; clear_glyph_matrix (w->desired_matrix); goto need_larger_matrices; } + /* Point was outside the scroll margins. */ + if (val < 0) + new_vpos = window_box_height (w) / 2; if (w->cursor.vpos < 0 && !w->frozen_window_start_p) { @@ -12259,7 +12264,7 @@ redisplay_window (window, just_this_one_p) && !NILP (current_buffer->mark_active)) { clear_glyph_matrix (w->desired_matrix); - if (!try_window (window, startp)) + if (!try_window (window, startp, 0)) goto need_larger_matrices; } } @@ -12349,7 +12354,11 @@ redisplay_window (window, just_this_one_p) = try_window_reusing_current_matrix (w))) { IF_DEBUG (debug_method_add (w, "1")); - try_window (window, startp); + if (try_window (window, startp, 1) < 0) + /* -1 means we need to scroll. + 0 means we need new matrices, but fonts_changed_p + is set in that case, so we will detect it below. */ + goto try_to_scroll; } if (fonts_changed_p) @@ -12479,7 +12488,7 @@ redisplay_window (window, just_this_one_p) || MINI_WINDOW_P (w) || !(used_current_matrix_p = try_window_reusing_current_matrix (w))) - try_window (window, startp); + try_window (window, startp, 0); /* If new fonts have been loaded (due to fontsets), give up. We have to start a new redisplay since we need to re-adjust glyph @@ -12499,13 +12508,13 @@ redisplay_window (window, just_this_one_p) { clear_glyph_matrix (w->desired_matrix); move_it_by_lines (&it, 1, 0); - try_window (window, it.current.pos); + try_window (window, it.current.pos, 0); } else if (PT < IT_CHARPOS (it)) { clear_glyph_matrix (w->desired_matrix); move_it_by_lines (&it, -1, 0); - try_window (window, it.current.pos); + try_window (window, it.current.pos, 0); } else { @@ -12691,14 +12700,18 @@ redisplay_window (window, just_this_one_p) /* Build the complete desired matrix of WINDOW with a window start - buffer position POS. Value is non-zero if successful. It is zero - if fonts were loaded during redisplay which makes re-adjusting - glyph matrices necessary. */ + buffer position POS. + + Value is 1 if successful. It is zero if fonts were loaded during + redisplay which makes re-adjusting glyph matrices necessary, and -1 + if point would appear in the scroll margins. + (We check that only if CHECK_MARGINS is nonzero. */ int -try_window (window, pos) +try_window (window, pos, check_margins) Lisp_Object window; struct text_pos pos; + int check_margins; { struct window *w = XWINDOW (window); struct it it; @@ -12723,6 +12736,30 @@ try_window (window, pos) return 0; } + /* Don't let the cursor end in the scroll margins. */ + if (check_margins) + { + int this_scroll_margin, cursor_height; + + this_scroll_margin = max (0, scroll_margin); + this_scroll_margin = min (this_scroll_margin, WINDOW_TOTAL_LINES (w) / 4); + this_scroll_margin *= FRAME_LINE_HEIGHT (it.f); + cursor_height = MATRIX_ROW (w->desired_matrix, w->cursor.vpos)->height; + + if ((w->cursor.y < this_scroll_margin + && CHARPOS (pos) > BEGV) + /* Old redisplay didn't take scroll margin into account at the bottom, + but then global-hl-line-mode doesn't scroll. KFS 2004-06-14 */ + || (w->cursor.y + (make_cursor_line_fully_visible_p + ? cursor_height + this_scroll_margin + : 1)) > it.last_visible_y) + { + w->cursor.vpos = -1; + clear_glyph_matrix (w->desired_matrix); + return -1; + } + } + /* If bottom moved off end of frame, change mode line percentage. */ if (XFASTINT (w->window_end_pos) <= 0 && Z != IT_CHARPOS (it)) @@ -21667,7 +21704,7 @@ note_mouse_highlight (f, x, y) /* If we were displaying active text in another window, clear that. Also clear if we move out of text area in same window. */ if (! EQ (window, dpyinfo->mouse_face_window) - || (part != ON_TEXT && part != ON_MODE_LINE && part != ON_HEADER_LINE + || (part != ON_TEXT && part != ON_MODE_LINE && part != ON_HEADER_LINE && !NILP (dpyinfo->mouse_face_window))) clear_mouse_face (dpyinfo); @@ -22894,17 +22931,17 @@ The face used for trailing whitespace is `trailing-whitespace'. */); DEFVAR_LISP ("nobreak-char-display", &Vnobreak_char_display, doc: /* *Control highlighting of nobreak space and soft hyphen. -t means highlight the character itself (for nobreak space, -use face `nobreak-space'. -nil means no highlighting. -other values mean display the escape glyph followed by an ordinary +A value of t means highlight the character itself (for nobreak space, +use face `nobreak-space'). +A value of nil means no highlighting. +Other values mean display the escape glyph followed by an ordinary space or ordinary hyphen. */); Vnobreak_char_display = Qt; DEFVAR_LISP ("void-text-area-pointer", &Vvoid_text_area_pointer, doc: /* *The pointer shape to show in void text areas. -Nil means to show the text pointer. Other options are `arrow', `text', -`hand', `vdrag', `hdrag', `modeline', and `hourglass'. */); +A value of nil means to show the text pointer. Other options are `arrow', +`text', `hand', `vdrag', `hdrag', `modeline', and `hourglass'. */); Vvoid_text_area_pointer = Qarrow; 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. */) clear_glyph_matrix (w->desired_matrix); clear_glyph_matrix (w->current_matrix); SET_TEXT_POS (pos, BEGV, BEGV_BYTE); - try_window (FRAME_ROOT_WINDOW (f), pos); + try_window (FRAME_ROOT_WINDOW (f), pos, 0); /* Compute width and height of the tooltip. */ width = height = 0; |