mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-06 06:20:55 -08:00
Merge from savannah/emacs-30
67f291ddaeCorrect conditions for iconification on Android130c3efa10Fix execution of MS-Windows app execution aliases in Eshellfffab032b0Improve 'tab-line-tabs-fixed-window-buffers' sorting perf...
This commit is contained in:
commit
ce56f939af
3 changed files with 27 additions and 17 deletions
|
|
@ -78,7 +78,7 @@ public class EmacsActivity extends Activity
|
||||||
public static EmacsWindow focusedWindow;
|
public static EmacsWindow focusedWindow;
|
||||||
|
|
||||||
/* Whether or not this activity is paused. */
|
/* Whether or not this activity is paused. */
|
||||||
private boolean isPaused;
|
private boolean isStopped;
|
||||||
|
|
||||||
/* Whether or not this activity is fullscreen. */
|
/* Whether or not this activity is fullscreen. */
|
||||||
private boolean isFullscreen;
|
private boolean isFullscreen;
|
||||||
|
|
@ -196,7 +196,7 @@ public class EmacsActivity extends Activity
|
||||||
window.view.requestFocus ();
|
window.view.requestFocus ();
|
||||||
|
|
||||||
/* If the activity is iconified, send that to the window. */
|
/* If the activity is iconified, send that to the window. */
|
||||||
if (isPaused)
|
if (isStopped)
|
||||||
window.noticeIconified ();
|
window.noticeIconified ();
|
||||||
|
|
||||||
/* Invalidate the focus. Since attachWindow may be called from
|
/* Invalidate the focus. Since attachWindow may be called from
|
||||||
|
|
@ -308,8 +308,13 @@ public class EmacsActivity extends Activity
|
||||||
public final void
|
public final void
|
||||||
onStop ()
|
onStop ()
|
||||||
{
|
{
|
||||||
timeOfLastInteraction = SystemClock.elapsedRealtime ();
|
/* Iconification was previously reported in onPause, but that was
|
||||||
|
misinformed, as `onStop' is the actual callback activated upon
|
||||||
|
changes in an activity's visibility. */
|
||||||
|
isStopped = true;
|
||||||
|
EmacsWindowManager.MANAGER.noticeIconified (this);
|
||||||
|
|
||||||
|
timeOfLastInteraction = SystemClock.elapsedRealtime ();
|
||||||
super.onStop ();
|
super.onStop ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -403,21 +408,11 @@ public class EmacsActivity extends Activity
|
||||||
invalidateFocus (3);
|
invalidateFocus (3);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public final void
|
|
||||||
onPause ()
|
|
||||||
{
|
|
||||||
isPaused = true;
|
|
||||||
|
|
||||||
EmacsWindowManager.MANAGER.noticeIconified (this);
|
|
||||||
super.onPause ();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final void
|
public final void
|
||||||
onResume ()
|
onResume ()
|
||||||
{
|
{
|
||||||
isPaused = false;
|
isStopped = false;
|
||||||
timeOfLastInteraction = 0;
|
timeOfLastInteraction = 0;
|
||||||
|
|
||||||
EmacsWindowManager.MANAGER.noticeDeiconified (this);
|
EmacsWindowManager.MANAGER.noticeDeiconified (this);
|
||||||
|
|
|
||||||
|
|
@ -301,7 +301,17 @@ Return nil, or a list of the form:
|
||||||
(INTERPRETER [ARGS] FILE)"
|
(INTERPRETER [ARGS] FILE)"
|
||||||
(let ((maxlen eshell-command-interpreter-max-length))
|
(let ((maxlen eshell-command-interpreter-max-length))
|
||||||
(if (and (file-readable-p file)
|
(if (and (file-readable-p file)
|
||||||
(file-regular-p file))
|
(file-regular-p file)
|
||||||
|
;; If the file is zero bytes, it can't possibly have a
|
||||||
|
;; shebang. This check may seem redundant, but we can
|
||||||
|
;; encounter files that Emacs considers both readable and
|
||||||
|
;; regular, but which aren't *actually* readable. This can
|
||||||
|
;; happen, for example, with certain kinds of reparse
|
||||||
|
;; points like APPEXECLINK on NTFS filesystems (MS-Windows
|
||||||
|
;; uses these for "app execution aliases"). In these
|
||||||
|
;; cases, the file size is 0, so this check protects us
|
||||||
|
;; from errors.
|
||||||
|
(> (file-attribute-size (file-attributes file)) 0))
|
||||||
(with-temp-buffer
|
(with-temp-buffer
|
||||||
(insert-file-contents-literally file nil 0 maxlen)
|
(insert-file-contents-literally file nil 0 maxlen)
|
||||||
(if (looking-at "#![ \t]*\\([^ \r\t\n]+\\)\\([ \t]+\\(.+\\)\\)?")
|
(if (looking-at "#![ \t]*\\([^ \r\t\n]+\\)\\([ \t]+\\(.+\\)\\)?")
|
||||||
|
|
|
||||||
|
|
@ -555,10 +555,15 @@ This means that switching to a buffer previously shown in the same
|
||||||
window will keep the same order of tabs that was before switching.
|
window will keep the same order of tabs that was before switching.
|
||||||
And newly displayed buffers are added to the end of the tab line."
|
And newly displayed buffers are added to the end of the tab line."
|
||||||
(let* ((old-buffers (window-parameter nil 'tab-line-buffers))
|
(let* ((old-buffers (window-parameter nil 'tab-line-buffers))
|
||||||
|
(buffer-positions (let ((index-table (make-hash-table :test 'eq)))
|
||||||
|
(seq-do-indexed
|
||||||
|
(lambda (buf idx) (puthash buf idx index-table))
|
||||||
|
old-buffers)
|
||||||
|
index-table))
|
||||||
(new-buffers (sort (tab-line-tabs-window-buffers)
|
(new-buffers (sort (tab-line-tabs-window-buffers)
|
||||||
:key (lambda (buffer)
|
:key (lambda (buffer)
|
||||||
(or (seq-position old-buffers buffer)
|
(gethash buffer buffer-positions
|
||||||
most-positive-fixnum)))))
|
most-positive-fixnum)))))
|
||||||
(set-window-parameter nil 'tab-line-buffers new-buffers)
|
(set-window-parameter nil 'tab-line-buffers new-buffers)
|
||||||
new-buffers))
|
new-buffers))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue