&& (git rev-parse --abbrev-ref HEAD \
|| echo "Unknown") } 2> /dev/null > $@
+install_temp/assets/build_info: install_temp
+ $(AM_V_GEN) { hostname; date +%s; } > $@
+
emacs.apk-in: install_temp install_temp/assets/directory-tree \
- install_temp/assets/version AndroidManifest.xml
+ install_temp/assets/version install_temp/assets/build_info \
+ AndroidManifest.xml
# Package everything. Specifying the assets on this command line is
# necessary for AAssetManager_getNextFileName to work on old versions
# of Android. Make sure not to generate R.java, as it's already been
;;; Code:
+\f
+
+(defun android-read-build-system ()
+ "Obtain the host name of the system on which Emacs was built.
+Use the data stored in the special file `/assets/build_info'.
+Value is the string ``Unknown'' upon failure, else the hostname
+of the build system."
+ (with-temp-buffer
+ (insert-file-contents "/assets/build_info")
+ (let ((string (buffer-substring 1 (line-end-position))))
+ (and (not (equal string "Unknown")) string))))
+
+(defun android-read-build-time ()
+ "Obtain the time at which Emacs was built.
+Use the data stored in the special file `/assets/build_info'.
+Value is nil upon failure, else the time in the same format as
+returned by `current-time'."
+ (with-temp-buffer
+ (insert-file-contents "/assets/build_info")
+ (end-of-line)
+ (let ((number (read (current-buffer))))
+ (time-convert number 'list))))
+
+\f
+
(defconst emacs-major-version
(progn (string-match "^[0-9]+" emacs-version)
(string-to-number (match-string 0 emacs-version)))
(string-to-number (match-string 1 emacs-version)))
"Minor version number of this version of Emacs.")
-(defconst emacs-build-system (system-name)
+(defconst emacs-build-system (or (and (eq system-type 'android)
+ (android-read-build-system))
+ (system-name))
"Name of the system on which Emacs was built, or nil if not available.")
-(defconst emacs-build-time (if emacs-build-system (current-time))
+(defconst emacs-build-time (if emacs-build-system
+ (or (and (eq system-type 'android)
+ (android-read-build-time))
+ (current-time)))
"Time at which Emacs was dumped out, or nil if not available.")
(defconst emacs-build-number 1 ; loadup.el may increment this
}
}
- /* Decode file format. */
- if (inserted > 0)
+ /* Decode file format. Don't do this if Qformat_decode is not
+ bound, which can happen when called early during loadup. */
+
+ if (inserted > 0 && !NILP (Fboundp (Qformat_decode)))
{
/* Don't run point motion or modification hooks when decoding. */
specpdl_ref count1 = SPECPDL_INDEX ();
void
replace_buffer_in_windows (Lisp_Object buffer)
{
- call1 (Qreplace_buffer_in_windows, buffer);
+ /* When kill-buffer is called early during loadup, this function is
+ undefined. */
+ if (!NILP (Fboundp (Qreplace_buffer_in_windows)))
+ call1 (Qreplace_buffer_in_windows, buffer);
}
/* If BUFFER is shown in a window, safely replace it with some other