emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 96097d36232 1/2: Merge from savannah/emacs-30


From: Po Lu
Subject: master 96097d36232 1/2: Merge from savannah/emacs-30
Date: Wed, 31 Jul 2024 20:36:38 -0400 (EDT)

branch: master
commit 96097d362322595e308157ff70f191ef2b49640d
Merge: d00eb0468b1 1154d8aafe2
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    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.
---
 doc/lispref/modes.texi        |  2 +-
 lisp/international/fontset.el |  9 ++++---
 lisp/tab-bar.el               | 18 ++++++++------
 src/nsterm.h                  |  3 ++-
 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
 @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 <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;
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)
   [nsEvArray removeObject: theEvent];
 }
 
+/***********************************************************************
+                          NSTextInputClient
+ ***********************************************************************/
 
-/* <NSTextInput> implementation (called through [super interpretKeyEvents:]).  
*/
+#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
@@ -8318,6 +8357,15 @@ ns_in_echo_area (void)
   [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 @@ ns_in_echo_area (void)
         }
 #endif
     }
+
+  /* Do what windowDidMove does which isn't called when entering/exiting
+     fullscreen mode.  */
+  [self adjustEmacsFrameRect];
 }
 
 - (void)windowWillExitFullScreen:(NSNotification *)notification
@@ -8389,6 +8441,10 @@ ns_in_echo_area (void)
 
   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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]