Update of /cvsroot/fink/experimental/todai/ecc/main/finkinfo/editors
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2702
Modified Files:
emacs21-carbon.info emacs21-carbon.patch
Log Message:
Add a patch to fix the Save Buffer As dialog.
Index: emacs21-carbon.patch
===================================================================
RCS file:
/cvsroot/fink/experimental/todai/ecc/main/finkinfo/editors/emacs21-carbon.patch,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- emacs21-carbon.patch 7 Apr 2005 12:31:24 -0000 1.1.1.1
+++ emacs21-carbon.patch 18 Apr 2005 19:32:06 -0000 1.2
@@ -555,8 +555,16 @@
+print ${POSTMATCH};
diff -Nru emacs-21.3.50-20041229.work/src/macfns.c emacs/src/macfns.c
--- emacs-21.3.50-20041229.work/src/macfns.c Tue Dec 28 02:27:30 2004
-+++ emacs/src/macfns.c Fri Mar 18 15:24:46 2005
-@@ -1778,6 +1778,8 @@
++++ emacs/src/macfns.c Tue Apr 19 04:21:23 2005
+@@ -55,6 +55,7 @@
+ #include <ctype.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
++#include <sys/param.h>
+
+ #include <stdlib.h>
+ #include <string.h>
+@@ -1778,6 +1779,8 @@
do_pending_window_change (0);
}
adjust_glyphs (f);
@@ -565,6 +573,174 @@
}
+@@ -4233,6 +4236,9 @@
+ File selection dialog
+ ***********************************************************************/
+
++static pascal void mac_nav_event_callback P_ ((NavEventCallbackMessage,
++ NavCBRecPtr, void *));
++
+ /**
+ There is a relatively standard way to do this using applescript to run
+ a (choose file) method. However, this doesn't do "the right thing"
+@@ -4257,8 +4263,9 @@
+ Lisp_Object file = Qnil;
+ int count = SPECPDL_INDEX ();
+ struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5, gcpro6;
+- char filename[1001];
++ char filename[MAXPATHLEN];
+ int default_filter_index = 1; /* 1: All Files, 2: Directories only */
++ static NavEventUPP mac_nav_event_callbackUPP = NULL;
+
+ GCPRO6 (prompt, dir, default_filename, mustmatch, file, only_dir_p);
+ CHECK_STRING (prompt);
+@@ -4286,16 +4293,20 @@
+ options.optionFlags |= kNavSelectAllReadableItem;
+ if (!NILP(prompt))
+ {
+- message = cfstring_create_with_utf8_cstring (SDATA (prompt));
++ message =
++ cfstring_create_with_utf8_cstring (SDATA (ENCODE_UTF_8 (prompt)));
+ options.message = message;
+ }
+ /* Don't set the application, let it use default.
+ options.clientName = CFSTR ("Emacs");
+ */
+
++ if (mac_nav_event_callbackUPP == NULL)
++ mac_nav_event_callbackUPP = NewNavEventUPP (mac_nav_event_callback);
++
+ if (!NILP (only_dir_p))
+- status = NavCreateChooseFolderDialog(&options, NULL, NULL, NULL,
+- &dialogRef);
++ status = NavCreateChooseFolderDialog(&options,
mac_nav_event_callbackUPP,
++ NULL, NULL, &dialogRef);
+ else if (NILP (mustmatch))
+ {
+ /* This is a save dialog */
+@@ -4303,42 +4314,54 @@
+ options.actionButtonLabel = CFSTR ("Ok");
+ options.windowTitle = CFSTR ("Enter name");
+
+- if (!NILP(default_filename))
++ if (STRINGP (default_filename))
+ {
+- saveName =
+- cfstring_create_with_utf8_cstring (SDATA (default_filename));
++ Lisp_Object utf8 = ENCODE_UTF_8 (default_filename);
++ char *begPtr = SDATA(utf8);
++ char *filePtr = begPtr + SBYTES(utf8);
++ while (filePtr != begPtr && !IS_DIRECTORY_SEP(filePtr[-1]))
++ filePtr--;
++ saveName = cfstring_create_with_utf8_cstring (filePtr);
+ options.saveFileName = saveName;
+ options.optionFlags |= kNavSelectDefaultLocation;
+ }
+ status = NavCreatePutFileDialog(&options,
+ 'TEXT', kNavGenericSignature,
+- NULL, NULL, &dialogRef);
++ mac_nav_event_callbackUPP, NULL,
++ &dialogRef);
+ }
+ else
+ {
+ /* This is an open dialog*/
+ status = NavCreateChooseFileDialog(&options, fileTypes,
+- NULL, NULL, NULL, NULL,
+- &dialogRef);
++ mac_nav_event_callbackUPP, NULL,
++ NULL, NULL, &dialogRef);
+ }
+
+ /* Set the default location and continue*/
+- if (status == noErr) {
+- if (!NILP(dir)) {
+- FSRef defLoc;
++ if (status == noErr)
++ {
+ AEDesc defLocAed;
+- status = FSPathMakeRef(SDATA(dir), &defLoc, NULL);
++#ifdef MAC_OSX
++ FSRef defLoc;
++ status = FSPathMakeRef(SDATA(ENCODE_FILE(dir)), &defLoc, NULL);
++#else
++ FSSpec defLoc;
++ status = posix_pathname_to_fsspec (SDATA (ENCODE_FILE (dir)), &defLoc);
++#endif
+ if (status == noErr)
+ {
++#ifdef MAC_OSX
+ AECreateDesc(typeFSRef, &defLoc, sizeof(FSRef), &defLocAed);
++#else
++ AECreateDesc(typeFSS, &defLoc, sizeof(FSSpec), &defLocAed);
++#endif
+ NavCustomControl(dialogRef, kNavCtlSetLocation, (void*) &defLocAed);
++ AEDisposeDesc(&defLocAed);
+ }
+- AEDisposeDesc(&defLocAed);
++ status = NavDialogRun(dialogRef);
+ }
+
+- status = NavDialogRun(dialogRef);
+- }
+-
+ if (saveName) CFRelease(saveName);
+ if (message) CFRelease(message);
+
+@@ -4355,11 +4378,22 @@
+ {
+ NavReplyRecord reply;
+ AEDesc aed;
++#ifdef MAC_OSX
+ FSRef fsRef;
++#else
++ FSSpec fs;
++#endif
+ status = NavDialogGetReply(dialogRef, &reply);
++
++#ifdef MAC_OSX
+ AECoerceDesc(&reply.selection, typeFSRef, &aed);
+ AEGetDescData(&aed, (void *) &fsRef, sizeof (FSRef));
+- FSRefMakePath(&fsRef, (UInt8 *) filename, 1000);
++ FSRefMakePath(&fsRef, (UInt8 *) filename, sizeof (filename));
++#else
++ AECoerceDesc (&reply.selection, typeFSS, &aed);
++ AEGetDescData (&aed, (void *) &fs, sizeof (FSSpec));
++ fsspec_to_posix_pathname (&fs, filename, sizeof (filename) - 1);
++#endif
+ AEDisposeDesc(&aed);
+ if (reply.saveFileName)
+ {
+@@ -4368,9 +4402,11 @@
+ if (len && filename[len-1] != '/')
+ filename[len++] = '/';
+ CFStringGetCString(reply.saveFileName, filename+len,
+- 1000-len, kCFStringEncodingUTF8);
++ sizeof (filename) - len,
++ kCFStringEncodingUTF8);
+ }
+- file = DECODE_FILE(build_string (filename));
++ file = DECODE_FILE (make_unibyte_string (filename,
++ strlen (filename)));
+ NavDisposeReply(&reply);
+ }
+ break;
+@@ -4396,6 +4432,15 @@
+ }
+
+
++/* Need to register some event callback function for enabling drag and
++ drop in Navigation Service dialogs. */
++static pascal void
++mac_nav_event_callback (selector, parms, data)
++ NavEventCallbackMessage selector;
++ NavCBRecPtr parms;
++ void *data ;
++{
++}
+ #endif
+
+ /***********************************************************************
diff -Nru emacs-21.3.50-20041229.work/src/macterm.c emacs/src/macterm.c
--- emacs-21.3.50-20041229.work/src/macterm.c Fri Mar 18 15:21:00 2005
+++ emacs/src/macterm.c Fri Mar 18 15:24:46 2005
Index: emacs21-carbon.info
===================================================================
RCS file:
/cvsroot/fink/experimental/todai/ecc/main/finkinfo/editors/emacs21-carbon.info,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- emacs21-carbon.info 7 Apr 2005 12:31:24 -0000 1.1.1.1
+++ emacs21-carbon.info 18 Apr 2005 19:32:06 -0000 1.2
@@ -1,6 +1,6 @@
Package: emacs21-carbon
Version: 21.3.50-20041229
-Revision: 3
+Revision: 4
Description: Flexible real-time text editor, v21.3, with Carbon support
License: GPL
Maintainer: Todai Fink Team <[EMAIL PROTECTED]>
@@ -151,7 +151,8 @@
produced are injected into a fresh copy of the source tree and tarred
up again.
- Original package by Christoph Pfister and Christian Swinehart
+ The Fx_file_dialog function in src/macfns.c is backported from 20050401
+ to fix bugs at the Save Buffer As dialog.
<<
DescPort: <<
The patchfile modifies startup.el, and brings in the scripts fix-info and
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Fink-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fink-commits