Repair test failures stemming from Android merge

* lisp/kmacro.el (kmacro-step-edit-query)
(kmacro-step-edit-pre-command): Use `dummy-event' instead of
[nil] to continue a kbd macro; this is because nil now has a
function key map.
* src/androidfns.c (Fx_hide_tip): Allow calling this as a stub.
* src/fileio.c (Finsert_file_contents): In adherence to the
documentation, forbid supplying a BEG offset even for seekable
files, i.e. /dev/urandom on Linux kernel based systems.
This commit is contained in:
Po Lu 2023-08-08 20:20:02 +08:00
parent 0c58350b31
commit 2b67609c34
3 changed files with 28 additions and 9 deletions

View file

@ -1189,7 +1189,10 @@ following additional answers: `insert', `insert-1', `replace', `replace-1',
(setq act (lookup-key kmacro-step-edit-map
(vector (with-current-buffer (current-buffer) (read-event))))))))
;; Resume macro execution and perform the action
;; Resume macro execution and perform the action.
;; Suffixing executing-kbd-macro with `dummy-event'
;; is done when pre-command-hook must be called
;; again as part of this keyboard macro's execution.
(cond
((cond
((eq act 'act)
@ -1220,18 +1223,21 @@ following additional answers: `insert', `insert-1', `replace', `replace-1',
((member act '(replace-1 replace))
(setq kmacro-step-edit-inserting (if (eq act 'replace-1) 1 t))
(if (= executing-kbd-macro-index (length executing-kbd-macro))
(setq executing-kbd-macro (vconcat executing-kbd-macro [nil])
(setq executing-kbd-macro (vconcat executing-kbd-macro
[dummy-event])
kmacro-step-edit-appending t))
nil)
((eq act 'append)
(setq kmacro-step-edit-inserting t)
(if (= executing-kbd-macro-index (length executing-kbd-macro))
(setq executing-kbd-macro (vconcat executing-kbd-macro [nil])
(setq executing-kbd-macro (vconcat executing-kbd-macro
[dummy-event])
kmacro-step-edit-appending t))
t)
((eq act 'append-end)
(if (= executing-kbd-macro-index (length executing-kbd-macro))
(setq executing-kbd-macro (vconcat executing-kbd-macro [nil])
(setq executing-kbd-macro (vconcat executing-kbd-macro
[dummy-event])
kmacro-step-edit-inserting t
kmacro-step-edit-appending t)
(setq kmacro-step-edit-active 'append-end))
@ -1314,7 +1320,8 @@ following additional answers: `insert', `insert-1', `replace', `replace-1',
(setq this-command #'ignore))
((eq kmacro-step-edit-active 'append-end)
(if (= executing-kbd-macro-index (length executing-kbd-macro))
(setq executing-kbd-macro (vconcat executing-kbd-macro [nil])
(setq executing-kbd-macro (vconcat executing-kbd-macro
[dummy-event])
kmacro-step-edit-inserting t
kmacro-step-edit-appending t
kmacro-step-edit-active t)))

View file

@ -2410,11 +2410,16 @@ DEFUN ("x-hide-tip", Fx_hide_tip, Sx_hide_tip, 0, 0, 0,
(void)
{
#ifdef ANDROID_STUBIFY
/* Fx_hide_tip is called from pre-command-hook (in turn called from
the tests.) Since signaling here prevents any tests from being
run, refrain from protesting if this stub is called. */
#if 0
error ("Android cross-compilation stub called!");
#endif /* 0 */
return Qnil;
#else
#else /* !ANDROID_STUBIFY */
return android_hide_tip (true);
#endif
#endif /* ANDROID_STUBIFY */
}
DEFUN ("android-detect-mouse", Fandroid_detect_mouse,

View file

@ -4177,11 +4177,18 @@ by calling `format-decode', which see. */)
replace = Qunbound;
}
seekable = emacs_fd_lseek (fd, 0, SEEK_CUR) != (off_t) -1;
if (!NILP (beg) && !seekable)
/* Forbid specifying BEG together with a special file, as per
the doc string. */
if (!NILP (beg))
xsignal2 (Qfile_error,
build_string ("cannot use a start position in a non-seekable file/device"),
orig_filename);
/* Now ascertain if this file is seekable, by detecting if
seeking leads to -1 being returned. */
seekable
= emacs_fd_lseek (fd, 0, SEEK_CUR) != (off_t) -1;
}
if (end_offset < 0)