(define-key global-map [?\s-z] 'undo)
(define-key global-map [?\s-|] 'shell-command-on-region)
(define-key global-map [s-kp-bar] 'shell-command-on-region)
+(define-key global-map [C-s- ] 'ns-do-show-character-palette)
+(define-key key-translation-map [C-s-268632064] [C-s- ])
;; (as in Terminal.app)
(define-key global-map [s-right] 'ns-next-frame)
(define-key global-map [s-left] 'ns-prev-frame)
(interactive)
(ns-emacs-info-panel))
+(declare-function ns-show-character-palette "nsfns.m" ())
+
+(defun ns-do-show-character-palette ()
+ (interactive)
+ (ns-show-character-palette))
+
(defun ns-next-frame ()
"Switch to next visible frame."
(interactive)
(pt.y - screen.frame.origin.y)));
}
+DEFUN ("ns-show-character-palette",
+ Fns_show_character_palette,
+ Sns_show_character_palette, 0, 0, 0,
+ doc: /* Show the macOS character palette. */)
+ (void)
+{
+ struct frame *f = SELECTED_FRAME ();
+ EmacsView *view = FRAME_NS_VIEW (f);
+ [NSApp orderFrontCharacterPalette:view];
+
+ return Qnil;
+}
+
/* ==========================================================================
Class implementations
defsubr (&Sns_frame_restack);
defsubr (&Sns_set_mouse_absolute_pixel_position);
defsubr (&Sns_mouse_absolute_pixel_position);
+ defsubr (&Sns_show_character_palette);
defsubr (&Sx_display_mm_width);
defsubr (&Sx_display_mm_height);
defsubr (&Sx_display_screens);
by doCommandBySelector: deleteBackward: */
- (void)insertText: (id)aString
{
- NSString *s = aString;
- NSUInteger len = [s length];
+ NSString *s;
+ NSUInteger len;
NSTRACE ("[EmacsView insertText:]");
+ if ([aString isKindOfClass:[NSAttributedString class]])
+ s = [aString string];
+ else
+ s = aString;
+
+ len = [s length];
+
if (NS_KEYLOG)
NSLog (@"insertText '%@'\tlen = %lu", aString, (unsigned long) len);
processingCompose = NO;