]> code.delx.au - gnu-emacs/commitdiff
Merge from emacs--rel--22
authorMiles Bader <miles@gnu.org>
Wed, 23 Apr 2008 05:55:42 +0000 (05:55 +0000)
committerMiles Bader <miles@gnu.org>
Wed, 23 Apr 2008 05:55:42 +0000 (05:55 +0000)
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-1121

28 files changed:
ChangeLog
admin/FOR-RELEASE
configure.in
doc/emacs/ChangeLog
doc/emacs/emacs.texi
doc/emacs/maintaining.texi
lib-src/ChangeLog
lib-src/makefile.w32-in
lisp/ChangeLog
lisp/emacs-lisp/autoload.el
lisp/gnus/nnrss.el
lisp/progmodes/cc-mode.el
lisp/progmodes/gdb-ui.el
lisp/progmodes/gud.el
lisp/progmodes/make-mode.el
lisp/term/mac-win.el
lisp/textmodes/paragraphs.el
nt/ChangeLog
nt/makefile.w32-in
src/ChangeLog
src/alloc.c
src/mac.c
src/macgui.h
src/macterm.c
src/macterm.h
src/mactoolbox.c
src/w32.c
src/w32proc.c

index b5f063caed27e2c9f3a62bf283ccc4491d244d65..55afae13d897455b26e2f7600c5212242d9543bc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-04-23  Dan Nicolaescu  <dann@ics.uci.edu>
+
+       * configure.in: Remove hpux10.20 from the desupported list.
+
 2008-04-18  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * configure.in: Define USE_LUCID/USE_MOTIF in config.h.
index 261afb68552353af783b0f37132c8f1ff6500ef4..9424d8f6c2ccddbf211d1580aee038b833be6772 100644 (file)
@@ -53,12 +53,6 @@ from 2007-08-27.  Impossible to procede without more input from OP (as
 of 20070912, emails are bouncing) or someone else who can reproduce this.
 http://lists.gnu.org/archive/html/emacs-devel/2007-08/msg01497.html
 
-** emacs-22.1 with GTK problems (with patches)
-Only outstanding issue seems to be whether Solaris 2.6 GTK can be
-supported in the absence of recursive mutexes, via a change to
-alloc.c, or whether configure should abort.
-http://lists.gnu.org/archive/html/bug-gnu-emacs/2007-09/msg00055.html
-
 * BUGS
 
 ** Does deleting frames run Lisp code?  If so, can we get rid of that?
index dee41383f1edbb39d237ba7e4fd0c055a3963355..4740fb9b5da11df6fc0730086a363e49913f51a6 100644 (file)
@@ -769,7 +769,7 @@ case "${machine}" in
 esac
 
 case "${opsys}" in
-     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 )
+     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 )
          echo "The system that you are configuring on: ${canonical} is considered to be obsolete"
          echo "and it is planned to be desupported in the next version of Emacs"
          echo "Please email emacs-devel@gnu.org as soon as possible if this system is still in use."
index 0fd90ba5a63ffab37098b563b60255d9660c23d7..2fddf83b4007d0fc0b435a00c0f02debef678e83 100644 (file)
        * building.texi (GDB-UI Layout, Breakpoints Buffer)
        (Other GDB-UI Buffers): Update for recent thread related changes.
 
+2008-04-11  Mirko Vukovic  <mirko.vukovic@gmail.com>  (tiny change)
+
+       * maintaining.texi (Maintaining):
+       * emacs.texi (Top): Typo.
+
 2008-04-08  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * display.texi (Font Lock): Prefer add-hook to using a non-nil `mode'
index aca77108e3b52d5b47bd3257e29fe08af00c9822..28b72eb5c136bba4aaed44b317f01f752999770b 100644 (file)
@@ -713,7 +713,7 @@ Maintaining Large Programs
 
 * Change Log::         Maintaining a change history for your program.
 * Format of ChangeLog:: What the change log file looks like.
-* Tags::               Go direct to any function in your program in one
+* Tags::               Go directly to any function in your program in one
                          command.  Tags remembers which file it is in.
 * Emerge::              A convenient way of merging two versions of a program.
 
index d4774379555ba750e9753b9299cb7f07c3308fdf..424f26b584a3604abda8d59de10d5f7eac43e579 100644 (file)
@@ -12,7 +12,7 @@ also particularly useful for this purpose.
 @menu
 * Change Log::         Maintaining a change history for your program.
 * Format of ChangeLog:: What the change log file looks like.
-* Tags::               Go direct to any function in your program in one
+* Tags::               Go directly to any function in your program in one
                          command.  Tags remembers which file it is in.
 @ifnottex
 * Emerge::              A convenient way of merging two versions of a program.
index ab8d490faefac8d84a2d210066282fac2c37f518..61a0a0c0310d0308a91091b2df29028d0848bcd8 100644 (file)
@@ -1,3 +1,9 @@
+2008-04-10  Jason Rumney  <jasonr@gnu.org>
+
+       * makefile.w32-in (CLIENTRES): New variable and target.
+       (TRES): Remove.
+       ($(BLD)/emacsclientw.exe): Use $(CLIENTRES) instead of $(TRES).
+
 2008-04-19  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * vcdiff: Use "sccs get" rather than "get"; leave PATH alone.
index 2d9954dbebcf83920f2a6877b2b909e8b557bcac..e81b2efb529b7cd6b2ba766d4fb4a0da3d4ec9f3 100644 (file)
@@ -75,18 +75,19 @@ ECLIENTOBJS =       $(BLD)/emacsclient.$(O) \
                $(BLD)/getopt.$(O) \
                $(BLD)/getopt1.$(O) \
                $(BLD)/ntlib.$(O)
-TRES =         ../nt/$(BLD)/emacs.res
+CLIENTRES =    ../nt/$(BLD)/emacsclient.res
 
-$(TRES):       ../nt/emacs.rc
-               $(RC) $(RC_OUT)../nt/$(BLD)/emacs.res $(ALL_DEPS)
+$(CLIENTRES):  ../nt/emacsclient.rc
+       @echo Emacsclient resource file must be built from nt directory
+       @exit -1
 
 $(BLD)/emacsclient.exe:                $(ECLIENTOBJS)
 # put wsock32.lib before $(LIBS) to ensure we don't link to ws2_32.lib
                $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(ECLIENTOBJS) $(WSOCK32) $(USER32) $(COMCTL32) $(LIBS)
 
-$(BLD)/emacsclientw.exe:       $(ECLIENTOBJS) $(TRES)
+$(BLD)/emacsclientw.exe:       $(ECLIENTOBJS) $(CLIENTRES)
 # put wsock32.lib before $(LIBS) to ensure we don't link to ws2_32.lib
-               $(LINK) $(LINK_OUT)$@ $(TRES) -mwindows $(LINK_FLAGS) $(ECLIENTOBJS) $(WSOCK32) $(USER32) $(COMCTL32) $(LIBS)
+               $(LINK) $(LINK_OUT)$@ $(CLIENTRES) -mwindows $(LINK_FLAGS) $(ECLIENTOBJS) $(WSOCK32) $(USER32) $(COMCTL32) $(LIBS)
 
 # emacsclient.$(O) depends on makefile.w32-in because makefile.w32-in
 # can be edited to define VERSION string, which is part of ECLIENT_CFLAGS.
index 27f8a12fc16d3eb4c2393460fbce5e72494b3061..3c5a1e6994e508f1f6f32bf7734af19c3b9200d3 100644 (file)
@@ -1,3 +1,36 @@
+2008-04-12  Nick Roberts  <nickrob@snap.net.nz>
+
+       * progmodes/gdb-ui.el (gdb-init-buffer): New function.
+       (gdb-set-gud-minor-mode-existing-buffers)
+       (gdb-info-breakpoints-custom, gdb-get-location)
+       (gdb-set-gud-minor-mode-existing-buffers-1): Use it.
+       Previously gdb-create-define-alist wasn't always run and added to
+       after-save-hook.
+
+       * progmodes/gud.el (gud-tooltip-tips): Use tooltip-event-buffer
+
+2008-04-12  Kevin Ryde  <user42@zip.com.au>
+
+       * progmodes/make-mode.el (makefile-fill-paragraph): Treat indented
+       comments like unindented ones.
+
+2008-04-12  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+       * term/mac-win.el (mac-ae-open-documents): Adjust selection range
+       parameter origins.
+
+2008-04-11  Kevin Ryde  <user42@zip.com.au>
+
+       * emacs-lisp/autoload.el (autoload-generate-file-autoloads):
+       Bind print-level to ensure output forms aren't truncated if
+       print-level is set to eval-expression-print-level when going via
+       eval-defun and friends, or has been otherwise fiddled with.
+
+2008-04-08  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * progmodes/cc-mode.el (c-basic-common-init): Don't set
+       font-lock-extend-after-change-region-function globally.
+
 2008-04-23  Juanma Barranquero  <lekktu@gmail.com>
 
        * speedbar.el (speedbar-use-tool-tips-flag)
index e6bca3b15dde0cb3d046c0dbd7328bd535c7254a..377d6c3f6999080b7e5841ec37eaad86d86c401b 100644 (file)
@@ -335,6 +335,7 @@ Return non-nil iff FILE adds no autoloads to OUTFILE
     (let ((autoloads-done '())
           (load-name (autoload-file-load-name file))
           (print-length nil)
+         (print-level nil)
           (print-readably t)           ; This does something in Lucid Emacs.
           (float-output-format nil)
           (visited (get-file-buffer file))
index 69a33088242fec46c1404ec2517b73400041fdd2..cd12b82fbeea1823b13bb61002786ecd7a58005e 100644 (file)
@@ -1131,7 +1131,5 @@ prefix), return the prefix."
 
 (provide 'nnrss)
 
-
-;;; nnrss.el ends here
-
 ;; arch-tag: 12910c07-0cdf-44fb-8d2c-416ded64c267
+;;; nnrss.el ends here
index 3fee14bf565e0041cb6f3eb021402039d89e0065..bd590d62f050738f5f731fd774e0ea05b42fa734 100644 (file)
@@ -601,7 +601,7 @@ that requires a literal mode spec at compile time."
   (add-hook 'before-change-functions 'c-before-change nil t)
   (make-local-hook 'after-change-functions)
   (add-hook 'after-change-functions 'c-after-change nil t)
-  (setq font-lock-extend-after-change-region-function
+  (set (make-local-variable 'font-lock-extend-after-change-region-function)
        'c-extend-after-change-region)) ; Currently (2008-04), only used by AWK.
 
 (defun c-setup-doc-comment-style ()
index d9776c0c4cdb08c3cb8c879f9b0d14955069c2a8..a3f3993629cb7d9f7c02060c30fb252445bc5bc3 100644 (file)
@@ -481,6 +481,15 @@ otherwise do not."
 
 (defconst gdb-source-file-regexp "\\(.+?\\), \\|\\([^, \n].*$\\)")
 
+(defun gdb-init-buffer ()
+  (set (make-local-variable 'gud-minor-mode)
+       (buffer-local-value 'gud-minor-mode gud-comint-buffer))
+  (set (make-local-variable 'tool-bar-map) gud-tool-bar-map)
+  (when gud-tooltip-mode
+    (make-local-variable 'gdb-define-alist)
+    (gdb-create-define-alist)
+    (add-hook 'after-save-hook 'gdb-create-define-alist nil t)))
+
 (defun gdb-set-gud-minor-mode-existing-buffers ()
   "Create list of source files for current GDB session."
   (goto-char (point-min))
@@ -493,12 +502,7 @@ otherwise do not."
        (when (and buffer-file-name
                   (member (file-name-nondirectory buffer-file-name)
                           gdb-source-file-list))
-         (set (make-local-variable 'gud-minor-mode) 'gdba)
-         (set (make-local-variable 'tool-bar-map) gud-tool-bar-map)
-         (when gud-tooltip-mode
-           (make-local-variable 'gdb-define-alist)
-           (gdb-create-define-alist)
-           (add-hook 'after-save-hook 'gdb-create-define-alist nil t))))))
+         (gdb-init-buffer)))))
   (gdb-force-mode-line-update
    (propertize "ready" 'face font-lock-variable-name-face)))
 
@@ -1953,10 +1957,7 @@ static char *magick[] = {
                                   (not (string-equal file "File not found")))
                              (with-current-buffer
                                  (find-file-noselect file 'nowarn)
-                               (set (make-local-variable 'gud-minor-mode)
-                                    'gdba)
-                               (set (make-local-variable 'tool-bar-map)
-                                    gud-tool-bar-map)
+                               (gdb-init-buffer)
                                ;; Only want one breakpoint icon at each
                                ;; location.
                                (save-excursion
@@ -3269,9 +3270,7 @@ Add directory to search path for source files using the GDB command, dir."))
       (throw 'file-not-found nil))
     (with-current-buffer
        (find-file-noselect (match-string 0))
-      (save-current-buffer
-       (set (make-local-variable 'gud-minor-mode) 'gdba)
-       (set (make-local-variable 'tool-bar-map) gud-tool-bar-map))
+      (gdb-init-buffer)
       ;; only want one breakpoint icon at each location
       (save-excursion
        (goto-line (string-to-number line))
@@ -3293,9 +3292,7 @@ of the current session."
                    buffer-file-name)
                  gdb-source-file-list)
          (with-current-buffer (find-buffer-visiting buffer-file-name)
-           (set (make-local-variable 'gud-minor-mode)
-                (buffer-local-value 'gud-minor-mode gud-comint-buffer))
-           (set (make-local-variable 'tool-bar-map) gud-tool-bar-map)))))
+           (gdb-init-buffer)))))
 
 ;;from put-image
 (defun gdb-put-string (putstring pos &optional dprop &rest sprops)
@@ -3625,13 +3622,7 @@ is set in them."
   (dolist (buffer (buffer-list))
     (with-current-buffer buffer
       (when (member buffer-file-name gdb-source-file-list)
-       (set (make-local-variable 'gud-minor-mode)
-            (buffer-local-value 'gud-minor-mode gud-comint-buffer))
-       (set (make-local-variable 'tool-bar-map) gud-tool-bar-map)
-       (when gud-tooltip-mode
-         (make-local-variable 'gdb-define-alist)
-         (gdb-create-define-alist)
-         (add-hook 'after-save-hook 'gdb-create-define-alist nil t)))))
+       (gdb-init-buffer))))
   (gdb-force-mode-line-update
    (propertize "ready" 'face font-lock-variable-name-face)))
 
index dbb1aa8be99e8ba87a6912fca736ee6bbea18f74..8bfccaabb6db35aff81ab13208bad6b611a56aae 100644 (file)
@@ -3424,10 +3424,7 @@ This function must return nil if it doesn't handle EVENT."
          (if (and (eq gud-minor-mode 'gdba)
                   (not gdb-active-process))
              (progn
-               (with-current-buffer
-                   (window-buffer (let ((mouse (mouse-position)))
-                                    (window-at (cadr mouse)
-                                               (cddr mouse))))
+               (with-current-buffer (tooltip-event-buffer event)
                  (let ((define-elt (assoc expr gdb-define-alist)))
                    (unless (null define-elt)
                      (tooltip-show
index ea9300f851be697242a7c8a9131565f3409debc5..2bf5b74c615e89cdcd0b624b6f219a0ca6ff4a68 100644 (file)
@@ -1352,7 +1352,7 @@ definition and conveniently use this command."
   (save-excursion
     (beginning-of-line)
     (cond
-     ((looking-at "^#+\\s-*")
+     ((looking-at "^[ \t]*#+\\s-*")
       ;; Found a comment.  Return nil to let normal filling take place.
       nil)
 
index 60f27052892edf6a259b3743a64cb207275145df..e15f2e4c87349722f694eaba47379bf930d653c8 100644 (file)
@@ -1802,11 +1802,11 @@ if possible.  If there's no such frame, a new frame is created."
             (let ((line (car selection-range))
                   (start (cadr selection-range))
                   (end (nth 2 selection-range)))
-              (if (> line 0)
-                  (goto-line line)
-                (if (and (> start 0) (> end 0))
-                    (progn (set-mark start)
-                           (goto-char end))))))
+              (if (>= line 0)
+                  (goto-line (1+ line))
+                (if (and (>= start 0) (>= end 0))
+                    (progn (set-mark (1+ start))
+                           (goto-char (1+ end)))))))
            ((stringp search-text)
             (re-search-forward
              (mapconcat 'regexp-quote (split-string search-text) "\\|")
index 231eba6ba86b5ba8000220f9b2272f5552a1d1fe..b21369edfdac00ceb506213320ee1bbb56626bfb 100644 (file)
@@ -355,8 +355,8 @@ With argument ARG, do it ARG times;
 a negative argument ARG = -N means move forward N paragraphs.
 
 A paragraph start is the beginning of a line which is a
-`first-line-of-paragraph' or which is ordinary text and follows a
-paragraph-separating line; except: if the first real line of a
+`paragraph-start' or which is ordinary text and follows a
+`paragraph-separate'ing line; except: if the first real line of a
 paragraph is preceded by a blank line, the paragraph starts at that
 blank line.
 
index 4adb653464a7874d7d57c5a9bb8da6c67df92989..075814f120eef9c7af5aff0e8c9e9206d31578ac 100644 (file)
@@ -1,3 +1,15 @@
+2008-04-23  Eli Zaretskii  <eliz@gnu.org>
+
+       * makefile.w32-in (ALL): Move $(CLIENTRES) from here...
+       (all): ...to here.  $(ALL) is a prerequisite of .PHONY, so having
+       a real file there is not a good idea.
+
+2008-04-23  Jason Rumney  <jasonr@gnu.org>
+
+       * makefile.w32-in (CLIENTRES): New variable and build target.
+       (all): Depend on it.
+       ($(TRES)): Use $(TRES) in rule.
+
 2008-04-21  Jason Rumney  <jasonr@gnu.org>
 
        * configure.bat (success): Print "make" rather than "gmake", as that
index ddf279cbdf74486888e5bfe285cdc7766b2482d5..053961a0c58d2d336e591004971660e63da727f4 100644 (file)
 # FIXME: This file uses DOS EOLs.  Convert to Unix after 22.1 is out\r
 #        (and remove or replace this comment).\r
 \r
+TRES           = $(BLD)/emacs.res\r
+CLIENTRES      = $(BLD)/emacsclient.res\r
+\r
+XMFLAGS                =\r
+\r
 ALL            = addpm ddeclient runemacs cmdproxy addsection preprep\r
 \r
 .PHONY: $(ALL)\r
 \r
-TRES           = $(BLD)/emacs.res\r
-\r
-XMFLAGS                =\r
 \r
 addpm:           stamp_BLD $(BLD)/addpm.exe\r
 $(BLD)/addpm.exe: $(BLD)/addpm.$(O)\r
@@ -62,7 +64,10 @@ $(BLD)/preprep.exe: $(BLD)/preprep.$(O)
 # it is not necessary on later versions, it is still ok to use it.\r
 #\r
 $(TRES):       emacs.rc icons/emacs.ico emacs.manifest stamp_BLD\r
-               $(RC) $(RC_OUT)$(BLD)/emacs.res emacs.rc\r
+               $(RC) $(RC_OUT)$(TRES) emacs.rc\r
+\r
+$(CLIENTRES):  emacsclient.rc stamp_BLD\r
+               $(RC) $(RC_OUT)$(CLIENTRES) emacsclient.rc\r
 \r
 runemacs:        stamp_BLD $(BLD)/runemacs.exe\r
 $(BLD)/runemacs.exe: $(BLD)/runemacs.$(O) $(TRES)\r
