Eli Zaretskii [Wed, 8 Jan 2020 18:53:00 +0000 (20:53 +0200)]
Fix build without threads
* src/systhread.c (sys_thread_create) [!THREADS_ENABLED]: Update
the function's signature to match prototype. Reported by Glenn
Morris <rgm@gnu.org>. (Bug#38632)
Eli Zaretskii [Wed, 8 Jan 2020 16:21:53 +0000 (18:21 +0200)]
Fix compression of directories in Dired
This fixes comporession and uncompression of directories on
MS-Windows, but also on other systems. The original code used
":" as the REGEXP of the directory entry in
dired-compress-file-suffixes, which on Windows always matched any
absolute file name, and can also match unusual file names on Posix
hosts. This false match would cause dired-compress-file to act as
if we are decompressing a directory, but use a command suitable
for compression, which would fail in interesting ways.
We now use a REGEXP that can never match any valid file name.
* lisp/dired-aux.el (dired-compress-file-suffixes): Make the
"compress directory" entry's REGEXP really fail to match any valid
file name.
(dired-compress-file): Adapt to the change in
dired-compress-file-suffixes. (Bug#39024)
(dired-compress): If the current file is a directory, or if the
uncompressed file is a directory, don't remove the original from
the listing, since it is left in the filesystem.
Eli Zaretskii [Mon, 6 Jan 2020 19:49:24 +0000 (21:49 +0200)]
Avoid assertion violations in very small-height windows
* src/xdisp.c (try_cursor_movement, redisplay_window)
(row_containing_pos): Skip tab-line glyph rows in addition to
header-line rows, when working on the top-most glyph row of a
window. This avoids assertion violations in set_cursor_from_row.
(Bug#38966)
Robert Pluim [Thu, 19 Dec 2019 16:33:16 +0000 (17:33 +0100)]
Use pthread_setname_np to set thread name
* configure.ac: Remove check for sys/prctl.h and prctl, check for
pthread_setname_np instead.
* systhread.c: Remove sys/prctl.h include.
(sys_thread_create) [HAVE_PTHREAD_SETNAME_NP]: Use pthread_setname_np
to set the name of the newly created thread (Bug#38632).
* thread.c (Fmake_thread): Use ENCODE_SYSTEM instead of
ENCODE_UTF_8 on the thread name.
Paul Eggert [Sun, 5 Jan 2020 19:48:59 +0000 (11:48 -0800)]
Move “Fix some broken conditional forms” to master
Revert 2020-01-04T19:17:12Z!eggert@cs.ucla.edu
which recently I installed into the emacs-27 branch by mistake.
These patches are now on master instead (via merging).
Do not merge to master.
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).
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 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.
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)
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 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.
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.
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.
Dmitry Gutov [Sat, 28 Dec 2019 16:28:30 +0000 (19:28 +0300)]
Do some renames for clarity
* lisp/progmodes/xref.el (xref--last-file-buffer):
Rename from xref--last-visiting-buffer. Update users.
(xref--find-file-buffer): Rename from xref--find-buffer-visiting
to match the standard function that gets called inside. Ditto.
Eli Zaretskii [Sat, 28 Dec 2019 13:19:05 +0000 (15:19 +0200)]
Rearrange NEWS, add missing documentation
* etc/NEWS: Rearrange and mark entries whether documented or not.
* doc/lispref/streams.texi (Output Variables): Document the new
default of 'print-quoted'.
* doc/lispref/keymaps.texi (Functions for Key Lookup): Document
that KEYMAP arg to 'lookup-key' can also be a list.
* doc/lispref/customize.texi (Variable Definitions): Document the
:local keyword of 'defcustom'.
* doc/lispref/numbers.texi (Float Basics): Document changes in
'logb'.
* doc/lispref/hooks.texi (Standard Hooks): Document
'comint-password-function'.
* doc/emacs/display.texi (Text Scale): Document text-size
adjustment using the mouse wheel.
* doc/emacs/frames.texi (Mouse Commands): Document image scaling
with the mouse wheel.
* doc/emacs/windows.texi (Window Convenience): Document
'global-tab-line-mode'.
* doc/emacs/search.texi (Repeat Isearch, Symbol Search)
(Isearch Yank): Document the new support for numeric arguments in
Isearch commands.
(Special Isearch): Document 'M-s M->' and 'M-s M-<'.
(Search Customizations): Document 'isearch-lazy-count'. Improve
indexing.
(Not Exiting Isearch): Document the new value of
'isearch-allow-scroll'.
* doc/emacs/maintaining.texi (Xref Commands): Document the new 'g'
key binding.
* doc/emacs/package.texi (Package Installation): Document changes
in 'package-check-signature'.
* doc/emacs/maintaining.texi (VC Change Log): Document
'vc-log-search'.
* doc/emacs/dired.texi (Operating on Files): Document
'dired-vc-rename'.
Eli Zaretskii [Sat, 28 Dec 2019 09:13:25 +0000 (11:13 +0200)]
Fix documentation of define-obsolete-* functions
* doc/lispref/functions.texi (Obsolete Functions): Make
documentation of functions that obsolete symbols match the
advertised calling conventions.
* lisp/emacs-lisp/byte-run.el (define-obsolete-function-alias)
(define-obsolete-variable-alias, define-obsolete-face-alias):
State in the doc strings that WHEN is a mandatory argument, to be
consistent with the advertised calling convention. (Bug#38675)
* lisp/gnus/gnus-start.el (gnus-group-change-level): Fix previous
patch that made info nil when adding new groups (thereby making
gnus-newsrc-alist invalid).
Dmitry Gutov [Fri, 27 Dec 2019 16:17:48 +0000 (19:17 +0300)]
(xref--find-buffer-visiting): Speed up by using get-file-buffer
* lisp/progmodes/xref.el (xref--find-buffer-visiting):
Speed up by using get-file-buffer.
(xref--collect-matches): Remove the condition on remote-id.
(https://lists.gnu.org/archive/html/emacs-devel/2019-12/msg00753.html)
Dmitry Gutov [Fri, 27 Dec 2019 15:18:41 +0000 (18:18 +0300)]
project--vc-list-files: Recurse into submodules
* lisp/progmodes/project.el (project-try-vc): Do not treat a Git
submodule as a project root, go up to the parent repo.
(project--git-submodules): New function.
(project--vc-list-files): Use it. Recurse into submodules.
Eli Zaretskii [Fri, 27 Dec 2019 14:19:09 +0000 (16:19 +0200)]
Minor improvements of buffer documentation
* doc/emacs/buffers.texi (Buffers): Say that buffers are killed
when no longer needed. Suggested by Jean-Christophe Helary
<jean.christophe.helary@traduction-libre.org>.
* lisp/calc/calc-alg.el (math-simplify-only, calc-simplify-mode)
(math-expand-formulas, calc-poly-div-remainder)
(math-living-dangerously, math-simplifying, calc-angle-mode)
(calc-prefer-frac, math-poly-base-variable):
Declare dynamic variables.
* test/lisp/calc/calc-tests.el (calc-poly-div):
Add test for at least one bug caused by missing declarations.
Dmitry Gutov [Thu, 26 Dec 2019 15:39:48 +0000 (17:39 +0200)]
Speed up dired-do-find-regexp
* lisp/dired-aux.el (dired-do-find-regexp): Speed up (bug#36857).
Previously, 'find' was called for every marked file (for plain
files and directories both). Now 'find' is only called for
directories.
Paul Eggert [Wed, 25 Dec 2019 20:01:07 +0000 (12:01 -0800)]
Port x_get_monitor_attributes_fallback to !HAVE_GTK3
* src/xfns.c (x_get_net_workarea) [!HAVE_GTK3]:
Define in this case too, since x_get_monitor_attributes_fallback
contains a call to it regardless whether HAVE_GTK3 is defined.
Wolfgang Scherer [Mon, 26 Aug 2019 22:45:48 +0000 (00:45 +0200)]
Improve vc--add-line, vc--remove-regexp
* lisp/vc/vc.el (vc--add-line): Create file if it does not exist.
Use existing buffer to avoid discrepancies with filesytem. Make sure
that the file ends with a newline.
(vc--remove-line): Do not create file if it does not exist. Use
existing buffer to avoid discrepancies with filesytem. (bug#37185)