Commit graph

135125 commits

Author SHA1 Message Date
Stefan Monnier
5259fdf960 * lisp/international/titdic-cnv.el: Use lexical-binding
(tit-process-body): Remove unused vars 'template' and 'second'.
(tsang-quick-converter): Remove unused args 'name' and 'title'.
Remove unused var 'slot'.
(tsang-b5-converter, quick-b5-converter, tsang-cns-converter)
(quick-cns-converter, py-converter, ziranma-converter)
(ctlau-converter, ctlau-gb-converter, ctlau-b5-converter):
Remove unused args 'name' and 'title'.
(miscdic-convert): Remove unused var 'dicbuf'.
Don't pass 'name' and 'title' to the conversion function.
2019-01-21 17:20:00 -05:00
Paul Eggert
be73ed4338 Simplify pdumper-load via timespectod
Suggested by Eli Zaretskii in:
https://lists.gnu.org/r/emacs-devel/2019-01/msg00458.html
* src/pdumper.c (pdumper_load): Simplify.
2019-01-21 12:49:00 -08:00
Stefan Monnier
657f6fe500 * src/pdumper.c (dump_string) [CHECK_STRUCTS]: Fix copy&paste error 2019-01-21 15:03:28 -05:00
Stefan Monnier
6896604bab * lisp/electric.el: Fix typo in last change. 2019-01-21 14:30:29 -05:00
Stefan Monnier
d1ea675d2c (electric--sort-post-self-insertion-hook): Accept non-symbol functions
* lisp/electric.el (electric--sort-post-self-insertion-hook):
Don't burp on non-symbol functions.
2019-01-21 13:52:51 -05:00
Alan Third
6e5ac1d1ff Fix occasional pdumper/bootstrap error
* src/Makefile.in (emacs$(EXEEXT)): Copy the new executable over
bootstrap-emacs.
2019-01-21 16:52:17 +00:00
Michael Albinus
7fcdabdcb0 * lisp/net/tramp-sh.el (tramp-set-remote-path): Fix usage of tmpfile. 2019-01-21 11:34:32 +01:00
Michael Albinus
e5ef4c660c Use `inhibit-read-only' in Tramp
* lisp/net/tramp.el (tramp-process-actions, tramp-accept-process-output)
(tramp-send-string):
* lisp/net/tramp-adb.el (tramp-adb-handle-make-process)
(tramp-adb-send-command-and-check, tramp-adb-wait-for-output):
* lisp/net/tramp-sh.el (tramp-sh-handle-make-process)
(tramp-wait-for-output, tramp-send-command-and-check):
* lisp/net/tramp-smb.el (tramp-smb-wait-for-output):
Use `inhibit-read-only'.
2019-01-21 09:48:55 +01:00
Michael Albinus
5961e4fa42 Use POSIX "df" in Tramp, if available
* lisp/net/tramp-sh.el (tramp-get-remote-df):
Support also POSIX.1 "df".
(tramp-sh-handle-file-system-info): Adapt accordingly.
2019-01-20 18:56:26 +01:00
Eli Zaretskii
67b1053dcd Support native image resizing on MS-Windows
* src/w32term.c (x_draw_image_foreground): Scale the image if
the requested dimensions are different from the bitmap
dimensions.
* src/image.c (Fimage_scaling_p): Return t when HAVE_NTGUI.
(x_set_image_size) [HAVE_NTGUI]: Record the scaled dimensions
in the image struct.
* src/dispextern.h (HAVE_NATIVE_SCALING): Define when
HAVE_NTGUI as well.

