aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPo Lu2023-01-24 21:37:22 +0800
committerPo Lu2023-01-24 21:37:22 +0800
commit9082b4e6ee27b995cbb61668cb437d7b91c7f5f8 (patch)
tree675d45a080d0e03d3d55542a0416e080be3839eb
parent54836c47c76f655a7e3d6cf28f0cf27b8d9f3cdd (diff)
downloademacs-9082b4e6ee27b995cbb61668cb437d7b91c7f5f8.tar.gz
emacs-9082b4e6ee27b995cbb61668cb437d7b91c7f5f8.zip
Make binaries distributed with Emacs work on Android
* doc/lispref/processes.texi (Subprocess Creation): Document variables containing program names. * etc/NEWS: Document new variables. * java/Makefile.in (CROSS_BINS): Add missing etags binary. * lisp/cedet/semantic/db-ebrowse.el (semanticdb-create-ebrowse-database): * lisp/gnus/mail-source.el (mail-source-movemail-program): * lisp/hexl.el (hexl-program): * lisp/htmlfontify.el (hfy-etags-bin): * lisp/ielm.el (inferior-emacs-lisp-mode): * lisp/mail/rmail.el (rmail-autodetect): (rmail-insert-inbox-text): * lisp/org/org-ctags.el (org-ctags-path-to-ctags): * lisp/progmodes/cperl-mode.el (cperl-etags): * lisp/speedbar.el (speedbar-fetch-etags-command): * lisp/textmodes/reftex-global.el (reftex-create-tags-file): Use new variables. * src/callproc.c (syms_of_callproc): New variables naming binaries redistributed with Emacs.
-rw-r--r--doc/lispref/processes.texi18
-rw-r--r--etc/NEWS8
-rw-r--r--java/Makefile.in4
-rw-r--r--lisp/cedet/semantic/db-ebrowse.el3
-rw-r--r--lisp/gnus/mail-source.el2
-rw-r--r--lisp/hexl.el2
-rw-r--r--lisp/htmlfontify.el5
-rw-r--r--lisp/ielm.el2
-rw-r--r--lisp/mail/rmail.el6
-rw-r--r--lisp/org/org-ctags.el4
-rw-r--r--lisp/progmodes/cperl-mode.el2
-rw-r--r--lisp/speedbar.el2
-rw-r--r--lisp/textmodes/reftex-global.el6
-rw-r--r--src/callproc.c63
14 files changed, 113 insertions, 14 deletions
diff --git a/doc/lispref/processes.texi b/doc/lispref/processes.texi
index 50e67475d8e..aa71e3ee131 100644
--- a/doc/lispref/processes.texi
+++ b/doc/lispref/processes.texi
@@ -185,6 +185,24 @@ respective remote host. In case of a local @code{default-directory},
185the function returns just the value of the variable @code{exec-path}. 185the function returns just the value of the variable @code{exec-path}.
186@end defun 186@end defun
187 187
188@cindex programs distributed with Emacs, starting
189@vindex ctags-program-name
190@vindex etags-program-name
191@vindex hexl-program-name
192@vindex emacsclient-program-name
193@vindex movemail-program-name
194@vindex ebrowse-program-manem
195 When starting a program that is part of the Emacs distribution,
196you must take into account that the program may have been renamed in
197order to comply with executable naming restrictions present on the
198system.
199
200 Instead of starting @command{ctags}, for example, you should specify
201the value of @code{ctags-program-name} instead. Likewise, instead of
202starting @command{movemail}, you must start
203@code{movemail-program-name}, and the same goes for @command{etags},
204@command{hexl}, @command{emacsclient}, and @command{ebrowse}.
205
188@node Shell Arguments 206@node Shell Arguments
189@section Shell Arguments 207@section Shell Arguments
190@cindex arguments for shell commands 208@cindex arguments for shell commands
diff --git a/etc/NEWS b/etc/NEWS
index 3a52492fd19..40f4364d8f6 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -239,6 +239,14 @@ This user option has been obsoleted in Emacs 27, use
239* Lisp Changes in Emacs 30.1 239* Lisp Changes in Emacs 30.1
240 240
241+++ 241+++
242** New variables describing the names of built in programs.
243The new variables 'ctags-program-name', 'ebrowse-program-name',
244'etags-program-name', 'hexl-program-name', 'emacsclient-program-name'
245and 'movemail-program-name' should be used instead of "ctags",
246"ebrowse", "etags", "hexl", and "emacsclient", when starting one of
247these built in programs in a subprocess.
248
249+++
242** 'x-popup-menu' now understands touch screen events. 250** 'x-popup-menu' now understands touch screen events.
243When a 'touchscreen-begin' or 'touchscreen-end' event is passed as the 251When a 'touchscreen-begin' or 'touchscreen-end' event is passed as the
244POSITION argument, it will behave as if that event was a mouse event. 252POSITION argument, it will behave as if that event was a mouse event.
diff --git a/java/Makefile.in b/java/Makefile.in
index b5e0cd7bb56..b32b2442305 100644
--- a/java/Makefile.in
+++ b/java/Makefile.in
@@ -69,6 +69,7 @@ APK_NAME = emacs-$(version)-$(ANDROID_MIN_SDK)-$(ANDROID_ABI).apk
69# lib/$(ANDROID_ABI)/libemacs.so 69# lib/$(ANDROID_ABI)/libemacs.so
70# lib/$(ANDROID_ABI)/libandroid-emacs.so 70# lib/$(ANDROID_ABI)/libandroid-emacs.so
71# lib/$(ANDROID_ABI)/libctags.so 71# lib/$(ANDROID_ABI)/libctags.so
72# lib/$(ANDROID_ABI)/libetags.so
72# lib/$(ANDROID_ABI)/libhexl.so 73# lib/$(ANDROID_ABI)/libhexl.so
73# lib/$(ANDROID_ABI)/libmovemail.so 74# lib/$(ANDROID_ABI)/libmovemail.so
74# lib/$(ANDROID_ABI)/librcs2log.so 75# lib/$(ANDROID_ABI)/librcs2log.so
@@ -83,7 +84,8 @@ all: $(APK_NAME)
83# Binaries to cross-compile. 84# Binaries to cross-compile.
84CROSS_BINS = ../cross/src/android-emacs ../cross/lib-src/ctags \ 85CROSS_BINS = ../cross/src/android-emacs ../cross/lib-src/ctags \
85 ../cross/lib-src/hexl ../cross/lib-src/movemail \ 86 ../cross/lib-src/hexl ../cross/lib-src/movemail \
86 ../cross/lib-src/ebrowse ../cross/lib-src/emacsclient 87 ../cross/lib-src/ebrowse ../cross/lib-src/emacsclient \
88 ../cross/lib-src/etags
87 89
88# Libraries to cross-compile. 90# Libraries to cross-compile.
89CROSS_LIBS = ../cross/src/libemacs.so 91CROSS_LIBS = ../cross/src/libemacs.so
diff --git a/lisp/cedet/semantic/db-ebrowse.el b/lisp/cedet/semantic/db-ebrowse.el
index f8ea73cbdde..3e54b9e76cf 100644
--- a/lisp/cedet/semantic/db-ebrowse.el
+++ b/lisp/cedet/semantic/db-ebrowse.el
@@ -158,7 +158,8 @@ is specified by `semanticdb-default-save-directory'."
158 ;; Call the EBROWSE command. 158 ;; Call the EBROWSE command.
159 (message "Creating ebrowse file: %s ..." savein) 159 (message "Creating ebrowse file: %s ..." savein)
160 (call-process-region (point-min) (point-max) 160 (call-process-region (point-min) (point-max)
161 "ebrowse" nil "*EBROWSE OUTPUT*" nil 161 ebrowse-program-name
162 nil "*EBROWSE OUTPUT*" nil
162 (concat "--output-file=" savein) 163 (concat "--output-file=" savein)
163 "--very-verbose") 164 "--very-verbose")
164 ) 165 )
diff --git a/lisp/gnus/mail-source.el b/lisp/gnus/mail-source.el
index 639a29582b3..82cb7ddd8ad 100644
--- a/lisp/gnus/mail-source.el
+++ b/lisp/gnus/mail-source.el
@@ -285,7 +285,7 @@ number."
285 "Number of idle seconds to wait before checking for new mail." 285 "Number of idle seconds to wait before checking for new mail."
286 :type 'number) 286 :type 'number)
287 287
288(defcustom mail-source-movemail-program "movemail" 288(defcustom mail-source-movemail-program movemail-program-name
289 "If non-nil, name of program for fetching new mail." 289 "If non-nil, name of program for fetching new mail."
290 :version "26.2" 290 :version "26.2"
291 :type '(choice (const nil) string)) 291 :type '(choice (const nil) string))
diff --git a/lisp/hexl.el b/lisp/hexl.el
index bb57f4ac4c3..5fa09459a46 100644
--- a/lisp/hexl.el
+++ b/lisp/hexl.el
@@ -60,7 +60,7 @@
60 (const 64)) 60 (const 64))
61 :version "24.3") 61 :version "24.3")
62 62
63(defcustom hexl-program "hexl" 63(defcustom hexl-program hexl-program-name
64 "The program that will hexlify and dehexlify its stdin. 64 "The program that will hexlify and dehexlify its stdin.
65`hexl-program' will always be concatenated with `hexl-options' 65`hexl-program' will always be concatenated with `hexl-options'
66and \"-de\" when dehexlifying a buffer." 66and \"-de\" when dehexlifying a buffer."
diff --git a/lisp/htmlfontify.el b/lisp/htmlfontify.el
index 1ab33cc6411..a06387687b9 100644
--- a/lisp/htmlfontify.el
+++ b/lisp/htmlfontify.el
@@ -308,13 +308,14 @@ done;")
308 :tag "etags-cmd-alist" 308 :tag "etags-cmd-alist"
309 :type '(alist :key-type (string) :value-type (string))) 309 :type '(alist :key-type (string) :value-type (string)))
310 310
311(defcustom hfy-etags-bin "etags" 311(defcustom hfy-etags-bin etags-program-name
312 "Location of etags binary (we begin by assuming it's in your path). 312 "Location of etags binary (we begin by assuming it's in your path).
313 313
314Note that if etags is not in your path, you will need to alter the shell 314Note that if etags is not in your path, you will need to alter the shell
315commands in `hfy-etags-cmd-alist'." 315commands in `hfy-etags-cmd-alist'."
316 :tag "etags-bin" 316 :tag "etags-bin"
317 :type '(file)) 317 :type '(file)
318 :version "30.1")
318 319
319(defcustom hfy-shell-file-name "/bin/sh" 320(defcustom hfy-shell-file-name "/bin/sh"
320 "Shell (Bourne or compatible) to invoke for complex shell operations." 321 "Shell (Bourne or compatible) to invoke for complex shell operations."
diff --git a/lisp/ielm.el b/lisp/ielm.el
index 5c370733c05..1eeec5fbb84 100644
--- a/lisp/ielm.el
+++ b/lisp/ielm.el
@@ -605,7 +605,7 @@ Customized bindings may be defined in `ielm-map', which currently contains:
605 ;; Was cat, but on non-Unix platforms that might not exist, so 605 ;; Was cat, but on non-Unix platforms that might not exist, so
606 ;; use hexl instead, which is part of the Emacs distribution. 606 ;; use hexl instead, which is part of the Emacs distribution.
607 (condition-case nil 607 (condition-case nil
608 (start-process "ielm" (current-buffer) "hexl") 608 (start-process "ielm" (current-buffer) hexl-program-name)
609 (file-error (start-process "ielm" (current-buffer) "cat"))) 609 (file-error (start-process "ielm" (current-buffer) "cat")))
610 (set-process-query-on-exit-flag (ielm-process) nil) 610 (set-process-query-on-exit-flag (ielm-process) nil)
611 (goto-char (point-max)) 611 (goto-char (point-max))
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index 659649b5d42..0572283b609 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -263,7 +263,7 @@ Otherwise, look for `movemail' in the directories in
263 ;; assuming it would work. 263 ;; assuming it would work.
264 ;; https://lists.gnu.org/r/bug-gnu-emacs/2008-02/msg00087.html 264 ;; https://lists.gnu.org/r/bug-gnu-emacs/2008-02/msg00087.html
265 (let ((progname (expand-file-name 265 (let ((progname (expand-file-name
266 (concat "movemail" 266 (concat movemail-program-name
267 (if (memq system-type '(ms-dos windows-nt)) 267 (if (memq system-type '(ms-dos windows-nt))
268 ".exe")) dir))) 268 ".exe")) dir)))
269 (when (and (not (file-directory-p progname)) 269 (when (and (not (file-directory-p progname))
@@ -1989,7 +1989,9 @@ Value is the size of the newly read mail after conversion."
1989 (buffer-disable-undo errors) 1989 (buffer-disable-undo errors)
1990 (let ((args 1990 (let ((args
1991 (append 1991 (append
1992 (list (or rmail-movemail-program "movemail") nil errors nil) 1992 (list (or rmail-movemail-program
1993 movemail-program-name)
1994 nil errors nil)
1993 (if rmail-preserve-inbox 1995 (if rmail-preserve-inbox
1994 (list "-p") 1996 (list "-p")
1995 nil) 1997 nil)
diff --git a/lisp/org/org-ctags.el b/lisp/org/org-ctags.el
index 5dd2bfd59cd..990214f4117 100644
--- a/lisp/org/org-ctags.el
+++ b/lisp/org/org-ctags.el
@@ -156,7 +156,9 @@ Format is: /REGEXP/TAGNAME/FLAGS,TAGTYPE/
156See the ctags documentation for more information.") 156See the ctags documentation for more information.")
157 157
158(defcustom org-ctags-path-to-ctags 158(defcustom org-ctags-path-to-ctags
159 (if (executable-find "ctags-exuberant") "ctags-exuberant" "ctags") 159 (if (executable-find "ctags-exuberant")
160 "ctags-exuberant"
161 ctags-program-name)
160 "Name of the ctags executable file." 162 "Name of the ctags executable file."
161 :version "24.1" 163 :version "24.1"
162 :type 'file) 164 :type 'file)
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index 412283f3488..9f79834f964 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -6533,7 +6533,7 @@ in subdirectories too."
6533 ;; of etags has been commented out in the menu since ... well, 6533 ;; of etags has been commented out in the menu since ... well,
6534 ;; forever. So, let's just stick to ASCII here. -- haj, 2021-09-14 6534 ;; forever. So, let's just stick to ASCII here. -- haj, 2021-09-14
6535 (interactive) 6535 (interactive)
6536 (let ((cmd "etags") 6536 (let ((cmd etags-program-name)
6537 (args `("-l" "none" "-r" 6537 (args `("-l" "none" "-r"
6538 ;; 1=fullname 2=package? 3=name 4=proto? 5=attrs? (VERY APPROX!) 6538 ;; 1=fullname 2=package? 3=name 4=proto? 5=attrs? (VERY APPROX!)
6539 ,(concat 6539 ,(concat
diff --git a/lisp/speedbar.el b/lisp/speedbar.el
index 60113ca1410..2f1d9d22110 100644
--- a/lisp/speedbar.el
+++ b/lisp/speedbar.el
@@ -3532,7 +3532,7 @@ to be at the beginning of a line in the etags buffer.
3532 3532
3533This variable is ignored if `speedbar-use-imenu-flag' is non-nil.") 3533This variable is ignored if `speedbar-use-imenu-flag' is non-nil.")
3534 3534
3535(defcustom speedbar-fetch-etags-command "etags" 3535(defcustom speedbar-fetch-etags-command etags-program-name
3536 "Command used to create an etags file. 3536 "Command used to create an etags file.
3537This variable is ignored if `speedbar-use-imenu-flag' is t." 3537This variable is ignored if `speedbar-use-imenu-flag' is t."
3538 :group 'speedbar 3538 :group 'speedbar
diff --git a/lisp/textmodes/reftex-global.el b/lisp/textmodes/reftex-global.el
index acf0891432f..b8b0ae6a061 100644
--- a/lisp/textmodes/reftex-global.el
+++ b/lisp/textmodes/reftex-global.el
@@ -39,8 +39,10 @@ The TAGS file is also immediately visited with `visit-tags-table'."
39 (reftex-access-scan-info current-prefix-arg) 39 (reftex-access-scan-info current-prefix-arg)
40 (let* ((master (reftex-TeX-master-file)) 40 (let* ((master (reftex-TeX-master-file))
41 (files (reftex-all-document-files)) 41 (files (reftex-all-document-files))
42 (cmd (format "etags %s" (mapconcat #'shell-quote-argument 42 (cmd (format "%s %s"
43 files " ")))) 43 etags-program-name
44 (mapconcat #'shell-quote-argument
45 files " "))))
44 (with-current-buffer (reftex-get-file-buffer-force master) 46 (with-current-buffer (reftex-get-file-buffer-force master)
45 (message "Running etags to create TAGS file...") 47 (message "Running etags to create TAGS file...")
46 (shell-command cmd) 48 (shell-command cmd)
diff --git a/src/callproc.c b/src/callproc.c
index 5e1e1a8cc0a..85895a7d9f2 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -2110,6 +2110,69 @@ use.
2110See `setenv' and `getenv'. */); 2110See `setenv' and `getenv'. */);
2111 Vprocess_environment = Qnil; 2111 Vprocess_environment = Qnil;
2112 2112
2113 DEFVAR_LISP ("ctags-program-name", Vctags_program_name,
2114 doc: /* Name of the `ctags' program distributed with Emacs.
2115Use this instead of calling `ctags' directly, as `ctags' may have been
2116renamed to comply with executable naming restrictions on the system. */);
2117#if !defined HAVE_ANDROID || defined ANDROID_STUBIFY
2118 Vctags_program_name = build_pure_c_string ("ctags");
2119#else
2120 Vctags_program_name = build_pure_c_string ("libctags.so");
2121#endif
2122
2123 DEFVAR_LISP ("etags-program-name", Vetags_program_name,
2124 doc: /* Name of the `etags' program distributed with Emacs.
2125Use this instead of calling `etags' directly, as `etags' may have been
2126renamed to comply with executable naming restrictions on the system. */);
2127#if !defined HAVE_ANDROID || defined ANDROID_STUBIFY
2128 Vetags_program_name = build_pure_c_string ("etags");
2129#else
2130 Vetags_program_name = build_pure_c_string ("libetags.so");
2131#endif
2132
2133 DEFVAR_LISP ("hexl-program-name", Vhexl_program_name,
2134 doc: /* Name of the `hexl' program distributed with Emacs.
2135Use this instead of calling `hexl' directly, as `hexl' may have been
2136renamed to comply with executable naming restrictions on the system. */);
2137#if !defined HAVE_ANDROID || defined ANDROID_STUBIFY
2138 Vhexl_program_name = build_pure_c_string ("hexl");
2139#else
2140 Vhexl_program_name = build_pure_c_string ("libhexl.so");
2141#endif
2142
2143 DEFVAR_LISP ("emacsclient-program-name", Vemacsclient_program_name,
2144 doc: /* Name of the `emacsclient' program distributed with Emacs.
2145Use this instead of calling `emacsclient' directly, as `emacsclient'
2146may have been renamed to comply with executable naming restrictions on
2147the system. */);
2148#if !defined HAVE_ANDROID || defined ANDROID_STUBIFY
2149 Vemacsclient_program_name = build_pure_c_string ("emacsclient");
2150#else
2151 Vemacsclient_program_name = build_pure_c_string ("libemacsclient.so");
2152#endif
2153
2154 DEFVAR_LISP ("movemail-program-name", Vmovemail_program_name,
2155 doc: /* Name of the `movemail' program distributed with Emacs.
2156Use this instead of calling `movemail' directly, as `movemail'
2157may have been renamed to comply with executable naming restrictions on
2158the system. */);
2159#if !defined HAVE_ANDROID || defined ANDROID_STUBIFY
2160 Vmovemail_program_name = build_pure_c_string ("movemail");
2161#else
2162 Vmovemail_program_name = build_pure_c_string ("libmovemail.so");
2163#endif
2164
2165 DEFVAR_LISP ("ebrowse-program-name", Vebrowse_program_name,
2166 doc: /* Name of the `ebrowse' program distributed with Emacs.
2167Use this instead of calling `ebrowse' directly, as `ebrowse'
2168may have been renamed to comply with executable naming restrictions on
2169the system. */);
2170#if !defined HAVE_ANDROID || defined ANDROID_STUBIFY
2171 Vebrowse_program_name = build_pure_c_string ("ebrowse");
2172#else
2173 Vebrowse_program_name = build_pure_c_string ("libebrowse.so");
2174#endif
2175
2113 defsubr (&Scall_process); 2176 defsubr (&Scall_process);
2114 defsubr (&Sgetenv_internal); 2177 defsubr (&Sgetenv_internal);
2115 defsubr (&Scall_process_region); 2178 defsubr (&Scall_process_region);