]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix selection for old GNUstep and GCC
authorAlan Third <alan@idiocy.org>
Thu, 25 Nov 2021 20:58:37 +0000 (20:58 +0000)
committerAlan Third <alan@idiocy.org>
Thu, 25 Nov 2021 21:04:50 +0000 (21:04 +0000)
* src/nsselect.m (ns_get_foreign_selection): Remove language features
not yet supported by GCC.  Be more selective with which pasteboard
types we use.
* src/nsterm.h: Set up some more #defines for deprecated variables.

src/nsselect.m
src/nsterm.h

index e999835014d03b64535037a558f89770dc02112c..8b23f6f51ad573d0cf47e5905a69d4802d40a3cd 100644 (file)
@@ -215,7 +215,7 @@ ns_get_local_selection (Lisp_Object selection_name,
 static Lisp_Object
 ns_get_foreign_selection (Lisp_Object symbol, Lisp_Object target)
 {
-  NSDictionary<NSString *, NSString *> *typeLookup;
+  NSDictionary *typeLookup;
   id pb;
   pb = ns_symbol_to_pb (symbol);
 
@@ -229,10 +229,14 @@ ns_get_foreign_selection (Lisp_Object symbol, Lisp_Object target)
 #else
              @"text/plain",        NSFilenamesPboardType,
 #endif
-             @"text/html",         NSPasteboardTypeHTML,
+#ifdef NS_IMPL_COCOA
+             /* FIXME: I believe these are actually available in recent
+                versions of GNUstep.  */
              @"text/plain",        NSPasteboardTypeMultipleTextSelection,
-             @"application/pdf",   NSPasteboardTypePDF,
              @"image/png",         NSPasteboardTypePNG,
+#endif
+             @"text/html",         NSPasteboardTypeHTML,
+             @"application/pdf",   NSPasteboardTypePDF,
              @"application/rtf",   NSPasteboardTypeRTF,
              @"application/rtfd",  NSPasteboardTypeRTFD,
              @"STRING",            NSPasteboardTypeString,
@@ -272,7 +276,7 @@ ns_get_foreign_selection (Lisp_Object symbol, Lisp_Object target)
           = [typeLookup allKeysForObject:
                           [NSString stringWithLispString:SYMBOL_NAME (target)]];
       else
-        availableTypes = @[NSPasteboardTypeString];
+        availableTypes = [NSArray arrayWithObject:NSPasteboardTypeString];
 
       t = [pb availableTypeFromArray:availableTypes];
 
index 8175f9966440d5bafdb31f76a828aae684683aec..a32b8fe149c4e2ab47449720bff3e56058ebd777 100644 (file)
@@ -1346,9 +1346,18 @@ enum NSWindowTabbingMode
 
 #if !defined (NS_IMPL_COCOA) || !defined (MAC_OS_X_VERSION_10_14)
 /* Deprecated in macOS 10.14.  */
+/* FIXME: Some of these new names, if not all, are actually available
+   in some recent version of GNUstep.  */
 #define NSPasteboardTypeString NSStringPboardType
 #define NSPasteboardTypeTabularText NSTabularTextPboardType
 #define NSPasteboardTypeURL NSURLPboardType
+#define NSPasteboardTypeHTML NSHTMLPboardType
+#define NSPasteboardTypeMultipleTextSelection NSMultipleTextSelectionPboardType
+#define NSPasteboardTypePDF NSPDFPboardType
+#define NSPasteboardTypePNG NSPNGPboardType
+#define NSPasteboardTypeRTF NSRTFPboardType
+#define NSPasteboardTypeRTFD NSRTFDPboardType
+#define NSPasteboardTypeTIFF NSTIFFPboardType
 #define NSControlStateValueOn NSOnState
 #define NSControlStateValueOff NSOffState
 #define NSBezelStyleRounded NSRoundedBezelStyle