diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi index 7c7823b5f9b..27b74a9d233 100644 --- a/doc/lispref/modes.texi +++ b/doc/lispref/modes.texi @@ -2259,7 +2259,7 @@ space filled on the right if its width is less than @var{width}. When @minus{}@var{width} columns if its width exceeds @minus{}@var{width}. For example, the usual way to show what percentage of a buffer is above -the top of the window is to use a list like this: @code{(-3 "%p")}. +the top of the window is to use a list like this: @w{@code{(-3 "%p")}}. @end table @node Mode Line Top diff --git a/lisp/international/fontset.el b/lisp/international/fontset.el index d4e24899d11..3e16e1f35bd 100644 --- a/lisp/international/fontset.el +++ b/lisp/international/fontset.el @@ -700,10 +700,11 @@ (nil . "JISX0213.2004-1") ,(font-spec :registry "iso10646-1" :lang 'ja) ,(font-spec :registry "iso10646-1" :lang 'zh) - ;; This is required, as otherwise many TrueType fonts with - ;; CJK characters but no corresponding ``design language'' - ;; declaration can't be found. - ,(font-spec :registry "iso10646-1" :script 'han)) + ;; This is required on Android, as otherwise many TrueType + ;; fonts with CJK characters but no corresponding ``design + ;; language'' declaration can't be found. + ,@(and (featurep 'android) + (list (font-spec :registry "iso10646-1" :script 'han)))) (cjk-misc (nil . "GB2312.1980-0") (nil . "JISX0208*") diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index db7bd7ca51f..b9726459b51 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el @@ -2248,14 +2248,16 @@ function `tab-bar-tab-name-function'." (seq-position (nthcdr beg tabs) group (lambda (tb gr) (not (equal (alist-get 'group tb) gr)))))) - (pos (when beg - (cond - ;; Don't move tab when it's already inside group bounds - ((and len (>= tab-index beg) (<= tab-index (+ beg len))) nil) - ;; Move tab from the right to the group end - ((and len (> tab-index (+ beg len))) (+ beg len 1)) - ;; Move tab from the left to the group beginning - ((< tab-index beg) beg))))) + (pos (if beg + (cond + ;; Don't move tab when it's already inside group bounds + ((and len (>= tab-index beg) (<= tab-index (+ beg len))) nil) + ;; Move tab from the right to the group end + ((and len (> tab-index (+ beg len))) (+ beg len 1)) + ;; Move tab from the left to the group beginning + ((< tab-index beg) beg)) + ;; Move tab with a new group to the end + -1))) (when pos (tab-bar-move-tab-to pos (1+ tab-index))))) diff --git a/src/nsterm.h b/src/nsterm.h index 3a713f8e8c9..a07829a36ec 100644 --- a/src/nsterm.h +++ b/src/nsterm.h @@ -463,7 +463,7 @@ enum ns_return_frame_mode @class EmacsLayer; #ifdef NS_IMPL_COCOA -@interface EmacsView : NSView +@interface EmacsView : NSView #else @interface EmacsView : NSView #endif @@ -522,6 +522,7 @@ enum ns_return_frame_mode - (void)copyRect:(NSRect)srcRect to:(NSPoint)dest; /* Non-notification versions of NSView methods. Used for direct calls. */ +- (void)adjustEmacsFrameRect; - (void)windowWillEnterFullScreen; - (void)windowDidEnterFullScreen; - (void)windowWillExitFullScreen; diff --git a/src/nsterm.m b/src/nsterm.m index d25f216edd4..b56c587bc69 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -7032,10 +7032,49 @@ In that case we use UCKeyTranslate (ns_get_shifted_character) [nsEvArray removeObject: theEvent]; } +/*********************************************************************** + NSTextInputClient + ***********************************************************************/ + +#ifdef NS_IMPL_COCOA + +- (void) insertText: (id) string + replacementRange: (NSRange) replacementRange +{ + if ([string isKindOfClass:[NSAttributedString class]]) + string = [string string]; + [self unmarkText]; + [self insertText:string]; +} + +- (void) setMarkedText: (id) string + selectedRange: (NSRange) selectedRange + replacementRange: (NSRange) replacementRange +{ + [self setMarkedText: string selectedRange: selectedRange]; +} + +- (nullable NSAttributedString *) + attributedSubstringForProposedRange: (NSRange) range + actualRange: (nullable NSRangePointer) actualRange +{ + return nil; +} + +- (NSRect) firstRectForCharacterRange: (NSRange) range + actualRange: (nullable NSRangePointer) actualRange +{ + return NSZeroRect; +} + +#endif /* NS_IMPL_COCOA */ + +/*********************************************************************** + NSTextInput + ***********************************************************************/ /* implementation (called through [super interpretKeyEvents:]). */ - /* : called when done composing; NOTE: also called when we delete over working text, followed immediately by doCommandBySelector: deleteBackward: */ @@ -8318,6 +8357,15 @@ - (void)windowDidEnterFullScreen:(NSNotification *)notification [self windowDidEnterFullScreen]; } +- (void)adjustEmacsFrameRect +{ + struct frame *f = emacsframe; + NSWindow *frame_window = [FRAME_NS_VIEW (f) window]; + NSRect r = [frame_window frame]; + f->left_pos = NSMinX (r) - NS_PARENT_WINDOW_LEFT_POS (f); + f->top_pos = NS_PARENT_WINDOW_TOP_POS (f) - NSMaxY (r); +} + - (void)windowDidEnterFullScreen /* provided for direct calls */ { NSTRACE ("[EmacsView windowDidEnterFullScreen]"); @@ -8347,6 +8395,10 @@ - (void)windowDidEnterFullScreen /* provided for direct calls */ } #endif } + + /* Do what windowDidMove does which isn't called when entering/exiting + fullscreen mode. */ + [self adjustEmacsFrameRect]; } - (void)windowWillExitFullScreen:(NSNotification *)notification @@ -8389,6 +8441,10 @@ - (void)windowDidExitFullScreen /* provided for direct calls */ if (next_maximized != -1) [[self window] performZoom:self]; + + /* Do what windowDidMove does which isn't called when entering/exiting + fullscreen mode. */ + [self adjustEmacsFrameRect]; } - (BOOL)fsIsNative