From 158835668dffcad0c5668dd01200f2737972bb3e Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 27 Jul 2024 15:56:47 +0300 Subject: [PATCH 1/5] ; * doc/lispref/modes.texi (Mode Line Data): Fix formatting. --- doc/lispref/modes.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From abefd9514bcf9d8de9d9e7f000ef55fad0d822fb Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Mon, 29 Jul 2024 21:16:16 +0300 Subject: [PATCH 2/5] * lisp/tab-bar.el (tab-bar-move-tab-to-group): Fix for a new group's tab. Move tab with a new group to the end of the tab bar (bug#72352) Suggested by Ship Mints --- lisp/tab-bar.el | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index edec6543a82..60d5bbf169b 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el @@ -2229,14 +2229,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))))) From 9f7c1ace9f86e4b657030a6e94c5d6aadc586878 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerd=20M=C3=B6llmann?= Date: Thu, 25 Jul 2024 09:20:04 +0200 Subject: [PATCH 3/5] NS: Set frame position when entering/exiting fullscreen (bug#71912) * src/nsterm.h ([EmacsView adjustEmacsRectRect]): Declare. * src/nsterm.m ([EmacsView windowDidEnterFullScreen]): New method. ([EmacsView windowDidEnterFullScreen]): Call it. ([EmacsView windowDidExitFullScreen]): Call it. --- src/nsterm.h | 1 + src/nsterm.m | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/src/nsterm.h b/src/nsterm.h index 3a713f8e8c9..e3f55c4e41c 100644 --- a/src/nsterm.h +++ b/src/nsterm.h @@ -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..8a0c12c7369 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -8318,6 +8318,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 +8356,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 +8402,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 From ceb5a1522270c41d0c9f5e6b52d61e3173f72f1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerd=20M=C3=B6llmann?= Date: Tue, 30 Jul 2024 07:47:44 +0200 Subject: [PATCH 4/5] MacOS: Let EmacsView implement NSTextInputClient * src/nsterm.h (@interface EmacsView): Implement NSTextInputClient protocol. * src/nsterm.m: Implement required NSTextInputClient methods, forwarding to existing NSTextInput methods. --- src/nsterm.h | 2 +- src/nsterm.m | 41 ++++++++++++++++++++++++++++++++++++++++- 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/src/nsterm.h b/src/nsterm.h index e3f55c4e41c..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 diff --git a/src/nsterm.m b/src/nsterm.m index 8a0c12c7369..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: */ From 1154d8aafe2f4702b8fc775835f830fd00cfbaaf Mon Sep 17 00:00:00 2001 From: Po Lu Date: Thu, 1 Aug 2024 08:23:36 +0800 Subject: [PATCH 5/5] Better resolve bug#72188 * lisp/international/fontset.el (setup-default-fontset) : Don't search for fonts matching the `han' script elsewhere than on Android, which restores the status quo existing in Emacs 29. (bug#72188) --- lisp/international/fontset.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lisp/international/fontset.el b/lisp/international/fontset.el index 33e444507c4..d60349e05e3 100644 --- a/lisp/international/fontset.el +++ b/lisp/international/fontset.el @@ -697,10 +697,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*")