@@ -81,7 +86,7 @@ $(BLD)/addpm.$(O) $(BLD)/ddeclient.$(O) $(BLD)/runemacs.$(O) $(BLD)/cmdproxy.$(O
 #\r
 # Build emacs\r
 #\r
-all:   which-sh stamp_BLD $(ALL) maybe-bootstrap all-other-dirs-$(MAKETYPE)\r
+all:   which-sh stamp_BLD $(ALL) $(CLIENTRES) maybe-bootstrap all-other-dirs-$(MAKETYPE)\r
 \r
 all-other-dirs-nmake: addsection\r
        cd ..\lib-src\r
index 378718dfc81a55df411c4ba98e65ea00be845e67..c346bb9f31d872b2145f3d3444231e8a02d2338d 100644 (file)
@@ -1,3 +1,64 @@
+2008-04-19  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+       * mac.c (create_apple_event) [TARGET_API_MAC_CARBON]:
+       Make function non-static.
+       (create_apple_event_from_event_ref) [TARGET_API_MAC_CARBON]:
+       Remove function.
+       (create_apple_event_from_drag_ref) [TARGET_API_MAC_CARBON]:
+       Move to mactoolbox.c.
+       (mac_event_parameters_to_lisp) [TARGET_API_MAC_CARBON]: New function.
+
+       * macgui.h (CGFloat) [!CGFLOAT_DEFINED]: New typedef.
+       (mac_rect_make): New macro.
+
+       * macterm.c (mac_draw_image_string_atsui) [MAC_OSX]: Use CGFloat
+       instead of float.
+       (mac_draw_image_string_cg) [USE_CG_TEXT_DRAWING]: Likewise.
+       (init_cg_color, mac_draw_line, mac_draw_cg_image, XSetForeground)
+       (XSetBackground) [USE_CG_DRAWING]: Likewise.
+       (mac_draw_image_string_atsui) [MAC_OSX]: Use mac_rect_make instead of
+       CGRectMake.
+       (mac_draw_image_string_cg) [USE_CG_TEXT_DRAWING]: Likewise.
+       (mac_erase_rectangle, mac_draw_cg_image, mac_fill_rectangle)
+       (mac_set_clip_rectangles) [USE_CG_DRAWING]: Likewise.
+       (XCreatePixmap, XCreatePixmapFromBitmapData): Use Window
+       instead of WindowRef in argument type.
+       (XCreatePixmap) [!MAC_OS8]: Don't call SetPortWindowPort.
+       (mac_invert_rectangle): Use CGContextSetBlendMode if available.
+       (mac_set_clip_rectangles, mac_reset_clip_rectangles): Take argument F
+       instead of DISPLAY.  All uses changed.
+       (mac_handle_size_change): Don't call SET_FRAME_GARBAGED.
+       (x_calc_absolute_position): Simplify so as not to use
+       FRAME_PIXEL_WIDTH/FRAME_PIXEL_HEIGHT.
+
+       * macterm.h (XCreatePixmap, XCreatePixmapFromBitmapData): Use Window
+       instead of WindowRef in argument type.
+       (create_apple_event_from_event_ref, create_apple_event_from_drag_ref)
+       [TARGET_API_MAC_CARBON]: Remove externs.
+       (create_apple_event, mac_event_parameters_to_lisp)
+       [TARGET_API_MAC_CARBON]: Add externs.
+
+       * mactoolbox.c: (Vmac_ts_script_language_on_focus)
+       (saved_ts_script_language_on_focus) [USE_MAC_TSM]: Remove externs.
+       (XTread_socket) [USE_MAC_TOOLBAR]: Select window if its structure part
+       is clicked.
+       (x_activate_menubar): Remove extern for saved_menu_event_location.
+       (create_apple_event_from_drag_ref) [TARGET_API_MAC_CARBON]:
+       Move from mac.c.
+
+2008-04-12  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+       * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT] (uninterrupt_malloc)
+       [HAVE_GTK_AND_PTHREAD && !DOUG_LEA_MALLOC]: Don't use recursive mutex.
+
+2008-04-10  Jason Rumney  <jasonr@gnu.org>
+
+       * w32.c (stat): When Vw32_get_true_file_attributes is Qlocal, get
+       attributes only for local files.
+
+       * w32proc.c (syms_of_ntproc): Change Vw32_get_true_file attributes
+       default to Qlocal.
+
 2008-04-22  Juri Linkov  <juri@jurta.org>
 
        * buffer.c (Fswitch_to_buffer): Change interactive spec to call
index fe37eec93793d6099b1f5a8b21b11e39e207cdd9..64c8cc8264ef254b7c9319933660e4bfe4390925 100644 (file)
@@ -1366,6 +1366,7 @@ void
 uninterrupt_malloc ()
 {
 #ifdef HAVE_GTK_AND_PTHREAD
+#ifdef DOUG_LEA_MALLOC
   pthread_mutexattr_t attr;
 
   /*  GLIBC has a faster way to do this, but lets keep it portable.
@@ -1373,6 +1374,11 @@ uninterrupt_malloc ()
   pthread_mutexattr_init (&attr);
   pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_RECURSIVE);
   pthread_mutex_init (&alloc_mutex, &attr);
+#else  /* !DOUG_LEA_MALLOC */
+  /* Some systems such as Solaris 2.6 doesn't have a recursive mutex,
+     and the bundled gmalloc.c doesn't require it.  */
+  pthread_mutex_init (&alloc_mutex, NULL);
+#endif /* !DOUG_LEA_MALLOC */
 #endif /* HAVE_GTK_AND_PTHREAD */
 
   if (__free_hook != emacs_blocked_free)
index 0ae233f048e08bc512b8c9649ded6c2275bdacb0..22f34747ea8f53501a63ae5005076f84f548e1b7 100644 (file)
--- a/src/mac.c
+++ b/src/mac.c
@@ -817,7 +817,7 @@ init_coercion_handler ()
 }
 
 #if TARGET_API_MAC_CARBON
-static OSErr
+OSErr
 create_apple_event (class, id, result)
      AEEventClass class;
      AEEventID id;
@@ -842,129 +842,76 @@ create_apple_event (class, id, result)
   return err;
 }
 
-OSStatus
-create_apple_event_from_event_ref (event, num_params, names, types, result)
+Lisp_Object
+mac_event_parameters_to_lisp (event, num_params, names, types)
      EventRef event;
      UInt32 num_params;
      const EventParamName *names;
      const EventParamType *types;
