1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00
Commit graph

141691 commits

Author SHA1 Message Date
Andrea Corallo
886ded1b70 * lisp/emacs-lisp/comp.el (comp-never-optimize-functions): Add yes-or-no-p 2020-04-16 18:59:40 +01:00
Andrea Corallo
c5ed3a72a8 * lisp/subr.el (eval-after-load): Make use of load-true-file-name bug#40638 2020-04-15 22:55:30 +01:00
Andrea Corallo
208a11d3f0 Merge remote-tracking branch 'savannah/master' into HEAD 2020-04-14 18:25:23 +01:00
Andrea Corallo
8db8c851ad Always set load-true-file-name' where load-file-name' is set too.
Fix bug#40620.

	* lisp/cus-dep.el (custom-make-dependencies): Set
	load-true-file-name.

	* lisp/emacs-lisp/package.el (package-quickstart-refresh):
	Likewise.

	* lisp/international/mule.el (load-with-code-conversion):
	Likewise.

	* lisp/loadup.el (load-true-file-name): Likewise.
2020-04-14 19:58:41 +01:00
Eli Zaretskii
6bf79d65d3 ; * src/image.c: Cleanup of #ifdef's related to HAVE_NATIVE_IMAGE_API. 2020-04-14 18:19:59 +03:00
Eli Zaretskii
e94206aaf6 Make use of MS-Windows native image API be selectable at run time
* configure.ac: Minor cleanup in how w32image.o is added to the
build when native image APIs are requested.

* src/w32gui.h (w32_load_image, w32_can_use_native_image_api)
(w32_gdiplus_shutdown): Move prototypes from w32term.h here, since
w32.c doesn't include w32term.h.
* src/image.c (struct image_type): No need to pass TYPE to the
'valid_p' method.  All callers changed.
(initialize_image_type) [HAVE_NATIVE_IMAGE_API]: Call
'image_can_use_native_api' before trying image-specific methods.
(image_can_use_native_api): New function.
(image_types): Remove the native_image_type parts.
(syms_of_image): New symbol 'native-image'.
(parse_image_spec): Accept native-image "type" for any image type.
* src/w32term.c (syms_of_w32term): New variable
'w32-use-native-image-API'.
* src/w32image.c: (w32_can_use_native_image_api): New function.
(gdiplus_init): Rename from w32_gdiplus_startup. Simplify code.
Move the call to GdiplusStartup to a separate function.  Use
ordinal number for SHCreateMemStream if cannot load it by name.
(w32_load_image): Ignore Win32Error status from
w32_select_active_frame.
Move DEFSYMs from here...
* src/image.c (syms_of_image) [HAVE_NATIVE_IMAGE_API]: ...to here.

* etc/NEWS: Update the entry about native image API use.
2020-04-14 18:10:41 +03:00
Andrea Corallo
8decfbe4d7 * lisp/emacs-lisp/comp.el (native-compile-async): Better error message. 2020-04-14 08:48:24 +01:00
Juan José García-Ripoll
df254a7445 Initial version of native image API support for MS-Windows
* src/w32image.c: New file.
* src/w32term.h: Add prototypes of 'w32_load_image',
'w32_gdiplus_startup', 'w32_gdiplus_shutdown', and
'w32_query_frame_background_color'.
* src/w32term.c (w32_query_frame_background_color): No longer
static.
* src/w32.c (term_ntproc) [HAVE_GDIPLUS]: Call
'w32_gdiplus_shutdown'.
* src/image.c (struct image_type) <valid_p>: Accept an additional
argument, the image type.  All implementations changed.
(init_native_image_functions, native_image_p, native_image_load)
[HAVE_NATIVE_IMAGE_API]: New methods for "native image type".
(initialize_image_type) [HAVE_NATIVE_IMAGE_API]: Call
'init_native_image_functions'.
(image_types) [HAVE_NATIVE_IMAGE_API]: Add settings for native
image API.
(lookup_image_type) [HAVE_NATIVE_IMAGE_API]: Initialize native
functions if needed.

* lisp/term/w32-win.el (dynamic-library-alist): Add gdiplus and
shlwapi.

* etc/NEWS: Announce the new feature.