* etc/NEWS: Update the announcement of native image scaling.
2019-01-20 17:59:12 +02:00
Philipp Stephani
551051596f Improve error data when passing a wrong type to 'sort' (Bug#34104)
* src/fns.c (Fsort): Use 'list-or-vector-p' for error message.
(syms_of_fns): Define 'list-or-vector-p'.

* test/src/fns-tests.el (fns-tests-sort): Extend unit test.
2019-01-20 00:04:19 +01:00
Paul Eggert
3e12551723 pdumper-stats now returns s, not ms
* doc/lispref/internals.texi (pdumper-stats):
* src/pdumper.c (pdumper_load): Return seconds, not milliseconds.
Minimize rounding errors in the usual case.
2019-01-19 14:39:16 -08:00
Eli Zaretskii
b821a70cb9 ; Fix a recent change in pdumper.c
* src/pdumper.c (Fpdumper_stats): Don't expand dump filename, as we don't
record the directory relative to which it was specified.
2019-01-19 20:37:50 +02:00
Eli Zaretskii
8e2b2a2b17 Minor cleanup in pdumper.c
* src/pdumper (subtract_timespec): Function removed.
(pdumper_load): Use timespec_sub instead of subtract_timespec.
2019-01-19 20:21:25 +02:00
Eli Zaretskii
8bb5939efa Improve 'pdumper-stats' and its documentation
* src/pdumper.c (Fpdumper_stats): Improve formatting and
wording of the doc string.  Decode the pdump file name and
expand-file-name it.

* doc/lispref/internals.texi (Building Emacs): Document
'pdumper-stats'.
2019-01-19 20:09:38 +02:00
Eli Zaretskii
436c225f1b Unbreak the macOS NS build
* src/xdisp.c (expose_window_tree): Declare and define 'f' on
NS as well.  Reported by Herbert J. Skuhra <herbert@gojira.at>.
2019-01-19 13:32:59 +02:00
Dmitry Gutov
8198d4be6b ; Update the commentary 2019-01-19 03:57:58 +03:00
Dmitry Gutov
b6af090022 Misc ignore-related project.el changes
* lisp/progmodes/project.el (project-ignores): Don't append the
default ignores list, just use vc-directory-exclusion-list.
(project--dir-ignores): Use the default ignores if the dir is
outside of the current project.
(project-files): Use project--dir-ignores to support external
roots better.
2019-01-19 03:54:58 +03:00
João Távora
7717778e8b Revert "Remove leftover from previous electric-layout-rules API"
This is a backward-incompatible change, and removing it isn't really
necessary.

This reverts commit 942dad2b51.
2019-01-18 22:29:02 +00:00
Stefan Monnier
78725e49d2 (electric-layout-post-self-insert-function-1): Simplify.
Call electric--after-char-pos right from the start, and take advantage of the
fact that it guarantees to return the right position or nil.
2019-01-18 17:20:21 -05:00
João Távora
0621591687 Ensure fns in electric-layout-rules are called in right position
* lisp/electric.el (electric-layout-rules): Ensure rules are
called from right spot.
2019-01-18 22:05:50 +00:00
João Távora
942dad2b51 Remove leftover from previous electric-layout-rules API
An element of electric-layout-rules is either a function or a pair
(CHAR . WHERE), and WHERE can't be a function anymore.

* lisp/electric.el (electric-layout-post-self-insert-function-1):
Remove leftover line.
2019-01-18 22:05:50 +00:00
Paul Eggert
7818bcdd6c Port to platforms where NULL is a pointer
* src/image.c (x_create_x_image_and_pixmap):
The Picture type is an integer, not a pointer.
Come to think of it, Picture is really XID, and as
far as I can tell, all-bits-one is the invalid XID,
not all-bits-zero.  However that is a bigger issue;
for now, this patch just unbreaks the build.
2019-01-18 13:04:09 -08:00
Eli Zaretskii
6bac9ea177 Improve documentation of portable dumping
* src/pdumper.c (Fdump_emacs_portable): Improve the doc string
and the error messages.

* doc/lispref/internals.texi (Building Emacs): Document
portable dumping and the 'dump-emacs-portable' function.
2019-01-18 17:58:47 +02:00
Glenn Morris
957090b795 Merge from origin/emacs-26
b6d78a0 (origin/emacs-26) Fix a typo in ELisp manual
c9f6f86 Prevent redrawing if frame is garbaged
00ba226 Attempt to fix hangs on MS-Windows due to C-g
b26d637 Fix Calc graph output on MS-Windows
03818b0 Fix a minor mistake in ELisp manual
6ac5985 ; Fix some trivial doc typos
21b9026 * etc/tutorials/TUTORIAL: Fix typo (bug#34049)
d223727 Fix UI of Buffer-menu
0f71655 Reinitialize ispell-really-enchant when changing the speller
9845044 Speed up loading css-mode
2019-01-18 07:50:47 -08:00
Eli Zaretskii
5e3b0f5239 Clean up memory allocation and unexec support on MS-Windows
* src/w32heap.c (report_temacs_memory_usage): Condition on
!CANNOT_DUMP, in addition to ENABLE_CHECKING.
(init_heap): Accept an argument, which tells us what heap
allocation method to use.
(DUMPED_HEAP_SIZE) [CANNOT_DUMP]: Define to a small value, as
we don't use dumped_data[] in this case.
* src/w32heap.h (init_heap): Adjust prototype.
<using_dynamic_heap>: Remove declaration.
* src/emacs.c (main) [WINDOWSNT]: Determine heap allocation
method based on whether we are in temacs and whether unexec
will be used to dump Emacs.  Pass the heap allocation method
to init_heap, which is now called after parsing the
--temacs=METHOD option.
* src/unexw32.c (unexec): Don't fiddle with using_dynamic_heap.
<using_dynamic_heap>: Remove definition.
* src/w32proc.c (malloc_before_init, realloc_before_init)
(free_before_init): New functions, to catch memory allocation
before heap allocation method is set up.
2019-01-18 17:04:00 +02:00
Eli Zaretskii
f943409183 ; * etc/NEWS: Fix description of pdumper. 2019-01-18 11:56:47 +02:00
Eli Zaretskii
b6d78a0d80 Fix a typo in ELisp manual
* doc/lispref/nonascii.texi (Converting Representations): Fix
inconsistency between @defun and the argument description of
'byte-to-string'.  (Bug#34119)
2019-01-18 10:51:57 +02:00
Dmitry Gutov
fbe87d0f8f Rebase project-find-regexp on top of project-files
* lisp/progmodes/project.el (project--files-in-directory):
New function.
(project-files, project-find-regexp): Use it.
(project--dir-ignores): New function.
(project--find-regexp-in): Remove.
(project--process-file-region): New function.
(project--find-regexp-in-files): New function.
(project-find-regexp, project-or-external-find-regexp): Use it, and
project-files as well.
2019-01-18 06:46:36 +03:00
Dmitry Gutov
afc8a41f48 ; Update the number 2019-01-18 06:46:35 +03:00
Dmitry Gutov
d8da0916ff Make 'project-files' the "canonical" generic of the two
* lisp/progmodes/project.el (project-files): Move the actual
command building and invocation here.
(project-file-completion-table): Delegate to 'project-files'.
2019-01-18 06:46:35 +03:00
Stefan Monnier
e99a124110 * lisp/textmodes/sgml-mode.el: Try and fix bug#33887.
Remove redundant :group args.
(sgml-syntax-propertize-rules): Speed up processing of most double quotes.
2019-01-17 18:25:00 -05:00
João Távora
be505726b6 Fix electric-pair-tests by disabling bug#33794's fix with a variable
The variable c--disable-fix-of-bug-33794, which should be removed in
the short term in favor of a permanent solution, is introduced.

It is bound to nil by default.  This means that breakage is still
happening in actual c-mode and c++-mode usage, though the tests no
longer show it.

To get around this breakage, put

   (setq c--disable-fix-of-bug-33794 t)

In your init file.  Evidently, you will lose the fix for bug#33794,
but that only affects a small corner case of c-toggle-auto-newline,
which is not turned on by default.

See https://lists.gnu.org/archive/html/emacs-devel/2019-01/msg00360.html
for more information.

* lisp/progmodes/cc-cmds.el (c--disable-fix-of-bug-33794): New
variable.
(c--with-post-self-insert-hook-maybe): New macro.
(c-electric-pound, c-electric-brace, c-electric-slash)
(c-electric-star, c-electric-semi&comma, c-electric-colon)
(c-electric-lt-gt, c-electric-paren): Use it.
(c-electric-paren, c-electric-brace): Check
c--disable-fix-of-bug-33794.

* test/lisp/electric-tests.el (c--disable-fix-of-bug-33794):
Forward declare.
(electric-pair-test-for)
(electric-layout-int-main-kernel-style)
(electric-modes-in-c-mode-with-self-insert-command): Use it.
2019-01-17 18:49:10 +00:00
João Távora
4bdc037469 Revert "Temporarily comment out CC Mode from tests..."
This reverts commit 54f297904e.
2019-01-17 18:49:07 +00:00
Martin Rudalics
e5663bea40 Fix wording in Window Hooks section of Elisp manual
* doc/lispref/windows.texi (Window Hooks): Fix wording in
description of window change functions.  Suggested by Robert
Pluim <rpluim@gmail.com>.
2019-01-17 19:07:47 +01:00
Alan Third
03b8903ee7 Be more specific with XRender bit-depths (bug#34051)
* src/image.c (x_create_x_image_and_pixmap): Fail gracefully if a bit
depth is requested that XRender doesn't support.
2019-01-17 17:30:54 +00:00
João Távora
5a6df06494 Simplify ignored extensions filtering in Icomplete (bug#34070)
* lisp/icomplete.el: Use lexical binding.
(icomplete-completions): Use minibuffer-completion-predicate
to filter out completion-ignored-extensions.
2019-01-17 15:17:02 +00:00
João Távora
7560ef7de9 Revert "Fix icomplete's cycling when filename filtering kicks in"
This reverts commit cdb082322d, which
was a fix for bug#34070.  A much better fix to be added soon.
2019-01-17 15:11:36 +00:00
João Távora
80cbfb61c5 Fix flymake-proc--delete-temp-directory if temp dir ends in slash
Fixes: bug#34074

Reported by 林宝龙 <lbl52001@gmail.com>.

* lisp/progmodes/flymake-proc.el
 (flymake-proc--delete-temp-directory):  Use directory-file-name.
2019-01-17 14:38:44 +00:00
Alan Mackenzie
54f297904e Temporarily comment out CC Mode from tests which are incompatible with it.
* tests/electric-tests (electric-pair-test-for): comment out c++-mode from the
list of modes to be used in tests.
(electric-pair-whitespace-chomping-2-at-point-4-in-c++-mode-in-strings)
(ert-deftest electric-layout-int-main-kernel-style)
(ert-deftest electric-layout-int-main-allman-style): Comment out.
2019-01-17 12:51:40 +00:00
Glenn Morris
8ca414de0e Fix --enable-profiling builds (bug#34099)
* src/profiler.c (syms_of_profiler_for_pdumper):
Only set cpu_log if CPU profiling is enabled.
2019-01-17 07:19:45 -05:00
Martin Rudalics
0aece3e118 Expand spectrum of window change functions
* src/window.c (run_window_change_functions): Run window
change functions for Qwindow_state_change_functions.
(resize_frame_windows): Set frame's window_change slot when
single-window frames change size.
(Qwindow_state_change_functions): New symbol.
(Vwindow_state_change_functions): New Lisp variable.
* doc/lispref/windows.texi (Selecting Windows): Mention
'window-selection/state-change-functions' and add reference to
Window Hooks.
(Window Hooks): Document 'window-state-change-functions'.
* etc/NEWS: Mention new hook 'window-state-change-functions'.
2019-01-17 10:21:07 +01:00
Paul Eggert
978cf88bda Port pdumper to older GNU/Linux
Problem reported by Colin Baxter in:
https://lists.gnu.org/r/emacs-devel/2019-01/msg00321.html
* src/alloc.c (my_heap_start): Also define if
GNU_LINUX && CANNOT_DUMP && DOUG_LEA_MALLOC.
2019-01-16 17:35:11 -08:00
Daniel Colascione
191a5568db Fix segfault in profiler after pdump load
Move initialization of the profiler's hash test to static
initialization from the syms function so that pdumper doesn't need to
bother capturing it in any special way.

* src/profiler.c (cmpfn_profiler, hashfn_profiler):
forward declare.
(hashtest_profiler): statically initialize.
(syms_of_profiler): remove dynamic initialization of
hashtest_profiler.
2019-01-16 20:26:19 -05:00
Paul Eggert
27f53bd688 * doc/lispref/processes.texi (Accepting Output): Simplify. 2019-01-16 15:52:51 -08:00
Daniel Colascione
3fd369becd Fix previous change: use correct pdumper function 2019-01-16 14:44:45 -05:00
Daniel Colascione
ece563e8ed Fix crash in charset detection after pdumper load
* src/coding.c:
(reset_coding_after_pdumper_load): new function re-init character
classes after pdumper load.
(syms_of_coding): Call it.
2019-01-16 14:37:28 -05:00
Andy Moreton
8bf51c380a Avoid compilation warnings in MS-Windows build
* src/pdumper.c (dump_cold_bignum):
* src/emacs.c(load_pdump) [WINDOWSNT]: Avoid compiler warnings
due to 64-bit vs 32-bit data type mismatches.
2019-01-16 20:04:27 +02:00
Eli Zaretskii
ebd174e218 Improve documentation of pdumper; minor code cleanup
* src/emacs.c (usage_message): Add the --dump-file option.
(string_starts_with_p, find_argument): Functions removed; use
'argmatch' instead.
(PDUMP_FILE_ARG): Macro removed; use literal strings instead,
as with other command-line options.  Use HAVE_PDUMPER for cpp
conditionals which used PDUMP_FILE_ARG.
(load_pdump, main): Use 'argmatch' for "--dump-file" and
"--temacs" arguments, thus supporting the "-dump-file" and
"-temacs" variants, for consistency with other options.
(main): Remove the extra fatal error for using --dump-file in
unexec'ed Emacs: load_pdump does that anyway.
(standard_args): Add --dump-file and --temacs, with
appropriate priorities.

* etc/NEWS: Expand on the pdumper support.

* doc/emacs/cmdargs.texi (Initial Options): Document the
'--dump-file' command-line option.
2019-01-16 17:55:53 +02:00
Eli Zaretskii
e96a54eb3b Fix minor glitch with producing 'emacs' executable
* src/Makefile.in (LC_ALL) [!DUMPING]: Don't overwrite
previous emacs-X.Y.Z executables with new ones.
2019-01-16 17:26:15 +02:00