Paul Eggert [Sat, 25 Jan 2020 00:41:38 +0000 (16:41 -0800)]
Install C source code for C-h f etc.
Without this change, on typical GNU/Linux distributions
like Debian, the first button of ‘C-h f car RET’ does not work
because the source code for ‘car’ is not installed (Bug#37527).
Fix this by installing the (compressed) C source code alongside
the (compressed) Lisp source code that is already installed.
This adds about 3 MB (about 2%) to the size of the installed files
on my platform.
* Makefile.in (emacs_srcdir): New macro.
(epaths-force): Substitute PATH_EMACS_SOURCE.
(install-c-src): New rule, that installs a copy of the C source
code if emacs_srcdir says to.
(install-arch-indep): Depend on it.
* configure.ac (emacs_srcdir): New var.
Add support for --disable-install-srcdir.
* lisp/emacs-lisp/find-func.el (find-function-C-source-directory):
Look in emacs-source-directory first.
(find-function-C-source): Also look for gzipped source files.
* lisp/startup.el (normal-top-level):
Also recode emacs-source-directory.
* src/epaths.in (PATH_EMACS_SOURCE): New macro.
* src/lread.c: Include dosname.h, for IS_ABSOLUTE_FILE_NAME.
(syms_of_lread): New var emacs-source-directory.
Paul Eggert [Fri, 24 Jan 2020 21:36:56 +0000 (13:36 -0800)]
Fix iso8601-parse so unknown DST is -1, not nil
The convention in a decoded time’s dst flag is that t means DST,
nil means standard time, and -1 means unknown. This differs from
the convention for other components of a decoded time, where nil
means unknown. Fix some places where iso8601-parse mistakenly
treated nil as meaning that the dst flag was unknown.
* doc/lispref/os.texi (Time Parsing):
Adjust to match parse-time-string’s doc string.
* lisp/calendar/iso8601.el (iso8601-parse):
Set dst flag to nil if a numeric time zone or "Z" is given.
(iso8601--decoded-time): Default dst flag to -1 if no dst
flag or zone is given.
* lisp/calendar/time-date.el (decoded-time-set-defaults):
When we don’t have a time zone, set the dst flag consistently
with DEFAULT-ZONE.
* test/lisp/calendar/iso8601-tests.el (test-iso8601-date-years)
(test-iso8601-date-dates, test-iso8601-date-obsolete)
(test-iso8601-date-weeks, test-iso8601-date-ordinals)
(test-iso8601-time, test-iso8601-combined)
(test-iso8601-duration, test-iso8601-intervals)
(standard-test-dates, standard-test-time-of-day-local-time)
(standard-test-time-of-day-fractions)
(nonstandard-test-time-of-day-decimals)
(standard-test-time-of-day-beginning-of-day)
(standard-test-date-and-time-of-day, standard-test-interval):
Adjust tests to match fixed behavior.
Glenn Morris [Fri, 24 Jan 2020 15:50:22 +0000 (07:50 -0800)]
Merge from origin/emacs-27
92f080dda8 Tab-bar related finishing touches. 224e8d1464 Make call_process call signal_after_change. This fixes bu... d02f2a793e * lisp/simple.el: Minor fixes to commentary. 196c42b8bf Fix a few typos 4f2b967795 Fix doc strings for image-dired rotation commands
Michael Albinus [Fri, 24 Jan 2020 13:41:22 +0000 (14:41 +0100)]
Support (un)mount of Tramp media devices
* lisp/net/tramp-gvfs.el (tramp-gvfs-gio-mapping): Add "gvfs-rename".
(tramp-gvfs-do-copy-or-rename-file): Use it.
(tramp-gvfs-activation-uri): Handle "media" method.
(tramp-gvfs-url-host): New defun.
(tramp-gvfs-handler-mounted-unmounted)
(tramp-gvfs-connection-mounted-p)
(tramp-gvfs-handler-volumeadded-volumeremoved)
(tramp-get-media-devices): Use it.
Paul Eggert [Fri, 24 Jan 2020 07:06:27 +0000 (23:06 -0800)]
Simplify locale setup
Stop exporting Vprevious_system_time_locale and
Vprevious_system_messages_locale to Elisp. I did that export by
mistake in 1999, and the Elisp variables have never been used.
Simplifying this cruft should make it easier to fix Bug#39248.
* etc/NEWS: Mention this.
* src/emacs.c (main): Simplify locale initialization.
(synchronize_locale): Simplify.
(Vprevious_system_time_locale, Vprevious_system_messages_locale):
Now static variables not visible to Lisp, and defined only if
HAVE_SETLOCALE.
(Vprevious_system_messages_locale): Define only if LC_MESSAGES.
* lisp/net/tramp-cache.el (tramp-get-file-property)
(tramp-set-file-property): Check, whether
`tramp-cache-{g,s}et-count-*' objects are numbers.
* lisp/net/tramp-gvfs.el (top): Don't set global default for
"media" in `tramp-default-host-alist'.
(tramp-gvfs-handler-volumeadded-volumeremoved): New defun.
(top): Register "org.gtk.Private.RemoteVolumeMonitor.VolumeAdded"
and "org.gtk.Private.RemoteVolumeMonitor.VolumeRemoved" signals.
(tramp-get-media-devices): Set defaults for "media" in
`tramp-default-host-alist'.
Paul Eggert [Thu, 23 Jan 2020 07:43:29 +0000 (23:43 -0800)]
Fix crash when sending Gnus message (Bug#39207)
* src/alloc.c (resize_string_data): The string must be multibyte.
When not bothering to reallocate, do bother to change the byte count.
* test/src/alloc-tests.el (aset-nbytes-change) New test.
Juri Linkov [Wed, 22 Jan 2020 23:23:17 +0000 (01:23 +0200)]
Tab-bar related finishing touches.
* lisp/tab-bar.el (tab-bar-tab-name-ellipsis): Use shorter name
instead of tab-bar-tab-name-truncated-ellipsis.
(tab-bar-new-tab-to) <defcustom>: Add 'function' option.
(tab-bar-new-tab-to) <function>: Use it.
* lisp/tab-line.el (tab-line-close-tab): Add missing arg 'tab' to
tab-line-close-tab-function funcall.
Alan Mackenzie [Wed, 22 Jan 2020 19:50:30 +0000 (19:50 +0000)]
Make call_process call signal_after_change. This fixes bug #38691.
Now, functions such as call-proess-region invoke after-change-functions
correctly.
* src/callproc.c (call_process): Call prepare_to_modify_buffer in a single
place, no longer delegating the task to insert_1_both, etc. Call
signal_after_change in each of two code branches, such that
before-change-functions and after-change-functions are always called in
balanced pairs.
* lisp/image-dired.el (image-dired-rotate-thumbnail-left)
(image-dired-rotate-thumbnail-right)
(image-dired-rotate-original-left)
(image-dired-rotate-original-right): Move the text in the doc
strings about rotating the originals to the correct commands
(bug#38928).
Glenn Morris [Wed, 22 Jan 2020 15:55:18 +0000 (07:55 -0800)]
Merge from origin/emacs-27
3b0938c042 (origin/emacs-27) Render Ido suggestions using an overlay d5d90dc412 * doc/misc/tramp.texi (Bug Reports): Encourage use of "ema... ac09e8e121 * lisp/vc/smerge-mode.el (smerge-match-conflict): Fix bug#... 7e37e61f4b Correct statement about ftcr and recommend HarfBuzz 4aec94da37 Avoid leaving artifacts when the system caret is used on w32 5abd8d73b0 Improve display of temporary echo messages
Glenn Morris [Wed, 22 Jan 2020 15:55:18 +0000 (07:55 -0800)]
Merge from origin/emacs-27
3ba0db41e3 Allow optional truncation of tab names in tab-bar and tab-... 7dd065fc7b Small fixes in documentation. 06166aa719 Improve explanation of available font backends under X 2eb834ead4 Clear output data pointer on NS
Michael Albinus [Wed, 22 Jan 2020 15:54:55 +0000 (16:54 +0100)]
Add new Tramp method "media"
* doc/misc/tramp.texi (Quick Start Guide, GVFS-based methods):
Add media devices.
* etc/NEWS: Mention new Tramp method "media".
* lisp/net/tramp-gvfs.el (tramp-gvfs-methods): Add "media" method.
(tramp-goa-methods): Add tramp-autoload cookie.
(tramp-media-methods): New defvar.
(tramp-gvfs-service-volumemonitor): New defsubst.
(top): Remove media methods if not supported. Add defaults for
`tramp-default-host-alist'.
(tramp-goa-account): Rename from `tramp-goa-name'. Adapt all callees.
(tramp-gvfs-service-afc-volumemonitor)
(tramp-gvfs-service-goa-volumemonitor)
(tramp-gvfs-service-gphoto2-volumemonitor)
(tramp-gvfs-service-mtp-volumemonitor)
(tramp-gvfs-path-remotevolumemonitor)
(tramp-gvfs-interface-remotevolumemonitor): New defconsts.
(tramp-media-device): New defstruct.
(tramp-gvfs-activation-uri): New defun.
(tramp-gvfs-url-file-name): Use it.
(tramp-gvfs-handler-mounted-unmounted)
(tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec):
Handle "media" method.
(tramp-get-goa-account): Rename from `tramp-make-goa-name'. Adapt
all callees.
(tramp-get-goa-accounts): Adapt docstring. Cache with nil key.
(tramp-parse-goa-accounts, tramp-get-media-device)
(tramp-get-media-devices)
(tramp-parse-media-names): New defuns.
(top): Rework completion function registration.
* lisp/net/tramp.el (tramp-dns-sd-service-regexp): New defconst.
(tramp-set-completion-function): Use it.
Nicholas Strauss [Wed, 22 Jan 2020 14:12:58 +0000 (15:12 +0100)]
Support solar and lunar eclipses in Calendar
* lisp/calendar/lunar.el (eclipse-check): New function to display
solar and lunar eclipses (bug#20414).
(lunar-phase): Use it.
(calendar-lunar-phases): Ditto.
Helmut Eller [Wed, 22 Jan 2020 13:18:17 +0000 (14:18 +0100)]
Default lisp-mode to use Common Lisp indentation
* lisp/emacs-lisp/lisp-mode.el (lisp-mode): Use
common-lisp-indent-function instead of lisp-indent-function as
Common Lisp is the most common non-Emacs Lisp today (bug#10097).
Eli Zaretskii [Tue, 21 Jan 2020 16:23:32 +0000 (18:23 +0200)]
Avoid leaving artifacts when the system caret is used on w32
* src/xdisp.c (try_window_reusing_current_matrix, try_window_id):
* src/dispnew.c (scrolling_window) [HAVE_NTGUI]: If
w32-use-visible-system-caret is non-nil, disallow scrolling the
display are in scroll_run_hook. This avoids copying traces of the
caret, about which Emacs knows nothing, and thus considers those
pixels show the default background. (Bug#39188)
(gui_update_window_end): Block input only around part of the code,
as we did before this code was extracted from backend-specific
implementations.
* src/w32term.c (w32_update_window_begin, w32_update_window_end):
Only hide/show the caret when redisplaying the window where the
caret is shown.
Eli Zaretskii [Tue, 21 Jan 2020 15:58:23 +0000 (17:58 +0200)]
Improve display of temporary echo messages
* lisp/minibuffer.el (set-minibuffer-message): Fix cursor position
for the temporary display of an echo-area message when minibuffer
is active. Ensure the message is visible even if the end of the
completion candidates presented by the likes of Icomplete mode is
not visible due to its length, under resize-mini-windows = nil.
(Bug#38457)
Juri Linkov [Mon, 20 Jan 2020 23:03:37 +0000 (01:03 +0200)]
Allow optional truncation of tab names in tab-bar and tab-line (bug#38693)
* lisp/tab-line.el (tab-line-tab-name-truncated-max): New defcustom.
(tab-line-tab-name-truncated-buffer): Use tab-line-tab-name-truncated-max
consistently with similar options in tab-bar.el.
(tab-line-tabs-limit): Remove variable.
(tab-line-tabs-window-buffers): Remove use of tab-line-tabs-limit
that was an experimental feature before horizontal scrolling was implemented.
(tab-line-close-tab-function): Rename from tab-line-close-tab-action
and allow a customizaed function as option.
(tab-line-close-tab): Call function if tab-line-close-tab-function
is customized to a function.
* lisp/tab-bar.el (tab-bar-tab-name-function): Add option
tab-bar-tab-name-truncated.
(tab-bar-tab-name-truncated-max): New defcustom.
(tab-bar-tab-name-truncated-ellipsis): New variable.
(tab-bar-tab-name-truncated): New function.
Glenn Morris [Mon, 20 Jan 2020 15:50:26 +0000 (07:50 -0800)]
Merge from origin/emacs-27
f3d30b5303 Remove some doc references to old Emacs versions 4217bc229b Fix infloop in shell.el 74b151195d Fix erc-notifications-notify for non-PRIVMSGs, broken in l... db4436eaf9 Fix the notification action for PRIVMSG in erc-notificatio... 36a4068105 ERC: New maintainer. 2391d3f45d ; spelling fixes e898442be3 Honor tags-case-fold-search during xref identifer completion
* test/lisp/shell-tests.el (shell-tests-completion-before-semi):
Go back to actually testing completion before semicolon.
(shell-tests-completion-after-semi): Test completion after semicolon,
correctly (bug#39075).
Paul Eggert [Mon, 20 Jan 2020 09:08:42 +0000 (01:08 -0800)]
Work better if stat etc. are interrupted
Quit or retry if fstat, lstat, stat or openat fail with EINTR.
This should fix some bugs on platforms where accessing files via
NFS can fail that way (Bug#9256).
* src/dired.c (file_attributes):
* src/fileio.c (file_directory_p) [O_PATH]:
Use emacs_openat instead of openat.
* src/dired.c (file_attributes): Use emacs_fstatat instead of fstatat.
* src/fileio.c (barf_or_query_if_file_exists, Frename_file):
* src/filelock.c (rename_lock_file):
Use emacs_fstatat instead of lstat.
* src/fileio.c (file_directory_p, Ffile_regular_p, Ffile_modes)
(Ffile_newer_than_file_p, Fverify_visited_file_modtime)
(Fset_visited_file_modtime, auto_save_1):
* src/lread.c (Fload):
* src/sysdep.c (get_current_dir_name_or_unreachable):
Use emacs_fstatat instead of stat.
* src/sysdep.c (emacs_fstatat, emacs_openat): New functions.
(emacs_open): Redo in terms of emacs_open.
Paul Eggert [Mon, 20 Jan 2020 07:40:45 +0000 (23:40 -0800)]
Fix drag and drop from some Qt versions
* lisp/x-dnd.el (x-dnd-handle-xdnd): Fix XdndDrop time stamp bug.
Problem and tiny change reported by Urs Fleisch (Bug#20804).
Copyright-paperwork-exempt: yes
Use the new `prefix-command-*` hooks and functions so it interacts
better with other prefix commands (and with itself), and so the
pre/post-command-hook and other command-loop operations are performed
"normally".
(mule-cmds--prefixed-command-next-coding-system)
(mule-cmds--prefixed-command-last-coding-system): New vars.
(mule-cmds--prefixed-command-pch, mule-cmds--prefixed-command-echo)
(mule-cmds--prefixed-command-preserve): New functions.
* test/lisp/net/tramp-tests.el (inhibit-message): Don't declare.
(tramp-message-show-message): Don't set.
(tramp-test06-directory-file-name): Use `non-essential'.
(tramp-test10-write-region): Use `inhibit-message'.
(tramp-test36-vc-registered): No special handling for old Emacsen.
(tramp--test-emacs25-p): Remove.
(tramp-test45-unload): Special case of `tramp-completion-mode'.
Tino Calancha [Sun, 19 Jan 2020 10:13:02 +0000 (11:13 +0100)]
Fix shell-command-dont-erase-buffer feature
* lisp/simple.el (shell-command-dont-erase-buffer):
The default, nil, is backward compatible, i.e. it erases the buffer
only if the output buffer is not the current one; the new value 'erase
always erases the output buffer.
Update docstring.
(shell-command-save-pos-or-erase):
Add optional arg output-to-current-buffer.
Rename it so that it's not internal. All callers updated.
(shell-command-set-point-after-cmd): Rename it so that it's not internal.
All callers updated.
Adjust it to cover a side case.
(shell-command): Adjust logic to match the specification (Bug#39067).
Enable the feature when the output buffer is the current one.
(shell-command-on-region): Little tweak to follow
`shell-command-dont-erase-buffer' specification.
Paul Eggert [Sun, 19 Jan 2020 04:54:29 +0000 (20:54 -0800)]
Remove Gnulib putenv code
It’s not needed, since Emacs always uses the system putenv and all
platforms have putenv. This improves on the fix for Bug#19874.
Suggested by Bruno Haible.
* admin/merge-gnulib (GNULIB_MODULES): Remove putenv.
* configure.ac: Remove workarounds for Gnulib putenv module.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib/putenv.c, m4/putenv.m4: Remove.
Paul Eggert [Sun, 19 Jan 2020 04:34:55 +0000 (20:34 -0800)]
Update from Gnulib
This incorporates:
2020-01-18 Rename ~~gnulib.m4 to zzgnulib.m4
2020-01-18 Fix "m4_require: circular dependency of AC_LANG_COMPILER(C)"
2020-01-18 Ensure Automake does not drop ~~gnulib.m4
2020-01-18 Fix major regression from 2020-01-10
* m4/00gnulib.m4, m4/gnulib-common.m4: Copy from Gnulib.
* m4/gnulib-comp.m4: Regenerate.
* m4/zzgnulib.m4: New file, from Gnulib.
Add space before messsage in byte compiler warnings
According to the GNU coding standards (info "(standards) Errors"):
> If you want to mention the column number, use one of these formats:
> SOURCE-FILE-NAME:LINENO:COLUMN: MESSAGE
> SOURCE-FILE-NAME:LINENO.COLUMN: MESSAGE
* lisp/emacs-lisp/bytecomp.el (byte-compile-warning-prefix): Add space
before message in byte compiler warnings to comply with the GNU coding
standards. (Bug#18969)
Eric Abrahamsen [Sat, 18 Jan 2020 19:08:11 +0000 (11:08 -0800)]
Ensure that gnus-summary-attach-article finds the right articles
* lisp/gnus/gnus-msg.el (gnus-summary-attach-article): Before
iterating over the articles to attach, first close any open
article. Using `set-buffer' required `gnus-summary-select-article' to
re-set the buffer every time, meaning we never got off the original
article.
Paul Eggert [Sat, 18 Jan 2020 21:18:27 +0000 (13:18 -0800)]
Don’t assume sizeof (size_t) == 4 in allocators
This removes some old 32-bit assumptions in Emacs allocator tuning,
and improves performance of ‘make compile-always’ by about 7% on a
couple of 64-bit GNU/Linux platforms I tried it on. It should not
affect performance on 32-bit platforms.
* src/alloc.c (MALLOC_SIZE_NEAR): New macro.
(MALLOC_ALIGNMENT): New constant.
(INTERVAL_BLOCK_SIZE, SBLOCK_SIZE, STRING_BLOCK_SIZE): Use the new
macro. Make these enum constants since they need not be macros.
Eric Abrahamsen [Sat, 18 Jan 2020 19:08:11 +0000 (11:08 -0800)]
Ensure that gnus-summary-attach-article finds the right articles
* lisp/gnus/gnus-msg.el (gnus-summary-attach-article): Before
iterating over the articles to attach, first close any open
article. Using `set-buffer' required `gnus-summary-select-article' to
re-set the buffer every time, meaning we never got off the original
article.
* test/lisp/shell-tests.el (shell-tests-completion-before-semi):
Amend the shell.el tests to catch errors such as bug#39057.
* lisp/shell.el (shell--parse-pcomplete-arguments): Skip the
semi-colon as well. This avoids inflooping when a semi-colon is
typed by the user. (Bug#39057)