* configure.ac (native-image-api): New option, OFF by default.
(HAVE_NATIVE_IMAGE_API): If native-image-api is selected, add
w32image.o to W32_OBJ.
2020-04-14 09:52:55 +03:00
Juri Linkov
7a9fb5d55c Fix hi-lock test and add new test for unhighlight (bug#40337)
* lisp/hi-lock.el (hi-lock-unface-buffer): Use hi-lock--hashcons
only on strings, not lists.

* test/lisp/hi-lock-tests.el (hi-lock-bug26666): Revert previous change,
use "a" instead of "b".
(hi-lock-unhighlight): New test.
2020-04-14 02:33:52 +03:00
Juri Linkov
086faceb1c * lisp/vc/vc.el (vc-deduce-fileset): Improve docstring (bug#34949). 2020-04-14 02:24:51 +03:00
Andrea Corallo
b7678cf10e * lisp/emacs-lisp/comp.el (comp-finalize-relocs): Better commentary. 2020-04-13 20:44:09 +01:00
Andrea Corallo
9f42f35418 * Fix native-compile-async for bug#40602.
* lisp/emacs-lisp/comp.el (native-compile-async): Relax coherency condition.
2020-04-13 20:44:09 +01:00
Andrea Corallo
517c123fd4 Merge remote-tracking branch 'savannah/master' into HEAD 2020-04-13 18:11:12 +01:00
Andrea Corallo
9787323552 * src/lread.c (Fload): Clean-up unnecessary sanity check.
'is_native_elisp' can't be non zero if NATIVE_COMP_FLAG is not set.
2020-04-13 18:10:03 +01:00
Andrea Corallo
05adf0353f Fix function find mechanism for installed instance.
* src/lread.c (parent_directory): New function.
	(Fload): Make use of 'parent_directory' and fix load-history
	build-up with relative paths.
2020-04-13 18:09:13 +01:00
Glenn Morris
cdbb37f628 Merge from origin/emacs-27
f84aed5fd2 (origin/emacs-27) Clarify documentation on inhibit-modific...
2020-04-13 09:02:29 -07:00
Glenn Morris
584ff8c2dc ; Merge from origin/emacs-27
The following commit was skipped:

81d07da788 gnus-shorten-url: Improve and avoid args-out-of-range error
2020-04-13 09:02:29 -07:00
Glenn Morris
0a4b992c42 Merge from origin/emacs-27
1dfc497fac Minor wording change in Introduction to Programming in Ema...
ff09b4eeac Fix 'flymake-show-diagnostics-buffer' when line numbers ar...
63e8d0ea87 Fix last changes describing mail commands
01212a762f Do setup Flymake in file-less Elisp buffers
36873ef2b2 Fix error message for ‘cl-struct-unknown-slot’ (bug#39995)
3f9310b0fe Fix and improve documentation of mail-related features
1482a75efa Fix build failure with Fx_gtk_debug
cf57663f2a Mention jit-lock deferred as an alternative to fast-but-im...

# Conflicts:
#	etc/NEWS
2020-04-13 09:02:29 -07:00
Glenn Morris
d0b9cf876f * doc/lispref/processes.texi (Network): Fix xref usage. 2020-04-13 09:01:45 -07:00
Glenn Morris
3b4def8e60 * doc/emacs/msdos.texi (Windows Keyboard): Fix xref. 2020-04-13 08:59:05 -07:00
Albert
9c6392c358 Fix previous change in w32fns.c
* src/w32fns.c (w32_msg_pump): Simplify by not calling
ImmGetOpenStatus.
(Fw32_get_ime_open_status): Fix a typo.
2020-04-13 18:31:35 +03:00
Eli Zaretskii
fc336a4655 Document the new 'w32-get/set-ime-open-status' functions
* doc/emacs/msdos.texi (Windows Keyboard): Document
'w32-set-ime-open-status'.

* etc/NEWS: Announce the new IME-related functions.
2020-04-13 16:33:57 +03:00
Eli Zaretskii
61da72dc2d ; Fix last change. 2020-04-13 16:20:14 +03:00
Albert
c6ecdab0ee Support toggling native Input Methods on MS-Windows
* src/w32term.h (WM_EMACS_IME_STATUS): New message code.

* src/w32fns.c (ImmGetOpenStatus_Proc, ImmSetOpenStatus_Proc): New
typedefs.
(w32_msg_pump): Handle the WM_EMACS_IME_STATUS message.
(Fw32_get_ime_open_status, Fw32_set_ime_open_status): New functions
(syms_of_w32fns): Defsubr them.
(globals_of_w32fns): Load ImmGetOpenStatus and ImmSetOpenStatus
from IMM2.DLL.
2020-04-13 16:07:19 +03:00
Štěpán Němec
f84aed5fd2 Clarify documentation on inhibit-modification-hooks intended usage
Cf. bug#40332 and the discussion at
https://lists.gnu.org/archive/html/emacs-devel/2020-03/msg00921.html

* doc/lispref/text.texi (Change Hooks):
* src/insdel.c (syms_of_insdel): Clarify the intended usage of
'inhibit-modification-hooks'.
2020-04-13 12:15:13 +02:00
Štěpán Němec
188bd80a90 gnus-shorten-url: Improve and avoid args-out-of-range error
'gnus-shorten-url' (used by 'gnus-summary-browse-url') ignored
fragment identifiers and didn't check substring bounds, in some cases
leading to runtime errors, e.g.:

  (gnus-shorten-url "https://some.url.with/path/and#also_a_long_target" 40)
  ;; => Lisp error: (args-out-of-range "/path/and" -18 nil)

This commit makes it account for #fragments and fixes faulty string
computation, reusing existing helper function.  (bug#39980)

* lisp/vc/ediff-init.el (ediff-truncate-string-left): Rename to
'string-truncate-left' and move...
* lisp/emacs-lisp/subr-x.el (string-truncate-left):  ...here.
All callers changed.
* lisp/gnus/gnus-sum.el (gnus-shorten-url): Fix args-out-of-range
error, don't drop #fragments, use 'string-truncate-left'.
2020-04-13 12:12:00 +02:00
Andrea Corallo
1c5548f1c5 * src/lread.c (Fload): Add comment. 2020-04-13 11:07:36 +01:00
Štěpán Němec
81d07da788 gnus-shorten-url: Improve and avoid args-out-of-range error
'gnus-shorten-url' (used by 'gnus-summary-browse-url') ignored
fragment identifiers and didn't check substring bounds, in some cases
leading to runtime errors, e.g.:

  (gnus-shorten-url "https://some.url.with/path/and#also_a_long_target" 40)
  ;; => Lisp error: (args-out-of-range "/path/and" -18 nil)

This commit makes it account for #fragments and fixes faulty string
computation.  (bug#39980)

Do not merge to master, where the helper is put to subr-x.el.

* lisp/gnus/gnus-sum.el (gnus--string-truncate-left): New helper
function (copied from 'ediff-truncate-string-left').
(gnus-shorten-url): Use it and don't drop #fragments.
2020-04-13 12:03:38 +02:00
Andrea Corallo
3effa2d674 Merge remote-tracking branch 'savannah/master' into HEAD 2020-04-13 10:55:51 +01:00
Andrea Corallo
c8b7e07553 Revert "Fix org for eln new compilation folder layout"
This reverts commit f77f6ca770.
2020-04-13 10:32:43 +01:00
Andrea Corallo
6e09597e27 Introduce load-true-file-name
* src/comp.c (maybe_defer_native_compilation): Use
	`load-true-file-name' instead of `load-file-name'.

	* src/lread.c (Fload, end_of_file_error, read1, read_list)
	(init_lread, syms_of_lread): Add new `load-true-file-name' and
	fake `load-file-name' value when loading .eln files.
2020-04-13 10:32:43 +01:00
Eli Zaretskii
c395ebaf21 Fix last change
* lisp/mail/rmail.el (rmail-simplified-subject): A prefix can have
up to 4 characters, not 3.
2020-04-13 12:25:37 +03:00
Eli Zaretskii
1dfc497fac Minor wording change in Introduction to Programming in Emacs Lisp
* doc/lispintro/emacs-lisp-intro.texi (Prevent confusion): Mention
that dynamic scoping is only the default in Emacs Lisp, not the
only scoping rule.  (Bug#40594)
2020-04-13 11:53:47 +03:00
Eli Zaretskii
49f2811f78 Improve support of "Re:" in Rmail
* lisp/mail/rmail.el (rmail-simplified-subject)
(rmail-reply-regexp): Recognize U+FF1A FULLWIDTH COLON as a colon
after "Re:"-type prefixes.
(rmail-re-abbrevs): New defcustom with localized abbreviations of
"Re:".
(rmail-reply-regexp): Use 'rmail-re-abbrevs'.  Recognize U+FF1A
in addition to the ASCII colon.

* etc/NEWS: Call out the new defcustom 'rmail-re-abbrevs'.
2020-04-13 11:43:39 +03:00
Eli Zaretskii
ff09b4eeac Fix 'flymake-show-diagnostics-buffer' when line numbers are displayed
* lisp/progmodes/flymake.el (flymake--diagnostics-buffer-entries):
Do nothing if 'flymake--diagnostics-buffer-source' is not a
buffer.  (Bug#40529)
2020-04-13 08:00:14 +03:00
Juri Linkov
91e4acf7c7 Fix hi-lock test and add new test for case-fold (bug#40337)
* lisp/hi-lock.el (hi-lock--regexps-at-point): Handle font-lock faces.
(hi-lock-unface-buffer): Simplify default value handling.
(hi-lock-set-pattern): Add either lighter or regexp to
hi-lock-interactive-lighters.
(hi-lock-set-pattern): Put overlay prop hi-lock-overlay-regexp to
either lighter or regexp.

* test/lisp/hi-lock-tests.el (hi-lock-bug26666): Use "b" instead of "a".
(hi-lock-case-fold): New test.
2020-04-13 02:40:56 +03:00
Štěpán Němec
68ffe4a3c9 Fix bootstrap compiler warnings about `read-library-name'
Introduced by

2020-03-28T22:16:28+01:00!stepnem@gmail.com
2c45091791 (load-library, locate-library: Use read-library-name)

Thanks to Juanma Barranquero <lekktu@gmail.com> for reporting.

* lisp/files.el:
* lisp/subr.el: Declare 'read-library-name'.
2020-04-12 22:41:32 +02:00
Eli Zaretskii
63e8d0ea87 Fix last changes describing mail commands
* doc/emacs/sending.texi (Sending Mail): Fix the description of
the behavior of 'C-x m' without prefix argument.  (Bug#40561)
2020-04-12 21:47:52 +03:00
Philipp Stephani
42306747d8 Fix error in 'call-process-region' when START is nil (Bug#40576)
* src/callproc.c (Fcall_process_region): Fix behavior when START is
nil and DELETE is non-nil.

* test/src/callproc-tests.el
(call-process-region-entire-buffer-with-delete): New unit test.
2020-04-12 19:04:11 +02:00
Philipp Stephani
900947fbe8 ; * test/src/callproc-tests.el: Fix checkdoc errors. 2020-04-12 18:08:35 +02:00
Andrea Corallo
f9a1d4b3f7 Merge remote-tracking branch 'savannah/master' into HEAD 2020-04-12 16:53:36 +01:00
Andrea Corallo
b56de5dda2 * src/pdumper.c (dump_do_dump_relocation): Optimize native dump load.
Check just once if is a local build or Emacs got installed.
2020-04-12 16:52:05 +01:00
Andrea Corallo
3dd6cf8139 Implement working make install for native build. 2020-04-12 16:52:05 +01:00
Andrea Corallo
7f5d1e9aa8 Set invocation variables during dump load.
Vinvocation_directory must be set during dump load process to support
.eln load.

	* src/pdumper.h: (pdumper_load): Add argv0 and original_pwd
	parameters.

	* src/pdumper.c (pdumper_load): Add argv0 and original_pwd
	parameter plus call 'set_invocation_vars'.

	* src/lisp.h (set_invocation_vars): New function.

	* src/emacs.c (set_invocation_vars): New function.
	(init_cmdargs): Move logic into 'set_invocation_vars' and call it.
	(load_pdump): Add 'original_pwd' parameter and update calls to
	'pdumper_load'.
	(main): Set emacs_wd earlier and update call to 'pdumper_load'.
2020-04-12 16:52:05 +01:00
Andrea Corallo
f4156b452f Implement position independent dump.
Set the filename for every compilation unit as realtive to obtain a
position independent dump.

	* lisp/loadup.el: Modify filename for every compilation unit as
	position independent.

	* src/pdumper.c (dump_do_dump_relocation): Update to be invocation
	directory relative.
2020-04-12 16:52:05 +01:00
João Távora
01212a762f Do setup Flymake in file-less Elisp buffers
Fixes: bug#40573

* lisp/progmodes/elisp-mode.el (emacs-lisp-mode): Change
condition for setting flymake-diagnostic-functions.
2020-04-12 15:17:15 +01:00
Philipp Stephani
36873ef2b2 Fix error message for ‘cl-struct-unknown-slot’ (bug#39995)
* lisp/emacs-lisp/cl-macs.el (cl-struct-unknown-slot): Remove spurious
format specifiers.
2020-04-12 15:12:16 +02:00
Andrea Corallo
d85b803b78 * src/comp.c (native-comp-unit-set-file): New function. 2020-04-12 13:31:38 +01:00
Andrea Corallo
62f956970f * src/comp.c (native-comp-unit-file): Better parameter name. 2020-04-12 13:31:38 +01:00
Philipp Stephani
aed427ece5 Also use named functions for the ‘gv’ declare forms (Bug#40491)
* lisp/emacs-lisp/gv.el (gv--expander-defun-declaration)
(gv--setter-defun-declaration): New helper functions; use them.
2020-04-12 14:27:33 +02:00