aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiles Bader2008-04-23 05:55:42 +0000
committerMiles Bader2008-04-23 05:55:42 +0000
commita113b3ca322fd73d97d0d9d69c9f48dc13fb326a (patch)
tree37b3ad22a198a83f68738ef86aec187bb6d926d9
parente96a8d6dc0ffc35cf6c02924de2453c69fa8f6fe (diff)
parent81fe843b5a3cc7708e0800aeb5bc0dbe448e800a (diff)
downloademacs-a113b3ca322fd73d97d0d9d69c9f48dc13fb326a.tar.gz
emacs-a113b3ca322fd73d97d0d9d69c9f48dc13fb326a.zip
Merge from emacs--rel--22
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-1121
-rw-r--r--ChangeLog4
-rw-r--r--admin/FOR-RELEASE6
-rw-r--r--configure.in2
-rw-r--r--doc/emacs/ChangeLog5
-rw-r--r--doc/emacs/emacs.texi2
-rw-r--r--doc/emacs/maintaining.texi2
-rw-r--r--lib-src/ChangeLog6
-rw-r--r--lib-src/makefile.w32-in11
-rw-r--r--lisp/ChangeLog33
-rw-r--r--lisp/emacs-lisp/autoload.el1
-rw-r--r--lisp/gnus/nnrss.el4
-rw-r--r--lisp/progmodes/cc-mode.el2
-rw-r--r--lisp/progmodes/gdb-ui.el37
-rw-r--r--lisp/progmodes/gud.el5
-rw-r--r--lisp/progmodes/make-mode.el2
-rw-r--r--lisp/term/mac-win.el10
-rw-r--r--lisp/textmodes/paragraphs.el4
-rw-r--r--nt/ChangeLog12
-rw-r--r--nt/makefile.w32-in15
-rw-r--r--src/ChangeLog61
-rw-r--r--src/alloc.c6
-rw-r--r--src/mac.c151
-rw-r--r--src/macgui.h5
-rw-r--r--src/macterm.c122
-rw-r--r--src/macterm.h15
-rw-r--r--src/mactoolbox.c85
-rw-r--r--src/w32.c5
-rw-r--r--src/w32proc.c10
28 files changed, 388 insertions, 235 deletions
diff --git a/ChangeLog b/ChangeLog
index b5f063caed2..55afae13d89 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
12008-04-23 Dan Nicolaescu <dann@ics.uci.edu>
2
3 * configure.in: Remove hpux10.20 from the desupported list.
4
12008-04-18 Stefan Monnier <monnier@iro.umontreal.ca> 52008-04-18 Stefan Monnier <monnier@iro.umontreal.ca>
2 6
3 * configure.in: Define USE_LUCID/USE_MOTIF in config.h. 7 * configure.in: Define USE_LUCID/USE_MOTIF in config.h.
diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE
index 261afb68552..9424d8f6c2c 100644
--- a/admin/FOR-RELEASE
+++ b/admin/FOR-RELEASE
@@ -53,12 +53,6 @@ from 2007-08-27. Impossible to procede without more input from OP (as
53of 20070912, emails are bouncing) or someone else who can reproduce this. 53of 20070912, emails are bouncing) or someone else who can reproduce this.
54http://lists.gnu.org/archive/html/emacs-devel/2007-08/msg01497.html 54http://lists.gnu.org/archive/html/emacs-devel/2007-08/msg01497.html
55 55
56** emacs-22.1 with GTK problems (with patches)
57Only outstanding issue seems to be whether Solaris 2.6 GTK can be
58supported in the absence of recursive mutexes, via a change to
59alloc.c, or whether configure should abort.
60http://lists.gnu.org/archive/html/bug-gnu-emacs/2007-09/msg00055.html
61
62* BUGS 56* BUGS
63 57
64** Does deleting frames run Lisp code? If so, can we get rid of that? 58** Does deleting frames run Lisp code? If so, can we get rid of that?
diff --git a/configure.in b/configure.in
index dee41383f1e..4740fb9b5da 100644
--- a/configure.in
+++ b/configure.in
@@ -769,7 +769,7 @@ case "${machine}" in
769esac 769esac
770 770
771case "${opsys}" in 771case "${opsys}" in
772 bsd386 | bsdos2-1 | bsdos2 | bsdos3 | bsdos4 | bsd4-1 | bsd4-2 | bsd4-3 | usg5-0 | usg5-2-2 | usg5-2 | usg5-3 | ultrix4-3 | 386bsd | hpux | hpux8 | hpux9 | hpux9shr | hpux10 | hpux10-20 | aix3-1 | aix3-2-5 | aix3-2 | aix4-1 | nextstep | ux4800 | uxpds | uxpv ) 772 bsd386 | bsdos2-1 | bsdos2 | bsdos3 | bsdos4 | bsd4-1 | bsd4-2 | bsd4-3 | usg5-0 | usg5-2-2 | usg5-2 | usg5-3 | ultrix4-3 | 386bsd | hpux | hpux8 | hpux9 | hpux9shr | hpux10 | aix3-1 | aix3-2-5 | aix3-2 | aix4-1 | nextstep | ux4800 | uxpds | uxpv )
773 echo "The system that you are configuring on: ${canonical} is considered to be obsolete" 773 echo "The system that you are configuring on: ${canonical} is considered to be obsolete"
774 echo "and it is planned to be desupported in the next version of Emacs" 774 echo "and it is planned to be desupported in the next version of Emacs"
775 echo "Please email emacs-devel@gnu.org as soon as possible if this system is still in use." 775 echo "Please email emacs-devel@gnu.org as soon as possible if this system is still in use."
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index 0fd90ba5a63..2fddf83b400 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -13,6 +13,11 @@
13 * building.texi (GDB-UI Layout, Breakpoints Buffer) 13 * building.texi (GDB-UI Layout, Breakpoints Buffer)
14 (Other GDB-UI Buffers): Update for recent thread related changes. 14 (Other GDB-UI Buffers): Update for recent thread related changes.
15 15
162008-04-11 Mirko Vukovic <mirko.vukovic@gmail.com> (tiny change)
17
18 * maintaining.texi (Maintaining):
19 * emacs.texi (Top): Typo.
20
162008-04-08 Stefan Monnier <monnier@iro.umontreal.ca> 212008-04-08 Stefan Monnier <monnier@iro.umontreal.ca>
17 22
18 * display.texi (Font Lock): Prefer add-hook to using a non-nil `mode' 23 * display.texi (Font Lock): Prefer add-hook to using a non-nil `mode'
diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi
index aca77108e3b..28b72eb5c13 100644
--- a/doc/emacs/emacs.texi
+++ b/doc/emacs/emacs.texi
@@ -713,7 +713,7 @@ Maintaining Large Programs
713 713
714* Change Log:: Maintaining a change history for your program. 714* Change Log:: Maintaining a change history for your program.
715* Format of ChangeLog:: What the change log file looks like. 715* Format of ChangeLog:: What the change log file looks like.
716* Tags:: Go direct to any function in your program in one 716* Tags:: Go directly to any function in your program in one
717 command. Tags remembers which file it is in. 717 command. Tags remembers which file it is in.
718* Emerge:: A convenient way of merging two versions of a program. 718* Emerge:: A convenient way of merging two versions of a program.
719 719
diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi
index d4774379555..424f26b584a 100644
--- a/doc/emacs/maintaining.texi
+++ b/doc/emacs/maintaining.texi
@@ -12,7 +12,7 @@ also particularly useful for this purpose.
12@menu 12@menu
13* Change Log:: Maintaining a change history for your program. 13* Change Log:: Maintaining a change history for your program.
14* Format of ChangeLog:: What the change log file looks like. 14* Format of ChangeLog:: What the change log file looks like.
15* Tags:: Go direct to any function in your program in one 15* Tags:: Go directly to any function in your program in one
16 command. Tags remembers which file it is in. 16 command. Tags remembers which file it is in.
17@ifnottex 17@ifnottex
18* Emerge:: A convenient way of merging two versions of a program. 18* Emerge:: A convenient way of merging two versions of a program.
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index ab8d490faef..61a0a0c0310 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,9 @@
12008-04-10 Jason Rumney <jasonr@gnu.org>
2
3 * makefile.w32-in (CLIENTRES): New variable and target.
4 (TRES): Remove.
5 ($(BLD)/emacsclientw.exe): Use $(CLIENTRES) instead of $(TRES).
6
12008-04-19 Stefan Monnier <monnier@iro.umontreal.ca> 72008-04-19 Stefan Monnier <monnier@iro.umontreal.ca>
2 8
3 * vcdiff: Use "sccs get" rather than "get"; leave PATH alone. 9 * vcdiff: Use "sccs get" rather than "get"; leave PATH alone.
diff --git a/lib-src/makefile.w32-in b/lib-src/makefile.w32-in
index 2d9954dbebc..e81b2efb529 100644
--- a/lib-src/makefile.w32-in
+++ b/lib-src/makefile.w32-in
@@ -75,18 +75,19 @@ ECLIENTOBJS = $(BLD)/emacsclient.$(O) \
75 $(BLD)/getopt.$(O) \ 75 $(BLD)/getopt.$(O) \
76 $(BLD)/getopt1.$(O) \ 76 $(BLD)/getopt1.$(O) \
77 $(BLD)/ntlib.$(O) 77 $(BLD)/ntlib.$(O)
78TRES = ../nt/$(BLD)/emacs.res 78CLIENTRES = ../nt/$(BLD)/emacsclient.res
79 79
80$(TRES): ../nt/emacs.rc 80$(CLIENTRES): ../nt/emacsclient.rc
81 $(RC) $(RC_OUT)../nt/$(BLD)/emacs.res $(ALL_DEPS) 81 @echo Emacsclient resource file must be built from nt directory
82 @exit -1
82 83
83$(BLD)/emacsclient.exe: $(ECLIENTOBJS) 84$(BLD)/emacsclient.exe: $(ECLIENTOBJS)
84# put wsock32.lib before $(LIBS) to ensure we don't link to ws2_32.lib 85# put wsock32.lib before $(LIBS) to ensure we don't link to ws2_32.lib
85 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(ECLIENTOBJS) $(WSOCK32) $(USER32) $(COMCTL32) $(LIBS) 86 $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(ECLIENTOBJS) $(WSOCK32) $(USER32) $(COMCTL32) $(LIBS)
86 87
87$(BLD)/emacsclientw.exe: $(ECLIENTOBJS) $(TRES) 88$(BLD)/emacsclientw.exe: $(ECLIENTOBJS) $(CLIENTRES)
88# put wsock32.lib before $(LIBS) to ensure we don't link to ws2_32.lib 89# put wsock32.lib before $(LIBS) to ensure we don't link to ws2_32.lib
89 $(LINK) $(LINK_OUT)$@ $(TRES) -mwindows $(LINK_FLAGS) $(ECLIENTOBJS) $(WSOCK32) $(USER32) $(COMCTL32) $(LIBS) 90 $(LINK) $(LINK_OUT)$@ $(CLIENTRES) -mwindows $(LINK_FLAGS) $(ECLIENTOBJS) $(WSOCK32) $(USER32) $(COMCTL32) $(LIBS)
90 91
91# emacsclient.$(O) depends on makefile.w32-in because makefile.w32-in 92# emacsclient.$(O) depends on makefile.w32-in because makefile.w32-in
92# can be edited to define VERSION string, which is part of ECLIENT_CFLAGS. 93# can be edited to define VERSION string, which is part of ECLIENT_CFLAGS.
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 27f8a12fc16..3c5a1e6994e 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,36 @@
12008-04-12 Nick Roberts <nickrob@snap.net.nz>
2
3 * progmodes/gdb-ui.el (gdb-init-buffer): New function.
4 (gdb-set-gud-minor-mode-existing-buffers)
5 (gdb-info-breakpoints-custom, gdb-get-location)
6 (gdb-set-gud-minor-mode-existing-buffers-1): Use it.
7 Previously gdb-create-define-alist wasn't always run and added to
8 after-save-hook.
9
10 * progmodes/gud.el (gud-tooltip-tips): Use tooltip-event-buffer
11
122008-04-12 Kevin Ryde <user42@zip.com.au>
13
14 * progmodes/make-mode.el (makefile-fill-paragraph): Treat indented
15 comments like unindented ones.
16
172008-04-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
18
19 * term/mac-win.el (mac-ae-open-documents): Adjust selection range
20 parameter origins.
21
222008-04-11 Kevin Ryde <user42@zip.com.au>
23
24 * emacs-lisp/autoload.el (autoload-generate-file-autoloads):
25 Bind print-level to ensure output forms aren't truncated if
26 print-level is set to eval-expression-print-level when going via
27 eval-defun and friends, or has been otherwise fiddled with.
28
292008-04-08 Stefan Monnier <monnier@iro.umontreal.ca>
30
31 * progmodes/cc-mode.el (c-basic-common-init): Don't set
32 font-lock-extend-after-change-region-function globally.
33
12008-04-23 Juanma Barranquero <lekktu@gmail.com> 342008-04-23 Juanma Barranquero <lekktu@gmail.com>
2 35
3 * speedbar.el (speedbar-use-tool-tips-flag) 36 * speedbar.el (speedbar-use-tool-tips-flag)
diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el
index e6bca3b15dd..377d6c3f699 100644
--- a/lisp/emacs-lisp/autoload.el
+++ b/lisp/emacs-lisp/autoload.el
@@ -335,6 +335,7 @@ Return non-nil iff FILE adds no autoloads to OUTFILE
335 (let ((autoloads-done '()) 335 (let ((autoloads-done '())
336 (load-name (autoload-file-load-name file)) 336 (load-name (autoload-file-load-name file))
337 (print-length nil) 337 (print-length nil)
338 (print-level nil)
338 (print-readably t) ; This does something in Lucid Emacs. 339 (print-readably t) ; This does something in Lucid Emacs.
339 (float-output-format nil) 340 (float-output-format nil)
340 (visited (get-file-buffer file)) 341 (visited (get-file-buffer file))
diff --git a/lisp/gnus/nnrss.el b/lisp/gnus/nnrss.el
index 69a33088242..cd12b82fbee 100644
--- a/lisp/gnus/nnrss.el
+++ b/lisp/gnus/nnrss.el
@@ -1131,7 +1131,5 @@ prefix), return the prefix."
1131 1131
1132(provide 'nnrss) 1132(provide 'nnrss)
1133 1133
1134
1135;;; nnrss.el ends here
1136
1137;; arch-tag: 12910c07-0cdf-44fb-8d2c-416ded64c267 1134;; arch-tag: 12910c07-0cdf-44fb-8d2c-416ded64c267
1135;;; nnrss.el ends here
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el
index 3fee14bf565..bd590d62f05 100644
--- a/lisp/progmodes/cc-mode.el
+++ b/lisp/progmodes/cc-mode.el
@@ -601,7 +601,7 @@ that requires a literal mode spec at compile time."
601 (add-hook 'before-change-functions 'c-before-change nil t) 601 (add-hook 'before-change-functions 'c-before-change nil t)
602 (make-local-hook 'after-change-functions) 602 (make-local-hook 'after-change-functions)
603 (add-hook 'after-change-functions 'c-after-change nil t) 603 (add-hook 'after-change-functions 'c-after-change nil t)
604 (setq font-lock-extend-after-change-region-function 604 (set (make-local-variable 'font-lock-extend-after-change-region-function)
605 'c-extend-after-change-region)) ; Currently (2008-04), only used by AWK. 605 'c-extend-after-change-region)) ; Currently (2008-04), only used by AWK.
606 606
607(defun c-setup-doc-comment-style () 607(defun c-setup-doc-comment-style ()
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el
index d9776c0c4cd..a3f3993629c 100644
--- a/lisp/progmodes/gdb-ui.el
+++ b/lisp/progmodes/gdb-ui.el
@@ -481,6 +481,15 @@ otherwise do not."
481 481
482(defconst gdb-source-file-regexp "\\(.+?\\), \\|\\([^, \n].*$\\)") 482(defconst gdb-source-file-regexp "\\(.+?\\), \\|\\([^, \n].*$\\)")
483 483
484(defun gdb-init-buffer ()
485 (set (make-local-variable 'gud-minor-mode)
486 (buffer-local-value 'gud-minor-mode gud-comint-buffer))
487 (set (make-local-variable 'tool-bar-map) gud-tool-bar-map)
488 (when gud-tooltip-mode
489 (make-local-variable 'gdb-define-alist)
490 (gdb-create-define-alist)
491 (add-hook 'after-save-hook 'gdb-create-define-alist nil t)))
492
484(defun gdb-set-gud-minor-mode-existing-buffers () 493(defun gdb-set-gud-minor-mode-existing-buffers ()
485 "Create list of source files for current GDB session." 494 "Create list of source files for current GDB session."
486 (goto-char (point-min)) 495 (goto-char (point-min))
@@ -493,12 +502,7 @@ otherwise do not."
493 (when (and buffer-file-name 502 (when (and buffer-file-name
494 (member (file-name-nondirectory buffer-file-name) 503 (member (file-name-nondirectory buffer-file-name)
495 gdb-source-file-list)) 504 gdb-source-file-list))
496 (set (make-local-variable 'gud-minor-mode) 'gdba) 505 (gdb-init-buffer)))))
497 (set (make-local-variable 'tool-bar-map) gud-tool-bar-map)
498 (when gud-tooltip-mode
499 (make-local-variable 'gdb-define-alist)
500 (gdb-create-define-alist)
501 (add-hook 'after-save-hook 'gdb-create-define-alist nil t))))))
502 (gdb-force-mode-line-update 506 (gdb-force-mode-line-update
503 (propertize "ready" 'face font-lock-variable-name-face))) 507 (propertize "ready" 'face font-lock-variable-name-face)))
504 508
@@ -1953,10 +1957,7 @@ static char *magick[] = {
1953 (not (string-equal file "File not found"))) 1957 (not (string-equal file "File not found")))
1954 (with-current-buffer 1958 (with-current-buffer
1955 (find-file-noselect file 'nowarn) 1959 (find-file-noselect file 'nowarn)
1956 (set (make-local-variable 'gud-minor-mode) 1960 (gdb-init-buffer)
1957 'gdba)
1958 (set (make-local-variable 'tool-bar-map)
1959 gud-tool-bar-map)
1960 ;; Only want one breakpoint icon at each 1961 ;; Only want one breakpoint icon at each
1961 ;; location. 1962 ;; location.
1962 (save-excursion 1963 (save-excursion
@@ -3269,9 +3270,7 @@ Add directory to search path for source files using the GDB command, dir."))
3269 (throw 'file-not-found nil)) 3270 (throw 'file-not-found nil))
3270 (with-current-buffer 3271 (with-current-buffer
3271 (find-file-noselect (match-string 0)) 3272 (find-file-noselect (match-string 0))
3272 (save-current-buffer 3273 (gdb-init-buffer)
3273 (set (make-local-variable 'gud-minor-mode) 'gdba)
3274 (set (make-local-variable 'tool-bar-map) gud-tool-bar-map))
3275 ;; only want one breakpoint icon at each location 3274 ;; only want one breakpoint icon at each location
3276 (save-excursion 3275 (save-excursion
3277 (goto-line (string-to-number line)) 3276 (goto-line (string-to-number line))
@@ -3293,9 +3292,7 @@ of the current session."
3293 buffer-file-name) 3292 buffer-file-name)
3294 gdb-source-file-list) 3293 gdb-source-file-list)
3295 (with-current-buffer (find-buffer-visiting buffer-file-name) 3294 (with-current-buffer (find-buffer-visiting buffer-file-name)
3296 (set (make-local-variable 'gud-minor-mode) 3295 (gdb-init-buffer)))))
3297 (buffer-local-value 'gud-minor-mode gud-comint-buffer))
3298 (set (make-local-variable 'tool-bar-map) gud-tool-bar-map)))))
3299 3296
3300;;from put-image 3297;;from put-image
3301(defun gdb-put-string (putstring pos &optional dprop &rest sprops) 3298(defun gdb-put-string (putstring pos &optional dprop &rest sprops)
@@ -3625,13 +3622,7 @@ is set in them."
3625 (dolist (buffer (buffer-list)) 3622 (dolist (buffer (buffer-list))
3626 (with-current-buffer buffer 3623 (with-current-buffer buffer
3627 (when (member buffer-file-name gdb-source-file-list) 3624 (when (member buffer-file-name gdb-source-file-list)
3628 (set (make-local-variable 'gud-minor-mode) 3625 (gdb-init-buffer))))
3629 (buffer-local-value 'gud-minor-mode gud-comint-buffer))
3630 (set (make-local-variable 'tool-bar-map) gud-tool-bar-map)
3631 (when gud-tooltip-mode
3632 (make-local-variable 'gdb-define-alist)
3633 (gdb-create-define-alist)
3634 (add-hook 'after-save-hook 'gdb-create-define-alist nil t)))))
3635 (gdb-force-mode-line-update 3626 (gdb-force-mode-line-update
3636 (propertize "ready" 'face font-lock-variable-name-face))) 3627 (propertize "ready" 'face font-lock-variable-name-face)))
3637 3628
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index dbb1aa8be99..8bfccaabb6d 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -3424,10 +3424,7 @@ This function must return nil if it doesn't handle EVENT."
3424 (if (and (eq gud-minor-mode 'gdba) 3424 (if (and (eq gud-minor-mode 'gdba)
3425 (not gdb-active-process)) 3425 (not gdb-active-process))
3426 (progn 3426 (progn
3427 (with-current-buffer 3427 (with-current-buffer (tooltip-event-buffer event)
3428 (window-buffer (let ((mouse (mouse-position)))
3429 (window-at (cadr mouse)
3430 (cddr mouse))))
3431 (let ((define-elt (assoc expr gdb-define-alist))) 3428 (let ((define-elt (assoc expr gdb-define-alist)))
3432 (unless (null define-elt) 3429 (unless (null define-elt)
3433 (tooltip-show 3430 (tooltip-show
diff --git a/lisp/progmodes/make-mode.el b/lisp/progmodes/make-mode.el
index ea9300f851b..2bf5b74c615 100644
--- a/lisp/progmodes/make-mode.el
+++ b/lisp/progmodes/make-mode.el
@@ -1352,7 +1352,7 @@ definition and conveniently use this command."
1352 (save-excursion 1352 (save-excursion
1353 (beginning-of-line) 1353 (beginning-of-line)
1354 (cond 1354 (cond
1355 ((looking-at "^#+\\s-*") 1355 ((looking-at "^[ \t]*#+\\s-*")
1356 ;; Found a comment. Return nil to let normal filling take place. 1356 ;; Found a comment. Return nil to let normal filling take place.
1357 nil) 1357 nil)
1358 1358
diff --git a/lisp/term/mac-win.el b/lisp/term/mac-win.el
index 60f27052892..e15f2e4c873 100644
--- a/lisp/term/mac-win.el
+++ b/lisp/term/mac-win.el
@@ -1802,11 +1802,11 @@ if possible. If there's no such frame, a new frame is created."
1802 (let ((line (car selection-range)) 1802 (let ((line (car selection-range))
1803 (start (cadr selection-range)) 1803 (start (cadr selection-range))
1804 (end (nth 2 selection-range))) 1804 (end (nth 2 selection-range)))
1805 (if (> line 0) 1805 (if (>= line 0)
1806 (goto-line line) 1806 (goto-line (1+ line))
1807 (if (and (> start 0) (> end 0)) 1807 (if (and (>= start 0) (>= end 0))
1808 (progn (set-mark start) 1808 (progn (set-mark (1+ start))
1809 (goto-char end)))))) 1809 (goto-char (1+ end)))))))
1810 ((stringp search-text) 1810 ((stringp search-text)
1811 (re-search-forward 1811 (re-search-forward
1812 (mapconcat 'regexp-quote (split-string search-text) "\\|") 1812 (mapconcat 'regexp-quote (split-string search-text) "\\|")
diff --git a/lisp/textmodes/paragraphs.el b/lisp/textmodes/paragraphs.el
index 231eba6ba86..b21369edfda 100644
--- a/lisp/textmodes/paragraphs.el
+++ b/lisp/textmodes/paragraphs.el
@@ -355,8 +355,8 @@ With argument ARG, do it ARG times;
355a negative argument ARG = -N means move forward N paragraphs. 355a negative argument ARG = -N means move forward N paragraphs.
356 356
357A paragraph start is the beginning of a line which is a 357A paragraph start is the beginning of a line which is a
358`first-line-of-paragraph' or which is ordinary text and follows a 358`paragraph-start' or which is ordinary text and follows a
359paragraph-separating line; except: if the first real line of a 359`paragraph-separate'ing line; except: if the first real line of a
360paragraph is preceded by a blank line, the paragraph starts at that 360paragraph is preceded by a blank line, the paragraph starts at that
361blank line. 361blank line.
362 362
diff --git a/nt/ChangeLog b/nt/ChangeLog
index 4adb653464a..075814f120e 100644
--- a/nt/ChangeLog
+++ b/nt/ChangeLog
@@ -1,3 +1,15 @@
12008-04-23 Eli Zaretskii <eliz@gnu.org>
2
3 * makefile.w32-in (ALL): Move $(CLIENTRES) from here...
4 (all): ...to here. $(ALL) is a prerequisite of .PHONY, so having
5 a real file there is not a good idea.
6
72008-04-23 Jason Rumney <jasonr@gnu.org>
8
9 * makefile.w32-in (CLIENTRES): New variable and build target.
10 (all): Depend on it.
11 ($(TRES)): Use $(TRES) in rule.
12
12008-04-21 Jason Rumney <jasonr@gnu.org> 132008-04-21 Jason Rumney <jasonr@gnu.org>
2 14
3 * configure.bat (success): Print "make" rather than "gmake", as that 15 * configure.bat (success): Print "make" rather than "gmake", as that
diff --git a/nt/makefile.w32-in b/nt/makefile.w32-in
index ddf279cbdf7..053961a0c58 100644
--- a/nt/makefile.w32-in
+++ b/nt/makefile.w32-in
@@ -24,13 +24,15 @@
24# FIXME: This file uses DOS EOLs. Convert to Unix after 22.1 is out 24# FIXME: This file uses DOS EOLs. Convert to Unix after 22.1 is out
25# (and remove or replace this comment). 25# (and remove or replace this comment).
26 26
27TRES = $(BLD)/emacs.res
28CLIENTRES = $(BLD)/emacsclient.res
29
30XMFLAGS =
31
27ALL = addpm ddeclient runemacs cmdproxy addsection preprep 32ALL = addpm ddeclient runemacs cmdproxy addsection preprep
28 33
29.PHONY: $(ALL) 34.PHONY: $(ALL)
30 35
31TRES = $(BLD)/emacs.res
32
33XMFLAGS =
34 36
35addpm: stamp_BLD $(BLD)/addpm.exe 37addpm: stamp_BLD $(BLD)/addpm.exe
36$(BLD)/addpm.exe: $(BLD)/addpm.$(O) 38$(BLD)/addpm.exe: $(BLD)/addpm.$(O)
@@ -62,7 +64,10 @@ $(BLD)/preprep.exe: $(BLD)/preprep.$(O)
62# it is not necessary on later versions, it is still ok to use it. 64# it is not necessary on later versions, it is still ok to use it.
63# 65#
64$(TRES): emacs.rc icons/emacs.ico emacs.manifest stamp_BLD 66$(TRES): emacs.rc icons/emacs.ico emacs.manifest stamp_BLD
65 $(RC) $(RC_OUT)$(BLD)/emacs.res emacs.rc 67 $(RC) $(RC_OUT)$(TRES) emacs.rc
68
69$(CLIENTRES): emacsclient.rc stamp_BLD
70 $(RC) $(RC_OUT)$(CLIENTRES) emacsclient.rc
66 71
67runemacs: stamp_BLD $(BLD)/runemacs.exe 72runemacs: stamp_BLD $(BLD)/runemacs.exe
68$(BLD)/runemacs.exe: $(BLD)/runemacs.$(O) $(TRES) 73$(BLD)/runemacs.exe: $(BLD)/runemacs.$(O) $(TRES)
@@ -81,7 +86,7 @@ $(BLD)/addpm.$(O) $(BLD)/ddeclient.$(O) $(BLD)/runemacs.$(O) $(BLD)/cmdproxy.$(O
81# 86#
82# Build emacs 87# Build emacs
83# 88#
84all: which-sh stamp_BLD $(ALL) maybe-bootstrap all-other-dirs-$(MAKETYPE) 89all: which-sh stamp_BLD $(ALL) $(CLIENTRES) maybe-bootstrap all-other-dirs-$(MAKETYPE)
85 90
86all-other-dirs-nmake: addsection 91all-other-dirs-nmake: addsection
87 cd ..\lib-src 92 cd ..\lib-src
diff --git a/src/ChangeLog b/src/ChangeLog
index 378718dfc81..c346bb9f31d 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,64 @@
12008-04-19 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2
3 * mac.c (create_apple_event) [TARGET_API_MAC_CARBON]:
4 Make function non-static.
5 (create_apple_event_from_event_ref) [TARGET_API_MAC_CARBON]:
6 Remove function.
7 (create_apple_event_from_drag_ref) [TARGET_API_MAC_CARBON]:
8 Move to mactoolbox.c.
9 (mac_event_parameters_to_lisp) [TARGET_API_MAC_CARBON]: New function.
10
11 * macgui.h (CGFloat) [!CGFLOAT_DEFINED]: New typedef.
12 (mac_rect_make): New macro.
13
14 * macterm.c (mac_draw_image_string_atsui) [MAC_OSX]: Use CGFloat
15 instead of float.
16 (mac_draw_image_string_cg) [USE_CG_TEXT_DRAWING]: Likewise.
17 (init_cg_color, mac_draw_line, mac_draw_cg_image, XSetForeground)
18 (XSetBackground) [USE_CG_DRAWING]: Likewise.
19 (mac_draw_image_string_atsui) [MAC_OSX]: Use mac_rect_make instead of
20 CGRectMake.
21 (mac_draw_image_string_cg) [USE_CG_TEXT_DRAWING]: Likewise.
22 (mac_erase_rectangle, mac_draw_cg_image, mac_fill_rectangle)
23 (mac_set_clip_rectangles) [USE_CG_DRAWING]: Likewise.
24 (XCreatePixmap, XCreatePixmapFromBitmapData): Use Window
25 instead of WindowRef in argument type.
26 (XCreatePixmap) [!MAC_OS8]: Don't call SetPortWindowPort.
27 (mac_invert_rectangle): Use CGContextSetBlendMode if available.
28 (mac_set_clip_rectangles, mac_reset_clip_rectangles): Take argument F
29 instead of DISPLAY. All uses changed.
30 (mac_handle_size_change): Don't call SET_FRAME_GARBAGED.
31 (x_calc_absolute_position): Simplify so as not to use
32 FRAME_PIXEL_WIDTH/FRAME_PIXEL_HEIGHT.
33
34 * macterm.h (XCreatePixmap, XCreatePixmapFromBitmapData): Use Window
35 instead of WindowRef in argument type.
36 (create_apple_event_from_event_ref, create_apple_event_from_drag_ref)
37 [TARGET_API_MAC_CARBON]: Remove externs.
38 (create_apple_event, mac_event_parameters_to_lisp)
39 [TARGET_API_MAC_CARBON]: Add externs.
40
41 * mactoolbox.c: (Vmac_ts_script_language_on_focus)
42 (saved_ts_script_language_on_focus) [USE_MAC_TSM]: Remove externs.
43 (XTread_socket) [USE_MAC_TOOLBAR]: Select window if its structure part
44 is clicked.
45 (x_activate_menubar): Remove extern for saved_menu_event_location.
46 (create_apple_event_from_drag_ref) [TARGET_API_MAC_CARBON]:
47 Move from mac.c.
48
492008-04-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
50
51 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT] (uninterrupt_malloc)
52 [HAVE_GTK_AND_PTHREAD && !DOUG_LEA_MALLOC]: Don't use recursive mutex.
53
542008-04-10 Jason Rumney <jasonr@gnu.org>
55
56 * w32.c (stat): When Vw32_get_true_file_attributes is Qlocal, get
57 attributes only for local files.
58
59 * w32proc.c (syms_of_ntproc): Change Vw32_get_true_file attributes
60 default to Qlocal.
61
12008-04-22 Juri Linkov <juri@jurta.org> 622008-04-22 Juri Linkov <juri@jurta.org>
2 63
3 * buffer.c (Fswitch_to_buffer): Change interactive spec to call 64 * buffer.c (Fswitch_to_buffer): Change interactive spec to call
diff --git a/src/alloc.c b/src/alloc.c
index fe37eec9379..64c8cc8264e 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -1366,6 +1366,7 @@ void
1366uninterrupt_malloc () 1366uninterrupt_malloc ()
1367{ 1367{
1368#ifdef HAVE_GTK_AND_PTHREAD 1368#ifdef HAVE_GTK_AND_PTHREAD
1369#ifdef DOUG_LEA_MALLOC
1369 pthread_mutexattr_t attr; 1370 pthread_mutexattr_t attr;
1370 1371
1371 /* GLIBC has a faster way to do this, but lets keep it portable. 1372 /* GLIBC has a faster way to do this, but lets keep it portable.
@@ -1373,6 +1374,11 @@ uninterrupt_malloc ()
1373 pthread_mutexattr_init (&attr); 1374 pthread_mutexattr_init (&attr);
1374 pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_RECURSIVE); 1375 pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_RECURSIVE);
1375 pthread_mutex_init (&alloc_mutex, &attr); 1376 pthread_mutex_init (&alloc_mutex, &attr);
1377#else /* !DOUG_LEA_MALLOC */
1378 /* Some systems such as Solaris 2.6 doesn't have a recursive mutex,
1379 and the bundled gmalloc.c doesn't require it. */
1380 pthread_mutex_init (&alloc_mutex, NULL);
1381#endif /* !DOUG_LEA_MALLOC */
1376#endif /* HAVE_GTK_AND_PTHREAD */ 1382#endif /* HAVE_GTK_AND_PTHREAD */
1377 1383
1378 if (__free_hook != emacs_blocked_free) 1384 if (__free_hook != emacs_blocked_free)
diff --git a/src/mac.c b/src/mac.c
index 0ae233f048e..22f34747ea8 100644
--- a/src/mac.c
+++ b/src/mac.c
@@ -817,7 +817,7 @@ init_coercion_handler ()
817} 817}
818 818
819#if TARGET_API_MAC_CARBON 819#if TARGET_API_MAC_CARBON
820static OSErr 820OSErr
821create_apple_event (class, id, result) 821create_apple_event (class, id, result)
822 AEEventClass class; 822 AEEventClass class;
823 AEEventID id; 823 AEEventID id;
@@ -842,129 +842,76 @@ create_apple_event (class, id, result)
842 return err; 842 return err;
843} 843}
844 844
845OSStatus 845Lisp_Object
846create_apple_event_from_event_ref (event, num_params, names, types, result) 846mac_event_parameters_to_lisp (event, num_params, names, types)
847 EventRef event; 847 EventRef event;
848 UInt32 num_params; 848 UInt32 num_params;
849 const EventParamName *names; 849 const EventParamName *names;
850 const EventParamType *types; 850 const EventParamType *types;
851 AppleEvent *result;
852{ 851{
853 OSStatus err; 852 OSStatus err;
854 UInt32 i, size; 853 Lisp_Object result = Qnil;
854 UInt32 i;
855 ByteCount size;
856#ifdef MAC_OSX
855 CFStringRef string; 857 CFStringRef string;
856 CFDataRef data; 858 CFDataRef data;
857 char *buf = NULL;
858
859 err = create_apple_event (0, 0, result); /* Dummy class and ID. */
860 if (err != noErr)
861 return err;
862
863 for (i = 0; i < num_params; i++)
864 switch (types[i])
865 {
866#ifdef MAC_OSX
867 case typeCFStringRef:
868 err = GetEventParameter (event, names[i], typeCFStringRef, NULL,
869 sizeof (CFStringRef), NULL, &string);
870 if (err != noErr)
871 break;
872 data = CFStringCreateExternalRepresentation (NULL, string,
873 kCFStringEncodingUTF8,
874 '?');
875 if (data == NULL)
876 break;
877 AEPutParamPtr (result, names[i], typeUTF8Text,
878 CFDataGetBytePtr (data), CFDataGetLength (data));
879 CFRelease (data);
880 break;
881#endif 859#endif
882
883 default:
884 err = GetEventParameter (event, names[i], types[i], NULL,
885 0, &size, NULL);
886 if (err != noErr)
887 break;
888 buf = xrealloc (buf, size);
889 err = GetEventParameter (event, names[i], types[i], NULL,
890 size, NULL, buf);
891 if (err == noErr)
892 AEPutParamPtr (result, names[i], types[i], buf, size);
893 break;
894 }
895 if (buf)
896 xfree (buf);
897
898 return noErr;
899}
900
901OSErr
902create_apple_event_from_drag_ref (drag, num_types, types, result)
903 DragRef drag;
904 UInt32 num_types;
905 const FlavorType *types;
906 AppleEvent *result;
907{
908 OSErr err;
909 UInt16 num_items;
910 AppleEvent items;
911 long index;
912 char *buf = NULL; 860 char *buf = NULL;
913 861
914 err = CountDragItems (drag, &num_items); 862 for (i = 0; i < num_params; i++)
915 if (err != noErr)
916 return err;
917 err = AECreateList (NULL, 0, false, &items);
918 if (err != noErr)
919 return err;
920
921 for (index = 1; index <= num_items; index++)
922 { 863 {
923 ItemReference item; 864 EventParamName name = names[i];
924 DescType desc_type = typeNull; 865 EventParamType type = types[i];
925 Size size;
926 866
927 err = GetDragItemReferenceNumber (drag, index, &item); 867 switch (type)
928 if (err == noErr)
929 { 868 {
930 int i; 869#ifdef MAC_OSX
870 case typeCFStringRef:
871 err = GetEventParameter (event, name, typeCFStringRef, NULL,
872 sizeof (CFStringRef), NULL, &string);
873 if (err != noErr)
874 break;
875 data = CFStringCreateExternalRepresentation (NULL, string,
876 kCFStringEncodingUTF8,
877 '?');
878 if (data == NULL)
879 break;
880 name = EndianU32_NtoB (name);
881 type = EndianU32_NtoB (typeUTF8Text);
882 result =
883 Fcons (Fcons (make_unibyte_string ((char *) &name, 4),
884 Fcons (make_unibyte_string ((char *) &type, 4),
885 make_unibyte_string (CFDataGetBytePtr (data),
886 CFDataGetLength (data)))),
887 result);
888 CFRelease (data);
889 break;
890#endif
931 891
932 for (i = 0; i < num_types; i++) 892 default:
893 err = GetEventParameter (event, name, type, NULL, 0, &size, NULL);
894 if (err != noErr)
895 break;
896 buf = xrealloc (buf, size);
897 err = GetEventParameter (event, name, type, NULL, size, NULL, buf);
898 if (err == noErr)
933 { 899 {
934 err = GetFlavorDataSize (drag, item, types[i], &size); 900 name = EndianU32_NtoB (name);
935 if (err == noErr) 901 type = EndianU32_NtoB (type);
936 { 902 result =
937 buf = xrealloc (buf, size); 903 Fcons (Fcons (make_unibyte_string ((char *) &name, 4),
938 err = GetFlavorData (drag, item, types[i], buf, &size, 0); 904 Fcons (make_unibyte_string ((char *) &type, 4),
939 } 905 make_unibyte_string (buf, size))),
940 if (err == noErr) 906 result);
941 {
942 desc_type = types[i];
943 break;
944 }
945 } 907 }
908 break;
946 } 909 }
947 err = AEPutPtr (&items, index, desc_type,
948 desc_type != typeNull ? buf : NULL,
949 desc_type != typeNull ? size : 0);
950 if (err != noErr)
951 break;
952 } 910 }
953 if (buf) 911 if (buf)
954 xfree (buf); 912 xfree (buf);
955 913
956 if (err == noErr) 914 return result;
957 {
958 err = create_apple_event (0, 0, result); /* Dummy class and ID. */
959 if (err == noErr)
960 err = AEPutParamDesc (result, keyDirectObject, &items);
961 if (err != noErr)
962 AEDisposeDesc (result);
963 }
964
965 AEDisposeDesc (&items);
966
967 return err;
968} 915}
969#endif /* TARGET_API_MAC_CARBON */ 916#endif /* TARGET_API_MAC_CARBON */
970 917
diff --git a/src/macgui.h b/src/macgui.h
index c549a885f48..41ac28f49ec 100644
--- a/src/macgui.h
+++ b/src/macgui.h
@@ -126,6 +126,10 @@ typedef unsigned long Time;
126#endif 126#endif
127#endif 127#endif
128 128
129#ifndef CGFLOAT_DEFINED
130typedef float CGFloat;
131#endif
132
129typedef WindowRef Window; 133typedef WindowRef Window;
130#if TARGET_API_MAC_CARBON 134#if TARGET_API_MAC_CARBON
131typedef ScrapRef Selection; 135typedef ScrapRef Selection;
@@ -149,6 +153,7 @@ typedef int Selection;
149#define mac_size_window SizeWindow 153#define mac_size_window SizeWindow
150#define mac_get_global_mouse GetGlobalMouse 154#define mac_get_global_mouse GetGlobalMouse
151#define mac_is_window_toolbar_visible IsWindowToolbarVisible 155#define mac_is_window_toolbar_visible IsWindowToolbarVisible
156#define mac_rect_make(f, x, y, w, h) CGRectMake (x, y, w, h)
152typedef GWorldPtr Pixmap; 157typedef GWorldPtr Pixmap;
153 158
154#define Cursor ThemeCursor 159#define Cursor ThemeCursor
diff --git a/src/macterm.c b/src/macterm.c
index 842e1844f50..f4715c7f772 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -351,7 +351,7 @@ init_cg_color ()
351 if (CGColorGetTypeID != NULL) 351 if (CGColorGetTypeID != NULL)
352#endif 352#endif
353 { 353 {
354 float rgba[] = {0.0f, 0.0f, 0.0f, 1.0f}; 354 CGFloat rgba[] = {0.0f, 0.0f, 0.0f, 1.0f};
355 355
356 mac_cg_color_black = CGColorCreate (mac_cg_color_space_rgb, rgba); 356 mac_cg_color_black = CGColorCreate (mac_cg_color_space_rgb, rgba);
357 } 357 }
@@ -460,7 +460,7 @@ mac_draw_line (f, gc, x1, y1, x2, y2)
460{ 460{
461#if USE_CG_DRAWING 461#if USE_CG_DRAWING
462 CGContextRef context; 462 CGContextRef context;
463 float gx1 = x1, gy1 = y1, gx2 = x2, gy2 = y2; 463 CGFloat gx1 = x1, gy1 = y1, gx2 = x2, gy2 = y2;
464 464
465 if (y1 != y2) 465 if (y1 != y2)
466 gx1 += 0.5f, gx2 += 0.5f; 466 gx1 += 0.5f, gx2 += 0.5f;
@@ -553,7 +553,7 @@ mac_erase_rectangle (f, gc, x, y, width, height)
553 553
554 context = mac_begin_cg_clip (f, gc); 554 context = mac_begin_cg_clip (f, gc);
555 CG_SET_FILL_COLOR_WITH_GC_BACKGROUND (context, gc); 555 CG_SET_FILL_COLOR_WITH_GC_BACKGROUND (context, gc);
556 CGContextFillRect (context, CGRectMake (x, y, width, height)); 556 CGContextFillRect (context, mac_rect_make (f, x, y, width, height));
557 mac_end_cg_clip (f); 557 mac_end_cg_clip (f);
558 } 558 }
559#else 559#else
@@ -632,8 +632,8 @@ mac_draw_cg_image (image, f, gc, src_x, src_y, width, height,
632 int dest_x, dest_y, overlay_p; 632 int dest_x, dest_y, overlay_p;
633{ 633{
634 CGContextRef context; 634 CGContextRef context;
635 float port_height = FRAME_PIXEL_HEIGHT (f); 635 CGFloat port_height = FRAME_PIXEL_HEIGHT (f);
636 CGRect dest_rect = CGRectMake (dest_x, dest_y, width, height); 636 CGRect dest_rect = mac_rect_make (f, dest_x, dest_y, width, height);
637 637
638 context = mac_begin_cg_clip (f, gc); 638 context = mac_begin_cg_clip (f, gc);
639 if (!overlay_p) 639 if (!overlay_p)
@@ -647,11 +647,11 @@ mac_draw_cg_image (image, f, gc, src_x, src_y, width, height,
647 if (CGImageIsMask (image)) 647 if (CGImageIsMask (image))
648 CG_SET_FILL_COLOR_WITH_GC_FOREGROUND (context, gc); 648 CG_SET_FILL_COLOR_WITH_GC_FOREGROUND (context, gc);
649 CGContextDrawImage (context, 649 CGContextDrawImage (context,
650 CGRectMake (dest_x - src_x, 650 mac_rect_make (f, dest_x - src_x,
651 port_height - (dest_y - src_y 651 port_height - (dest_y - src_y
652 + CGImageGetHeight (image)), 652 + CGImageGetHeight (image)),
653 CGImageGetWidth (image), 653 CGImageGetWidth (image),
654 CGImageGetHeight (image)), 654 CGImageGetHeight (image)),
655 image); 655 image);
656 mac_end_cg_clip (f); 656 mac_end_cg_clip (f);
657} 657}
@@ -744,7 +744,7 @@ mac_free_bitmap (bitmap)
744Pixmap 744Pixmap
745XCreatePixmap (display, w, width, height, depth) 745XCreatePixmap (display, w, width, height, depth)
746 Display *display; 746 Display *display;
747 WindowRef w; 747 Window w;
748 unsigned int width, height; 748 unsigned int width, height;
749 unsigned int depth; 749 unsigned int depth;
750{ 750{
@@ -752,8 +752,9 @@ XCreatePixmap (display, w, width, height, depth)
752 Rect r; 752 Rect r;
753 QDErr err; 753 QDErr err;
754 754
755#ifdef MAC_OS8
755 SetPortWindowPort (w); 756 SetPortWindowPort (w);
756 757#endif
757 SetRect (&r, 0, 0, width, height); 758 SetRect (&r, 0, 0, width, height);
758#if !defined (WORDS_BIG_ENDIAN) && USE_CG_DRAWING 759#if !defined (WORDS_BIG_ENDIAN) && USE_CG_DRAWING
759 if (depth == 1) 760 if (depth == 1)
@@ -773,7 +774,7 @@ XCreatePixmap (display, w, width, height, depth)
773Pixmap 774Pixmap
774XCreatePixmapFromBitmapData (display, w, data, width, height, fg, bg, depth) 775XCreatePixmapFromBitmapData (display, w, data, width, height, fg, bg, depth)
775 Display *display; 776 Display *display;
776 WindowRef w; 777 Window w;
777 char *data; 778 char *data;
778 unsigned int width, height; 779 unsigned int width, height;
779 unsigned long fg, bg; 780 unsigned long fg, bg;
@@ -838,7 +839,7 @@ mac_fill_rectangle (f, gc, x, y, width, height)
838 839
839 context = mac_begin_cg_clip (f, gc); 840 context = mac_begin_cg_clip (f, gc);
840 CG_SET_FILL_COLOR_WITH_GC_FOREGROUND (context, gc); 841 CG_SET_FILL_COLOR_WITH_GC_FOREGROUND (context, gc);
841 CGContextFillRect (context, CGRectMake (x, y, width, height)); 842 CGContextFillRect (context, mac_rect_make (f, x, y, width, height));
842 mac_end_cg_clip (f); 843 mac_end_cg_clip (f);
843#else 844#else
844 Rect r; 845 Rect r;
@@ -887,7 +888,26 @@ mac_invert_rectangle (f, x, y, width, height)
887 int x, y; 888 int x, y;
888 unsigned int width, height; 889 unsigned int width, height;
889{ 890{
890 Rect r; 891#if USE_CG_DRAWING && MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
892#if MAC_OS_X_VERSION_MIN_REQUIRED < 1040 && MAC_OS_X_VERSION_MIN_REQUIRED >= 1020
893 if (CGContextSetBlendMode != NULL)
894#endif
895 {
896 CGContextRef context;
897
898 context = mac_begin_cg_clip (f, NULL);
899 CGContextSetRGBFillColor (context, 1.0f, 1.0f, 1.0f, 1.0f);
900 CGContextSetBlendMode (context, kCGBlendModeDifference);
901 CGContextFillRect (context, mac_rect_make (f, x, y, width, height));
902 mac_end_cg_clip (f);
903 }
904#if MAC_OS_X_VERSION_MIN_REQUIRED < 1040 && MAC_OS_X_VERSION_MIN_REQUIRED >= 1020
905 else /* CGContextSetBlendMode == NULL */
906#endif
907#endif /* USE_CG_DRAWING && MAC_OS_X_VERSION_MAX_ALLOWED >= 1040 */
908#if !USE_CG_DRAWING || MAC_OS_X_VERSION_MAX_ALLOWED < 1040 || (MAC_OS_X_VERSION_MIN_REQUIRED < 1040 && MAC_OS_X_VERSION_MIN_REQUIRED >= 1020)
909 {
910 Rect r;
891 911
892#if USE_CG_DRAWING 912#if USE_CG_DRAWING
893 mac_prepare_for_quickdraw (f); 913 mac_prepare_for_quickdraw (f);
@@ -1018,7 +1038,7 @@ mac_draw_image_string_atsui (f, gc, x, y, buf, nchars, bg_width,
1018 else 1038 else
1019 { 1039 {
1020 static CGContextRef context; 1040 static CGContextRef context;
1021 float port_height = FRAME_PIXEL_HEIGHT (f); 1041 CGFloat port_height = FRAME_PIXEL_HEIGHT (f);
1022 static const ATSUAttributeTag tags[] = {kATSUCGContextTag}; 1042 static const ATSUAttributeTag tags[] = {kATSUCGContextTag};
1023 static const ByteCount sizes[] = {sizeof (CGContextRef)}; 1043 static const ByteCount sizes[] = {sizeof (CGContextRef)};
1024 static const ATSUAttributeValuePtr values[] = {&context}; 1044 static const ATSUAttributeValuePtr values[] = {&context};
@@ -1042,9 +1062,10 @@ mac_draw_image_string_atsui (f, gc, x, y, buf, nchars, bg_width,
1042 { 1062 {
1043 CG_SET_FILL_COLOR_WITH_GC_BACKGROUND (context, gc); 1063 CG_SET_FILL_COLOR_WITH_GC_BACKGROUND (context, gc);
1044 CGContextFillRect (context, 1064 CGContextFillRect (context,
1045 CGRectMake (x, y - FONT_BASE (GC_FONT (gc)), 1065 mac_rect_make (f,
1046 bg_width, 1066 x, y - FONT_BASE (GC_FONT (gc)),
1047 FONT_HEIGHT (GC_FONT (gc)))); 1067 bg_width,
1068 FONT_HEIGHT (GC_FONT (gc))));
1048 } 1069 }
1049 CGContextScaleCTM (context, 1, -1); 1070 CGContextScaleCTM (context, 1, -1);
1050 CGContextTranslateCTM (context, 0, -port_height); 1071 CGContextTranslateCTM (context, 0, -port_height);
@@ -1388,7 +1409,7 @@ mac_draw_image_string_cg (f, gc, x, y, buf, nchars, bg_width, overstrike_p)
1388 XChar2b *buf; 1409 XChar2b *buf;
1389 int nchars, bg_width, overstrike_p; 1410 int nchars, bg_width, overstrike_p;
1390{ 1411{
1391 float port_height, gx, gy; 1412 CGFloat port_height, gx, gy;
1392 int i; 1413 int i;
1393 CGContextRef context; 1414 CGContextRef context;
1394 CGGlyph *glyphs; 1415 CGGlyph *glyphs;
@@ -1430,8 +1451,8 @@ mac_draw_image_string_cg (f, gc, x, y, buf, nchars, bg_width, overstrike_p)
1430 CG_SET_FILL_COLOR_WITH_GC_BACKGROUND (context, gc); 1451 CG_SET_FILL_COLOR_WITH_GC_BACKGROUND (context, gc);
1431 CGContextFillRect 1452 CGContextFillRect
1432 (context, 1453 (context,
1433 CGRectMake (gx, y - FONT_BASE (GC_FONT (gc)), 1454 mac_rect_make (f, gx, y - FONT_BASE (GC_FONT (gc)),
1434 bg_width, FONT_HEIGHT (GC_FONT (gc)))); 1455 bg_width, FONT_HEIGHT (GC_FONT (gc))));
1435 } 1456 }
1436 CGContextScaleCTM (context, 1, -1); 1457 CGContextScaleCTM (context, 1, -1);
1437 CGContextTranslateCTM (context, 0, -port_height); 1458 CGContextTranslateCTM (context, 0, -port_height);
@@ -1733,7 +1754,7 @@ XSetForeground (display, gc, color)
1733 } 1754 }
1734 else 1755 else
1735 { 1756 {
1736 float rgba[4]; 1757 CGFloat rgba[4];
1737 1758
1738 rgba[0] = gc->fore_color.red / 65535.0f; 1759 rgba[0] = gc->fore_color.red / 65535.0f;
1739 rgba[1] = gc->fore_color.green / 65535.0f; 1760 rgba[1] = gc->fore_color.green / 65535.0f;
@@ -1774,7 +1795,7 @@ XSetBackground (display, gc, color)
1774 } 1795 }
1775 else 1796 else
1776 { 1797 {
1777 float rgba[4]; 1798 CGFloat rgba[4];
1778 1799
1779 rgba[0] = gc->back_color.red / 65535.0f; 1800 rgba[0] = gc->back_color.red / 65535.0f;
1780 rgba[1] = gc->back_color.green / 65535.0f; 1801 rgba[1] = gc->back_color.green / 65535.0f;
@@ -1803,8 +1824,8 @@ XSetFont (display, gc, font)
1803/* Mac replacement for XSetClipRectangles. */ 1824/* Mac replacement for XSetClipRectangles. */
1804 1825
1805static void 1826static void
1806mac_set_clip_rectangles (display, gc, rectangles, n) 1827mac_set_clip_rectangles (f, gc, rectangles, n)
1807 Display *display; 1828 struct frame *f;
1808 GC gc; 1829 GC gc;
1809 Rect *rectangles; 1830 Rect *rectangles;
1810 int n; 1831 int n;
@@ -1836,9 +1857,9 @@ mac_set_clip_rectangles (display, gc, rectangles, n)
1836 { 1857 {
1837 Rect *rect = rectangles + i; 1858 Rect *rect = rectangles + i;
1838 1859
1839 gc->clip_rects[i] = CGRectMake (rect->left, rect->top, 1860 gc->clip_rects[i] = mac_rect_make (f, rect->left, rect->top,
1840 rect->right - rect->left, 1861 rect->right - rect->left,
1841 rect->bottom - rect->top); 1862 rect->bottom - rect->top);
1842 } 1863 }
1843#endif 1864#endif
1844} 1865}
@@ -1847,8 +1868,8 @@ mac_set_clip_rectangles (display, gc, rectangles, n)
1847/* Mac replacement for XSetClipMask. */ 1868/* Mac replacement for XSetClipMask. */
1848 1869
1849static INLINE void 1870static INLINE void
1850mac_reset_clip_rectangles (display, gc) 1871mac_reset_clip_rectangles (f, gc)
1851 Display *display; 1872 struct frame *f;
1852 GC gc; 1873 GC gc;
1853{ 1874{
1854 gc->n_clip_rects = 0; 1875 gc->n_clip_rects = 0;
@@ -2338,7 +2359,7 @@ x_draw_fringe_bitmap (w, row, p)
2338 XSetForeground (display, face->gc, gcv.foreground); 2359 XSetForeground (display, face->gc, gcv.foreground);
2339 } 2360 }
2340 2361
2341 mac_reset_clip_rectangles (display, face->gc); 2362 mac_reset_clip_rectangles (f, face->gc);
2342} 2363}
2343 2364
2344#if USE_CG_DRAWING 2365#if USE_CG_DRAWING
@@ -2852,7 +2873,7 @@ x_set_glyph_string_clipping (s)
2852 int n; 2873 int n;
2853 2874
2854 n = get_glyph_string_clip_rects (s, rects, MAX_CLIP_RECTS); 2875 n = get_glyph_string_clip_rects (s, rects, MAX_CLIP_RECTS);
2855 mac_set_clip_rectangles (s->display, s->gc, rects, n); 2876 mac_set_clip_rectangles (s->f, s->gc, rects, n);
2856} 2877}
2857 2878
2858 2879
@@ -3442,7 +3463,7 @@ x_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width,
3442 gc = f->output_data.mac->white_relief.gc; 3463 gc = f->output_data.mac->white_relief.gc;
3443 else 3464 else
3444 gc = f->output_data.mac->black_relief.gc; 3465 gc = f->output_data.mac->black_relief.gc;
3445 mac_set_clip_rectangles (dpy, gc, clip_rect, 1); 3466 mac_set_clip_rectangles (f, gc, clip_rect, 1);
3446 3467
3447 /* Top. */ 3468 /* Top. */
3448 if (top_p) 3469 if (top_p)
@@ -3457,12 +3478,12 @@ x_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width,
3457 mac_draw_line (f, gc, 3478 mac_draw_line (f, gc,
3458 left_x + i, top_y + i, left_x + i, bottom_y - i + 1); 3479 left_x + i, top_y + i, left_x + i, bottom_y - i + 1);
3459 3480
3460 mac_reset_clip_rectangles (dpy, gc); 3481 mac_reset_clip_rectangles (f, gc);
3461 if (raised_p) 3482 if (raised_p)
3462 gc = f->output_data.mac->black_relief.gc; 3483 gc = f->output_data.mac->black_relief.gc;
3463 else 3484 else
3464 gc = f->output_data.mac->white_relief.gc; 3485 gc = f->output_data.mac->white_relief.gc;
3465 mac_set_clip_rectangles (dpy, gc, clip_rect, 1); 3486 mac_set_clip_rectangles (f, gc, clip_rect, 1);
3466 3487
3467 /* Bottom. */ 3488 /* Bottom. */
3468 if (bot_p) 3489 if (bot_p)
@@ -3477,7 +3498,7 @@ x_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width,
3477 mac_draw_line (f, gc, 3498 mac_draw_line (f, gc,
3478 right_x - i, top_y + i + 1, right_x - i, bottom_y - i); 3499 right_x - i, top_y + i + 1, right_x - i, bottom_y - i);
3479 3500
3480 mac_reset_clip_rectangles (dpy, gc); 3501 mac_reset_clip_rectangles (f, gc);
3481} 3502}
3482 3503
3483 3504
@@ -3499,7 +3520,7 @@ x_draw_box_rect (s, left_x, top_y, right_x, bottom_y, width,
3499 3520
3500 XGetGCValues (s->display, s->gc, GCForeground, &xgcv); 3521 XGetGCValues (s->display, s->gc, GCForeground, &xgcv);
3501 XSetForeground (s->display, s->gc, s->face->box_color); 3522 XSetForeground (s->display, s->gc, s->face->box_color);
3502 mac_set_clip_rectangles (s->display, s->gc, clip_rect, 1); 3523 mac_set_clip_rectangles (s->f, s->gc, clip_rect, 1);
3503 3524
3504 /* Top. */ 3525 /* Top. */
3505 mac_fill_rectangle (s->f, s->gc, left_x, top_y, 3526 mac_fill_rectangle (s->f, s->gc, left_x, top_y,
@@ -3520,7 +3541,7 @@ x_draw_box_rect (s, left_x, top_y, right_x, bottom_y, width,
3520 top_y, width, bottom_y - top_y + 1); 3541 top_y, width, bottom_y - top_y + 1);
3521 3542
3522 XSetForeground (s->display, s->gc, xgcv.foreground); 3543 XSetForeground (s->display, s->gc, xgcv.foreground);
3523 mac_reset_clip_rectangles (s->display, s->gc); 3544 mac_reset_clip_rectangles (s->f, s->gc);
3524} 3545}
3525 3546
3526 3547
@@ -3829,7 +3850,7 @@ x_draw_stretch_glyph_string (s)
3829 gc = s->face->gc; 3850 gc = s->face->gc;
3830 3851
3831 get_glyph_string_clip_rect (s, &r); 3852 get_glyph_string_clip_rect (s, &r);
3832 mac_set_clip_rectangles (s->display, gc, &r, 1); 3853 mac_set_clip_rectangles (s->f, gc, &r, 1);
3833 3854
3834#if 0 /* MAC_TODO: stipple */ 3855#if 0 /* MAC_TODO: stipple */
3835 if (s->face->stipple) 3856 if (s->face->stipple)
@@ -4029,7 +4050,7 @@ x_draw_glyph_string (s)
4029 } 4050 }
4030 4051
4031 /* Reset clipping. */ 4052 /* Reset clipping. */
4032 mac_reset_clip_rectangles (s->display, s->gc); 4053 mac_reset_clip_rectangles (s->f, s->gc);
4033} 4054}
4034 4055
4035/* Shift display to make room for inserted glyphs. */ 4056/* Shift display to make room for inserted glyphs. */
@@ -6409,7 +6430,7 @@ x_draw_bar_cursor (w, row, width, kind)
6409 cursor_glyph->pixel_width, 6430 cursor_glyph->pixel_width,
6410 width); 6431 width);
6411 6432
6412 mac_reset_clip_rectangles (dpy, gc); 6433 mac_reset_clip_rectangles (f, gc);
6413 } 6434 }
6414} 6435}
6415 6436
@@ -6739,7 +6760,6 @@ mac_handle_size_change (f, pixelwidth, pixelheight)
6739 change_frame_size (f, rows, cols, 0, 1, 0); 6760 change_frame_size (f, rows, cols, 0, 1, 0);
6740 FRAME_PIXEL_WIDTH (f) = pixelwidth; 6761 FRAME_PIXEL_WIDTH (f) = pixelwidth;
6741 FRAME_PIXEL_HEIGHT (f) = pixelheight; 6762 FRAME_PIXEL_HEIGHT (f) = pixelheight;
6742 SET_FRAME_GARBAGED (f);
6743 6763
6744 /* If cursor was outside the new size, mark it as off. */ 6764 /* If cursor was outside the new size, mark it as off. */
6745 mark_window_cursors_off (XWINDOW (f->root_window)); 6765 mark_window_cursors_off (XWINDOW (f->root_window));
@@ -6772,7 +6792,6 @@ void
6772x_calc_absolute_position (f) 6792x_calc_absolute_position (f)
6773 struct frame *f; 6793 struct frame *f;
6774{ 6794{
6775 int width_diff = 0, height_diff = 0;
6776 int flags = f->size_hint_flags; 6795 int flags = f->size_hint_flags;
6777 Rect inner, outer; 6796 Rect inner, outer;
6778 6797
@@ -6787,22 +6806,15 @@ x_calc_absolute_position (f)
6787 mac_get_window_bounds (f, &inner, &outer); 6806 mac_get_window_bounds (f, &inner, &outer);
6788 UNBLOCK_INPUT; 6807 UNBLOCK_INPUT;
6789 6808
6790 width_diff = (outer.right - outer.left) - (inner.right - inner.left);
6791 height_diff = (outer.bottom - outer.top) - (inner.bottom - inner.top);
6792
6793 /* Treat negative positions as relative to the leftmost bottommost 6809 /* Treat negative positions as relative to the leftmost bottommost
6794 position that fits on the screen. */ 6810 position that fits on the screen. */
6795 if (flags & XNegative) 6811 if (flags & XNegative)
6796 f->left_pos = (FRAME_MAC_DISPLAY_INFO (f)->width 6812 f->left_pos += (FRAME_MAC_DISPLAY_INFO (f)->width
6797 - width_diff 6813 - (outer.right - outer.left));
6798 - FRAME_PIXEL_WIDTH (f)
6799 + f->left_pos);
6800 6814
6801 if (flags & YNegative) 6815 if (flags & YNegative)
6802 f->top_pos = (FRAME_MAC_DISPLAY_INFO (f)->height 6816 f->top_pos += (FRAME_MAC_DISPLAY_INFO (f)->height
6803 - height_diff 6817 - (outer.bottom - outer.top));
6804 - FRAME_PIXEL_HEIGHT (f)
6805 + f->top_pos);
6806 6818
6807 /* The left_pos and top_pos 6819 /* The left_pos and top_pos
6808 are now relative to the top and left screen edges, 6820 are now relative to the top and left screen edges,
diff --git a/src/macterm.h b/src/macterm.h
index 0a448484873..6a000451785 100644
--- a/src/macterm.h
+++ b/src/macterm.h
@@ -628,9 +628,9 @@ extern void x_destroy_window P_ ((struct frame *));
628extern void x_wm_set_size_hint P_ ((struct frame *, long, int)); 628extern void x_wm_set_size_hint P_ ((struct frame *, long, int));
629extern void x_delete_display P_ ((struct x_display_info *)); 629extern void x_delete_display P_ ((struct x_display_info *));
630extern void mac_initialize P_ ((void)); 630extern void mac_initialize P_ ((void));
631extern Pixmap XCreatePixmap P_ ((Display *, WindowRef, unsigned int, 631extern Pixmap XCreatePixmap P_ ((Display *, Window, unsigned int,
632 unsigned int, unsigned int)); 632 unsigned int, unsigned int));
633extern Pixmap XCreatePixmapFromBitmapData P_ ((Display *, WindowRef, char *, 633extern Pixmap XCreatePixmapFromBitmapData P_ ((Display *, Window, char *,
634 unsigned int, unsigned int, 634 unsigned int, unsigned int,
635 unsigned long, unsigned long, 635 unsigned long, unsigned long,
636 unsigned int)); 636 unsigned int));
@@ -673,13 +673,10 @@ extern void mac_clear_font_name_table P_ ((void));
673extern Lisp_Object mac_aedesc_to_lisp P_ ((const AEDesc *)); 673extern Lisp_Object mac_aedesc_to_lisp P_ ((const AEDesc *));
674extern OSErr mac_ae_put_lisp P_ ((AEDescList *, UInt32, Lisp_Object)); 674extern OSErr mac_ae_put_lisp P_ ((AEDescList *, UInt32, Lisp_Object));
675#if TARGET_API_MAC_CARBON 675#if TARGET_API_MAC_CARBON
676extern OSStatus create_apple_event_from_event_ref P_ ((EventRef, UInt32, 676extern OSErr create_apple_event P_ ((AEEventClass, AEEventID, AppleEvent *));
677 const EventParamName *, 677extern Lisp_Object mac_event_parameters_to_lisp P_ ((EventRef, UInt32,
678 const EventParamType *, 678 const EventParamName *,
679 AppleEvent *)); 679 const EventParamType *));
680extern OSErr create_apple_event_from_drag_ref P_ ((DragRef, UInt32,
681 const FlavorType *,
682 AppleEvent *));
683extern CFStringRef cfstring_create_with_utf8_cstring P_ ((const char *)); 680extern CFStringRef cfstring_create_with_utf8_cstring P_ ((const char *));
684extern CFStringRef cfstring_create_with_string P_ ((Lisp_Object)); 681extern CFStringRef cfstring_create_with_string P_ ((Lisp_Object));
685extern Lisp_Object cfdata_to_lisp P_ ((CFDataRef)); 682extern Lisp_Object cfdata_to_lisp P_ ((CFDataRef));
diff --git a/src/mactoolbox.c b/src/mactoolbox.c
index 6b4d22049a9..71abce23fe0 100644
--- a/src/mactoolbox.c
+++ b/src/mactoolbox.c
@@ -120,8 +120,6 @@ extern Lisp_Object Qtext_input;
120extern Lisp_Object Qupdate_active_input_area, Qunicode_for_key_event; 120extern Lisp_Object Qupdate_active_input_area, Qunicode_for_key_event;
121extern Lisp_Object Vmac_ts_active_input_overlay; 121extern Lisp_Object Vmac_ts_active_input_overlay;
122extern Lisp_Object Qbefore_string; 122extern Lisp_Object Qbefore_string;
123extern Lisp_Object Vmac_ts_script_language_on_focus;
124extern Lisp_Object saved_ts_script_language_on_focus;
125#endif 123#endif
126 124
127static int mac_event_to_emacs_modifiers P_ ((EventRef)); 125static int mac_event_to_emacs_modifiers P_ ((EventRef));
@@ -606,15 +604,15 @@ install_application_handler ()
606#if USE_MAC_TSM 604#if USE_MAC_TSM
607 if (err == noErr) 605 if (err == noErr)
608 { 606 {
609 static const EventTypeSpec spec[] = 607 static const EventTypeSpec specs[] =
610 {{kEventClassTextInput, kEventTextInputUpdateActiveInputArea}, 608 {{kEventClassTextInput, kEventTextInputUpdateActiveInputArea},
611 {kEventClassTextInput, kEventTextInputUnicodeForKeyEvent}, 609 {kEventClassTextInput, kEventTextInputUnicodeForKeyEvent},
612 {kEventClassTextInput, kEventTextInputOffsetToPos}}; 610 {kEventClassTextInput, kEventTextInputOffsetToPos}};
613 611
614 err = InstallApplicationEventHandler (NewEventHandlerUPP 612 err = InstallApplicationEventHandler (NewEventHandlerUPP
615 (mac_handle_text_input_event), 613 (mac_handle_text_input_event),
616 GetEventTypeCount (spec), 614 GetEventTypeCount (specs),
617 spec, NULL, NULL); 615 specs, NULL, NULL);
618 } 616 }
619#endif 617#endif
620 618
@@ -3009,8 +3007,8 @@ mac_event_to_emacs_modifiers (EventRef eventRef)
3009 GetEventParameter (eventRef, kEventParamKeyModifiers, typeUInt32, NULL, 3007 GetEventParameter (eventRef, kEventParamKeyModifiers, typeUInt32, NULL,
3010 sizeof (UInt32), NULL, &mods); 3008 sizeof (UInt32), NULL, &mods);
3011 class = GetEventClass (eventRef); 3009 class = GetEventClass (eventRef);
3012 if (!NILP (Vmac_emulate_three_button_mouse) && 3010 if (!NILP (Vmac_emulate_three_button_mouse)
3013 (class == kEventClassMouse || class == kEventClassCommand)) 3011 && (class == kEventClassMouse || class == kEventClassCommand))
3014 { 3012 {
3015 mods &= ~(optionKey | cmdKey); 3013 mods &= ~(optionKey | cmdKey);
3016 } 3014 }
@@ -3560,6 +3558,9 @@ XTread_socket (sd, expected, hold_quit)
3560 OSStatus err; 3558 OSStatus err;
3561 HIViewRef ch; 3559 HIViewRef ch;
3562 3560
3561 if (FrontNonFloatingWindow () != window_ptr)
3562 SelectWindow (window_ptr);
3563
3563 err = HIViewGetViewForMouseEvent (HIViewGetRoot (window_ptr), 3564 err = HIViewGetViewForMouseEvent (HIViewGetRoot (window_ptr),
3564 eventRef, &ch); 3565 eventRef, &ch);
3565 /* This doesn't work on Mac OS X 10.2. */ 3566 /* This doesn't work on Mac OS X 10.2. */
@@ -4248,7 +4249,6 @@ x_activate_menubar (f)
4248{ 4249{
4249 SInt32 menu_choice; 4250 SInt32 menu_choice;
4250 SInt16 menu_id, menu_item; 4251 SInt16 menu_id, menu_item;
4251 extern Point saved_menu_event_location;
4252 4252
4253 set_frame_menubar (f, 0, 1); 4253 set_frame_menubar (f, 0, 1);
4254 BLOCK_INPUT; 4254 BLOCK_INPUT;
@@ -5704,6 +5704,75 @@ static pascal OSErr mac_do_receive_drag P_ ((WindowRef, void *, DragRef));
5704static DragTrackingHandlerUPP mac_do_track_dragUPP = NULL; 5704static DragTrackingHandlerUPP mac_do_track_dragUPP = NULL;
5705static DragReceiveHandlerUPP mac_do_receive_dragUPP = NULL; 5705static DragReceiveHandlerUPP mac_do_receive_dragUPP = NULL;
5706 5706
5707static OSErr
5708create_apple_event_from_drag_ref (drag, num_types, types, result)
5709 DragRef drag;
5710 UInt32 num_types;
5711 const FlavorType *types;
5712 AppleEvent *result;
5713{
5714 OSErr err;
5715 UInt16 num_items;
5716 AppleEvent items;
5717 long index;
5718 char *buf = NULL;
5719
5720 err = CountDragItems (drag, &num_items);
5721 if (err != noErr)
5722 return err;
5723 err = AECreateList (NULL, 0, false, &items);
5724 if (err != noErr)
5725 return err;
5726
5727 for (index = 1; index <= num_items; index++)
5728 {
5729 ItemReference item;
5730 DescType desc_type = typeNull;
5731 Size size;
5732
5733 err = GetDragItemReferenceNumber (drag, index, &item);
5734 if (err == noErr)
5735 {
5736 int i;
5737
5738 for (i = 0; i < num_types; i++)
5739 {
5740 err = GetFlavorDataSize (drag, item, types[i], &size);
5741 if (err == noErr)
5742 {
5743 buf = xrealloc (buf, size);
5744 err = GetFlavorData (drag, item, types[i], buf, &size, 0);
5745 }
5746 if (err == noErr)
5747 {
5748 desc_type = types[i];
5749 break;
5750 }
5751 }
5752 }
5753 err = AEPutPtr (&items, index, desc_type,
5754 desc_type != typeNull ? buf : NULL,
5755 desc_type != typeNull ? size : 0);
5756 if (err != noErr)
5757 break;
5758 }
5759 if (buf)
5760 xfree (buf);
5761
5762 if (err == noErr)
5763 {
5764 err = create_apple_event (0, 0, result); /* Dummy class and ID. */
5765 if (err == noErr)
5766 err = AEPutParamDesc (result, keyDirectObject, &items);
5767 if (err != noErr)
5768 AEDisposeDesc (result);
5769 }
5770
5771 AEDisposeDesc (&items);
5772
5773 return err;
5774}
5775
5707static void 5776static void
5708mac_store_drag_event (window, mouse_pos, modifiers, desc) 5777mac_store_drag_event (window, mouse_pos, modifiers, desc)
5709 WindowRef window; 5778 WindowRef window;
diff --git a/src/w32.c b/src/w32.c
index a04de3032e1..25756087a63 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -110,6 +110,9 @@ void globals_of_w32 ();
110extern Lisp_Object Vw32_downcase_file_names; 110extern Lisp_Object Vw32_downcase_file_names;
111extern Lisp_Object Vw32_generate_fake_inodes; 111extern Lisp_Object Vw32_generate_fake_inodes;
112extern Lisp_Object Vw32_get_true_file_attributes; 112extern Lisp_Object Vw32_get_true_file_attributes;
113/* Defined in process.c for its own purpose. */
114extern Lisp_Object Qlocal;
115
113extern int w32_num_mouse_buttons; 116extern int w32_num_mouse_buttons;
114 117
115 118
@@ -2644,6 +2647,8 @@ stat (const char * path, struct stat * buf)
2644 } 2647 }
2645 2648
2646 if (!NILP (Vw32_get_true_file_attributes) 2649 if (!NILP (Vw32_get_true_file_attributes)
2650 && !(EQ (Vw32_get_true_file_attributes, Qlocal) &&
2651 GetDriveType (name) == DRIVE_FIXED)
2647 /* No access rights required to get info. */ 2652 /* No access rights required to get info. */
2648 && (fh = CreateFile (name, 0, 0, NULL, OPEN_EXISTING, 2653 && (fh = CreateFile (name, 0, 0, NULL, OPEN_EXISTING,
2649 FILE_FLAG_BACKUP_SEMANTICS, NULL)) 2654 FILE_FLAG_BACKUP_SEMANTICS, NULL))
diff --git a/src/w32proc.c b/src/w32proc.c
index fbb4030e319..0665fa28f16 100644
--- a/src/w32proc.c
+++ b/src/w32proc.c
@@ -110,6 +110,7 @@ Lisp_Object Vw32_generate_fake_inodes;
110 exactly, at the expense of slower operation. Since true hard links 110 exactly, at the expense of slower operation. Since true hard links
111 are supported on NTFS volumes, this is only relevant on NT. */ 111 are supported on NTFS volumes, this is only relevant on NT. */
112Lisp_Object Vw32_get_true_file_attributes; 112Lisp_Object Vw32_get_true_file_attributes;
113extern Lisp_Object Qlocal;
113 114
114Lisp_Object Qhigh, Qlow; 115Lisp_Object Qhigh, Qlow;
115 116
@@ -2353,9 +2354,12 @@ the truename of a file can be slow. */);
2353 2354
2354 DEFVAR_LISP ("w32-get-true-file-attributes", &Vw32_get_true_file_attributes, 2355 DEFVAR_LISP ("w32-get-true-file-attributes", &Vw32_get_true_file_attributes,
2355 doc: /* Non-nil means determine accurate link count in `file-attributes'. 2356 doc: /* Non-nil means determine accurate link count in `file-attributes'.
2356Note that this option is only useful for files on NTFS volumes, where hard links 2357This option is only useful for files on NTFS volumes, where
2357are supported. Moreover, it slows down `file-attributes' noticeably. */); 2358hard links are supported. The default value `local' means only do
2358 Vw32_get_true_file_attributes = Qt; 2359this for files on local harddrives. Any other non-nil value means do
2360this even on remote and removable drives where the performance impact
2361may be noticeable even on modern hardware. */);
2362 Vw32_get_true_file_attributes = Qlocal;
2359 2363
2360 staticpro (&Vw32_valid_locale_ids); 2364 staticpro (&Vw32_valid_locale_ids);
2361 staticpro (&Vw32_valid_codepages); 2365 staticpro (&Vw32_valid_codepages);