Commit graph

1094 commits

Author SHA1 Message Date
Lars Ingebrigtsen
f97993ee66 Rename to inhibit-automatic-native-compilation
* src/comp.c (maybe_defer_native_compilation):
(syms_of_comp):
* lisp/subr.el (native-comp-deferred-compilation):
* lisp/startup.el (inhibit-native-compilation):
(normal-top-level):
* lisp/progmodes/elisp-mode.el (emacs-lisp-native-compile-and-load):
* lisp/emacs-lisp/comp.el (comp-trampoline-compile):
* etc/NEWS:
* doc/lispref/compile.texi (Native-Compilation Variables): Rename
inhibit-native-compilation to inhibit-automatic-native-compilation.
2022-10-03 19:50:03 +02:00
Lars Ingebrigtsen
5fec9182db Add new variable 'inhibit-native-compilation'
* doc/lispref/compile.texi (Native-Compilation Variables):
Document it.

* lisp/startup.el (normal-top-level): Set
inhibit-native-compilation from environment variable.

* lisp/subr.el (native-comp-deferred-compilation): Make obsolete.

* lisp/emacs-lisp/comp.el (comp-trampoline-compile): Don't write
trampolines to disk.

* lisp/progmodes/elisp-mode.el
(emacs-lisp-native-compile-and-load): Adjust.

