* doc/misc/trampver.texi:
* lisp/net/trampver.el: Change version to "2.4.4-pre".
* lisp/net/tramp-adb.el (tramp-adb-handle-copy-file)
(tramp-adb-handle-rename-file, tramp-adb-handle-process-file):
Use `tramp-file-local-name'.
(tramp-adb-handle-exec-path): Expand `default-directory'.
* lisp/net/tramp-cmds.el (tramp-rename-files):
Use `tramp-file-local-name'.
* lisp/net/tramp-sh.el (tramp-sh-handle-make-symbolic-link)
(tramp-do-copy-or-rename-file-directly)
(tramp-sh-handle-process-file, tramp-set-remote-path)
(tramp-find-inline-encoding, tramp-get-remote-touch):
Use `tramp-file-local-name'.
(tramp-sh-handle-make-process): Support `stderr' as file name.
Delete temporary stderr file.
(tramp-sh-handle-exec-path): Expand `default-directory'.
* lisp/net/tramp-smb.el (tramp-smb-handle-make-symbolic-link)
(tramp-smb-handle-process-file): Use `tramp-file-local-name'.
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-do-copy-or-rename-file)
(tramp-sudoedit-handle-set-file-uid-gid):
Use `tramp-unquote-file-local-name'.
(tramp-sudoedit-handle-make-symbolic-link):
Use `tramp-file-local-name'.
(tramp-sudoedit-handle-file-system-info): Fix a scoping error.
* lisp/net/tramp.el: Bump version to 2.4.4-pre.
(tramp-ignored-file-name-regexp, tramp-time-dont-know)
(tramp-time-doesnt-exist): Fix typo.
(tramp-file-local-name): Extend for non-remote file names.
(tramp-unquote-file-local-name): New defun.
(tramp-completion-make-tramp-file-name): Simplify.
(tramp-set-connection-local-variables-for-buffer)
(tramp-equal-remote, tramp-handle-make-auto-save-file-name):
Use `tramp-tramp-file-p'.
(tramp-handle-file-name-case-insensitive-p)
(tramp-handle-file-truename, tramp-get-remote-tmpdir)
(tramp-make-tramp-temp-file): Use `tramp-file-local-name'.
(tramp-handle-shell-command, tramp-handle-start-file-process):
Implement asynchronous `error-buffer'.
Mark 'catch' and 'condition-case' bytecodes as obsolete
They have not been generated by the byte-compiler since Emacs 25.
* lisp/emacs-lisp/bytecomp.el (byte-catch, byte-condition-case):
* src/bytecode.c (BYTE_CODES, exec_byte_code):
Mark as obsolete (since Emacs 25; they were still generated in 24.4).
Paul Eggert [Sun, 5 Jan 2020 20:29:05 +0000 (12:29 -0800)]
Go back to iso-2022-7bit for titdic-cnv.el again
* admin/notes/unicode: Mention this.
* lisp/international/titdic-cnv.el:
Go back to iso-2022-7bit for this file, since utf-8-emacs unified
characters that tsanq-quick-converter did not want unified.
Problem reported by Eli Zaretskii in:
https://lists.gnu.org/r/emacs-devel/2020-01/msg00156.html
Paul Eggert [Sun, 5 Jan 2020 19:44:48 +0000 (11:44 -0800)]
Merge from origin/emacs-27
448df8fec7 Improve doc-strings of 'quit-window' and 'quit-restore-win... 7f01dfca56 Fix MH-E bug #470: Show buffer discards text properties f95a2b8301 Fix some broken conditional forms 28727444f1 Fix a scoping error in tramp-sudoedit.el 6cbdd048bd * lisp/autorevert.el (auto-revert-notify-handler): Fix bra... 076dd1f69a Fix typo in 'window_box_height'
Also print function data when printing module functions.
This is especially useful in cases where modules only use a single
entry point and use the data to dispatch to the actual function. Such
a design is common for languages such as Go and C++.
* src/emacs-module.c (module_function_data): New function.
* src/print.c (print_vectorlike): Use it to print module function data
if not NULL.
(print_object): Adapt size of buffer.
* test/data/emacs-module/mod-test.c (emacs_module_init): Pass some
non-NULL data to ‘mod-test-sum’.
(Fmod_test_sum): Check that correct data is passed through.
* test/src/emacs-module-tests.el (mod-test-sum-test)
(module-function-object): Adapt unit tests.
Martin Rudalics [Sun, 5 Jan 2020 08:59:01 +0000 (09:59 +0100)]
Improve doc-strings of 'quit-window' and 'quit-restore-window' (Bug#38819)
* lisp/window.el (quit-restore-window, quit-window): Make
doc-strings more consistent; add references to corresponding
section of the Elisp manual (Bug#38819).
Paul Eggert [Sun, 5 Jan 2020 03:07:02 +0000 (19:07 -0800)]
Simplify x-dnd.el due to bignums
* lisp/x-dnd.el (x-dnd-get-drop-x-y, x-dnd-version-from-flags)
(x-dnd-more-than-3-from-flags, x-dnd-get-motif-value)
(x-dnd-motif-value-to-list): Do not worry about pairs of
16-bit numbers, as the C code no longer generates them;
it generates bignums now, when needed on 32-bit platforms.
Stephen Gildea [Sat, 4 Jan 2020 23:28:07 +0000 (15:28 -0800)]
Fix MH-E bug #470: Show buffer discards text properties
* lisp/mh-e/mh-show.el (mh-display-msg): reset font lock and set
major mode *before* formatting message content. This changes lets
fonts work when the Show buffer is reused for a new message.
(mh-show-mode): no longer set buffer-read-only; that is better done
by mh-display-msg after setting all content.
Paul Eggert [Sat, 4 Jan 2020 21:33:44 +0000 (13:33 -0800)]
Fix bug in recent allocate_string_data patch
Reported by Glenn Morris in:
https://lists.gnu.org/r/emacs-devel/2020-01/msg00098.html
* src/alloc.c (allocate_string_data): If the string is small and
there is not enough room in the current block, clear the string if
CLEARIT.
Paul Eggert [Sat, 4 Jan 2020 19:17:12 +0000 (11:17 -0800)]
Fix some broken conditional forms
Problem reported by Mattias Engdegård in:
https://lists.gnu.org/r/emacs-devel/2020-01/msg00088.html
* lisp/cedet/ede/cpp-root.el (ede-create-lots-of-projects-under-dir):
Remove this quick hack, which didn’t do anything anyway.
* lisp/cedet/ede/pconf.el (ede-proj-configure-test-required-file):
* lisp/emacs-lisp/tabulated-list.el (tabulated-list-print-col):
* lisp/net/nsm.el (nsm-check-tls-connection):
Use ‘when’ rather than bypassing it. This doesn’t affect behavior
and is better style.
* lisp/cedet/srecode/semantic.el (srecode-semantic-handle-:tag):
Fix typo that suppressed an error.
* lisp/filesets.el (filesets-run-cmd): Fix typo that mishandled spacing.
* lisp/gnus/gnus-cloud.el (gnus-cloud-update-newsrc-data):
Fix typo that caused “GROUP has older different info in the cloud
as of DATE, update it here?” prompt result to always be treated as
“yes”.
* lisp/gnus/mml-smime.el (mml-smime-openssl-encrypt): Simplify,
since smime-encrypt-buffer signals error on failure.
* lisp/international/titdic-cnv.el (tsang-quick-converter): Simplify.
The conversion of this file to utf-8-emacs in
2019-01-08T02:18:40Z!monnier@iro.umontreal.ca removed the
distinction between Big5 and CNS fulltitles in the generated docstring.
* lisp/org/org-agenda.el (org-agenda-show-and-scroll-up):
* lisp/textmodes/table.el (table--generate-source-cell-contents):
Simplify by removing useless code.
* lisp/org/ox-odt.el (org-odt--format-timestamp): Fix typo that
always output time-of-day even when the timestamp lacked it.
* test/src/emacs-module-tests.el (module/function-finalizer): Create
100 leaked functions to increase the probability that at least one
gets garbage-collected.
* src/emacs-module.h.in: Remove 'noexcept' from function pointer type
aliases. It is illegal there in C++11, see
https://en.cppreference.com/w/cpp/language/noexcept_spec.
Paul Eggert [Sat, 4 Jan 2020 01:14:00 +0000 (17:14 -0800)]
Let the OS clear new large strings of NUL
On my platform, this sped up (make-string 4000000000 0) from 2.5
to 0.015 seconds (not that people should want to do this much :-).
* src/alloc.c (allocate_string_data): New arg CLEARIT.
Callers changed.
(Fmake_string): Prefer calloc to malloc+memset when allocating a
large string of NUL bytes.
(make_clear_string): New function.
(make_uninit_string): Use it.
(make_clear_multibyte_string): New function.
(make_uninit_multibyte_string): Use it.
Philipp Stephani [Sun, 11 Feb 2018 20:38:22 +0000 (21:38 +0100)]
Implement finalizers for module functions (Bug#30373)
* src/module-env-28.h: Add new module environment functions to
module environment for Emacs 28.
* src/emacs-module.h.in: Document that 'emacs_finalizer' also works
for function finalizers.
* src/emacs-module.c (CHECK_MODULE_FUNCTION): New function.
(struct Lisp_Module_Function): Add finalizer data member.
(module_make_function): Initialize finalizer.
(module_get_function_finalizer)
(module_set_function_finalizer): New module environment functions.
(module_finalize_function): New function.
(initialize_environment): Initialize new environment functions.
* src/alloc.c (cleanup_vector): Call potential module function
finalizer during garbage collection.
* test/data/emacs-module/mod-test.c (signal_error): New helper
function.
(memory_full): Use it.
(finalizer): New example function finalizer.
(Fmod_test_make_function_with_finalizer)
(Fmod_test_function_finalizer_calls): New test module functions.
(emacs_module_init): Define them.
* test/src/emacs-module-tests.el (module/function-finalizer): New unit
test.
* doc/lispref/internals.texi (Module Functions): Document new
functionality.
(Module Misc): Move description of 'emacs_finalizer' type to 'Module
Functions' node, and add a reference to it.
Michael Albinus [Fri, 3 Jan 2020 12:18:52 +0000 (13:18 +0100)]
Change Tramp version to 2.4.3.27.1
* doc/misc/trampver.texi:
* lisp/net/trampver.el: Change version to "2.4.3.27.1".
(customize-package-emacs-version-alist): Add Tramp version
integrated in Emacs 27.1.
Eli Zaretskii [Fri, 3 Jan 2020 07:28:35 +0000 (09:28 +0200)]
Fix redisplay when mode-line-format changes mode-line's height
* lisp/frame.el (top-level): Add mode-line-format,
tab-line-format, and header-line-format to the list of variables
that should trigger an immediate redisplay of the buffer's
window. This fixes redisplay of windows when the mode line
changes its height.
* src/xdisp.c (window_box_height): Use the window's
mode_line_height, tab_line_height, and header_line_height fields
in preference to CURRENT_MODE_LINE_HEIGHT,
CURRENT_TAB_LINE_HEIGHT, and CURRENT_HEADER_LINE_HEIGHT,
respectively. This fixes display of vertical scroll bar when the
height of the window's mode line changes.
* src/dispnew.c (adjust_glyph_matrix): When resizing a window's
matrix, reset the mode_line_p flag of the previous mode-line row,
so that the window_box_height, CURRENT_MODE_LINE_HEIGHT, and their
ilk won't use stale info. (Bug#38828)
Paul Eggert [Fri, 3 Jan 2020 02:02:32 +0000 (18:02 -0800)]
Let the OS clear large new objects
Prefer calloc to malloc+memset when allocating large zeroed objects.
This avoids page thrashing when (make-vector 1000000000 nil)
allocates a large nil vector, as Emacs need not touch the
vector’s pages. This wins on platforms like GNU/Linux where
calloc can fiddle with page tables to create a block of memory
that is lazily zeroed.
* src/alloc.c (lisp_malloc, lmalloc, allocate_vectorlike):
New arg CLEARIT to tell callee whether to use malloc or calloc.
All callers changed.
(allocate_clear_vector, allocate_nil_vector): New functions.
* src/alloc.c (xzalloc, make_vector):
* src/lisp.h (make_nil_vector):
Prefer calloc to malloc + memset(...,0,...).
Eli Zaretskii [Wed, 1 Jan 2020 17:55:35 +0000 (19:55 +0200)]
Fix compilation with GTK versions older than 3
* src/xfns.c (x_get_net_workarea): Change a recently moved #ifndef
so that GTK builds which need this function will compile it.
Reported by John <jpff@codemist.co.uk>.
Eli Zaretskii [Wed, 1 Jan 2020 17:55:35 +0000 (19:55 +0200)]
Fix compilation with GTK versions older than 3
* src/xfns.c (x_get_net_workarea): Change a recently moved #ifndef
so that GTK builds which need this function will compile it.
Reported by John <jpff@codemist.co.uk>.
Eli Zaretskii [Wed, 1 Jan 2020 17:49:57 +0000 (19:49 +0200)]
Fix reverting customizations
* lisp/custom.el (custom-push-theme): Don't use setcar to modify
the recorded value of PROP; instead, cons a new property list by
deleting the old value and adding the new one. (Bug#38812)
Occasionally, loading cl-generic.el from source requires
max_specpdl_size > 1600 when bootstrapping, and thus fails.
In any case we are very close to the limit.
Paul Eggert [Wed, 1 Jan 2020 04:15:27 +0000 (04:15 +0000)]
Assume C99-style ‘long long’
Now that Gnulib assumes ‘long long’, it is a good time to clean
out old cruft porting to pre-C99 compilers that lack it.
* src/data.c (ULL_WIDTH, ULL_MAX): Remove.
All uses replaced by ULLONG_WIDTH, ULLONG_MAX.
(bits_word_to_host_endian): Assume ‘unsigned long long’.
By the way, the old code had a performance typo: it used
HAVE_UNSIGNED_LONG_LONG where it should have used
HAVE_UNSIGNED_LONG_LONG_INT.
* src/sysdep.c (ULLONG_MAX): Remove, as lib/limits.h does this now.
(time_from_jiffies) [GNU_LINUX]: Assume ‘long long’.
Paul Eggert [Wed, 1 Jan 2020 01:08:16 +0000 (01:08 +0000)]
Merge from origin/emacs-27
186152ba40 Pacify gcc -Wunused-function on Ubuntu 18.04.3 4cd143aded Fix copyright years by hand 365e01cc9f Update copyright year to 2020 cd2c156163 ; * etc/NEWS: Make the description of XDG fallback more ac...
Paul Eggert [Wed, 1 Jan 2020 01:03:14 +0000 (01:03 +0000)]
Pacify gcc -Wunused-function on Ubuntu 18.04.3
This improves on 2019-12-25T20:01:07Z!eggert@cs.ucla.edu,
by fixing a GCC warning on Ubuntu 18.04.3
“‘x_get_net_workarea’ defined but not used”.
* src/xfns.c (x_get_net_workarea) [!USE_GTK]: Do not define.
Glenn Morris [Tue, 31 Dec 2019 15:50:15 +0000 (07:50 -0800)]
; Merge from origin/emacs-27
The following commits were skipped:
195bde9ea8 (origin/emacs-27) Don't always resort in recently introduc... f2a349ba8d Don't force completion recalculation in icomplete-fido-ret 9b1053ba27 Correctly cache sorted completions in icomplete--sorted-co... b1c3ed9f32 Move flex style's minibuffer-default-aware sorting to lisp... e3276f36c0 Make fido-mode behave more like ido-mode when finding dire... fe0ed17175 Slightly simplify lisp/icomplete.el with new icomplete--ca... 5352947d0d Another adjustment to flex completion style's sorting func...
Glenn Morris [Tue, 31 Dec 2019 15:50:15 +0000 (07:50 -0800)]
Merge from origin/emacs-27
9b6872b4e4 ; * test/lisp/calc/calc-tests.el: Fix warnings 957cdca6f0 Make minibuffer-tests work in out-of-tree builds (bug#38816) 2065316749 Make comint-tests more robust (bug#38813)
João Távora [Wed, 25 Dec 2019 17:57:20 +0000 (17:57 +0000)]
Don't force completion recalculation in icomplete-fido-ret
Besides the adverse effect of delaying completions, it tripped up the
useful logic of icomplete-force-complete-and-exit in the case where a
default was available, but no completions calculated yet.
* lisp/icomplete.el (icomplete-fido-ret): Don't force calculation
of completions.
* test/lisp/comint-tests.el (comint-test-no-password-function)
(comint-test-password-function-with-value)
(comint-test-password-function-with-nil):
Call accept-process-output as many times as needed, with a slightly
more generous timeout (100 ms), after sending the Password: prompt to
the process, since there must be time for some back-and-forth
communication. Also clear the process-query-on-exit flag, since it
doesn't go well with noninteractive tests.
Glenn Morris [Mon, 30 Dec 2019 17:12:25 +0000 (09:12 -0800)]
Merge from origin/emacs-27
59f71d20ea (origin/emacs-27) Fix tar-mode reading the oldgnu Tar format e3ec84fd7d Ensure mini-window is resized to show active minibuffer co... 450633f85a Fix mini-window resizing under resize-mini-windows = t 219d47893a (emacs-27) Fixes for makeinfo 4.13 4bbfd2b42f ; fix previous NEWS entry 81b697d106 Fix crash under -nw on macOS properly this time 9ce4207969 Revert "Check for GUI frame in ns_color_index_to_rgba" 732dcfc850 Ignore all color fonts when using XFT aa0c679f48 Avoid unbounded growth of cl-random-state components (bug#...
Glenn Morris [Mon, 30 Dec 2019 17:04:05 +0000 (09:04 -0800)]
Merge from origin/emacs-27
70fe552c61 ; xref-references-in-directory: Autoload as well 181f571651 Fix up requires 43f66c3368 Extract xref-matches-in-files from project--find-regexp-in... 65af18d86e Rename xref-collect-references and xref-collect-matches 98788bf976 ; Improve the docstring some more c190e91a1e Improve docstrings 012c12a05e Fix when expose draws partially visible first glyph (bug#3... d915b8c3f1 Don't require semantic/fw 50a0126402 Do some renames for clarity 74261ff301 Rearrange NEWS, add missing documentation 6c9571379e Fix interactive spec in netrc-parse 32222fb34c Fix documentation of define-obsolete-* functions
Eli Zaretskii [Mon, 30 Dec 2019 16:17:03 +0000 (18:17 +0200)]
Fix tar-mode reading the oldgnu Tar format
This makes sure an entry for a long file name will not
accidentally appear as a directory, and thus its size will be
disregarded, causing corrupted file headers for all the subsequent
entries. The original problem happened because the long file name
truncated to 99 bytes happened to end in a slash, which tar-mode
takes to be the indication of a directory.
* lisp/tar-mode.el (tar-header-block-tokenize): Accept an
additional argument DISABLE-SLASH; if non-nil, don't set the
link-type field of the descriptor to 5 (meaning a directory) just
because the name ends in a slash. Use this argument when calling
itself recursively, to read the entry of the file with a long
name. Set the link-type to 5 if the long name ends in a slash.
(Bug#38777)
Eli Zaretskii [Mon, 30 Dec 2019 15:53:52 +0000 (17:53 +0200)]
Fix mini-window resizing under resize-mini-windows = t
* src/window.c (grow_mini_window): Fix resizing of mini-window
when the echo area is cleared, and the caller asks for the
mini-window to have zero lines. (Bug#38791)
Avoid unbounded growth of cl-random-state components (bug#38753)
* lisp/emacs-lisp/cl-extra.el (cl-random):
Perform the modulo 2**23 operation before updating the state instead
of after. The result is always the same, but it prevents the state
from growing into arbitrary large bignums.
Dmitry Gutov [Sun, 29 Dec 2019 12:22:11 +0000 (15:22 +0300)]
Fix up requires
* lisp/progmodes/project.el (project-files):
Remove (require 'xref).
(project--files-in-directory): Add it here instead.
(project-find-regexp, project-or-external-find-regexp): And here.
For 'xref--show-xrefs'.
Dmitry Gutov [Sun, 29 Dec 2019 12:44:08 +0000 (15:44 +0300)]
Rename xref-collect-references and xref-collect-matches
* lisp/progmodes/xref.el (xref-references-in-directory): Rename
from xref-collect-references. Update the sole caller.
(xref-matches-in-directory): Rename from xref-collect-matches.
Update all callers (all of them are in the /tests/ dir).
* test/lisp/progmodes/xref-tests.el (xref-tests-data-dir):
Don't use the EMACS_TEST_DIRECTORY env var. It doesn't work when
running interactively.