Merge from savannah/emacs-30

1154d8aafe Better resolve bug#72188
ceb5a15222 MacOS: Let EmacsView implement NSTextInputClient
9f7c1ace9f NS: Set frame position when entering/exiting fullscreen (...
74fe889a93 Merge branch 'emacs-30' of git.savannah.gnu.org:/srv/git/...
abefd9514b * lisp/tab-bar.el (tab-bar-move-tab-to-group): Fix for a ...
e09982f8f5 Merge branch 'emacs-30' of git.savannah.gnu.org:/srv/git/...
5cf64d8377 Fix sporadic crashes and `select' failures in dumped images
a475360af9 Correct display of Doc View documents after tab switching
b0d927e1dc Merge branch 'emacs-30' of git.savannah.gnu.org:/srv/git/...
469bc7c968 Use 'kill-process' as a fallback when a pipe gets broken ...
158835668d ; * doc/lispref/modes.texi (Mode Line Data): Fix formatting.
This commit is contained in:
Po Lu 2024-08-01 08:25:31 +08:00
commit 96097d3623
5 changed files with 75 additions and 15 deletions

View file

@ -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

View file

@ -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*")

View file

@ -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)))))

View file

@ -463,7 +463,7 @@ enum ns_return_frame_mode
@class EmacsLayer;
#ifdef NS_IMPL_COCOA
@interface EmacsView : NSView <NSTextInput, NSWindowDelegate>
@interface EmacsView : NSView <NSTextInput, NSTextInputClient, NSWindowDelegate>
#else
@interface EmacsView : NSView <NSTextInput>
#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;

View file

@ -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
***********************************************************************/
/* <NSTextInput> implementation (called through [super interpretKeyEvents:]). */
/* <NSTextInput>: 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