-     AppleEvent *result;
 {
   OSStatus err;
-  UInt32 i, size;
+  Lisp_Object result = Qnil;
+  UInt32 i;
+  ByteCount size;
+#ifdef MAC_OSX
   CFStringRef string;
   CFDataRef data;
-  char *buf = NULL;
-
-  err = create_apple_event (0, 0, result); /* Dummy class and ID.  */
-  if (err != noErr)
-    return err;
-
-  for (i = 0; i < num_params; i++)
-    switch (types[i])
-      {
-#ifdef MAC_OSX
-      case typeCFStringRef:
-       err = GetEventParameter (event, names[i], typeCFStringRef, NULL,
-                                sizeof (CFStringRef), NULL, &string);
-       if (err != noErr)
-         break;
-       data = CFStringCreateExternalRepresentation (NULL, string,
-                                                    kCFStringEncodingUTF8,
-                                                    '?');
-       if (data == NULL)
-         break;
-       AEPutParamPtr (result, names[i], typeUTF8Text,
-                      CFDataGetBytePtr (data), CFDataGetLength (data));
-       CFRelease (data);
-       break;
 #endif
-
-      default:
-       err = GetEventParameter (event, names[i], types[i], NULL,
-                                0, &size, NULL);
-       if (err != noErr)
-         break;
-       buf = xrealloc (buf, size);
-       err = GetEventParameter (event, names[i], types[i], NULL,
-                                size, NULL, buf);
-       if (err == noErr)
-         AEPutParamPtr (result, names[i], types[i], buf, size);
-       break;
-      }
-  if (buf)
-    xfree (buf);
-
-  return noErr;
-}
-
-OSErr
-create_apple_event_from_drag_ref (drag, num_types, types, result)
-     DragRef drag;
-     UInt32 num_types;
-     const FlavorType *types;
-     AppleEvent *result;
-{
-  OSErr err;
-  UInt16 num_items;
-  AppleEvent items;
-  long index;
   char *buf = NULL;
 
-  err = CountDragItems (drag, &num_items);
-  if (err != noErr)
-    return err;
-  err = AECreateList (NULL, 0, false, &items);
-  if (err != noErr)
-    return err;
-
-  for (index = 1; index <= num_items; index++)
+  for (i = 0; i < num_params; i++)
     {
-      ItemReference item;
-      DescType desc_type = typeNull;
-      Size size;
+      EventParamName name = names[i];
+      EventParamType type = types[i];
 
-      err = GetDragItemReferenceNumber (drag, index, &item);
-      if (err == noErr)
+      switch (type)
        {
-         int i;
+#ifdef MAC_OSX
+       case typeCFStringRef:
+         err = GetEventParameter (event, name, typeCFStringRef, NULL,
+                                  sizeof (CFStringRef), NULL, &string);
+         if (err != noErr)
+           break;
+         data = CFStringCreateExternalRepresentation (NULL, string,
+                                                      kCFStringEncodingUTF8,
+                                                      '?');
+         if (data == NULL)
+           break;
+         name = EndianU32_NtoB (name);
+         type = EndianU32_NtoB (typeUTF8Text);
+         result =
+           Fcons (Fcons (make_unibyte_string ((char *) &name, 4),
+                         Fcons (make_unibyte_string ((char *) &type, 4),
+                                make_unibyte_string (CFDataGetBytePtr (data),
+                                                     CFDataGetLength (data)))),
+                  result);
+         CFRelease (data);
+         break;
+#endif
 
-         for (i = 0; i < num_types; i++)
+       default:
+         err = GetEventParameter (event, name, type, NULL, 0, &size, NULL);
+         if (err != noErr)
+           break;
+         buf = xrealloc (buf, size);
+         err = GetEventParameter (event, name, type, NULL, size, NULL, buf);
+         if (err == noErr)
            {
-             err = GetFlavorDataSize (drag, item, types[i], &size);
-             if (err == noErr)
-               {
-                 buf = xrealloc (buf, size);
-                 err = GetFlavorData (drag, item, types[i], buf, &size, 0);
-               }
-             if (err == noErr)
-               {
-                 desc_type = types[i];
-                 break;
-               }
+             name = EndianU32_NtoB (name);
+             type = EndianU32_NtoB (type);
+             result =
+               Fcons (Fcons (make_unibyte_string ((char *) &name, 4),
+                             Fcons (make_unibyte_string ((char *) &type, 4),
+                                    make_unibyte_string (buf, size))),
+                      result);
            }
+         break;
        }
-      err = AEPutPtr (&items, index, desc_type,
-                     desc_type != typeNull ? buf : NULL,
-                     desc_type != typeNull ? size : 0);
-      if (err != noErr)
-       break;
     }
   if (buf)
     xfree (buf);
 
-  if (err == noErr)
-    {
-      err = create_apple_event (0, 0, result); /* Dummy class and ID.  */
-      if (err == noErr)
-       err = AEPutParamDesc (result, keyDirectObject, &items);
-      if (err != noErr)
-       AEDisposeDesc (result);
-    }
-
-  AEDisposeDesc (&items);
-
-  return err;
+  return result;
 }
 #endif /* TARGET_API_MAC_CARBON */
 \f
index c549a885f48a1c1bde5850b104ee24109bbcafea..41ac28f49ec87e9ba8d6e369ee1a531e5267e413 100644 (file)
@@ -126,6 +126,10 @@ typedef unsigned long Time;
 #endif
 #endif
 
+#ifndef CGFLOAT_DEFINED
+typedef float CGFloat;
+#endif
+
 typedef WindowRef Window;
 #if TARGET_API_MAC_CARBON
 typedef ScrapRef Selection;
@@ -149,6 +153,7 @@ typedef int Selection;
 #define mac_size_window                SizeWindow
 #define mac_get_global_mouse   GetGlobalMouse
 #define mac_is_window_toolbar_visible  IsWindowToolbarVisible
+#define mac_rect_make(f, x, y, w, h)   CGRectMake (x, y, w, h)
 typedef GWorldPtr Pixmap;
 
 #define Cursor ThemeCursor
index 842e1844f50244260813802d1249a44e4f0324c0..f4715c7f77280a7bbdf083a65bd687780ccdb0bd 100644 (file)
@@ -351,7 +351,7 @@ init_cg_color ()
   if (CGColorGetTypeID != NULL)
 #endif
     {
-      float rgba[] = {0.0f, 0.0f, 0.0f, 1.0f};
+      CGFloat rgba[] = {0.0f, 0.0f, 0.0f, 1.0f};
 
       mac_cg_color_black = CGColorCreate (mac_cg_color_space_rgb, rgba);
     }
@@ -460,7 +460,7 @@ mac_draw_line (f, gc, x1, y1, x2, y2)
 {
 #if USE_CG_DRAWING
   CGContextRef context;
-  float gx1 = x1, gy1 = y1, gx2 = x2, gy2 = y2;
+  CGFloat gx1 = x1, gy1 = y1, gx2 = x2, gy2 = y2;
 
   if (y1 != y2)
     gx1 += 0.5f, gx2 += 0.5f;
@@ -553,7 +553,7 @@ mac_erase_rectangle (f, gc, x, y, width, height)
 
       context = mac_begin_cg_clip (f, gc);
       CG_SET_FILL_COLOR_WITH_GC_BACKGROUND (context, gc);
-      CGContextFillRect (context, CGRectMake (x, y, width, height));
+      CGContextFillRect (context, mac_rect_make (f, x, y, width, height));
       mac_end_cg_clip (f);
     }
 #else
