[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/src/mac.c [emacs-unicode-2]
From: |
Miles Bader |
Subject: |
[Emacs-diffs] Changes to emacs/src/mac.c [emacs-unicode-2] |
Date: |
Thu, 14 Oct 2004 05:13:28 -0400 |
Index: emacs/src/mac.c
diff -c emacs/src/mac.c:1.16.4.2 emacs/src/mac.c:1.16.4.3
*** emacs/src/mac.c:1.16.4.2 Fri Jul 23 04:30:41 2004
--- emacs/src/mac.c Thu Oct 14 08:49:53 2004
***************
*** 24,29 ****
--- 24,30 ----
#include <stdio.h>
#include <errno.h>
+ #include <time.h>
#include <utime.h>
#include <dirent.h>
#include <sys/types.h>
***************
*** 46,51 ****
--- 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
***************
*** 72,77 ****
--- 75,81 ----
#include "process.h"
#include "sysselect.h"
#include "systime.h"
+ #include "blockinput.h"
Lisp_Object QCLIPBOARD;
***************
*** 2547,2553 ****
--- 2551,2559 ----
CHECK_STRING (script);
+ BLOCK_INPUT;
status = do_applescript (SDATA (script), &result);
+ UNBLOCK_INPUT;
if (status)
{
if (!result)
***************
*** 2617,2642 ****
()
{
#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 */
***************
*** 2701,2713 ****
#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 ();
***************
*** 2742,2750 ****
--- 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;
***************
*** 2769,2776 ****
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 ----
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] Changes to emacs/src/mac.c [emacs-unicode-2],
Miles Bader <=