diff options
| author | Po Lu | 2024-08-01 08:25:31 +0800 |
|---|---|---|
| committer | Po Lu | 2024-08-01 08:25:31 +0800 |
| commit | 96097d362322595e308157ff70f191ef2b49640d (patch) | |
| tree | 095ad24c7f807cc69350b5336172c493f2621e52 | |
| parent | d00eb0468b147f2bfcb58bc586801f0495f5973d (diff) | |
| parent | 1154d8aafe2f4702b8fc775835f830fd00cfbaaf (diff) | |
| download | emacs-96097d362322595e308157ff70f191ef2b49640d.tar.gz emacs-96097d362322595e308157ff70f191ef2b49640d.zip | |
Merge from savannah/emacs-30
1154d8aafe2 Better resolve bug#72188
ceb5a152227 MacOS: Let EmacsView implement NSTextInputClient
9f7c1ace9f8 NS: Set frame position when entering/exiting fullscreen (...
74fe889a93f Merge branch 'emacs-30' of git.savannah.gnu.org:/srv/git/...
abefd9514bc * lisp/tab-bar.el (tab-bar-move-tab-to-group): Fix for a ...
e09982f8f5a Merge branch 'emacs-30' of git.savannah.gnu.org:/srv/git/...
5cf64d8377a Fix sporadic crashes and `select' failures in dumped images
a475360af98 Correct display of Doc View documents after tab switching
b0d927e1dce Merge branch 'emacs-30' of git.savannah.gnu.org:/srv/git/...
469bc7c9686 Use 'kill-process' as a fallback when a pipe gets broken ...
158835668df ; * doc/lispref/modes.texi (Mode Line Data): Fix formatting.
| -rw-r--r-- | doc/lispref/modes.texi | 2 | ||||
| -rw-r--r-- | lisp/international/fontset.el | 9 | ||||
| -rw-r--r-- | lisp/tab-bar.el | 18 | ||||
| -rw-r--r-- | src/nsterm.h | 3 | ||||
| -rw-r--r-- | src/nsterm.m | 58 |
5 files changed, 75 insertions, 15 deletions
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 | |||
| 2259 | @minus{}@var{width} columns if its width exceeds @minus{}@var{width}. | 2259 | @minus{}@var{width} columns if its width exceeds @minus{}@var{width}. |
| 2260 | 2260 | ||
| 2261 | For example, the usual way to show what percentage of a buffer is above | 2261 | For example, the usual way to show what percentage of a buffer is above |
| 2262 | the top of the window is to use a list like this: @code{(-3 "%p")}. | 2262 | the top of the window is to use a list like this: @w{@code{(-3 "%p")}}. |
| 2263 | @end table | 2263 | @end table |
| 2264 | 2264 | ||
| 2265 | @node Mode Line Top | 2265 | @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 @@ | |||
| 700 | (nil . "JISX0213.2004-1") | 700 | (nil . "JISX0213.2004-1") |
| 701 | ,(font-spec :registry "iso10646-1" :lang 'ja) | 701 | ,(font-spec :registry "iso10646-1" :lang 'ja) |
| 702 | ,(font-spec :registry "iso10646-1" :lang 'zh) | 702 | ,(font-spec :registry "iso10646-1" :lang 'zh) |
| 703 | ;; This is required, as otherwise many TrueType fonts with | 703 | ;; This is required on Android, as otherwise many TrueType |
| 704 | ;; CJK characters but no corresponding ``design language'' | 704 | ;; fonts with CJK characters but no corresponding ``design |
| 705 | ;; declaration can't be found. | 705 | ;; language'' declaration can't be found. |
| 706 | ,(font-spec :registry "iso10646-1" :script 'han)) | 706 | ,@(and (featurep 'android) |
| 707 | (list (font-spec :registry "iso10646-1" :script 'han)))) | ||
| 707 | 708 | ||
| 708 | (cjk-misc (nil . "GB2312.1980-0") | 709 | (cjk-misc (nil . "GB2312.1980-0") |
| 709 | (nil . "JISX0208*") | 710 | (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'." | |||
| 2248 | (seq-position (nthcdr beg tabs) group | 2248 | (seq-position (nthcdr beg tabs) group |
| 2249 | (lambda (tb gr) | 2249 | (lambda (tb gr) |
| 2250 | (not (equal (alist-get 'group tb) gr)))))) | 2250 | (not (equal (alist-get 'group tb) gr)))))) |
| 2251 | (pos (when beg | 2251 | (pos (if beg |
| 2252 | (cond | 2252 | (cond |
| 2253 | ;; Don't move tab when it's already inside group bounds | 2253 | ;; Don't move tab when it's already inside group bounds |
| 2254 | ((and len (>= tab-index beg) (<= tab-index (+ beg len))) nil) | 2254 | ((and len (>= tab-index beg) (<= tab-index (+ beg len))) nil) |
| 2255 | ;; Move tab from the right to the group end | 2255 | ;; Move tab from the right to the group end |
| 2256 | ((and len (> tab-index (+ beg len))) (+ beg len 1)) | 2256 | ((and len (> tab-index (+ beg len))) (+ beg len 1)) |
| 2257 | ;; Move tab from the left to the group beginning | 2257 | ;; Move tab from the left to the group beginning |
| 2258 | ((< tab-index beg) beg))))) | 2258 | ((< tab-index beg) beg)) |
| 2259 | ;; Move tab with a new group to the end | ||
| 2260 | -1))) | ||
| 2259 | (when pos | 2261 | (when pos |
| 2260 | (tab-bar-move-tab-to pos (1+ tab-index))))) | 2262 | (tab-bar-move-tab-to pos (1+ tab-index))))) |
| 2261 | 2263 | ||
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 | |||
| 463 | @class EmacsLayer; | 463 | @class EmacsLayer; |
| 464 | 464 | ||
| 465 | #ifdef NS_IMPL_COCOA | 465 | #ifdef NS_IMPL_COCOA |
| 466 | @interface EmacsView : NSView <NSTextInput, NSWindowDelegate> | 466 | @interface EmacsView : NSView <NSTextInput, NSTextInputClient, NSWindowDelegate> |
| 467 | #else | 467 | #else |
| 468 | @interface EmacsView : NSView <NSTextInput> | 468 | @interface EmacsView : NSView <NSTextInput> |
| 469 | #endif | 469 | #endif |
| @@ -522,6 +522,7 @@ enum ns_return_frame_mode | |||
| 522 | - (void)copyRect:(NSRect)srcRect to:(NSPoint)dest; | 522 | - (void)copyRect:(NSRect)srcRect to:(NSPoint)dest; |
| 523 | 523 | ||
| 524 | /* Non-notification versions of NSView methods. Used for direct calls. */ | 524 | /* Non-notification versions of NSView methods. Used for direct calls. */ |
| 525 | - (void)adjustEmacsFrameRect; | ||
| 525 | - (void)windowWillEnterFullScreen; | 526 | - (void)windowWillEnterFullScreen; |
| 526 | - (void)windowDidEnterFullScreen; | 527 | - (void)windowDidEnterFullScreen; |
| 527 | - (void)windowWillExitFullScreen; | 528 | - (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,9 +7032,48 @@ ns_create_font_panel_buttons (id target, SEL select, SEL cancel_action) | |||
| 7032 | [nsEvArray removeObject: theEvent]; | 7032 | [nsEvArray removeObject: theEvent]; |
| 7033 | } | 7033 | } |
| 7034 | 7034 | ||
| 7035 | /*********************************************************************** | ||
| 7036 | NSTextInputClient | ||
| 7037 | ***********************************************************************/ | ||
| 7035 | 7038 | ||
| 7036 | /* <NSTextInput> implementation (called through [super interpretKeyEvents:]). */ | 7039 | #ifdef NS_IMPL_COCOA |
| 7040 | |||
| 7041 | - (void) insertText: (id) string | ||
| 7042 | replacementRange: (NSRange) replacementRange | ||
| 7043 | { | ||
| 7044 | if ([string isKindOfClass:[NSAttributedString class]]) | ||
| 7045 | string = [string string]; | ||
| 7046 | [self unmarkText]; | ||
| 7047 | [self insertText:string]; | ||
| 7048 | } | ||
| 7049 | |||
| 7050 | - (void) setMarkedText: (id) string | ||
| 7051 | selectedRange: (NSRange) selectedRange | ||
| 7052 | replacementRange: (NSRange) replacementRange | ||
| 7053 | { | ||
| 7054 | [self setMarkedText: string selectedRange: selectedRange]; | ||
| 7055 | } | ||
| 7037 | 7056 | ||
| 7057 | - (nullable NSAttributedString *) | ||
| 7058 | attributedSubstringForProposedRange: (NSRange) range | ||
| 7059 | actualRange: (nullable NSRangePointer) actualRange | ||
| 7060 | { | ||
| 7061 | return nil; | ||
| 7062 | } | ||
| 7063 | |||
| 7064 | - (NSRect) firstRectForCharacterRange: (NSRange) range | ||
| 7065 | actualRange: (nullable NSRangePointer) actualRange | ||
| 7066 | { | ||
| 7067 | return NSZeroRect; | ||
| 7068 | } | ||
| 7069 | |||
| 7070 | #endif /* NS_IMPL_COCOA */ | ||
| 7071 | |||
| 7072 | /*********************************************************************** | ||
| 7073 | NSTextInput | ||
| 7074 | ***********************************************************************/ | ||
| 7075 | |||
| 7076 | /* <NSTextInput> implementation (called through [super interpretKeyEvents:]). */ | ||
| 7038 | 7077 | ||
| 7039 | /* <NSTextInput>: called when done composing; | 7078 | /* <NSTextInput>: called when done composing; |
| 7040 | NOTE: also called when we delete over working text, followed | 7079 | NOTE: also called when we delete over working text, followed |
| @@ -8318,6 +8357,15 @@ ns_in_echo_area (void) | |||
| 8318 | [self windowDidEnterFullScreen]; | 8357 | [self windowDidEnterFullScreen]; |
| 8319 | } | 8358 | } |
| 8320 | 8359 | ||
| 8360 | - (void)adjustEmacsFrameRect | ||
| 8361 | { | ||
| 8362 | struct frame *f = emacsframe; | ||
| 8363 | NSWindow *frame_window = [FRAME_NS_VIEW (f) window]; | ||
| 8364 | NSRect r = [frame_window frame]; | ||
| 8365 | f->left_pos = NSMinX (r) - NS_PARENT_WINDOW_LEFT_POS (f); | ||
| 8366 | f->top_pos = NS_PARENT_WINDOW_TOP_POS (f) - NSMaxY (r); | ||
| 8367 | } | ||
| 8368 | |||
| 8321 | - (void)windowDidEnterFullScreen /* provided for direct calls */ | 8369 | - (void)windowDidEnterFullScreen /* provided for direct calls */ |
| 8322 | { | 8370 | { |
| 8323 | NSTRACE ("[EmacsView windowDidEnterFullScreen]"); | 8371 | NSTRACE ("[EmacsView windowDidEnterFullScreen]"); |
| @@ -8347,6 +8395,10 @@ ns_in_echo_area (void) | |||
| 8347 | } | 8395 | } |
| 8348 | #endif | 8396 | #endif |
| 8349 | } | 8397 | } |
| 8398 | |||
| 8399 | /* Do what windowDidMove does which isn't called when entering/exiting | ||
| 8400 | fullscreen mode. */ | ||
| 8401 | [self adjustEmacsFrameRect]; | ||
| 8350 | } | 8402 | } |
| 8351 | 8403 | ||
| 8352 | - (void)windowWillExitFullScreen:(NSNotification *)notification | 8404 | - (void)windowWillExitFullScreen:(NSNotification *)notification |
| @@ -8389,6 +8441,10 @@ ns_in_echo_area (void) | |||
| 8389 | 8441 | ||
| 8390 | if (next_maximized != -1) | 8442 | if (next_maximized != -1) |
| 8391 | [[self window] performZoom:self]; | 8443 | [[self window] performZoom:self]; |
| 8444 | |||
| 8445 | /* Do what windowDidMove does which isn't called when entering/exiting | ||
| 8446 | fullscreen mode. */ | ||
| 8447 | [self adjustEmacsFrameRect]; | ||
| 8392 | } | 8448 | } |
| 8393 | 8449 | ||
| 8394 | - (BOOL)fsIsNative | 8450 | - (BOOL)fsIsNative |