@@ -632,8 +632,8 @@ mac_draw_cg_image (image, f, gc, src_x, src_y, width, height,
      int dest_x, dest_y, overlay_p;
 {
   CGContextRef context;
-  float port_height = FRAME_PIXEL_HEIGHT (f);
-  CGRect dest_rect = CGRectMake (dest_x, dest_y, width, height);
+  CGFloat port_height = FRAME_PIXEL_HEIGHT (f);
+  CGRect dest_rect = mac_rect_make (f, dest_x, dest_y, width, height);
 
   context = mac_begin_cg_clip (f, gc);
   if (!overlay_p)
@@ -647,11 +647,11 @@ mac_draw_cg_image (image, f, gc, src_x, src_y, width, height,
   if (CGImageIsMask (image))
     CG_SET_FILL_COLOR_WITH_GC_FOREGROUND (context, gc);
   CGContextDrawImage (context,
-                     CGRectMake (dest_x - src_x,
-                                 port_height - (dest_y - src_y
-                                                + CGImageGetHeight (image)),
-                                 CGImageGetWidth (image),
-                                 CGImageGetHeight (image)),
+                     mac_rect_make (f, dest_x - src_x,
+                                    port_height - (dest_y - src_y
+                                                   + CGImageGetHeight (image)),
+                                    CGImageGetWidth (image),
+                                    CGImageGetHeight (image)),
                      image);
   mac_end_cg_clip (f);
 }
@@ -744,7 +744,7 @@ mac_free_bitmap (bitmap)
 Pixmap
 XCreatePixmap (display, w, width, height, depth)
      Display *display;
-     WindowRef w;
+     Window w;
      unsigned int width, height;
      unsigned int depth;
 {
@@ -752,8 +752,9 @@ XCreatePixmap (display, w, width, height, depth)
   Rect r;
   QDErr err;
 
+#ifdef MAC_OS8
   SetPortWindowPort (w);
-
+#endif
   SetRect (&r, 0, 0, width, height);
 #if !defined (WORDS_BIG_ENDIAN) && USE_CG_DRAWING
   if (depth == 1)
@@ -773,7 +774,7 @@ XCreatePixmap (display, w, width, height, depth)
 Pixmap
 XCreatePixmapFromBitmapData (display, w, data, width, height, fg, bg, depth)
      Display *display;
-     WindowRef w;
+     Window w;
      char *data;
      unsigned int width, height;
      unsigned long fg, bg;
@@ -838,7 +839,7 @@ mac_fill_rectangle (f, gc, x, y, width, height)
 
   context = mac_begin_cg_clip (f, gc);
   CG_SET_FILL_COLOR_WITH_GC_FOREGROUND (context, gc);
-  CGContextFillRect (context, CGRectMake (x, y, width, height));
+  CGContextFillRect (context, mac_rect_make (f, x, y, width, height));
   mac_end_cg_clip (f);
 #else
   Rect r;
@@ -887,7 +888,26 @@ mac_invert_rectangle (f, x, y, width, height)
      int x, y;
      unsigned int width, height;
 {
-  Rect r;
+#if USE_CG_DRAWING && MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 1040 && MAC_OS_X_VERSION_MIN_REQUIRED >= 1020
+  if (CGContextSetBlendMode != NULL)
+#endif
+    {
+      CGContextRef context;
+
+      context = mac_begin_cg_clip (f, NULL);
+      CGContextSetRGBFillColor (context, 1.0f, 1.0f, 1.0f, 1.0f);
+      CGContextSetBlendMode (context, kCGBlendModeDifference);
+      CGContextFillRect (context, mac_rect_make (f, x, y, width, height));
+      mac_end_cg_clip (f);
+    }
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 1040 && MAC_OS_X_VERSION_MIN_REQUIRED >= 1020
+  else                         /* CGContextSetBlendMode == NULL */
+#endif
+#endif /* USE_CG_DRAWING && MAC_OS_X_VERSION_MAX_ALLOWED >= 1040 */
+#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)
+    {
+      Rect r;
 
 #if USE_CG_DRAWING
   mac_prepare_for_quickdraw (f);
@@ -1018,7 +1038,7 @@ mac_draw_image_string_atsui (f, gc, x, y, buf, nchars, bg_width,
   else
     {
       static CGContextRef context;
-      float port_height = FRAME_PIXEL_HEIGHT (f);
+      CGFloat port_height = FRAME_PIXEL_HEIGHT (f);
       static const ATSUAttributeTag tags[] = {kATSUCGContextTag};
       static const ByteCount sizes[] = {sizeof (CGContextRef)};
       static const ATSUAttributeValuePtr values[] = {&context};
@@ -1042,9 +1062,10 @@ mac_draw_image_string_atsui (f, gc, x, y, buf, nchars, bg_width,
            {
              CG_SET_FILL_COLOR_WITH_GC_BACKGROUND (context, gc);
              CGContextFillRect (context,
-                                CGRectMake (x, y - FONT_BASE (GC_FONT (gc)),
-                                            bg_width,
-                                            FONT_HEIGHT (GC_FONT (gc))));
+                                mac_rect_make (f,
+                                               x, y - FONT_BASE (GC_FONT (gc)),
+                                               bg_width,
+                                               FONT_HEIGHT (GC_FONT (gc))));
            }
          CGContextScaleCTM (context, 1, -1);
          CGContextTranslateCTM (context, 0, -port_height);
@@ -1388,7 +1409,7 @@ mac_draw_image_string_cg (f, gc, x, y, buf, nchars, bg_width, overstrike_p)
      XChar2b *buf;
      int nchars, bg_width, overstrike_p;
 {
-  float port_height, gx, gy;
+  CGFloat port_height, gx, gy;
   int i;
   CGContextRef context;
   CGGlyph *glyphs;
@@ -1430,8 +1451,8 @@ mac_draw_image_string_cg (f, gc, x, y, buf, nchars, bg_width, overstrike_p)
          CG_SET_FILL_COLOR_WITH_GC_BACKGROUND (context, gc);
          CGContextFillRect
            (context,
-            CGRectMake (gx, y - FONT_BASE (GC_FONT (gc)),
-                        bg_width, FONT_HEIGHT (GC_FONT (gc))));
+            mac_rect_make (f, gx, y - FONT_BASE (GC_FONT (gc)),
+                           bg_width, FONT_HEIGHT (GC_FONT (gc))));
        }
       CGContextScaleCTM (context, 1, -1);
       CGContextTranslateCTM (context, 0, -port_height);
@@ -1733,7 +1754,7 @@ XSetForeground (display, gc, color)
            }
          else
            {
-             float rgba[4];
+             CGFloat rgba[4];
 
              rgba[0] = gc->fore_color.red / 65535.0f;
              rgba[1] = gc->fore_color.green / 65535.0f;
@@ -1774,7 +1795,7 @@ XSetBackground (display, gc, color)
            }
          else
            {
-             float rgba[4];
+             CGFloat rgba[4];
 
              rgba[0] = gc->back_color.red / 65535.0f;
              rgba[1] = gc->back_color.green / 65535.0f;
@@ -1803,8 +1824,8 @@ XSetFont (display, gc, font)
 /* Mac replacement for XSetClipRectangles.  */
 
 static void
-mac_set_clip_rectangles (display, gc, rectangles, n)
-     Display *display;
+mac_set_clip_rectangles (f, gc, rectangles, n)
+     struct frame *f;
      GC gc;
      Rect *rectangles;
      int n;
@@ -1836,9 +1857,9 @@ mac_set_clip_rectangles (display, gc, rectangles, n)
     {
       Rect *rect = rectangles + i;
 
-      gc->clip_rects[i] = CGRectMake (rect->left, rect->top,
-                                     rect->right - rect->left,
-                                     rect->bottom - rect->top);
+      gc->clip_rects[i] = mac_rect_make (f, rect->left, rect->top,
+                                        rect->right - rect->left,
+                                        rect->bottom - rect->top);
     }
 #endif
 }
@@ -1847,8 +1868,8 @@ mac_set_clip_rectangles (display, gc, rectangles, n)
 /* Mac replacement for XSetClipMask.  */
 
 static INLINE void
-mac_reset_clip_rectangles (display, gc)
-     Display *display;
+mac_reset_clip_rectangles (f, gc)
+     struct frame *f;
      GC gc;
 {
   gc->n_clip_rects = 0;
@@ -2338,7 +2359,7 @@ x_draw_fringe_bitmap (w, row, p)
       XSetForeground (display, face->gc, gcv.foreground);
     }
 
-  mac_reset_clip_rectangles (display, face->gc);
+  mac_reset_clip_rectangles (f, face->gc);
 }
 
 #if USE_CG_DRAWING
@@ -2852,7 +2873,7 @@ x_set_glyph_string_clipping (s)
   int n;
 
   n = get_glyph_string_clip_rects (s, rects, MAX_CLIP_RECTS);
-  mac_set_clip_rectangles (s->display, s->gc, rects, n);
+  mac_set_clip_rectangles (s->f, s->gc, rects, n);
 }
 
 
@@ -3442,7 +3463,7 @@ x_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width,
     gc = f->output_data.mac->white_relief.gc;
   else
     gc = f->output_data.mac->black_relief.gc;
-  mac_set_clip_rectangles (dpy, gc, clip_rect, 1);
+  mac_set_clip_rectangles (f, gc, clip_rect, 1);
 
   /* Top.  */
   if (top_p)
@@ -3457,12 +3478,12 @@ x_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width,
       mac_draw_line (f, gc,
                     left_x + i, top_y + i, left_x + i, bottom_y - i + 1);
 
-  mac_reset_clip_rectangles (dpy, gc);
+  mac_reset_clip_rectangles (f, gc);
   if (raised_p)
     gc = f->output_data.mac->black_relief.gc;
   else
     gc = f->output_data.mac->white_relief.gc;
-  mac_set_clip_rectangles (dpy, gc, clip_rect, 1);
+  mac_set_clip_rectangles (f, gc, clip_rect, 1);
 
   /* Bottom.  */
   if (bot_p)
@@ -3477,7 +3498,7 @@ x_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width,
       mac_draw_line (f, gc,
                     right_x - i, top_y + i + 1, right_x - i, bottom_y - i);
 
-  mac_reset_clip_rectangles (dpy, gc);
+  mac_reset_clip_rectangles (f, gc);
 }
 
 
@@ -3499,7 +3520,7 @@ x_draw_box_rect (s, left_x, top_y, right_x, bottom_y, width,
 
   XGetGCValues (s->display, s->gc, GCForeground, &xgcv);
   XSetForeground (s->display, s->gc, s->face->box_color);
-  mac_set_clip_rectangles (s->display, s->gc, clip_rect, 1);
+  mac_set_clip_rectangles (s->f, s->gc, clip_rect, 1);
 
   /* Top.  */
   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,
                        top_y, width, bottom_y - top_y + 1);
 
   XSetForeground (s->display, s->gc, xgcv.foreground);
-  mac_reset_clip_rectangles (s->display, s->gc);
+  mac_reset_clip_rectangles (s->f, s->gc);
 }
 
 
@@ -3829,7 +3850,7 @@ x_draw_stretch_glyph_string (s)
            gc = s->face->gc;
 
          get_glyph_string_clip_rect (s, &r);
-         mac_set_clip_rectangles (s->display, gc, &r, 1);
+         mac_set_clip_rectangles (s->f, gc, &r, 1);
 
 #if 0 /* MAC_TODO: stipple */
          if (s->face->stipple)
@@ -4029,7 +4050,7 @@ x_draw_glyph_string (s)
     }
 
   /* Reset clipping.  */