* src/comp.c (syms_of_comp): New variable
inhibit-native-compilation.
(maybe_defer_native_compilation): Use it.
2022-10-03 15:26:13 +02:00
Eli Zaretskii
6f57cb6d81 Fix point adjustment in recreated *Messages* buffers
* lisp/startup.el (normal-top-level): Move setting of
'window-point-insertion-type' from here...
* lisp/simple.el (messages-buffer-mode): ...to here.  This is so
any *Messages* buffers we create instead of the original one, if
it's killed, will have the same type of the window-point marker.
(Bug#57466)
2022-08-29 16:52:07 +03:00
Eli Zaretskii
4582e356d1 Fix error during startup in -nw sessions
* lisp/startup.el (normal-top-level, command-line-1): Don't mess
with fonts in a text-mode session.  (Bug#56660)
2022-07-20 14:57:15 +03:00
Eli Zaretskii
170dcde029 ; * lisp/startup.el (command-line-1): Fix last change. 2022-07-10 11:43:45 +03:00
Eli Zaretskii
aa25a38f2c Fix the startup.el behavior when 'face-font-rescale-alist' is non-nil
* lisp/startup.el (command-line-1, normal-top-level): Reset the
default face's font only if 'face-font-rescale-alist' affects that
face's font.  For the use case where it matters, see
https://lists.gnu.org/archive/html/emacs-devel/2022-07/msg00157.html.
Make the 'inhibit-startup-screen' and non-inhibit branches behave
the same in that case.
2022-07-10 11:32:05 +03:00
Lars Ingebrigtsen
388e0c18f4 Make the nativecomp test eln directory more reliably be removed
* lisp/startup.el (startup-redirect-eln-cache, normal-top-level):
Don't create the nativecomp directory here, because this led to
brittle deletions of the directory -- there would be several
instances of the directory left over after a test run.

* lisp/emacs-lisp/ert.el (ert-run-tests-batch-and-exit): Create
the nativecomp directory.
2022-05-24 14:06:38 +02:00
Sean Whitton
054062060e Factor out *scratch* initialization
* lisp/simple.el (get-scratch-buffer-create): New function, factored
out of scratch-buffer, and additionally clearing the modification flag
and calling substitute-command-keys (bug#55257).
(scratch-buffer):
* lisp/server.el (server-execute):
* lisp/startup.el (normal-no-mouse-startup-screen, command-line-1):
* lisp/window.el (last-buffer, window-normalize-buffer-to-switch-to):
* src/buffer.c (Fother_buffer, other_buffer_safely): Use it.
(syms_of_buffer): Add Qget_scratch_buffer_create.
* lisp/startup.el (startup--get-buffer-create-scratch): Delete
now-unused function.
* doc/lispref/os.texi (Summary: Sequence of Actions at Startup):
* NEWS (Incompatible changes in Emacs 29.1): Document the change.
2022-05-09 18:49:13 -07:00
Lars Ingebrigtsen
e41b7cc935 Fix inhibiting reading the user init file with "emacs -x"
* lisp/startup.el (command-line): Really inhibit loading the user
init file with "emacs -x".
2022-05-06 14:04:55 +02:00
Eli Zaretskii
f2f9e8dc76 ; Improve comments for a recently installed bugfix
* lisp/startup.el (command-line): Remove references to a wrong bug
number and improve comments for delaying the 'user-emacs-directory'
warning.  (Bug#25163)
2022-04-22 15:18:56 +03:00
Tino Calancha
783dd6da31 Respect user-emacs-directory-warning in startup
* lisp/startup.el (command-line): If user-emacs-directory is not
accessible, delay to show a warning until all command line args
are processed (bug#25163).
2022-04-21 17:27:50 +02:00
Lars Ingebrigtsen
fac640ee86 Make it easier to use Emacs as a script interpreter
* doc/emacs/cmdargs.texi (Initial Options): Document -x.
* lisp/startup.el (command-line-1): Add new -scripteval.
(command-line--eval-script): New function.

* src/emacs.c (main): Transform -x to -scripteval.
(standard_args): Add -x (bug#20682).
2022-04-18 12:59:03 +02:00
Robert Pluim
a86205b060 Guard against custom entries that can contain NULs
There are custom entries that contain lambda's as values by default,
which can result in them containing embedded NULs after
byte-compilation, which wreaks havoc when they are saved to .emacs and
later read in.  (Bug#52554)

* lisp/cus-edit.el (custom-save-all): Bind
print-escape-control-characters to t.
* lisp/startup.el (startup--load-user-init-file): Bind
inhibit-null-byte-detection to t.
2022-03-16 18:58:49 +01:00
Lars Ingebrigtsen
69c3ae2969 Make `next-buffer' order reflect command line file order
* lisp/startup.el (command-line-1): Make `next-buffer' order
reflect the command line file order (bug#21505).
2022-02-21 15:42:59 +01:00
Eli Zaretskii
c2913c30b1 Merge from origin/emacs-28
# Conflicts:
#	lisp/startup.el
2022-02-18 10:38:42 +02:00
Andrea Corallo
efaa0ebca9 * lisp/startup.el (normal-top-level): Small code move, improve 202d3be873. 2022-02-11 15:21:47 +01:00
Eli Zaretskii
2d897f7c66 Merge from origin/emacs-28
# Conflicts:
#	lisp/startup.el
2022-02-10 19:12:19 +02:00
Eli Zaretskii
c30106ce9f ; * lisp/startup.el (normal-top-level): Fix byte-compilation warning. 2022-02-10 19:05:41 +02:00
Lars Ingebrigtsen
d64a1f7251 Restore command-line--load-script messaging
* lisp/startup.el (command-line--load-script): Restore previous
non-messaging behaviour.
2022-02-10 15:13:33 +01:00
Andrea Corallo
202d3be873 * lisp/startup.el (normal-top-level): Disable native-comp if not available 2022-02-10 14:26:29 +01:00
Lars Ingebrigtsen
53da8c50fc Don't signal a backtrace on empty --script files
* lisp/startup.el (command-line--load-script): New function that
avoids erroring out if it turns out there's no forms in the buffer
(bug#4616).

* lisp/subr.el (delete-line): New utility function.
* lisp/international/mule.el (load-with-code-conversion): Accept
an eval function.
2022-02-10 13:44:55 +01:00
Eli Zaretskii
d3c47011d5 Allow customization of the user's eln-cache directory
* lisp/startup.el (startup-redirect-eln-cache)
(startup--update-eln-cache): New functions.
(startup--original-eln-load-path): New defvar.
(normal-top-level): Record the original value of
'native-comp-eln-load-path' in 'startup--original-eln-load-path'.
Do not amend 'native-comp-eln-load-path' here, as that could
overwrite user customizations.
(command-line): Amend 'native-comp-eln-load-path' after loading
the early-init file, and then again after loading the user init
file.  (Bug#53891)

* etc/NEWS: Announce 'startup-redirect-eln-cache'.
2022-02-10 10:34:29 +02:00
Andrea Corallo
665ec8946d * lisp/startup.el (startup--require-comp-safely): Fix typo in a92c6191b0 2022-02-01 17:46:55 +01:00
Andrea Corallo
e7fd6fe7ec Rename comp--loadable' into comp--compilable'
* lisp/startup.el (comp--compilable): Rename from `comp--loadable'.
(startup--require-comp-safely): Update accordingly.
(startup--honor-delayed-native-compilations): Likewise.
* src/comp.c (syms_of_comp): Update.
(maybe_defer_native_compilation): Likewise.
2022-02-01 11:30:17 +01:00
Andrea Corallo
a92c6191b0 * Fix `startup--require-comp-safely' (bug#53675)
* lisp/startup.el (startup--require-comp-safely): Remove unnecessary
check.
2022-02-01 11:30:17 +01:00
Po Lu
a85e9d7641 Fix error at startup with recent change
* lisp/startup.el (normal-top-level): Don't access
`native-comp-eln-load-path' if not (featurep 'native-compile).
2022-01-29 19:08:52 +08:00
Eli Zaretskii
a773d7f05b Fix native-compilation at startup
* lisp/startup.el (normal-top-level): Set up the initial value of
'native-comp-eln-load-path' early into startup, then amend it
after calling 'command-line'.  (Bug#53497)
2022-01-29 11:55:02 +02:00
Lars Ingebrigtsen
bf695b937e Move native-comp-eln-load-path setting earlier again
* lisp/startup.el (normal-top-level): Move
`native-comp-eln-load-path' earlier because hooks called may need
the setting (bug#53596).
2022-01-28 15:26:39 +01:00
Eli Zaretskii
b293e254eb ; Rename 'startup--require-comp-safetly'
* src/comp.c (maybe_defer_native_compilation):
* lisp/startup.el (startup--require-comp-safely): Rename from
'startup--require-comp-safetly'.  All callers changed.
2022-01-28 09:37:28 +02:00
Lars Ingebrigtsen
8eaf04de83 Add new switch --init-directory
* doc/emacs/cmdargs.texi (Initial Options): Mention it.
* lisp/startup.el (normal-top-level): Move the eln init to after
we've processed the command line arguments.
(command-line): Interpret the --init-directory switch.

* src/emacs.c (standard_args): Add.
2022-01-27 23:38:13 +01:00
Andrea Corallo
536a57b72c Fix potential native compiler circular dependencies during load
* lisp/startup.el (startup--require-comp-safetly): New function.
(startup--honor-delayed-native-compilations): Make use of
`startup--require-comp-safetly'.
* src/comp.c (CALL0I): New define.
(maybe_defer_native_compilation): Make use of
`startup--require-comp-safetly'.
2022-01-27 23:02:31 +01:00
Andrea Corallo
d0aac84b2a * Fix `startup--honor-delayed-native-compilations' for (bug#53497)
* lisp/startup.el (startup--honor-delayed-native-compilations): Don't
forget to set `comp--loadable' when `comp--delayed-sources' is empty.
2022-01-27 11:55:35 +01:00
Eli Zaretskii
dcd76bd48d Merge from origin/emacs-28
836be7a112 ; * etc/refcards/ru-refcard.tex: Update Copyright year.
86cbc6ee4a * lisp/net/tramp-sh.el: Adapt copyright year
ebe8772f65 ; Minor fixes related to copyright years
23c1ee6989 ; * test/manual/etags/ETAGS.good_N: Adjust to copyright ye...
8d3fc7ec89 * src/xfaces.c (face_for_font): Make 'hash' be uintptr_t.
19dcb237b5 ; Add 2022 to copyright years.

# Conflicts:
#	etc/NEWS
#	etc/refcards/ru-refcard.tex
#	lib/cdefs.h
#	lisp/erc/erc-dcc.el
#	lisp/erc/erc-imenu.el
#	lisp/erc/erc-replace.el
#	lisp/image-dired.el
#	lisp/progmodes/xref.el
#	m4/alloca.m4
#	m4/byteswap.m4
#	m4/errno_h.m4
#	m4/getopt.m4
#	m4/gnulib-common.m4
#	m4/inttypes.m4
#	m4/stddef_h.m4
#	m4/stdint.m4
#	m4/sys_socket_h.m4
2022-01-01 07:03:03 -05:00
Eli Zaretskii
19dcb237b5 ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
Eli Zaretskii
0922634b28 Minor improvements of 'lisp-directory' docs
* lisp/startup.el (lisp-directory):
* etc/NEWS:
* doc/lispref/loading.texi (Library Search): Improve wording of
documentation of 'lisp-directory' and related features.
2021-12-31 10:56:28 +02:00
Stefan Monnier
59732a83c8 Don't store docstrings of preloaded .el files in etc/DOC
Since the location of those files changes between build time and
installation time, this requires to tweak the file name used in those
(#$ . NNN) references during the dump so they don't hardcode the build
directory.  We do it in the same way as was already done for those
same file names in `load-history`, except we convert them back to
absolute file names more lazily (i.e. when fetching the actual
docstring rather than at startup), which requires remembering the
`lisp-dir` computed at startup in the new `lisp-directory` variable.

* src/Makefile.in ($(etc)/DOC): Don't scan Lisp files any more.

* src/lread.c (Fload): Use relative file names for `load-file-name`
when preloading for the dump, like we already did for `current-load-list`.
(read_list): Don't zero-out dynamic docstring references during the
preload since they won't be filled later by Snarf-documentation any more.
(read1): Remove the hash-hack for doc references that were zeroed.

* lisp/startup.el (lisp-directory): New variable.
(command-line): Set it.

* src/doc.c (get_doc_string): Use `lisp-directory` for dynamic
docstring references using relative file names.
(syms_of_doc): Add `Qlisp_directory`.

* lib-src/make-docfile.c (scan_file): Don't handle `.el` or `.elc`
files any more.
(IS_SLASH): Remove macro, not used any more.
(skip_white, read_lisp_symbol, search_lisp_doc_at_eol)
(scan_lisp_file): Remove functions, not used any more.

* doc/lispref/loading.texi (Library Search): Mention `lisp-directory`.
2021-12-30 23:17:45 -05:00
Po Lu
da2c0e8f7d Merge remote-tracking branch 'origin/master' into feature/pgtk 2021-12-13 13:32:53 +08:00
Juri Linkov
e4e9a7ce43 * lisp/startup.el: Let-bind browse-url-browser-function instead of setq-local
* lisp/startup.el (fancy-startup-text, fancy-about-text)
(fancy-splash-head, normal-about-screen): Let-bind browse-url-browser-function
to eww-browse-url around functions that use browse-url.
(fancy-startup-screen, fancy-about-screen): Don't set buffer-local
browse-url-browser-function.
https://lists.gnu.org/archive/html/emacs-devel/2021-12/msg00939.html
2021-12-12 19:48:40 +02:00
Po Lu
d9b3f665bc Merge remote-tracking branch 'origin/master' into feature/pgtk 2021-12-07 09:32:13 +08:00
Daniel Fleischer
63c8a6066a Add package management to tutorial and startup screen
* etc/tutorials/TUTORIAL: Add section about package installation.
* lisp/startup.el (fancy-startup-tail): Add button for
package-list-packages.

This was discussed in:
https://lists.gnu.org/r/emacs-devel/2021-12/msg00079.html
2021-12-06 14:59:35 +01:00
Po Lu
8f2d0450ad Merge remote-tracking branch 'origin/master' into feature/pgtk 2021-12-06 08:57:17 +08:00
Lars Ingebrigtsen
b961af66b9 Fix fancy-about-screen point placement
* lisp/startup.el (fancy-about-screen): Make point placement more
resilient (bug#43636).
2021-12-05 20:54:50 +01:00
Yuuki Harano
e5f74cecf1 Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into feature/pgtk 2021-12-06 00:37:01 +09:00
Lars Ingebrigtsen
dbadbb5bad Tweak fancy-about-text
* lisp/startup.el (fancy-about-text): Mention that Emacs is an
editor, because people don't know that (bug#43636).
2021-12-05 01:53:31 +01:00
Lars Ingebrigtsen
ab41b1c554 Fill Emacs version on about screen
* lisp/startup.el (fancy-about-text): Fill the Emacs version,
since it's too long these days.
2021-12-05 01:51:12 +01:00
Po Lu
3005c00b13 Merge remote-tracking branch 'origin/master' into feature/pgtk 2021-12-01 09:05:07 +08:00
Andrea Corallo
9b381a95ef Improve native compiler startup circular dependecy prevention mechanism
* src/comp.c (maybe_defer_native_compilation): Update to accumulate
delayed objects in `comp--delayed-sources'.
(syms_of_comp): Add `comp--delayed-sources' and `comp--loadable'
vars.

* lisp/startup.el (startup--honor-delayed-native-compilations): New
function.
(normal-top-level): Call it.
2021-11-30 15:42:41 +01:00
Po Lu
8f5d2a3181 Merge remote-tracking branch 'origin/master' into feature/pgtk 2021-11-30 08:16:50 +08:00
Eli Zaretskii
0c44b8edb4 Fix handling of '--dump-file' command-line option
* lisp/startup.el (command-line-1): Handle "--dump-file" and
"--seccomp" if they are left on the command-line.  (Bug#52106)
2021-11-25 20:54:07 +02:00
Lars Ingebrigtsen
539ee617d4 Fill the Emacs version on the splash page
* lisp/startup.el (fancy-startup-tail):
(normal-mouse-startup-screen):
(normal-no-mouse-startup-screen): Fill the Emacs version data,
since it's usually longer than a single line, anyway.
2021-11-21 11:04:40 +01:00