aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiles Bader2005-01-24 22:34:31 +0000
committerMiles Bader2005-01-24 22:34:31 +0000
commit87795686a9e8ea51ec492d01d7dce4698b14f3af (patch)
tree737f41796d19fc2dae8a9b77ecf372ae9cca9f01
parent7ed0a705d1cf6dcf340b3407bbffd21f1cfbc925 (diff)
parent6adb6f01302f35954f3b50bbf8ae8d94af268792 (diff)
downloademacs-87795686a9e8ea51ec492d01d7dce4698b14f3af.tar.gz
emacs-87795686a9e8ea51ec492d01d7dce4698b14f3af.zip
Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-6
Merge from emacs--cvs-trunk--0 Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-48 - miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-51 Update from CVS
-rw-r--r--etc/NEWS7
-rw-r--r--lisp/ChangeLog46
-rw-r--r--lisp/calc/calc-store.el2
-rw-r--r--lisp/files.el77
-rw-r--r--lisp/international/encoded-kb.el4
-rw-r--r--lisp/progmodes/gdb-ui.el45
-rw-r--r--lisp/simple.el10
-rw-r--r--lisp/term/w32-win.el94
-rw-r--r--lisp/textmodes/refill.el84
-rw-r--r--lispref/ChangeLog8
-rw-r--r--lispref/windows.texi23
-rw-r--r--man/ChangeLog4
-rw-r--r--man/faq.texi2
-rw-r--r--src/ChangeLog50
-rw-r--r--src/dispextern.h5
-rw-r--r--src/indent.c8
-rw-r--r--src/macgui.h7
-rw-r--r--src/macterm.c105
-rw-r--r--src/window.c57
-rw-r--r--src/xdisp.c52
20 files changed, 440 insertions, 250 deletions
diff --git a/etc/NEWS b/etc/NEWS
index a558172586f..4ebf40dab90 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -2563,6 +2563,13 @@ the command `undefined'. (In earlier Emacs versions, it used
2563* Lisp Changes in Emacs 21.4 2563* Lisp Changes in Emacs 21.4
2564 2564
2565+++ 2565+++
2566** The line-move, scroll-up, and scroll-down functions will now
2567modify the window vscroll to scroll through display rows that are
2568taller that the height of the window, for example in the presense of
2569large images. To disable this feature, Lisp code may bind the new
2570variable `auto-window-vscroll' to nil.
2571
2572+++
2566** If a buffer sets buffer-save-without-query to non-nil, 2573** If a buffer sets buffer-save-without-query to non-nil,
2567save-some-buffers will always save that buffer without asking 2574save-some-buffers will always save that buffer without asking
2568(if it's modified). 2575(if it's modified).
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 0be81220340..c70fd38ecd7 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,49 @@
12005-01-24 Jay Belanger <belanger@truman.edu>
2
3 * calc/calc-store.el (calc-declare-variable): Use calc-var-name to
4 display variable name.
5
62005-01-24 Kenichi Handa <handa@m17n.org>
7
8 * international/encoded-kb.el (encoded-kbd-iso2022-single-shift):
9 Fix setting of the element of encoded-kbd-iso2022-invocations.
10
112005-01-24 Nick Roberts <nickrob@snap.net.nz>
12
13 * progmodes/gdb-ui.el (gdb-goto-breakpoint, gdb-frames-select)
14 (gdb-threads-select): Change to also accept mouse events.
15 (gdb-mouse-goto-breakpoint, gdb-frames-mouse-select)
16 (gdb-threads-mouse-select): Delete.
17
182005-01-23 Luc Teirlinck <teirllm@auburn.edu>
19
20 * files.el (insert-directory): Take care of empty directory,
21 listed without -a switch.
22
232005-01-23 Stefan Monnier <monnier@iro.umontreal.ca>
24
25 * textmodes/refill.el (refill-post-command-function):
26 Add `indent-new-comment-line' and `reindent-then-newline-and-indent'
27 to the list of functions that we should be careful not to undo.
28 (refill-late-fill-paragraph-function): Remove.
29 (refill-saved-state): New var.
30 (refill-mode): Use it to save fill-paragraph-function.
31 Save also the value of auto-fill-function.
32
33 * term/w32-win.el: Simplify code.
34
352005-01-23 Kim F. Storm <storm@cua.dk>
36
37 * simple.el (line-move): Adapt to new return value from
38 pos-visible-in-window-p.
39
40 * simple.el (line-move): Fix last change. Check partial
41 visibility at point rather than at window-start.
42
432005-01-22 Jason Rumney <jasonr@gnu.org>
44
45 * term/w32-win.el (xw-defined-colors): Remove debug-message.
46
12005-01-22 David Kastrup <dak@gnu.org> 472005-01-22 David Kastrup <dak@gnu.org>
2 48
3 * progmodes/grep.el: Add alias `find-grep' for `grep-find'. 49 * progmodes/grep.el: Add alias `find-grep' for `grep-find'.
diff --git a/lisp/calc/calc-store.el b/lisp/calc/calc-store.el
index b2cef4936a0..52f0cc0272d 100644
--- a/lisp/calc/calc-store.el
+++ b/lisp/calc/calc-store.el
@@ -482,7 +482,7 @@
482 (setq rp nil))) 482 (setq rp nil)))
483 (not rp))))) 483 (not rp)))))
484 (calc-unread-command ?\C-a) 484 (calc-unread-command ?\C-a)
485 (setq decl (read-string (format "Declare: %s to be: " var) 485 (setq decl (read-string (format "Declare: %s to be: " (calc-var-name var))
486 (and rp 486 (and rp
487 (math-format-flat-expr (nth 2 (car dp)) 0)))) 487 (math-format-flat-expr (nth 2 (car dp)) 0))))
488 (setq decl (and (string-match "[^ \t]" decl) 488 (setq decl (and (string-match "[^ \t]" decl)
diff --git a/lisp/files.el b/lisp/files.el
index cdaa7a5adb8..841332b957a 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -4550,45 +4550,54 @@ normally equivalent short `-D' option is just passed on to
4550 (when (if (stringp switches) 4550 (when (if (stringp switches)
4551 (string-match "--dired\\>" switches) 4551 (string-match "--dired\\>" switches)
4552 (member "--dired" switches)) 4552 (member "--dired" switches))
4553 ;; The following overshoots by one line for an empty
4554 ;; directory listed with "--dired", but without "-a"
4555 ;; switch, where the ls output contains a
4556 ;; "//DIRED-OPTIONS//" line, but no "//DIRED//" line.
4557 ;; We take care of that case later.
4553 (forward-line -2) 4558 (forward-line -2)
4554 (when (looking-at "//SUBDIRED//") 4559 (when (looking-at "//SUBDIRED//")
4555 (delete-region (point) (progn (forward-line 1) (point))) 4560 (delete-region (point) (progn (forward-line 1) (point)))
4556 (forward-line -1)) 4561 (forward-line -1))
4557 (when (looking-at "//DIRED//") 4562 (if (looking-at "//DIRED//")
4558 (let ((end (line-end-position)) 4563 (let ((end (line-end-position))
4559 (linebeg (point)) 4564 (linebeg (point))
4560 error-lines) 4565 error-lines)
4561 ;; Find all the lines that are error messages, 4566 ;; Find all the lines that are error messages,
4562 ;; and record the bounds of each one. 4567 ;; and record the bounds of each one.
4563 (goto-char beg) 4568 (goto-char beg)
4564 (while (< (point) linebeg) 4569 (while (< (point) linebeg)
4565 (or (eql (following-char) ?\s) 4570 (or (eql (following-char) ?\s)
4566 (push (list (point) (line-end-position)) error-lines)) 4571 (push (list (point) (line-end-position)) error-lines))
4567 (forward-line 1)) 4572 (forward-line 1))
4568 (setq error-lines (nreverse error-lines)) 4573 (setq error-lines (nreverse error-lines))
4569 ;; Now read the numeric positions of file names. 4574 ;; Now read the numeric positions of file names.
4570 (goto-char linebeg) 4575 (goto-char linebeg)
4571 (forward-word 1) 4576 (forward-word 1)
4572 (forward-char 3) 4577 (forward-char 3)
4573 (while (< (point) end) 4578 (while (< (point) end)
4574 (let ((start (insert-directory-adj-pos 4579 (let ((start (insert-directory-adj-pos
4580 (+ beg (read (current-buffer)))
4581 error-lines))
4582 (end (insert-directory-adj-pos
4575 (+ beg (read (current-buffer))) 4583 (+ beg (read (current-buffer)))
4576 error-lines)) 4584 error-lines)))
4577 (end (insert-directory-adj-pos 4585 (if (memq (char-after end) '(?\n ?\ ))
4578 (+ beg (read (current-buffer))) 4586 ;; End is followed by \n or by " -> ".
4579 error-lines))) 4587 (put-text-property start end 'dired-filename t)
4580 (if (memq (char-after end) '(?\n ?\ )) 4588 ;; It seems that we can't trust ls's output as to
4581 ;; End is followed by \n or by " -> ". 4589 ;; byte positions of filenames.
4582 (put-text-property start end 'dired-filename t) 4590 (put-text-property beg (point) 'dired-filename nil)
4583 ;; It seems that we can't trust ls's output as to 4591 (end-of-line))))
4584 ;; byte positions of filenames. 4592 (goto-char end)
4585 (put-text-property beg (point) 'dired-filename nil) 4593 (beginning-of-line)
4586 (end-of-line)))) 4594 (delete-region (point) (progn (forward-line 1) (point))))
4587 (goto-char end) 4595 ;; Take care of the case where the ls output contains a
4588 (beginning-of-line) 4596 ;; "//DIRED-OPTIONS//"-line, but no "//DIRED//"-line
4589 (delete-region (point) (progn (forward-line 1) (point)))) 4597 ;; and we went one line too far back (see above).
4590 (if (looking-at "//DIRED-OPTIONS//") 4598 (forward-line 1))
4591 (delete-region (point) (progn (forward-line 1) (point)))))) 4599 (if (looking-at "//DIRED-OPTIONS//")
4600 (delete-region (point) (progn (forward-line 1) (point)))))
4592 4601
4593 ;; Now decode what read if necessary. 4602 ;; Now decode what read if necessary.
4594 (let ((coding (or coding-system-for-read 4603 (let ((coding (or coding-system-for-read
diff --git a/lisp/international/encoded-kb.el b/lisp/international/encoded-kb.el
index ad80baecf76..d5452c92c43 100644
--- a/lisp/international/encoded-kb.el
+++ b/lisp/international/encoded-kb.el
@@ -130,9 +130,7 @@ The following key sequence may cause multilingual text insertion."
130 130
131(defun encoded-kbd-iso2022-single-shift (ignore) 131(defun encoded-kbd-iso2022-single-shift (ignore)
132 (let ((char (encoded-kbd-last-key))) 132 (let ((char (encoded-kbd-last-key)))
133 (aset encoded-kbd-iso2022-invocations 2 133 (aset encoded-kbd-iso2022-invocations 2 (if (= char ?\216) 2 3)))
134 (aref encoded-kbd-iso2022-designations
135 (if (= char ?\216) 2 3))))
136 "") 134 "")
137 135
138(defun encoded-kbd-self-insert-iso2022-7bit (ignore) 136(defun encoded-kbd-self-insert-iso2022-7bit (ignore)
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el
index 993d440cd0c..1827589387e 100644
--- a/lisp/progmodes/gdb-ui.el
+++ b/lisp/progmodes/gdb-ui.el
@@ -1243,7 +1243,7 @@ static char *magick[] = {
1243 (define-key map "d" 'gdb-delete-breakpoint) 1243 (define-key map "d" 'gdb-delete-breakpoint)
1244 (define-key map "q" 'kill-this-buffer) 1244 (define-key map "q" 'kill-this-buffer)
1245 (define-key map "\r" 'gdb-goto-breakpoint) 1245 (define-key map "\r" 'gdb-goto-breakpoint)
1246 (define-key map [mouse-2] 'gdb-mouse-goto-breakpoint) 1246 (define-key map [mouse-2] 'gdb-goto-breakpoint)
1247 map)) 1247 map))
1248 1248
1249(defun gdb-breakpoints-mode () 1249(defun gdb-breakpoints-mode ()
@@ -1291,9 +1291,10 @@ static char *magick[] = {
1291 (concat gdb-server-prefix "delete " (match-string 1) "\n") 'ignore)) 1291 (concat gdb-server-prefix "delete " (match-string 1) "\n") 'ignore))
1292 (error "Not recognized as break/watchpoint line"))) 1292 (error "Not recognized as break/watchpoint line")))
1293 1293
1294(defun gdb-goto-breakpoint () 1294(defun gdb-goto-breakpoint (&optional event)
1295 "Display the breakpoint location specified at current line." 1295 "Display the breakpoint location specified at current line."
1296 (interactive) 1296 (interactive (list last-input-event))
1297 (if event (mouse-set-point event))
1297 (save-excursion 1298 (save-excursion
1298 (beginning-of-line 1) 1299 (beginning-of-line 1)
1299 (if (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba)) 1300 (if (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba))
@@ -1311,14 +1312,8 @@ static char *magick[] = {
1311 (goto-line (string-to-number line)) 1312 (goto-line (string-to-number line))
1312 (set-window-point window (point)))))) 1313 (set-window-point window (point))))))
1313 (error "Not recognized as break/watchpoint line")))) 1314 (error "Not recognized as break/watchpoint line"))))
1314
1315(defun gdb-mouse-goto-breakpoint (event)
1316 "Display the breakpoint location that you click on."
1317 (interactive "e")
1318 (mouse-set-point event)
1319 (gdb-goto-breakpoint))
1320 1315
1321;; 1316
1322;; Frames buffer. This displays a perpetually correct bactracktrace 1317;; Frames buffer. This displays a perpetually correct bactracktrace
1323;; (from the command `where'). 1318;; (from the command `where').
1324;; 1319;;
@@ -1372,7 +1367,7 @@ static char *magick[] = {
1372 (suppress-keymap map) 1367 (suppress-keymap map)
1373 (define-key map "q" 'kill-this-buffer) 1368 (define-key map "q" 'kill-this-buffer)
1374 (define-key map "\r" 'gdb-frames-select) 1369 (define-key map "\r" 'gdb-frames-select)
1375 (define-key map [mouse-2] 'gdb-frames-mouse-select) 1370 (define-key map [mouse-2] 'gdb-frames-select)
1376 map)) 1371 map))
1377 1372
1378(defun gdb-frames-mode () 1373(defun gdb-frames-mode ()
@@ -1396,20 +1391,15 @@ static char *magick[] = {
1396 (n (or (and pos (match-string-no-properties 1)) "0"))) 1391 (n (or (and pos (match-string-no-properties 1)) "0")))
1397 n))) 1392 n)))
1398 1393
1399(defun gdb-frames-select () 1394(defun gdb-frames-select (&optional event)
1400 "Select the frame and display the relevant source." 1395 "Select the frame and display the relevant source."
1401 (interactive) 1396 (interactive (list last-input-event))
1397 (if event (mouse-set-point event))
1402 (gdb-enqueue-input 1398 (gdb-enqueue-input
1403 (list (concat gdb-server-prefix "frame " (gdb-get-frame-number) "\n") 'ignore)) 1399 (list (concat gdb-server-prefix "frame " (gdb-get-frame-number) "\n") 'ignore))
1404 (gud-display-frame)) 1400 (gud-display-frame))
1405
1406(defun gdb-frames-mouse-select (event)
1407 "Select the frame you click on and display the relevant source."
1408 (interactive "e")
1409 (mouse-set-point event)
1410 (gdb-frames-select))
1411 1401
1412;; 1402
1413;; Threads buffer. This displays a selectable thread list. 1403;; Threads buffer. This displays a selectable thread list.
1414;; 1404;;
1415(gdb-set-buffer-rules 'gdb-threads-buffer 1405(gdb-set-buffer-rules 'gdb-threads-buffer
@@ -1454,7 +1444,7 @@ static char *magick[] = {
1454 (suppress-keymap map) 1444 (suppress-keymap map)
1455 (define-key map "q" 'kill-this-buffer) 1445 (define-key map "q" 'kill-this-buffer)
1456 (define-key map "\r" 'gdb-threads-select) 1446 (define-key map "\r" 'gdb-threads-select)
1457 (define-key map [mouse-2] 'gdb-threads-mouse-select) 1447 (define-key map [mouse-2] 'gdb-threads-select)
1458 map)) 1448 map))
1459 1449
1460(defun gdb-threads-mode () 1450(defun gdb-threads-mode ()
@@ -1474,20 +1464,15 @@ static char *magick[] = {
1474 (re-search-backward "^\\s-*\\([0-9]*\\)" nil t) 1464 (re-search-backward "^\\s-*\\([0-9]*\\)" nil t)
1475 (match-string-no-properties 1))) 1465 (match-string-no-properties 1)))
1476 1466
1477(defun gdb-threads-select () 1467(defun gdb-threads-select (&optional event)
1478 "Select the thread and display the relevant source." 1468 "Select the thread and display the relevant source."
1479 (interactive) 1469 (interactive (list last-input-event))
1470 (if event (mouse-set-point event))
1480 (gdb-enqueue-input 1471 (gdb-enqueue-input
1481 (list (concat "thread " (gdb-get-thread-number) "\n") 'ignore)) 1472 (list (concat "thread " (gdb-get-thread-number) "\n") 'ignore))
1482 (gud-display-frame)) 1473 (gud-display-frame))
1483
1484(defun gdb-threads-mouse-select (event)
1485 "Select the thread you click on and display the relevant source."
1486 (interactive "e")
1487 (mouse-set-point event)
1488 (gdb-threads-select))
1489 1474
1490;; 1475
1491;; Registers buffer. 1476;; Registers buffer.
1492;; 1477;;
1493(gdb-set-buffer-rules 'gdb-registers-buffer 1478(gdb-set-buffer-rules 'gdb-registers-buffer
diff --git a/lisp/simple.el b/lisp/simple.el
index c54c67ea8ac..db7ae23bf41 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -3183,17 +3183,17 @@ Outline mode sets this."
3183(defun line-move (arg &optional noerror to-end) 3183(defun line-move (arg &optional noerror to-end)
3184 (if auto-window-vscroll 3184 (if auto-window-vscroll
3185 (let ((forward (> arg 0)) 3185 (let ((forward (> arg 0))
3186 (pvis (pos-visible-in-window-p (window-start) nil t))) 3186 (part (nth 2 (pos-visible-in-window-p (point) nil t))))
3187 (if (and pvis (null (nth 2 pvis)) 3187 (if (and (consp part)
3188 (> (nth (if forward 4 3) pvis) 0)) 3188 (> (setq part (if forward (cdr part) (car part))) 0))
3189 (set-window-vscroll nil 3189 (set-window-vscroll nil
3190 (if forward 3190 (if forward
3191 (+ (window-vscroll nil t) 3191 (+ (window-vscroll nil t)
3192 (min (nth 4 pvis) 3192 (min part
3193 (* (frame-char-height) arg))) 3193 (* (frame-char-height) arg)))
3194 (max 0 3194 (max 0
3195 (- (window-vscroll nil t) 3195 (- (window-vscroll nil t)
3196 (min (nth 3 pvis) 3196 (min part
3197 (* (frame-char-height) (- arg)))))) 3197 (* (frame-char-height) (- arg))))))
3198 t) 3198 t)
3199 (set-window-vscroll nil 0) 3199 (set-window-vscroll nil 0)
diff --git a/lisp/term/w32-win.el b/lisp/term/w32-win.el
index b2f2269c558..4646e54b4a0 100644
--- a/lisp/term/w32-win.el
+++ b/lisp/term/w32-win.el
@@ -1,6 +1,6 @@
1;;; w32-win.el --- parse switches controlling interface with W32 window system 1;;; w32-win.el --- parse switches controlling interface with W32 window system
2 2
3;; Copyright (C) 1993, 1994, 2003, 2004 Free Software Foundation, Inc. 3;; Copyright (C) 1993, 1994, 2003, 2004, 2005 Free Software Foundation, Inc.
4 4
5;; Author: Kevin Gallo 5;; Author: Kevin Gallo
6;; Keywords: terminals 6;; Keywords: terminals
@@ -139,50 +139,26 @@ the last file dropped is selected."
139 "Handle SWITCH of the form \"-switch value\" or \"-switch\"." 139 "Handle SWITCH of the form \"-switch value\" or \"-switch\"."
140 (let ((aelt (assoc switch command-line-x-option-alist))) 140 (let ((aelt (assoc switch command-line-x-option-alist)))
141 (if aelt 141 (if aelt
142 (let ((param (nth 3 aelt)) 142 (push (cons (nth 3 aelt) (or (nth 4 aelt) (pop x-invocation-args)))
143 (value (nth 4 aelt))) 143 default-frame-alist))))
144 (if value
145 (setq default-frame-alist
146 (cons (cons param value)
147 default-frame-alist))
148 (setq default-frame-alist
149 (cons (cons param
150 (car x-invocation-args))
151 default-frame-alist)
152 x-invocation-args (cdr x-invocation-args)))))))
153 144
154(defun x-handle-numeric-switch (switch) 145(defun x-handle-numeric-switch (switch)
155 "Handle SWITCH of the form \"-switch n\"." 146 "Handle SWITCH of the form \"-switch n\"."
156 (let ((aelt (assoc switch command-line-x-option-alist))) 147 (let ((aelt (assoc switch command-line-x-option-alist)))
157 (if aelt 148 (if aelt
158 (let ((param (nth 3 aelt))) 149 (push (cons (nth 3 aelt) (string-to-int (pop x-invocation-args)))
159 (setq default-frame-alist 150 default-frame-alist))))
160 (cons (cons param
161 (string-to-int (car x-invocation-args)))
162 default-frame-alist)
163 x-invocation-args
164 (cdr x-invocation-args))))))
165 151
166;; Handle options that apply to initial frame only 152;; Handle options that apply to initial frame only
167(defun x-handle-initial-switch (switch) 153(defun x-handle-initial-switch (switch)
168 (let ((aelt (assoc switch command-line-x-option-alist))) 154 (let ((aelt (assoc switch command-line-x-option-alist)))
169 (if aelt 155 (if aelt
170 (let ((param (nth 3 aelt)) 156 (push (cons (nth 3 aelt) (or (nth 4 aelt) (pop x-invocation-args)))
171 (value (nth 4 aelt))) 157 initial-frame-alist))))
172 (if value
173 (setq initial-frame-alist
174 (cons (cons param value)
175 initial-frame-alist))
176 (setq initial-frame-alist
177 (cons (cons param
178 (car x-invocation-args))
179 initial-frame-alist)
180 x-invocation-args (cdr x-invocation-args)))))))
181 158
182(defun x-handle-iconic (switch) 159(defun x-handle-iconic (switch)
183 "Make \"-iconic\" SWITCH apply only to the initial frame." 160 "Make \"-iconic\" SWITCH apply only to the initial frame."
184 (setq initial-frame-alist 161 (push '(visibility . icon) initial-frame-alist))
185 (cons '(visibility . icon) initial-frame-alist)))
186 162
187(defun x-handle-xrm-switch (switch) 163(defun x-handle-xrm-switch (switch)
188 "Handle the \"-xrm\" SWITCH." 164 "Handle the \"-xrm\" SWITCH."
@@ -226,18 +202,15 @@ the last file dropped is selected."
226;; to the option's operand; set the name of the initial frame, too. 202;; to the option's operand; set the name of the initial frame, too.
227 (or (consp x-invocation-args) 203 (or (consp x-invocation-args)
228 (error "%s: missing argument to `%s' option" (invocation-name) switch)) 204 (error "%s: missing argument to `%s' option" (invocation-name) switch))
229 (setq x-resource-name (car x-invocation-args) 205 (setq x-resource-name (pop x-invocation-args))
230 x-invocation-args (cdr x-invocation-args)) 206 (push (cons 'name x-resource-name) initial-frame-alist))
231 (setq initial-frame-alist (cons (cons 'name x-resource-name)
232 initial-frame-alist)))
233 207
234(defvar x-display-name nil 208(defvar x-display-name nil
235 "The display name specifying server and frame.") 209 "The display name specifying server and frame.")
236 210
237(defun x-handle-display (switch) 211(defun x-handle-display (switch)
238 "Handle the \"-display\" SWITCH." 212 "Handle the \"-display\" SWITCH."
239 (setq x-display-name (car x-invocation-args) 213 (setq x-display-name (pop x-invocation-args)))
240 x-invocation-args (cdr x-invocation-args)))
241 214
242(defun x-handle-args (args) 215(defun x-handle-args (args)
243 "Process the X-related command line options in ARGS. 216 "Process the X-related command line options in ARGS.
@@ -281,7 +254,7 @@ This returns ARGS with the arguments that have been processed removed."
281 (cons argval x-invocation-args))) 254 (cons argval x-invocation-args)))
282 (funcall handler this-switch)) 255 (funcall handler this-switch))
283 (funcall handler this-switch)) 256 (funcall handler this-switch))
284 (setq args (cons orig-this-switch args))))) 257 (push orig-this-switch args))))
285 (nconc (nreverse args) x-invocation-args)) 258 (nconc (nreverse args) x-invocation-args))
286 259
287;; 260;;
@@ -1046,16 +1019,10 @@ XConsortium: rgb.txt,v 10.41 94/02/20 18:39:36 rws Exp")
1046(defun xw-defined-colors (&optional frame) 1019(defun xw-defined-colors (&optional frame)
1047 "Internal function called by `defined-colors', which see." 1020 "Internal function called by `defined-colors', which see."
1048 (or frame (setq frame (selected-frame))) 1021 (or frame (setq frame (selected-frame)))
1049 (let* ((color-map-colors (mapcar (lambda (clr) (car clr)) w32-color-map)) 1022 (let ((defined-colors nil))
1050 (all-colors (or color-map-colors x-colors)) 1023 (dolist (this-color (or (mapcar 'car w32-color-map) x-colors))
1051 (this-color nil)
1052 (defined-colors nil))
1053 (message "Defining colors...")
1054 (while all-colors
1055 (setq this-color (car all-colors)
1056 all-colors (cdr all-colors))
1057 (and (color-supported-p this-color frame t) 1024 (and (color-supported-p this-color frame t)
1058 (setq defined-colors (cons this-color defined-colors)))) 1025 (push this-color defined-colors)))
1059 defined-colors)) 1026 defined-colors))
1060 1027
1061 1028
@@ -1077,13 +1044,10 @@ XConsortium: rgb.txt,v 10.41 94/02/20 18:39:36 rws Exp")
1077 1044
1078;;; Make sure we have a valid resource name. 1045;;; Make sure we have a valid resource name.
1079(or (stringp x-resource-name) 1046(or (stringp x-resource-name)
1080 (let (i) 1047 (setq x-resource-name
1081 (setq x-resource-name (invocation-name)) 1048 ;; Change any . or * characters in x-resource-name to hyphens,
1082 1049 ;; so as not to choke when we use it in X resource queries.
1083 ;; Change any . or * characters in x-resource-name to hyphens, 1050 (replace-regexp-in-string "[.*]" "-" (invocation-name))))
1084 ;; so as not to choke when we use it in X resource queries.
1085 (while (setq i (string-match "[.*]" x-resource-name))
1086 (aset x-resource-name i ?-))))
1087 1051
1088;; For the benefit of older Emacses (19.27 and earlier) that are sharing 1052;; For the benefit of older Emacses (19.27 and earlier) that are sharing
1089;; the same lisp directory, don't pass the third argument unless we seem 1053;; the same lisp directory, don't pass the third argument unless we seem
@@ -1167,21 +1131,17 @@ See the documentation of `create-fontset-from-fontset-spec for the format.")
1167 (setq initial-frame-alist (append initial-frame-alist parsed)) 1131 (setq initial-frame-alist (append initial-frame-alist parsed))
1168 ;; The size parms apply to all frames. 1132 ;; The size parms apply to all frames.
1169 (if (assq 'height parsed) 1133 (if (assq 'height parsed)
1170 (setq default-frame-alist 1134 (push (cons 'height (cdr (assq 'height parsed)))
1171 (cons (cons 'height (cdr (assq 'height parsed))) 1135 default-frame-alist))
1172 default-frame-alist)))
1173 (if (assq 'width parsed) 1136 (if (assq 'width parsed)
1174 (setq default-frame-alist 1137 (push (cons 'width (cdr (assq 'width parsed)))
1175 (cons (cons 'width (cdr (assq 'width parsed))) 1138 default-frame-alist)))))
1176 default-frame-alist))))))
1177 1139
1178;; Check the reverseVideo resource. 1140;; Check the reverseVideo resource.
1179(let ((case-fold-search t)) 1141(let ((case-fold-search t))
1180 (let ((rv (x-get-resource "reverseVideo" "ReverseVideo"))) 1142 (let ((rv (x-get-resource "reverseVideo" "ReverseVideo")))
1181 (if (and rv 1143 (if (and rv (string-match "^\\(true\\|yes\\|on\\)$" rv))
1182 (string-match "^\\(true\\|yes\\|on\\)$" rv)) 1144 (push '(reverse . t) default-frame-alist))))
1183 (setq default-frame-alist
1184 (cons '(reverse . t) default-frame-alist)))))
1185 1145
1186(defun x-win-suspend-error () 1146(defun x-win-suspend-error ()
1187 "Report an error when a suspend is attempted." 1147 "Report an error when a suspend is attempted."
@@ -1245,7 +1205,7 @@ font dialog to get the matching FONTS. Otherwise use a pop-up menu
1245 (and chosen-font (list chosen-font))) 1205 (and chosen-font (list chosen-font)))
1246 (x-popup-menu 1206 (x-popup-menu
1247 last-nonmenu-event 1207 last-nonmenu-event
1248 ;; Append list of fontsets currently defined. 1208 ;; Append list of fontsets currently defined.
1249 ;; Conditional on new-fontset so bootstrapping works on non-GUI compiles 1209 ;; Conditional on new-fontset so bootstrapping works on non-GUI compiles
1250 (if (fboundp 'new-fontset) 1210 (if (fboundp 'new-fontset)
1251 (append w32-fixed-font-alist (list (generate-fontset-menu))))))) 1211 (append w32-fixed-font-alist (list (generate-fontset-menu)))))))
@@ -1269,5 +1229,5 @@ font dialog to get the matching FONTS. Otherwise use a pop-up menu
1269 (tiff "libtiff3.dll" "libtiff.dll") 1229 (tiff "libtiff3.dll" "libtiff.dll")
1270 (gif "libungif.dll"))) 1230 (gif "libungif.dll")))
1271 1231
1272;;; arch-tag: 69fb1701-28c2-4890-b351-3d1fe4b4f166 1232;; arch-tag: 69fb1701-28c2-4890-b351-3d1fe4b4f166
1273;;; w32-win.el ends here 1233;;; w32-win.el ends here
diff --git a/lisp/textmodes/refill.el b/lisp/textmodes/refill.el
index 60b64e9a9f2..9979f4a3e27 100644
--- a/lisp/textmodes/refill.el
+++ b/lisp/textmodes/refill.el
@@ -1,6 +1,6 @@
1;;; refill.el --- `auto-fill' by refilling paragraphs on changes 1;;; refill.el --- `auto-fill' by refilling paragraphs on changes
2 2
3;; Copyright (C) 2000, 2003 Free Software Foundation, Inc. 3;; Copyright (C) 2000, 2003, 2005 Free Software Foundation, Inc.
4 4
5;; Author: Dave Love <fx@gnu.org> 5;; Author: Dave Love <fx@gnu.org>
6;; Maintainer: Miles Bader <miles@gnu.org> 6;; Maintainer: Miles Bader <miles@gnu.org>
@@ -85,6 +85,8 @@
85 85
86;;; Code: 86;;; Code:
87 87
88(eval-when-compile (require 'cl))
89
88(defgroup refill nil 90(defgroup refill nil
89 "Refilling paragraphs on changes." 91 "Refilling paragraphs on changes."
90 :group 'fill) 92 :group 'fill)
@@ -169,40 +171,36 @@ complex processing.")
169 "Post-command function to do refilling (conditionally)." 171 "Post-command function to do refilling (conditionally)."
170 (when refill-doit ; there was a change 172 (when refill-doit ; there was a change
171 ;; There's probably scope for more special cases here... 173 ;; There's probably scope for more special cases here...
172 (if (eq this-command 'self-insert-command) 174 (case this-command
173 ;; Treat self-insertion commands specially, since they don't 175 (self-insert-command
174 ;; always reset `refill-doit' -- for self-insertion commands that 176 ;; Treat self-insertion commands specially, since they don't
175 ;; *don't* cause a refill, we want to leave it turned on so that 177 ;; always reset `refill-doit' -- for self-insertion commands that
176 ;; any subsequent non-modification command will cause a refill. 178 ;; *don't* cause a refill, we want to leave it turned on so that
177 (when (aref auto-fill-chars (char-before)) 179 ;; any subsequent non-modification command will cause a refill.
178 ;; Respond to the same characters as auto-fill (other than 180 (when (aref auto-fill-chars (char-before))
179 ;; newline, covered below). 181 ;; Respond to the same characters as auto-fill (other than
180 (refill-fill-paragraph-at refill-doit) 182 ;; newline, covered below).
181 (setq refill-doit nil)) 183 (refill-fill-paragraph-at refill-doit)
182 (cond 184 (setq refill-doit nil)))
183 ((or (eq this-command 'quoted-insert) 185 ((quoted-insert fill-paragraph fill-region) nil)
184 (eq this-command 'fill-paragraph) 186 ((newline newline-and-indent open-line indent-new-comment-line
185 (eq this-command 'fill-region)) 187 reindent-then-newline-and-indent)
186 nil) 188 ;; Don't zap what was just inserted.
187 ((or (eq this-command 'newline) 189 (save-excursion
188 (eq this-command 'newline-and-indent) 190 (beginning-of-line) ; for newline-and-indent
189 (eq this-command 'open-line)) 191 (skip-chars-backward "\n")
190 ;; Don't zap what was just inserted. 192 (save-restriction
191 (save-excursion 193 (narrow-to-region (point-min) (point))
192 (beginning-of-line) ; for newline-and-indent 194 (refill-fill-paragraph-at refill-doit)))
193 (skip-chars-backward "\n") 195 (widen)
194 (save-restriction 196 (save-excursion
195 (narrow-to-region (point-min) (point)) 197 (skip-chars-forward "\n")
196 (refill-fill-paragraph-at refill-doit))) 198 (save-restriction
197 (widen) 199 (narrow-to-region (line-beginning-position) (point-max))
198 (save-excursion 200 (refill-fill-paragraph-at refill-doit))))
199 (skip-chars-forward "\n") 201 (t
200 (save-restriction 202 (refill-fill-paragraph-at refill-doit)))
201 (narrow-to-region (line-beginning-position) (point-max)) 203 (setq refill-doit nil)))
202 (refill-fill-paragraph-at refill-doit))))
203 (t
204 (refill-fill-paragraph-at refill-doit)))
205 (setq refill-doit nil))))
206 204
207(defun refill-pre-command-function () 205(defun refill-pre-command-function ()
208 "Pre-command function to do refilling (conditionally)." 206 "Pre-command function to do refilling (conditionally)."
@@ -213,7 +211,7 @@ complex processing.")
213 (refill-fill-paragraph-at refill-doit) 211 (refill-fill-paragraph-at refill-doit)
214 (setq refill-doit nil))) 212 (setq refill-doit nil)))
215 213
216(defvar refill-late-fill-paragraph-function nil) 214(defvar refill-saved-state nil)
217 215
218;;;###autoload 216;;;###autoload
219(define-minor-mode refill-mode 217(define-minor-mode refill-mode
@@ -228,16 +226,18 @@ refilling if they would cause auto-filling."
228 (when refill-ignorable-overlay 226 (when refill-ignorable-overlay
229 (delete-overlay refill-ignorable-overlay) 227 (delete-overlay refill-ignorable-overlay)
230 (kill-local-variable 'refill-ignorable-overlay)) 228 (kill-local-variable 'refill-ignorable-overlay))
231 (when (local-variable-p 'refill-late-fill-paragraph-function) 229 (when (local-variable-p 'refill-saved-state)
232 (setq fill-paragraph-function refill-late-fill-paragraph-function) 230 (dolist (x refill-saved-state)
233 (kill-local-variable 'refill-late-fill-paragraph-function)) 231 (set (make-local-variable (car x)) (cdr x)))
232 (kill-local-variable 'refill-saved-state))
234 (if refill-mode 233 (if refill-mode
235 (progn 234 (progn
236 (add-hook 'after-change-functions 'refill-after-change-function nil t) 235 (add-hook 'after-change-functions 'refill-after-change-function nil t)
237 (add-hook 'post-command-hook 'refill-post-command-function nil t) 236 (add-hook 'post-command-hook 'refill-post-command-function nil t)
238 (add-hook 'pre-command-hook 'refill-pre-command-function nil t) 237 (add-hook 'pre-command-hook 'refill-pre-command-function nil t)
239 (set (make-local-variable 'refill-late-fill-paragraph-function) 238 (set (make-local-variable 'refill-saved-state)
240 fill-paragraph-function) 239 (mapcar (lambda (s) (cons s (symbol-value s)))
240 '(fill-paragraph-function auto-fill-function)))
241 ;; This provides the test for recursive paragraph filling. 241 ;; This provides the test for recursive paragraph filling.
242 (set (make-local-variable 'fill-paragraph-function) 242 (set (make-local-variable 'fill-paragraph-function)
243 'refill-fill-paragraph) 243 'refill-fill-paragraph)
@@ -257,5 +257,5 @@ refilling if they would cause auto-filling."
257 257
258(provide 'refill) 258(provide 'refill)
259 259
260;;; arch-tag: 2c4ce9e8-1daa-4a3b-b6f8-fd6ac5bf6138 260;; arch-tag: 2c4ce9e8-1daa-4a3b-b6f8-fd6ac5bf6138
261;;; refill.el ends here 261;;; refill.el ends here
diff --git a/lispref/ChangeLog b/lispref/ChangeLog
index 12b67ac30b3..c871d5aad87 100644
--- a/lispref/ChangeLog
+++ b/lispref/ChangeLog
@@ -1,3 +1,11 @@
12005-01-23 Kim F. Storm <storm@cua.dk>
2
3 * windows.texi (Window Start): Fix `pos-visible-in-window-p'
4 return value. Third element FULLY replaced by PARTIAL which
5 specifies number of invisible pixels if row is only partially visible.
6 (Textual Scrolling): Mention auto-window-vscroll.
7 (Vertical Scrolling): New defvar auto-window-vscroll.
8
12005-01-16 Luc Teirlinck <teirllm@auburn.edu> 92005-01-16 Luc Teirlinck <teirllm@auburn.edu>
2 10
3 * keymaps.texi (Changing Key Bindings): `suppress-keymap' now uses 11 * keymaps.texi (Changing Key Bindings): `suppress-keymap' now uses
diff --git a/lispref/windows.texi b/lispref/windows.texi
index 636d1d745cc..5041fb5b2df 100644
--- a/lispref/windows.texi
+++ b/lispref/windows.texi
@@ -1345,10 +1345,12 @@ non-@code{nil} anyway. @xref{Horizontal Scrolling}.
1345If @var{position} is visible, @code{pos-visible-in-window-p} returns 1345If @var{position} is visible, @code{pos-visible-in-window-p} returns
1346@code{t} if @var{partially} is @code{nil}; if @var{partially} is 1346@code{t} if @var{partially} is @code{nil}; if @var{partially} is
1347non-@code{nil}, it returns a list of the form @code{(@var{x} @var{y} 1347non-@code{nil}, it returns a list of the form @code{(@var{x} @var{y}
1348@var{fully})}, where @var{x} and @var{y} are the pixel coordinates 1348@var{partial})}, where @var{x} and @var{y} are the pixel coordinates
1349relative to the top left corner of the window, and @var{fully} is 1349relative to the top left corner of the window, and @var{partial} is
1350@code{t} if the character after @var{position} is fully visible and 1350@code{nil} if the character after @var{position} is fully visible;
1351@code{nil} otherwise. 1351otherwise it is a cons @code{(@var{rtop} . @var{rbot})} where the
1352@var{rtop} and @var{rbot} specify the number of invisible pixels at
1353the top and bottom of the row at @var{position}.
1352 1354
1353Here is an example: 1355Here is an example:
1354 1356
@@ -1397,6 +1399,12 @@ names that fit the user's point of view.
1397buffer is different from the buffer that is displayed in the selected 1399buffer is different from the buffer that is displayed in the selected
1398window. @xref{Current Buffer}. 1400window. @xref{Current Buffer}.
1399 1401
1402 If the window contains a row which is taller than the height of the
1403window (for example in the presense of a large image), the scroll
1404functions will adjust the window vscroll to scroll the partially
1405visible row. To disable this feature, Lisp code may bind the variable
1406`auto-window-vscroll' to @code{nil} (@pxref{Vertical Scrolling}).
1407
1400@deffn Command scroll-up &optional count 1408@deffn Command scroll-up &optional count
1401This function scrolls the text in the selected window upward 1409This function scrolls the text in the selected window upward
1402@var{count} lines. If @var{count} is negative, scrolling is actually 1410@var{count} lines. If @var{count} is negative, scrolling is actually
@@ -1622,6 +1630,13 @@ If @var{pixels-p} is non-@code{nil}, @var{lines} specifies a number of
1622pixels. In this case, the return value is @var{lines}. 1630pixels. In this case, the return value is @var{lines}.
1623@end defun 1631@end defun
1624 1632
1633@defvar auto-window-vscroll
1634If this variable is non-@code{nil}, the line-move, scroll-up, and
1635scroll-down functions will automatically modify the window vscroll to
1636scroll through display rows that are taller that the height of the
1637window, for example in the presense of large images.
1638@end defvar
1639
1625@node Horizontal Scrolling 1640@node Horizontal Scrolling
1626@section Horizontal Scrolling 1641@section Horizontal Scrolling
1627@cindex horizontal scrolling 1642@cindex horizontal scrolling
diff --git a/man/ChangeLog b/man/ChangeLog
index 1eb82ac520f..63e3591265e 100644
--- a/man/ChangeLog
+++ b/man/ChangeLog
@@ -1,3 +1,7 @@
12005-01-24 David Kastrup <dak@gnu.org>
2
3 * faq.texi: Update AUCTeX version info.
4
12005-01-16 Xavier Maillard <zedek@gnu-rox.org> (tiny change) 52005-01-16 Xavier Maillard <zedek@gnu-rox.org> (tiny change)
2 6
3 * gnus-faq.texi ([4.1]): Typo. 7 * gnus-faq.texi ([4.1]): Typo.
diff --git a/man/faq.texi b/man/faq.texi
index b2a8b40155f..061441fe994 100644
--- a/man/faq.texi
+++ b/man/faq.texi
@@ -4000,7 +4000,7 @@ User Manual}, and
4000@email{dak@@gnu.org, David Kastrup} 4000@email{dak@@gnu.org, David Kastrup}
4001 4001
4002@item Latest version 4002@item Latest version
400311.52 400311.54
4004 4004
4005@item Distribution 4005@item Distribution
4006@uref{ftp://ftp.gnu.org/pub/gnu/auctex/} 4006@uref{ftp://ftp.gnu.org/pub/gnu/auctex/}
diff --git a/src/ChangeLog b/src/ChangeLog
index 53f0d8722a8..e9a38a7d64c 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,53 @@
12005-01-24 Kim F. Storm <storm@cua.dk>
2
3 * xdisp.c (move_it_by_lines): If we move forward after going too
4 far back, cancel move if end position is same as start position.
5
62005-01-24 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7
8 * dispextern.h (struct glyph_string): New members clip_head and
9 clip_tail.
10
11 * xdisp.c (get_glyph_string_clip_rect): Restrict horizontal clip
12 region to the area between clip_head and clip_tail.
13 (draw_glyphs): Record the area that need to be actually redrawn to
14 the new variables clip_head and clip_tail when there are
15 overhangs. Set values of these variables to the corresponding
16 members in struct glyph_string. Refine x coordinates for
17 notice_overwritten_cursor using clip_head and clip_tail.
18
19 * macgui.h (STORE_XCHARSETSTRUCT): New macro.
20
21 * macterm.c (mac_compute_glyph_string_overhangs): Implement with
22 QDTextBounds.
23 (x_draw_glyph_string): Don't fill the background of the successor
24 of a glyph with a right overhang if the successor will draw a cursor.
25 (XLoadQueryFont): Obtain font metrics using QDTextBounds.
26 (x_redisplay_interface): Add entry for compute_glyph_string_overhangs.
27
282005-01-24 Kim F. Storm <storm@cua.dk>
29
30 * window.c (window_scroll_pixel_based): Fix scrolling in the wrong
31 direction if window height was smaller than next-screen-context-lines.
32 Now always scroll at least one line in the requested direction.
33 Ensure that we actually do scroll backwards when requested to do so.
34
35 * xdisp.c (redisplay_window): Only try to make cursor line fully
36 visible once (to avoid redisplay loop).
37
382005-01-23 Kim F. Storm <storm@cua.dk>
39
40 * window.c (Fpos_visible_in_window_p): Simplify return value for
41 partially visible rows.
42 (window_scroll_pixel_based): Adapt to that change.
43
44 * window.c (window_scroll_pixel_based): Force moving to next line
45 if scrolling doesn't move start point, e.g. if looking at tall image.
46
47 * xdisp.c (pos_visible_p): Return 0 if non-interactive.
48 Clear last_height before calling line_bottom_y to get real height.
49 Fix calculation of y.
50
12005-01-22 Steven Tamm <steventamm@mac.com> 512005-01-22 Steven Tamm <steventamm@mac.com>
2 52
3 * s/darwin.h: Removed PTY_ITERATION from here. 53 * s/darwin.h: Removed PTY_ITERATION from here.
diff --git a/src/dispextern.h b/src/dispextern.h
index 8a24551260d..ac56cdd31f2 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -1193,6 +1193,11 @@ struct glyph_string
1193 /* Slice */ 1193 /* Slice */
1194 struct glyph_slice slice; 1194 struct glyph_slice slice;
1195 1195
1196 /* Non-null means the horizontal clipping region starts from the
1197 left edge of *clip_head, and ends with the right edge of
1198 *clip_tail, not including their overhangs. */
1199 struct glyph_string *clip_head, *clip_tail;
1200
1196 struct glyph_string *next, *prev; 1201 struct glyph_string *next, *prev;
1197}; 1202};
1198 1203
diff --git a/src/indent.c b/src/indent.c
index 1d69d346f92..8b8bf924a94 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -1,6 +1,6 @@
1/* Indentation functions. 1/* Indentation functions.
2 Copyright (C) 1985,86,87,88,93,94,95,98,2000,01,02,03,2004 2 Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1998, 2000, 2001,
3 Free Software Foundation, Inc. 3 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
@@ -340,7 +340,9 @@ will have a variable width)
340Ignores finite width of frame, which means that this function may return 340Ignores finite width of frame, which means that this function may return
341values greater than (frame-width). 341values greater than (frame-width).
342Whether the line is visible (if `selective-display' is t) has no effect; 342Whether the line is visible (if `selective-display' is t) has no effect;
343however, ^M is treated as end of line when `selective-display' is t. */) 343however, ^M is treated as end of line when `selective-display' is t.
344Text that has an invisible property is considered as having width 0, unless
345`buffer-invisibility-spec' specifies that it is replaced by an ellipsis. */)
344 () 346 ()
345{ 347{
346 Lisp_Object temp; 348 Lisp_Object temp;
diff --git a/src/macgui.h b/src/macgui.h
index 1e1447dfaa8..cb157bb8c25 100644
--- a/src/macgui.h
+++ b/src/macgui.h
@@ -92,6 +92,13 @@ typedef struct _XCharStruct
92 int descent; 92 int descent;
93} XCharStruct; 93} XCharStruct;
94 94
95#define STORE_XCHARSTRUCT(xcs, w, bds) \
96 ((xcs).width = (w), \
97 (xcs).lbearing = (bds).left, \
98 (xcs).rbearing = (bds).right, \
99 (xcs).ascent = -(bds).top, \
100 (xcs).descent = (bds).bottom)
101
95struct MacFontStruct { 102struct MacFontStruct {
96 char *fontname; 103 char *fontname;
97 104
diff --git a/src/macterm.c b/src/macterm.c
index d083252d90c..9a1ee834ce5 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -1997,20 +1997,33 @@ static void
1997mac_compute_glyph_string_overhangs (s) 1997mac_compute_glyph_string_overhangs (s)
1998 struct glyph_string *s; 1998 struct glyph_string *s;
1999{ 1999{
2000#if 0 2000 Rect r;
2001 /* MAC_TODO: XTextExtents16 does nothing yet... */ 2001 MacFontStruct *font = s->font;
2002
2003 TextFont (font->mac_fontnum);
2004 TextSize (font->mac_fontsize);
2005 TextFace (font->mac_fontface);
2002 2006
2003 if (s->cmp == NULL 2007 if (s->two_byte_p)
2004 && s->first_glyph->type == CHAR_GLYPH) 2008 QDTextBounds (s->nchars * 2, (char *)s->char2b, &r);
2009 else
2005 { 2010 {
2006 XCharStruct cs; 2011 int i;
2007 int direction, font_ascent, font_descent; 2012 char *buf = xmalloc (s->nchars);
2008 XTextExtents16 (s->font, s->char2b, s->nchars, &direction, 2013
2009 &font_ascent, &font_descent, &cs); 2014 if (buf == NULL)
2010 s->right_overhang = cs.rbearing > cs.width ? cs.rbearing - cs.width : 0; 2015 SetRect (&r, 0, 0, 0, 0);
2011 s->left_overhang = cs.lbearing < 0 ? -cs.lbearing : 0; 2016 else
2017 {
2018 for (i = 0; i < s->nchars; ++i)
2019 buf[i] = s->char2b[i].byte2;
2020 QDTextBounds (s->nchars, buf, &r);
2021 xfree (buf);
2022 }
2012 } 2023 }
2013#endif 2024
2025 s->right_overhang = r.right > s->width ? r.right - s->width : 0;
2026 s->left_overhang = r.left < 0 ? -r.left : 0;
2014} 2027}
2015 2028
2016 2029
@@ -3078,10 +3091,12 @@ x_draw_glyph_string (s)
3078{ 3091{
3079 int relief_drawn_p = 0; 3092 int relief_drawn_p = 0;
3080 3093
3081 /* If S draws into the background of its successor, draw the 3094 /* If S draws into the background of its successor that does not
3082 background of the successor first so that S can draw into it. 3095 draw a cursor, draw the background of the successor first so that
3083 This makes S->next use XDrawString instead of XDrawImageString. */ 3096 S can draw into it. This makes S->next use XDrawString instead
3084 if (s->next && s->right_overhang && !s->for_overlaps_p) 3097 of XDrawImageString. */
3098 if (s->next && s->right_overhang && !s->for_overlaps_p
3099 && s->next->hl != DRAW_CURSOR)
3085 { 3100 {
3086 xassert (s->next->img == NULL); 3101 xassert (s->next->img == NULL);
3087 x_set_glyph_string_gc (s->next); 3102 x_set_glyph_string_gc (s->next);
@@ -6780,30 +6795,40 @@ XLoadQueryFont (Display *dpy, char *fontname)
6780 returns 15 for 12-point Monaco! */ 6795 returns 15 for 12-point Monaco! */
6781 char_width = CharWidth ('m'); 6796 char_width = CharWidth ('m');
6782 6797
6783 font->max_bounds.rbearing = char_width; 6798 if (is_two_byte_font)
6784 font->max_bounds.lbearing = 0; 6799 {
6785 font->max_bounds.width = char_width; 6800 font->per_char = NULL;
6786 font->max_bounds.ascent = the_fontinfo.ascent;
6787 font->max_bounds.descent = the_fontinfo.descent;
6788 6801
6789 font->min_bounds = font->max_bounds; 6802 if (fontface & italic)
6803 font->max_bounds.rbearing = char_width + 1;
6804 else
6805 font->max_bounds.rbearing = char_width;
6806 font->max_bounds.lbearing = 0;
6807 font->max_bounds.width = char_width;
6808 font->max_bounds.ascent = the_fontinfo.ascent;
6809 font->max_bounds.descent = the_fontinfo.descent;
6790 6810
6791 if (is_two_byte_font || CharWidth ('m') == CharWidth ('i')) 6811 font->min_bounds = font->max_bounds;
6792 font->per_char = NULL; 6812 }
6793 else 6813 else
6794 { 6814 {
6795 font->per_char = (XCharStruct *) 6815 font->per_char = (XCharStruct *)
6796 xmalloc (sizeof (XCharStruct) * (0xff - 0x20 + 1)); 6816 xmalloc (sizeof (XCharStruct) * (0xff - 0x20 + 1));
6797 { 6817 {
6798 int c, min_width, max_width; 6818 int c, min_width, max_width;
6819 Rect char_bounds, min_bounds, max_bounds;
6820 char ch;
6799 6821
6800 min_width = max_width = char_width; 6822 min_width = max_width = char_width;
6823 SetRect (&min_bounds, -32767, -32767, 32767, 32767);
6824 SetRect (&max_bounds, 0, 0, 0, 0);
6801 for (c = 0x20; c <= 0xff; c++) 6825 for (c = 0x20; c <= 0xff; c++)
6802 { 6826 {
6803 font->per_char[c - 0x20] = font->max_bounds; 6827 ch = c;
6804 char_width = CharWidth (c); 6828 char_width = CharWidth (ch);
6805 font->per_char[c - 0x20].width = char_width; 6829 QDTextBounds (1, &ch, &char_bounds);
6806 font->per_char[c - 0x20].rbearing = char_width; 6830 STORE_XCHARSTRUCT (font->per_char[c - 0x20],
6831 char_width, char_bounds);
6807 /* Some Japanese fonts (in SJIS encoding) return 0 as the 6832 /* Some Japanese fonts (in SJIS encoding) return 0 as the
6808 character width of 0x7f. */ 6833 character width of 0x7f. */
6809 if (char_width > 0) 6834 if (char_width > 0)
@@ -6811,9 +6836,25 @@ XLoadQueryFont (Display *dpy, char *fontname)
6811 min_width = min (min_width, char_width); 6836 min_width = min (min_width, char_width);
6812 max_width = max (max_width, char_width); 6837 max_width = max (max_width, char_width);
6813 } 6838 }
6814 } 6839 if (!EmptyRect (&char_bounds))
6815 font->min_bounds.width = min_width; 6840 {
6816 font->max_bounds.width = max_width; 6841 SetRect (&min_bounds,
6842 max (min_bounds.left, char_bounds.left),
6843 max (min_bounds.top, char_bounds.top),
6844 min (min_bounds.right, char_bounds.right),
6845 min (min_bounds.bottom, char_bounds.bottom));
6846 UnionRect (&max_bounds, &char_bounds, &max_bounds);
6847 }
6848 }
6849 STORE_XCHARSTRUCT (font->min_bounds, min_width, min_bounds);
6850 STORE_XCHARSTRUCT (font->max_bounds, max_width, max_bounds);
6851 if (min_width == max_width
6852 && max_bounds.left >= 0 && max_bounds.right <= max_width)
6853 {
6854 /* Fixed width and no overhangs. */
6855 xfree (font->per_char);
6856 font->per_char = NULL;
6857 }
6817 } 6858 }
6818 } 6859 }
6819 6860
@@ -9719,7 +9760,7 @@ static struct redisplay_interface x_redisplay_interface =
9719 0, /* destroy_fringe_bitmap */ 9760 0, /* destroy_fringe_bitmap */
9720 mac_per_char_metric, 9761 mac_per_char_metric,
9721 mac_encode_char, 9762 mac_encode_char,
9722 NULL, /* mac_compute_glyph_string_overhangs */ 9763 mac_compute_glyph_string_overhangs,
9723 x_draw_glyph_string, 9764 x_draw_glyph_string,
9724 mac_define_frame_cursor, 9765 mac_define_frame_cursor,
9725 mac_clear_frame_area, 9766 mac_clear_frame_area,
diff --git a/src/window.c b/src/window.c
index 9b8a031f6c1..370251882ba 100644
--- a/src/window.c
+++ b/src/window.c
@@ -333,11 +333,10 @@ If POS is only out of view because of horizontal scrolling, return non-nil.
333POS defaults to point in WINDOW; WINDOW defaults to the selected window. 333POS defaults to point in WINDOW; WINDOW defaults to the selected window.
334 334
335If POS is visible, return t if PARTIALLY is nil; if PARTIALLY is non-nil, 335If POS is visible, return t if PARTIALLY is nil; if PARTIALLY is non-nil,
336return value is a list (X Y FULLY [RTOP RBOT]) where X and Y are the pixel 336return value is a list (X Y PARTIAL) where X and Y are the pixel coordinates
337coordinates relative to the top left corner of the window, and FULLY is t if the 337relative to the top left corner of the window. PARTIAL is nil if the character
338character after POS is fully visible and nil otherwise. If FULLY is nil, 338after POS is fully visible; otherwise it is a cons (RTOP . RBOT) where RTOP
339RTOP and RBOT are the number of pixels invisible at the top and bottom row 339and RBOT are the number of pixels invisible at the top and bottom of the row. */)
340of the window. */)
341 (pos, window, partially) 340 (pos, window, partially)
342 Lisp_Object pos, window, partially; 341 Lisp_Object pos, window, partially;
343{ 342{
@@ -376,12 +375,10 @@ of the window. */)
376 if (!NILP (in_window) && !NILP (partially)) 375 if (!NILP (in_window) && !NILP (partially))
377 in_window = Fcons (make_number (x), 376 in_window = Fcons (make_number (x),
378 Fcons (make_number (y), 377 Fcons (make_number (y),
379 Fcons (fully_p ? Qt : Qnil, 378 Fcons ((fully_p ? Qnil
380 (fully_p 379 : Fcons (make_number (rtop),
381 ? Qnil 380 make_number (rbot))),
382 : Fcons (make_number (rtop), 381 Qnil)));
383 Fcons (make_number (rbot),
384 Qnil))))));
385 return in_window; 382 return in_window;
386} 383}
387 384
@@ -4578,21 +4575,23 @@ window_scroll_pixel_based (window, n, whole, noerror)
4578 } 4575 }
4579 else if (auto_window_vscroll_p) 4576 else if (auto_window_vscroll_p)
4580 { 4577 {
4581 if (NILP (XCAR (XCDR (XCDR (tem))))) 4578 if (tem = XCAR (XCDR (XCDR (tem))), CONSP (tem))
4582 { 4579 {
4583 int px; 4580 int px;
4584 int dy = WINDOW_FRAME_LINE_HEIGHT (w); 4581 int dy = WINDOW_FRAME_LINE_HEIGHT (w);
4585 if (whole) 4582 if (whole)
4586 dy = window_box_height (w) - next_screen_context_lines * dy; 4583 dy = max ((window_box_height (w)
4584 - next_screen_context_lines * dy),
4585 dy);
4587 dy *= n; 4586 dy *= n;
4588 4587
4589 if (n < 0 && (px = XINT (Fnth (make_number (3), tem))) > 0) 4588 if (n < 0 && (px = XINT (XCAR (tem))) > 0)
4590 { 4589 {
4591 px = max (0, -w->vscroll - min (px, -dy)); 4590 px = max (0, -w->vscroll - min (px, -dy));
4592 Fset_window_vscroll (window, make_number (px), Qt); 4591 Fset_window_vscroll (window, make_number (px), Qt);
4593 return; 4592 return;
4594 } 4593 }
4595 if (n > 0 && (px = XINT (Fnth (make_number (4), tem))) > 0) 4594 if (n > 0 && (px = XINT (XCDR (tem))) > 0)
4596 { 4595 {
4597 px = max (0, -w->vscroll + min (px, dy)); 4596 px = max (0, -w->vscroll + min (px, dy));
4598 Fset_window_vscroll (window, make_number (px), Qt); 4597 Fset_window_vscroll (window, make_number (px), Qt);
@@ -4618,18 +4617,34 @@ window_scroll_pixel_based (window, n, whole, noerror)
4618 start_display (&it, w, start); 4617 start_display (&it, w, start);
4619 if (whole) 4618 if (whole)
4620 { 4619 {
4621 int screen_full = (window_box_height (w) 4620 int start_pos = IT_CHARPOS (it);
4622 - next_screen_context_lines * FRAME_LINE_HEIGHT (it.f)); 4621 int dy = WINDOW_FRAME_LINE_HEIGHT (w);
4623 int dy = n * screen_full; 4622 dy = max ((window_box_height (w)
4623 - next_screen_context_lines * dy),
4624 dy) * n;
4624 4625
4625 /* Note that move_it_vertically always moves the iterator to the 4626 /* Note that move_it_vertically always moves the iterator to the
4626 start of a line. So, if the last line doesn't have a newline, 4627 start of a line. So, if the last line doesn't have a newline,
4627 we would end up at the start of the line ending at ZV. */ 4628 we would end up at the start of the line ending at ZV. */
4628 if (dy <= 0) 4629 if (dy <= 0)
4629 move_it_vertically_backward (&it, -dy); 4630 {
4631 move_it_vertically_backward (&it, -dy);
4632 /* Ensure we actually does move, e.g. in case we are currently
4633 looking at an image that is taller that the window height. */
4634 while (start_pos == IT_CHARPOS (it)
4635 && start_pos > BEGV)
4636 move_it_by_lines (&it, -1, 1);
4637 }
4630 else if (dy > 0) 4638 else if (dy > 0)
4631 move_it_to (&it, ZV, -1, it.current_y + dy, -1, 4639 {
4632 MOVE_TO_POS | MOVE_TO_Y); 4640 move_it_to (&it, ZV, -1, it.current_y + dy, -1,
4641 MOVE_TO_POS | MOVE_TO_Y);
4642 /* Ensure we actually does move, e.g. in case we are currently
4643 looking at an image that is taller that the window height. */
4644 while (start_pos == IT_CHARPOS (it)
4645 && start_pos < ZV)
4646 move_it_by_lines (&it, 1, 1);
4647 }
4633 } 4648 }
4634 else 4649 else
4635 move_it_by_lines (&it, n, 1); 4650 move_it_by_lines (&it, n, 1);
diff --git a/src/xdisp.c b/src/xdisp.c
index 6a59de7ef8d..a8f36e04e38 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -1259,16 +1259,18 @@ pos_visible_p (w, charpos, x, y, rtop, rbot, exact_mode_line_heights_p)
1259{ 1259{
1260 struct it it; 1260 struct it it;
1261 struct text_pos top; 1261 struct text_pos top;
1262 int visible_p; 1262 int visible_p = 0;
1263 struct buffer *old_buffer = NULL; 1263 struct buffer *old_buffer = NULL;
1264 1264
1265 if (noninteractive)
1266 return visible_p;
1267
1265 if (XBUFFER (w->buffer) != current_buffer) 1268 if (XBUFFER (w->buffer) != current_buffer)
1266 { 1269 {
1267 old_buffer = current_buffer; 1270 old_buffer = current_buffer;
1268 set_buffer_internal_1 (XBUFFER (w->buffer)); 1271 set_buffer_internal_1 (XBUFFER (w->buffer));
1269 } 1272 }
1270 1273
1271 visible_p = 0;
1272 SET_TEXT_POS_FROM_MARKER (top, w->start); 1274 SET_TEXT_POS_FROM_MARKER (top, w->start);
1273 1275
1274 /* Compute exact mode line heights, if requested. */ 1276 /* Compute exact mode line heights, if requested. */
@@ -1293,7 +1295,7 @@ pos_visible_p (w, charpos, x, y, rtop, rbot, exact_mode_line_heights_p)
1293 if (IT_CHARPOS (it) >= charpos) 1295 if (IT_CHARPOS (it) >= charpos)
1294 { 1296 {
1295 int top_y = it.current_y; 1297 int top_y = it.current_y;
1296 int bottom_y = line_bottom_y (&it); 1298 int bottom_y = (last_height = 0, line_bottom_y (&it));
1297 int window_top_y = WINDOW_HEADER_LINE_HEIGHT (w); 1299 int window_top_y = WINDOW_HEADER_LINE_HEIGHT (w);
1298 1300
1299 if (top_y < window_top_y) 1301 if (top_y < window_top_y)
@@ -1303,7 +1305,7 @@ pos_visible_p (w, charpos, x, y, rtop, rbot, exact_mode_line_heights_p)
1303 if (visible_p && x) 1305 if (visible_p && x)
1304 { 1306 {
1305 *x = it.current_x; 1307 *x = it.current_x;
1306 *y = max (top_y + it.max_ascent - it.ascent, window_top_y); 1308 *y = max (top_y + max (0, it.max_ascent - it.ascent), window_top_y);
1307 if (rtop) 1309 if (rtop)
1308 { 1310 {
1309 *rtop = max (0, window_top_y - top_y); 1311 *rtop = max (0, window_top_y - top_y);
@@ -1787,6 +1789,24 @@ get_glyph_string_clip_rect (s, nr)
1787 r.height = s->row->visible_height; 1789 r.height = s->row->visible_height;
1788 } 1790 }
1789 1791
1792 if (s->clip_head)
1793 if (r.x < s->clip_head->x)
1794 {
1795 if (r.width >= s->clip_head->x - r.x)
1796 r.width -= s->clip_head->x - r.x;
1797 else
1798 r.width = 0;
1799 r.x = s->clip_head->x;
1800 }
1801 if (s->clip_tail)
1802 if (r.x + r.width > s->clip_tail->x + s->clip_tail->background_width)
1803 {
1804 if (s->clip_tail->x + s->clip_tail->background_width >= r.x)
1805 r.width = s->clip_tail->x + s->clip_tail->background_width - r.x;
1806 else
1807 r.width = 0;
1808 }
1809
1790 /* If S draws overlapping rows, it's sufficient to use the top and 1810 /* If S draws overlapping rows, it's sufficient to use the top and
1791 bottom of the window for clipping because this glyph string 1811 bottom of the window for clipping because this glyph string
1792 intentionally draws over other lines. */ 1812 intentionally draws over other lines. */
@@ -6505,11 +6525,15 @@ move_it_by_lines (it, dvpos, need_y_p)
6505 it->current_y -= it2.current_y; 6525 it->current_y -= it2.current_y;
6506 it->current_x = it->hpos = 0; 6526 it->current_x = it->hpos = 0;
6507 6527
6508 /* If we moved too far, move IT some lines forward. */ 6528 /* If we moved too far back, move IT some lines forward. */
6509 if (it2.vpos > -dvpos) 6529 if (it2.vpos > -dvpos)
6510 { 6530 {
6511 int delta = it2.vpos + dvpos; 6531 int delta = it2.vpos + dvpos;
6532 it2 = *it;
6512 move_it_to (it, -1, -1, -1, it->vpos + delta, MOVE_TO_VPOS); 6533 move_it_to (it, -1, -1, -1, it->vpos + delta, MOVE_TO_VPOS);
6534 /* Move back again if we got too far ahead. */
6535 if (IT_CHARPOS (*it) >= start_charpos)
6536 *it = it2;
6513 } 6537 }
6514 } 6538 }
6515} 6539}
@@ -12332,6 +12356,8 @@ redisplay_window (window, just_this_one_p)
12332 /* If centering point failed to make the whole line visible, 12356 /* If centering point failed to make the whole line visible,
12333 put point at the top instead. That has to make the whole line 12357 put point at the top instead. That has to make the whole line
12334 visible, if it can be done. */ 12358 visible, if it can be done. */
12359 if (centering_position == 0)
12360 goto done;
12335 clear_glyph_matrix (w->desired_matrix); 12361 clear_glyph_matrix (w->desired_matrix);
12336 centering_position = 0; 12362 centering_position = 0;
12337 goto point_at_top; 12363 goto point_at_top;
@@ -18338,6 +18364,7 @@ draw_glyphs (w, x, row, area, start, end, hl, overlaps_p)
18338{ 18364{
18339 struct glyph_string *head, *tail; 18365 struct glyph_string *head, *tail;
18340 struct glyph_string *s; 18366 struct glyph_string *s;
18367 struct glyph_string *clip_head = NULL, *clip_tail = NULL;
18341 int last_x, area_width; 18368 int last_x, area_width;
18342 int x_reached; 18369 int x_reached;
18343 int i, j; 18370 int i, j;
@@ -18406,6 +18433,7 @@ draw_glyphs (w, x, row, area, start, end, hl, overlaps_p)
18406 start = i; 18433 start = i;
18407 compute_overhangs_and_x (t, head->x, 1); 18434 compute_overhangs_and_x (t, head->x, 1);
18408 prepend_glyph_string_lists (&head, &tail, h, t); 18435 prepend_glyph_string_lists (&head, &tail, h, t);
18436 clip_head = head;
18409 } 18437 }
18410 18438
18411 /* Prepend glyph strings for glyphs in front of the first glyph 18439 /* Prepend glyph strings for glyphs in front of the first glyph
@@ -18418,6 +18446,7 @@ draw_glyphs (w, x, row, area, start, end, hl, overlaps_p)
18418 i = left_overwriting (head); 18446 i = left_overwriting (head);
18419 if (i >= 0) 18447 if (i >= 0)
18420 { 18448 {
18449 clip_head = head;
18421 BUILD_GLYPH_STRINGS (i, start, h, t, 18450 BUILD_GLYPH_STRINGS (i, start, h, t,
18422 DRAW_NORMAL_TEXT, dummy_x, last_x); 18451 DRAW_NORMAL_TEXT, dummy_x, last_x);
18423 for (s = h; s; s = s->next) 18452 for (s = h; s; s = s->next)
@@ -18437,6 +18466,7 @@ draw_glyphs (w, x, row, area, start, end, hl, overlaps_p)
18437 DRAW_NORMAL_TEXT, x, last_x); 18466 DRAW_NORMAL_TEXT, x, last_x);
18438 compute_overhangs_and_x (h, tail->x + tail->width, 0); 18467 compute_overhangs_and_x (h, tail->x + tail->width, 0);
18439 append_glyph_string_lists (&head, &tail, h, t); 18468 append_glyph_string_lists (&head, &tail, h, t);
18469 clip_tail = tail;
18440 } 18470 }
18441 18471
18442 /* Append glyph strings for glyphs following the last glyph 18472 /* Append glyph strings for glyphs following the last glyph
@@ -18447,6 +18477,7 @@ draw_glyphs (w, x, row, area, start, end, hl, overlaps_p)
18447 i = right_overwriting (tail); 18477 i = right_overwriting (tail);
18448 if (i >= 0) 18478 if (i >= 0)
18449 { 18479 {
18480 clip_tail = tail;
18450 BUILD_GLYPH_STRINGS (end, i, h, t, 18481 BUILD_GLYPH_STRINGS (end, i, h, t,
18451 DRAW_NORMAL_TEXT, x, last_x); 18482 DRAW_NORMAL_TEXT, x, last_x);
18452 for (s = h; s; s = s->next) 18483 for (s = h; s; s = s->next)
@@ -18454,6 +18485,12 @@ draw_glyphs (w, x, row, area, start, end, hl, overlaps_p)
18454 compute_overhangs_and_x (h, tail->x + tail->width, 0); 18485 compute_overhangs_and_x (h, tail->x + tail->width, 0);
18455 append_glyph_string_lists (&head, &tail, h, t); 18486 append_glyph_string_lists (&head, &tail, h, t);
18456 } 18487 }
18488 if (clip_head || clip_tail)
18489 for (s = head; s; s = s->next)
18490 {
18491 s->clip_head = clip_head;
18492 s->clip_tail = clip_tail;
18493 }
18457 } 18494 }
18458 18495
18459 /* Draw all strings. */ 18496 /* Draw all strings. */
@@ -18467,8 +18504,9 @@ draw_glyphs (w, x, row, area, start, end, hl, overlaps_p)
18467 completely. */ 18504 completely. */
18468 && !overlaps_p) 18505 && !overlaps_p)
18469 { 18506 {
18470 int x0 = head ? head->x : x; 18507 int x0 = clip_head ? clip_head->x : (head ? head->x : x);
18471 int x1 = tail ? tail->x + tail->background_width : x; 18508 int x1 = (clip_tail ? clip_tail->x + clip_tail->background_width
18509 : (tail ? tail->x + tail->background_width : x));
18472 18510
18473 int text_left = window_box_left (w, TEXT_AREA); 18511 int text_left = window_box_left (w, TEXT_AREA);
18474 x0 -= text_left; 18512 x0 -= text_left;