-  mac_reset_clip_rectangles (s->display, s->gc);
+  mac_reset_clip_rectangles (s->f, s->gc);
 }
 
 /* Shift display to make room for inserted glyphs.   */
@@ -6409,7 +6430,7 @@ x_draw_bar_cursor (w, row, width, kind)
                            cursor_glyph->pixel_width,
                            width);
 
-      mac_reset_clip_rectangles (dpy, gc);
+      mac_reset_clip_rectangles (f, gc);
     }
 }
 
@@ -6739,7 +6760,6 @@ mac_handle_size_change (f, pixelwidth, pixelheight)
       change_frame_size (f, rows, cols, 0, 1, 0);
       FRAME_PIXEL_WIDTH (f) = pixelwidth;
       FRAME_PIXEL_HEIGHT (f) = pixelheight;
-      SET_FRAME_GARBAGED (f);
 
       /* If cursor was outside the new size, mark it as off.  */
       mark_window_cursors_off (XWINDOW (f->root_window));
@@ -6772,7 +6792,6 @@ void
 x_calc_absolute_position (f)
      struct frame *f;
 {
-  int width_diff = 0, height_diff = 0;
   int flags = f->size_hint_flags;
   Rect inner, outer;
 
@@ -6787,22 +6806,15 @@ x_calc_absolute_position (f)
   mac_get_window_bounds (f, &inner, &outer);
   UNBLOCK_INPUT;
 
-  width_diff = (outer.right - outer.left) - (inner.right - inner.left);
-  height_diff = (outer.bottom - outer.top) - (inner.bottom - inner.top);
-
   /* Treat negative positions as relative to the leftmost bottommost
      position that fits on the screen.  */
   if (flags & XNegative)
-    f->left_pos = (FRAME_MAC_DISPLAY_INFO (f)->width
-                   - width_diff
-                  - FRAME_PIXEL_WIDTH (f)
-                  + f->left_pos);
+    f->left_pos += (FRAME_MAC_DISPLAY_INFO (f)->width
+                   - (outer.right - outer.left));
 
   if (flags & YNegative)
-    f->top_pos = (FRAME_MAC_DISPLAY_INFO (f)->height
-                 - height_diff
-                 - FRAME_PIXEL_HEIGHT (f)
-                 + f->top_pos);
+    f->top_pos += (FRAME_MAC_DISPLAY_INFO (f)->height
+                  - (outer.bottom - outer.top));
 
   /* The left_pos and top_pos
      are now relative to the top and left screen edges,
index 0a4484848732424f5b58320497039208e952d799..6a000451785d00d011c758771bcc80cabb49ad4d 100644 (file)
@@ -628,9 +628,9 @@ extern void x_destroy_window P_ ((struct frame *));
 extern void x_wm_set_size_hint P_ ((struct frame *, long, int));
 extern void x_delete_display P_ ((struct x_display_info *));
 extern void mac_initialize P_ ((void));
-extern Pixmap XCreatePixmap P_ ((Display *, WindowRef, unsigned int,
+extern Pixmap XCreatePixmap P_ ((Display *, Window, unsigned int,
                                 unsigned int, unsigned int));
-extern Pixmap XCreatePixmapFromBitmapData P_ ((Display *, WindowRef, char *,
+extern Pixmap XCreatePixmapFromBitmapData P_ ((Display *, Window, char *,
                                               unsigned int, unsigned int,
                                               unsigned long, unsigned long,
                                               unsigned int));
@@ -673,13 +673,10 @@ extern void mac_clear_font_name_table P_ ((void));
 extern Lisp_Object mac_aedesc_to_lisp P_ ((const AEDesc *));
 extern OSErr mac_ae_put_lisp P_ ((AEDescList *, UInt32, Lisp_Object));
 #if TARGET_API_MAC_CARBON
-extern OSStatus create_apple_event_from_event_ref P_ ((EventRef, UInt32,
-                                                      const EventParamName *,
-                                                      const EventParamType *,
-                                                      AppleEvent *));
-extern OSErr create_apple_event_from_drag_ref P_ ((DragRef, UInt32,
-                                                  const FlavorType *,
-                                                  AppleEvent *));
+extern OSErr create_apple_event P_ ((AEEventClass, AEEventID, AppleEvent *));
+extern Lisp_Object mac_event_parameters_to_lisp P_ ((EventRef, UInt32,
+                                                    const EventParamName *,
+                                                    const EventParamType *));
 extern CFStringRef cfstring_create_with_utf8_cstring P_ ((const char *));
 extern CFStringRef cfstring_create_with_string P_ ((Lisp_Object));
 extern Lisp_Object cfdata_to_lisp P_ ((CFDataRef));
index 6b4d22049a9c0fd18d144995476912b36e9279f2..71abce23fe0422fbbc4d7e010f3b6e861f4648f3 100644 (file)
@@ -120,8 +120,6 @@ extern Lisp_Object Qtext_input;
 extern Lisp_Object Qupdate_active_input_area, Qunicode_for_key_event;
 extern Lisp_Object Vmac_ts_active_input_overlay;
 extern Lisp_Object Qbefore_string;
-extern Lisp_Object Vmac_ts_script_language_on_focus;
-extern Lisp_Object saved_ts_script_language_on_focus;
 #endif
 
 static int mac_event_to_emacs_modifiers P_ ((EventRef));
@@ -606,15 +604,15 @@ install_application_handler ()
 #if USE_MAC_TSM
   if (err == noErr)
     {
-      static const EventTypeSpec spec[] =
+      static const EventTypeSpec specs[] =
        {{kEventClassTextInput, kEventTextInputUpdateActiveInputArea},
         {kEventClassTextInput, kEventTextInputUnicodeForKeyEvent},
         {kEventClassTextInput, kEventTextInputOffsetToPos}};
 
       err = InstallApplicationEventHandler (NewEventHandlerUPP
                                            (mac_handle_text_input_event),
-                                           GetEventTypeCount (spec),
-                                           spec, NULL, NULL);
+                                           GetEventTypeCount (specs),
+                                           specs, NULL, NULL);
     }
 #endif
 
@@ -3009,8 +3007,8 @@ mac_event_to_emacs_modifiers (EventRef eventRef)
   GetEventParameter (eventRef, kEventParamKeyModifiers, typeUInt32, NULL,
                    sizeof (UInt32), NULL, &mods);
   class = GetEventClass (eventRef);
-  if (!NILP (Vmac_emulate_three_button_mouse) &&
-      (class == kEventClassMouse || class == kEventClassCommand))
+  if (!NILP (Vmac_emulate_three_button_mouse)
+      && (class == kEventClassMouse || class == kEventClassCommand))
     {
       mods &= ~(optionKey | cmdKey);
     }
@@ -3560,6 +3558,9 @@ XTread_socket (sd, expected, hold_quit)
                  OSStatus err;
                  HIViewRef ch;
 
+                 if (FrontNonFloatingWindow () != window_ptr)
+                   SelectWindow (window_ptr);
+
                  err = HIViewGetViewForMouseEvent (HIViewGetRoot (window_ptr),
                                                    eventRef, &ch);
                  /* This doesn't work on Mac OS X 10.2.  */
@@ -4248,7 +4249,6 @@ x_activate_menubar (f)
 {
   SInt32 menu_choice;
   SInt16 menu_id, menu_item;
-  extern Point saved_menu_event_location;
 
   set_frame_menubar (f, 0, 1);
   BLOCK_INPUT;
@@ -5704,6 +5704,75 @@ static pascal OSErr mac_do_receive_drag P_ ((WindowRef, void *, DragRef));
 static DragTrackingHandlerUPP mac_do_track_dragUPP = NULL;
 static DragReceiveHandlerUPP mac_do_receive_dragUPP = NULL;
 
+static OSErr
+create_apple_event_from_drag_ref (drag, num_types, types, result)
+     DragRef drag;
+     UInt32 num_types;
+     const FlavorType *types;
+     AppleEvent *result;
+{
+  OSErr err;
+  UInt16 num_items;
+  AppleEvent items;
+  long index;
+  char *buf = NULL;
+
+  err = CountDragItems (drag, &num_items);
+  if (err != noErr)
+    return err;
+  err = AECreateList (NULL, 0, false, &items);
+  if (err != noErr)
+    return err;
+
+  for (index = 1; index <= num_items; index++)
+    {
+      ItemReference item;
+      DescType desc_type = typeNull;
+      Size size;
+
+      err = GetDragItemReferenceNumber (drag, index, &item);
+      if (err == noErr)
+       {
+         int i;
+
+         for (i = 0; i < num_types; i++)
+           {
+             err = GetFlavorDataSize (drag, item, types[i], &size);
+             if (err == noErr)
+               {
+                 buf = xrealloc (buf, size);
+                 err = GetFlavorData (drag, item, types[i], buf, &size, 0);
+               }
+             if (err == noErr)
+               {
+                 desc_type = types[i];
+                 break;
+               }
+           }
+       }
+      err = AEPutPtr (&items, index, desc_type,
+                     desc_type != typeNull ? buf : NULL,
+                     desc_type != typeNull ? size : 0);
+      if (err != noErr)
+       break;
+    }
+  if (buf)
+    xfree (buf);
+
+  if (err == noErr)
+    {
+      err = create_apple_event (0, 0, result); /* Dummy class and ID.  */
+      if (err == noErr)
+       err = AEPutParamDesc (result, keyDirectObject, &items);
+      if (err != noErr)
+       AEDisposeDesc (result);
+    }
+
+  AEDisposeDesc (&items);
+
+  return err;
+}
+
 static void
 mac_store_drag_event (window, mouse_pos, modifiers, desc)
      WindowRef window;
index a04de3032e1ba6395ce178d871325c2536bc7a5b..25756087a636ed55fd5b0853d1244ea42c5da7c6 100644 (file)
--- a/src/w32.c
+++ b/src/w32.c
@@ -110,6 +110,9 @@ void globals_of_w32 ();
 extern Lisp_Object Vw32_downcase_file_names;
 extern Lisp_Object Vw32_generate_fake_inodes;
 extern Lisp_Object Vw32_get_true_file_attributes;
+/* Defined in process.c for its own purpose.  */
+extern Lisp_Object Qlocal;
+
 extern int w32_num_mouse_buttons;
 
 \f
@@ -2644,6 +2647,8 @@ stat (const char * path, struct stat * buf)
     }
 
   if (!NILP (Vw32_get_true_file_attributes)
+      && !(EQ (Vw32_get_true_file_attributes, Qlocal) && 
+          GetDriveType (name) == DRIVE_FIXED)
       /* No access rights required to get info.  */
       && (fh = CreateFile (name, 0, 0, NULL, OPEN_EXISTING,
                           FILE_FLAG_BACKUP_SEMANTICS, NULL))
index fbb4030e319c6184eef41c6f3158ad934a055fd2..0665fa28f16c1729a83e25c25bc8c1dcedc69876 100644 (file)
@@ -110,6 +110,7 @@ Lisp_Object Vw32_generate_fake_inodes;
    exactly, at the expense of slower operation.  Since true hard links
    are supported on NTFS volumes, this is only relevant on NT.  */
 Lisp_Object Vw32_get_true_file_attributes;
+extern Lisp_Object Qlocal;
 
 Lisp_Object Qhigh, Qlow;
 
@@ -2353,9 +2354,12 @@ the truename of a file can be slow.  */);
 
   DEFVAR_LISP ("w32-get-true-file-attributes", &Vw32_get_true_file_attributes,
               doc: /* Non-nil means determine accurate link count in `file-attributes'.
-Note that this option is only useful for files on NTFS volumes, where hard links
-are supported.  Moreover, it slows down `file-attributes' noticeably.  */);
-  Vw32_get_true_file_attributes = Qt;
+This option is only useful for files on NTFS volumes, where
+hard links are supported.  The default value `local' means only do
+this for files on local harddrives.  Any other non-nil value means do
+this even on remote and removable drives where the performance impact
+may be noticeable even on modern hardware.  */);
+  Vw32_get_true_file_attributes = Qlocal;
 
   staticpro (&Vw32_valid_locale_ids);
   staticpro (&Vw32_valid_codepages);