diff options
| author | Po Lu | 2024-07-08 15:43:55 +0800 |
|---|---|---|
| committer | Po Lu | 2024-07-08 15:43:55 +0800 |
| commit | ce56f939affe8147f4172aa030058029a3c7922b (patch) | |
| tree | 46c4b4ed882ed35187d1de60b2634e91eab16aad | |
| parent | 8e1a43890da53a387c31950f11c3d2dbb7a70614 (diff) | |
| parent | 67f291ddae31cc4623fd93280b141ee8611f3f5a (diff) | |
| download | emacs-ce56f939affe8147f4172aa030058029a3c7922b.tar.gz emacs-ce56f939affe8147f4172aa030058029a3c7922b.zip | |
Merge from savannah/emacs-30
67f291ddae3 Correct conditions for iconification on Android
130c3efa108 Fix execution of MS-Windows app execution aliases in Eshell
fffab032b05 Improve 'tab-line-tabs-fixed-window-buffers' sorting perf...
| -rw-r--r-- | java/org/gnu/emacs/EmacsActivity.java | 23 | ||||
| -rw-r--r-- | lisp/eshell/esh-ext.el | 12 | ||||
| -rw-r--r-- | lisp/tab-line.el | 9 |
3 files changed, 27 insertions, 17 deletions
diff --git a/java/org/gnu/emacs/EmacsActivity.java b/java/org/gnu/emacs/EmacsActivity.java index 7d02e4f4834..0c9e8312b90 100644 --- a/java/org/gnu/emacs/EmacsActivity.java +++ b/java/org/gnu/emacs/EmacsActivity.java | |||
| @@ -78,7 +78,7 @@ public class EmacsActivity extends Activity | |||
| 78 | public static EmacsWindow focusedWindow; | 78 | public static EmacsWindow focusedWindow; |
| 79 | 79 | ||
| 80 | /* Whether or not this activity is paused. */ | 80 | /* Whether or not this activity is paused. */ |
| 81 | private boolean isPaused; | 81 | private boolean isStopped; |
| 82 | 82 | ||
| 83 | /* Whether or not this activity is fullscreen. */ | 83 | /* Whether or not this activity is fullscreen. */ |
| 84 | private boolean isFullscreen; | 84 | private boolean isFullscreen; |
| @@ -196,7 +196,7 @@ public class EmacsActivity extends Activity | |||
| 196 | window.view.requestFocus (); | 196 | window.view.requestFocus (); |
| 197 | 197 | ||
| 198 | /* If the activity is iconified, send that to the window. */ | 198 | /* If the activity is iconified, send that to the window. */ |
| 199 | if (isPaused) | 199 | if (isStopped) |
| 200 | window.noticeIconified (); | 200 | window.noticeIconified (); |
| 201 | 201 | ||
| 202 | /* Invalidate the focus. Since attachWindow may be called from | 202 | /* Invalidate the focus. Since attachWindow may be called from |
| @@ -308,8 +308,13 @@ public class EmacsActivity extends Activity | |||
| 308 | public final void | 308 | public final void |
| 309 | onStop () | 309 | onStop () |
| 310 | { | 310 | { |
| 311 | timeOfLastInteraction = SystemClock.elapsedRealtime (); | 311 | /* Iconification was previously reported in onPause, but that was |
| 312 | misinformed, as `onStop' is the actual callback activated upon | ||
| 313 | changes in an activity's visibility. */ | ||
| 314 | isStopped = true; | ||
| 315 | EmacsWindowManager.MANAGER.noticeIconified (this); | ||
| 312 | 316 | ||
| 317 | timeOfLastInteraction = SystemClock.elapsedRealtime (); | ||
| 313 | super.onStop (); | 318 | super.onStop (); |
| 314 | } | 319 | } |
| 315 | 320 | ||
| @@ -405,19 +410,9 @@ public class EmacsActivity extends Activity | |||
| 405 | 410 | ||
| 406 | @Override | 411 | @Override |
| 407 | public final void | 412 | public final void |
| 408 | onPause () | ||
| 409 | { | ||
| 410 | isPaused = true; | ||
| 411 | |||
| 412 | EmacsWindowManager.MANAGER.noticeIconified (this); | ||
| 413 | super.onPause (); | ||
| 414 | } | ||
| 415 | |||
| 416 | @Override | ||
| 417 | public final void | ||
| 418 | onResume () | 413 | onResume () |
| 419 | { | 414 | { |
| 420 | isPaused = false; | 415 | isStopped = false; |
| 421 | timeOfLastInteraction = 0; | 416 | timeOfLastInteraction = 0; |
| 422 | 417 | ||
| 423 | EmacsWindowManager.MANAGER.noticeDeiconified (this); | 418 | EmacsWindowManager.MANAGER.noticeDeiconified (this); |
diff --git a/lisp/eshell/esh-ext.el b/lisp/eshell/esh-ext.el index 3c4deb32601..cf93d2904da 100644 --- a/lisp/eshell/esh-ext.el +++ b/lisp/eshell/esh-ext.el | |||
| @@ -301,7 +301,17 @@ Return nil, or a list of the form: | |||
| 301 | (INTERPRETER [ARGS] FILE)" | 301 | (INTERPRETER [ARGS] FILE)" |
| 302 | (let ((maxlen eshell-command-interpreter-max-length)) | 302 | (let ((maxlen eshell-command-interpreter-max-length)) |
| 303 | (if (and (file-readable-p file) | 303 | (if (and (file-readable-p file) |
| 304 | (file-regular-p file)) | 304 | (file-regular-p file) |
| 305 | ;; If the file is zero bytes, it can't possibly have a | ||
| 306 | ;; shebang. This check may seem redundant, but we can | ||
| 307 | ;; encounter files that Emacs considers both readable and | ||
| 308 | ;; regular, but which aren't *actually* readable. This can | ||
| 309 | ;; happen, for example, with certain kinds of reparse | ||
| 310 | ;; points like APPEXECLINK on NTFS filesystems (MS-Windows | ||
| 311 | ;; uses these for "app execution aliases"). In these | ||
| 312 | ;; cases, the file size is 0, so this check protects us | ||
| 313 | ;; from errors. | ||
| 314 | (> (file-attribute-size (file-attributes file)) 0)) | ||
| 305 | (with-temp-buffer | 315 | (with-temp-buffer |
| 306 | (insert-file-contents-literally file nil 0 maxlen) | 316 | (insert-file-contents-literally file nil 0 maxlen) |
| 307 | (if (looking-at "#![ \t]*\\([^ \r\t\n]+\\)\\([ \t]+\\(.+\\)\\)?") | 317 | (if (looking-at "#![ \t]*\\([^ \r\t\n]+\\)\\([ \t]+\\(.+\\)\\)?") |
diff --git a/lisp/tab-line.el b/lisp/tab-line.el index 1d14fda9825..462a0a27692 100644 --- a/lisp/tab-line.el +++ b/lisp/tab-line.el | |||
| @@ -555,10 +555,15 @@ This means that switching to a buffer previously shown in the same | |||
| 555 | window will keep the same order of tabs that was before switching. | 555 | window will keep the same order of tabs that was before switching. |
| 556 | And newly displayed buffers are added to the end of the tab line." | 556 | And newly displayed buffers are added to the end of the tab line." |
| 557 | (let* ((old-buffers (window-parameter nil 'tab-line-buffers)) | 557 | (let* ((old-buffers (window-parameter nil 'tab-line-buffers)) |
| 558 | (buffer-positions (let ((index-table (make-hash-table :test 'eq))) | ||
| 559 | (seq-do-indexed | ||
| 560 | (lambda (buf idx) (puthash buf idx index-table)) | ||
| 561 | old-buffers) | ||
| 562 | index-table)) | ||
| 558 | (new-buffers (sort (tab-line-tabs-window-buffers) | 563 | (new-buffers (sort (tab-line-tabs-window-buffers) |
| 559 | :key (lambda (buffer) | 564 | :key (lambda (buffer) |
| 560 | (or (seq-position old-buffers buffer) | 565 | (gethash buffer buffer-positions |
| 561 | most-positive-fixnum))))) | 566 | most-positive-fixnum))))) |
| 562 | (set-window-parameter nil 'tab-line-buffers new-buffers) | 567 | (set-window-parameter nil 'tab-line-buffers new-buffers) |
| 563 | new-buffers)) | 568 | new-buffers)) |
| 564 | 569 | ||