[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/src/mac.c
From: |
Steven Tamm |
Subject: |
[Emacs-diffs] Changes to emacs/src/mac.c |
Date: |
Sun, 10 Oct 2004 13:09:12 -0400 |
Index: emacs/src/mac.c
diff -c emacs/src/mac.c:1.22 emacs/src/mac.c:1.23
*** emacs/src/mac.c:1.22 Fri Oct 8 18:38:17 2004
--- emacs/src/mac.c Sun Oct 10 16:56:21 2004
***************
*** 47,52 ****
--- 47,54 ----
#undef realloc
#undef init_process
#include <Carbon/Carbon.h>
+ #undef mktime
+ #define mktime emacs_mktime
#undef free
#define free unexec_free
#undef malloc
***************
*** 73,78 ****
--- 75,81 ----
#include "process.h"
#include "sysselect.h"
#include "systime.h"
+ #include "blockinput.h"
Lisp_Object QCLIPBOARD;
***************
*** 2548,2554 ****
--- 2551,2559 ----
CHECK_STRING (script);
+ BLOCK_INPUT;
status = do_applescript (SDATA (script), &result);
+ UNBLOCK_INPUT;
if (status)
{
if (!result)
***************
*** 2618,2643 ****
()
{
#if TARGET_API_MAC_CARBON
ScrapRef scrap;
ScrapFlavorFlags sff;
Size s;
int i;
char *data;
! if (GetCurrentScrap (&scrap) != noErr)
! return Qnil;
!
! if (GetScrapFlavorFlags (scrap, kScrapFlavorTypeText, &sff) != noErr)
! return Qnil;
!
! if (GetScrapFlavorSize (scrap, kScrapFlavorTypeText, &s) != noErr)
! return Qnil;
!
! if ((data = (char*) alloca (s)) == NULL)
! return Qnil;
!
! if (GetScrapFlavorData (scrap, kScrapFlavorTypeText, &s, data) != noErr
! || s == 0)
return Qnil;
/* Emacs expects clipboard contents have Unix-style eol's */
--- 2623,2645 ----
()
{
#if TARGET_API_MAC_CARBON
+ OSStatus err;
ScrapRef scrap;
ScrapFlavorFlags sff;
Size s;
int i;
char *data;
! BLOCK_INPUT;
! err = GetCurrentScrap (&scrap);
! if (err == noErr)
! err = GetScrapFlavorFlags (scrap, kScrapFlavorTypeText, &sff);
! if (err == noErr)
! err = GetScrapFlavorSize (scrap, kScrapFlavorTypeText, &s);
! if (err == noErr && (data = (char*) alloca (s)))
! err = GetScrapFlavorData (scrap, kScrapFlavorTypeText, &s, data);
! UNBLOCK_INPUT;
! if (err != noErr || s == 0)
return Qnil;
/* Emacs expects clipboard contents have Unix-style eol's */
***************
*** 2702,2714 ****
#if TARGET_API_MAC_CARBON
{
ScrapRef scrap;
ClearCurrentScrap ();
if (GetCurrentScrap (&scrap) != noErr)
! error ("cannot get current scrap");
if (PutScrapFlavor (scrap, kScrapFlavorTypeText, kScrapFlavorMaskNone,
len,
buf) != noErr)
! error ("cannot put to scrap");
}
#else /* not TARGET_API_MAC_CARBON */
ZeroScrap ();
--- 2704,2725 ----
#if TARGET_API_MAC_CARBON
{
ScrapRef scrap;
+
+ BLOCK_INPUT;
ClearCurrentScrap ();
if (GetCurrentScrap (&scrap) != noErr)
! {
! UNBLOCK_INPUT;
! error ("cannot get current scrap");
! }
if (PutScrapFlavor (scrap, kScrapFlavorTypeText, kScrapFlavorMaskNone,
len,
buf) != noErr)
! {
! UNBLOCK_INPUT;
! error ("cannot put to scrap");
! }
! UNBLOCK_INPUT;
}
#else /* not TARGET_API_MAC_CARBON */
ZeroScrap ();
***************
*** 2743,2751 ****
--- 2754,2764 ----
ScrapRef scrap;
ScrapFlavorFlags sff;
+ BLOCK_INPUT;
if (GetCurrentScrap (&scrap) == noErr)
if (GetScrapFlavorFlags (scrap, kScrapFlavorTypeText, &sff) == noErr)
val = Qt;
+ UNBLOCK_INPUT;
#else /* not TARGET_API_MAC_CARBON */
Handle my_handle;
long rc, scrap_offset;
***************
*** 2770,2777 ****
extern int inhibit_window_system;
extern int noninteractive;
- #include "blockinput.h"
-
/* When Emacs is started from the Finder, SELECT always immediately
returns as if input is present when file descriptor 0 is polled for
input. Strangely, when Emacs is run as a GUI application from the
--- 2783,2788 ----