From b4911a6f0da0bfae3832b3aa0c111db4bb2f49d5 Mon Sep 17 00:00:00 2001 From: Alan Third Date: Mon, 2 Mar 2020 17:54:32 +0000 Subject: Fix macOS/GNUstep compilation warnings * src/nsfns.m (handlePanelKeys): Unused function. * src/nsterm.m (ns_set_appearance): ([EmacsView initFrameFromEmacs:]): Use EmacsWindow type instead of NSWindow. (ns_clip_to_row): Unused function. (ns_dumpglyphs_stretch): Remove unused variable. (ns_term_init): ([EmacsWindow setAppearance]): Only compile on macOS. (ns_mouse_position): Make sure f is initialised on GNUstep. * src/emacs.c (main): Move allocation of autorelease pool to before first use. --- src/nsfns.m | 74 ------------------------------------------------------------- 1 file changed, 74 deletions(-) (limited to 'src/nsfns.m') diff --git a/src/nsfns.m b/src/nsfns.m index cbde93b3f10..f6e7f4e9acb 100644 --- a/src/nsfns.m +++ b/src/nsfns.m @@ -3012,80 +3012,6 @@ DEFUN ("ns-show-character-palette", ========================================================================== */ -/* - Handle arrow/function/control keys and copy/paste/cut in file dialogs. - Return YES if handled, NO if not. - */ -static BOOL -handlePanelKeys (NSSavePanel *panel, NSEvent *theEvent) -{ - NSString *s; - int i; - BOOL ret = NO; - - if ([theEvent type] != NSEventTypeKeyDown) return NO; - s = [theEvent characters]; - - for (i = 0; i < [s length]; ++i) - { - int ch = (int) [s characterAtIndex: i]; - switch (ch) - { - case NSHomeFunctionKey: - case NSDownArrowFunctionKey: - case NSUpArrowFunctionKey: - case NSLeftArrowFunctionKey: - case NSRightArrowFunctionKey: - case NSPageUpFunctionKey: - case NSPageDownFunctionKey: - case NSEndFunctionKey: - /* Don't send command modified keys, as those are handled in the - performKeyEquivalent method of the super class. */ - if (! ([theEvent modifierFlags] & NSEventModifierFlagCommand)) - { - [panel sendEvent: theEvent]; - ret = YES; - } - break; - /* As we don't have the standard key commands for - copy/paste/cut/select-all in our edit menu, we must handle - them here. TODO: handle Emacs key bindings for copy/cut/select-all - here, paste works, because we have that in our Edit menu. - I.e. refactor out code in nsterm.m, keyDown: to figure out the - correct modifier. */ - case 'x': // Cut - case 'c': // Copy - case 'v': // Paste - case 'a': // Select all - if ([theEvent modifierFlags] & NSEventModifierFlagCommand) - { - [NSApp sendAction: - (ch == 'x' - ? @selector(cut:) - : (ch == 'c' - ? @selector(copy:) - : (ch == 'v' - ? @selector(paste:) - : @selector(selectAll:)))) - to:nil from:panel]; - ret = YES; - } - default: - // Send all control keys, as the text field supports C-a, C-f, C-e - // C-b and more. - if ([theEvent modifierFlags] & NSEventModifierFlagControl) - { - [panel sendEvent: theEvent]; - ret = YES; - } - break; - } - } - - - return ret; -} - @implementation EmacsFileDelegate /* -------------------------------------------------------------------------- Delegate methods for Open/Save panels -- cgit v1.2.1