The test reference data was produced with accidental interference from
the system daylight saving in effect at the time. Prevent that
from occurring again and correct the data.
* test/lisp/calendar/lunar-tests.el (with-lunar-test):
Switch to UTC and make sure daylight saving adjustment is disabled.
Use normal time presentation for maintainability.
* test/lisp/calendar/lunar-tests.el (lunar-test-phase): Adjust to UTC.
(lunar-test-phase-list): Adjust to UTC with correct times.
Enable the test by removing its :unstable mark.
Fix Indian time zone test when run by Irishmen (bug#45818)
* test/lisp/calendar/solar-tests.el (solar-sunrise-sunset):
Inhibit any attempt by confused calendar code to apply daylight saving
correction when Irish time zone settings are in effect. It's not
entirely clear why this is needed but may be related to the fact that
'IST' stands for both Irish and Indian Standard Time, and that Ireland
uses reversed daylight saving in winter.
Robert Pluim [Tue, 12 Jan 2021 17:50:38 +0000 (18:50 +0100)]
Only run IPv6 tests if we have an IPv6 address
* test/src/process-tests.el (ipv6-is-available): New function for
checking whether we have a globally routable IPv6 prefix assigned.
(lookup-family-specification): Use 'ipv6-is-available' to check for
IPv6. Use 'localhost' instead of 'google.com' to test
'network-lookup-address-info' API.
(lookup-google): Use 'ipv6-is-available' to check for
IPv6.
* test/lisp/net/nsm-tests.el (nsm-ipv6-is-available): Rename to
'ipv6-is-available', make identical to the one in
test/src/process-tests.el.
* doc/lispref/elisp.texi (Top): Add a link.
* doc/lispref/errors.texi (Standard Errors): Mention the new error.
* doc/lispref/minibuf.texi (Minibuffers): Add a link.
(Inhibiting Interaction): New node.
* src/data.c (syms_of_data): Define the `inhibited-interaction' error.
* src/lisp.h: Export the barfing function.
* src/lread.c (Fread_char, Fread_event, Fread_char_exclusive):
Barf if inhibited.
* src/minibuf.c (barf_if_interaction_inhibited): New function.
(Fread_from_minibuffer, Fread_no_blanks_input): Barf if inhibited.
(syms_of_minibuf): Define the `inhibit-interaction' variable.
Brian Leung [Tue, 12 Jan 2021 12:29:03 +0000 (13:29 +0100)]
comint-read-input-ring: Simplify last commit
* lisp/comint.el (comint-read-input-ring): It is not necessary to use
`goto-char' again since we have already moved point to the desired
location (bug#45797).
Eric Ludlam [Sun, 10 Jan 2021 15:37:50 +0000 (10:37 -0500)]
cedet/ede/auto.el:
(ede-calc-fromconfig): New method. Support functions in addition to
string matchers.
(ede-dirmatch-installed, ede-do-dirmatch):
Use `ede-calc-fromconfig' to do conversion.
Author: Eric Ludlam <zappo@gnu.org>
Eric Ludlam [Sun, 10 Jan 2021 15:54:49 +0000 (10:54 -0500)]
eieio-base.el:
(eieio-persistent-make-instance): Save the backward compatible 'name'
of objects saved in the file, and if the newly loaded class inherits
from 'eieio-named', restore the name of the object.
Author: Eric Ludlam <zappo@gnu.org>
Eric Abrahamsen [Mon, 11 Jan 2021 17:46:58 +0000 (09:46 -0800)]
Fix possible prepending of "TEXT" to IMAP searches
* lisp/gnus/gnus-search.el (gnus-search-imap-search-keys): Add missing
keys "old", "new", "or" and "not".
(gnus-search-run-search): In addition, don't touch the query if it
starts with a parenthesis. Consider just getting rid of this
convenience altogether.
Brian Leung [Mon, 11 Jan 2021 15:42:03 +0000 (16:42 +0100)]
Make comint-read-input-ring skip uninteresting text in .zsh_history
* lisp/comint.el (comint-read-input-ring): Simplify (bug#45606).
* lisp/shell.el (shell-mode): Add "~/.zsh_history".
* lisp/comint.el (comint-read-input-ring): Bind
`comint-input-ring-file-prefix' in anticipation of a buffer switch.
* lisp/comint.el (comint-read-input-ring): Skip the separator.
Because re-search-backward moves point to the beginning of the match,
and since we don't want the separator appearing in the output, we skip
over it.
This is required to properly detect instances of the value that zsh
uses for `comint-input-ring-file-prefix'; if the
`comint-input-ring-file-prefix' is ':potato', the subsequent
invocation `looking-at' sees '\n:potato' for all entries after the one
at the very beginning of the history file.
Anticrisis [Mon, 11 Jan 2021 15:16:50 +0000 (16:16 +0100)]
Add a failing test for bug#44834
* test/lisp/progmodes/tcl-tests.el (tcl-mode-namespace-indent-2):
New, failing test (bug#44834).
(tcl-mode-function-name-2):
(tcl-mode-function-name-3): Fix names of the tests so that they're
actually run.
Leon Vack [Mon, 11 Jan 2021 14:51:14 +0000 (15:51 +0100)]
Support using auth-source for NickServ passwords in ERC
* lisp/etc/erc-services.el (erc-nickserv-passwords): Document that
the passwords are only used when erc-prompt-for-nickserv-password
is nil.
* (erc-use-auth-source-for-nickserv-password): New customizable
variable to enable checking auth-source for NickServ passwords.
* (etc-nickserv-get-password): New function to handle the lookup
of the NickServ password from both auth-source and the
erc-nickserv-passwords variable.
* (erc-nickserv-call-identify-function): Use new
erc-nickserv-get-password function to lookup NickServ passwords.
* (erc-nickserv-identify-autodetect, erc-nickserv-identify-on-connect,
erc-nickserv-identify-on-nick-change): Call
erc-nickserv-call-identify-function when
erc-use-auth-source-for-nickserv-password is set.
* etc/NEWS: Document change (bug#45340).
Fix problem with non-ASCII characters in nnmaildir
* lisp/gnus/nnmaildir.el (nnmaildir-request-article): Enable
multipart 8bit-content-transfer-encoded files to be displayed
correctly by reading as `raw-text' instead of having Emacs
(incorrectly) decode the files (bug#44307).
Philipp Stephani [Sun, 10 Jan 2021 21:28:31 +0000 (22:28 +0100)]
Add functions to open a file without quitting.
In some situations, e.g. when the Lisp machinery isn't available, we
can't quit. Don't check the quit flags in such situations, in case
they contain garbage.
* src/sysdep.c (emacs_open_noquit, emacs_openat_noquit): New variants
of 'emacs_open' and 'emacs_openat' that don't check the quit flags.
* src/emacs.c (main, Fdaemon_initialized):
* src/pdumper.c (pdumper_load):
* src/w32term.c (w32_initialize):
* src/buffer.c (mmap_init):
* src/callproc.c (emacs_spawn): Use them where we can't quit.
Alan Mackenzie [Sun, 10 Jan 2021 20:32:40 +0000 (20:32 +0000)]
Fix incompleteness in the implementation of minibuffer-follows-selected-frame
In particular, add a new value to the variable, and fix several bugs apparent
with the implementation up till now.
* doc/emacs/mini.texi (Basic Minibuffer): Add a description of the new
non-nil, non-t value of minibuffer-follows-selected-frame.
* doc/emacs/trouble.texi (Quitting): Add a description of how C-g handles
recursive minibuffers when typed in one which isn't the most nested.
* doc/lispref/minibuf.texi (Intro to Minibuffers): Add an @dfn for "active
minibuffer".
(Minibuffer Commands): Document that exit-minibuffer throws an error when not
invoked from the innermost Minibuffer.
(Recursive Mini): Amend the description of the visibility of outer level
minibuffers.
(Minibuffer Misc): In the description of the minibuffer hooks, replace "the
minibuffer" with "a minibuffer".
* etc/NEWS (Entry announcing minibuffer-follows-selected-frame): Add a
description of the new non-nil, non-t value.
* lisp/cus-start.el (top level): make the customize entry for
minibuffer-follows-selected-frame a choice between three entries.
* lisp/minibuffer.el (exit-minibuffer): throw an error when we're not in the
most nested minibuffer.
(top level): Bind C-g to abort-minibuffers in minibuffer-local-map.
* lisp/window.el (window-deletable-p): return the symbol `frame' when (amongst
other things) minibuffer-follows-selected-frame is t.
* src/eval.c (internal_catch): Add a mechanism to (throw 'exit t) repeatedly
when the throw currently being processed doesn't terminate the current
minibuffer.
* src/lisp.h (this_minibuffer_depth): New extern declaration
(minibuf_level): extern declaration moved here from window.h.
* src/minibuf.c (minibuffer_follows_frame, minibuf_stays_put)
(minibuf_moves_frame_when_opened): New and amended functions to query the
value of minibuffer-follows-selected-frame.
(choose_minibuf_frame): check (minibuf > 1) in place of (minibufer > 0) at a
particular place. At another place, check that an alleged frame is so and is
live. Before selecting a non-miniwindow on a different frame, ensure it
really is a different frame.
(move_minibuffer_onto_frame): Stack up all recursive minibuffers on the target
frame. Check the minibuf_window isn't in the old frame before setting that
frame's miniwindow to an inactive minibuffer.
(Finnermost_minibuffer_p, Fabort_minibuffers): New primitives.
(this_minibuffer_depth): New function.
(read_minibuf): Record the calling frame in a variable, and switch back to it
after the recursive edit has terminated normally, using
select-frame-set-input-focus. Stack up all the recursive minibuffers on the
miniwindow where a new minibuffer is being opened. After the recursive edit,
switch the selected window away from the expired minibuffer's window.
(nth_minibuffer): New function.
(minibuffer-follows-selected-frame): Change from a DEFVAR_BOOL to a
DEFVAR_LISP.
* src/window.c (decode_next_window_args): Set *minibuf to w's mini-window's
content when that content is a minibuffer.
* src/window.h (minibuf_level) Declaration moved from here to lisp.h.
* lisp/gnus/message.el (message-forward-ignored-headers): Clarify
doc string once again.
(message-forward-make-body-mime): Remove headers when not
encrypted (bug#45631).
(message-forward-make-body): Pass in correct values.
David Edmondson [Sun, 10 Jan 2021 14:45:07 +0000 (15:45 +0100)]
Fix example in the Gnus manual
* doc/misc/gnus.texi (Score Variables): In the example showing how to
use a list of functions for gnus-score-find-score-files-find-function,
return a list of strings from the lambda rather than trying to call
the string as a function (bug#45673).
Improve fill-region-as-paragraph when there's a fill prefix
* lisp/textmodes/fill.el (fill-region-as-paragraph): Try to
improve how line breaks are set on unbreakable text with a fill
prefix area that has spaces within (bug#45720).
k3tu0isui [Sun, 10 Jan 2021 13:36:51 +0000 (14:36 +0100)]
Make font locking work in mercury-mode
* lisp/progmodes/prolog.el (prolog-font-lock-keywords): Work in
all modes derived from prolog-mode (bug#45747).
(mercury-mode): Set up variables based on the Prolog system (bug#45747).
Hyperlink symbol names without word syntax in Help
* lisp/emacs-lisp/lisp-mode.el (lisp-el-font-lock-keywords-2)
(lisp-cl-font-lock-keywords-2): Allow single-character symbol names.
* lisp/help-mode.el (help-xref-symbol-regexp): Also match symbol
names starting with symbol syntax (bug#6601, bug#24309).
* test/lisp/help-mode-tests.el (help-mode-tests-xref-button): Test
hyperlink creation for function names without symbol syntax.
Daniel Martín [Sun, 10 Jan 2021 12:45:44 +0000 (13:45 +0100)]
Minor shortdoc link improvements
* lisp/emacs-lisp/shortdoc.el (shortdoc--display-function): Use
describe-function as a fallback link when a function is not documented
in any Info manual. Also make the link respond to mouse-1, like the
rest of *Help* links, and add a proper help-echo property.
* lisp/help-fns.el (help-fns--mention-shortdoc-groups): Same link
improvement as described before, this time for the shortdoc groups
(bug#45750).
We first need to register the received process ID so that
'handle_child_signal' checks it. Otherwise we might never call
'waitpid' for these processes, risking deadlock.
* src/callproc.c (call_process):
* src/process.c (create_process): Don't unblock SIGCHLD before
registering the process ID to wait for.
* src/callproc.c (emacs_spawn): Accept a signal set from the caller.
Stefan Monnier [Sat, 9 Jan 2021 00:59:16 +0000 (19:59 -0500)]
* lisp/emacs-lisp/cl-macs.el: Optimize self-calls in tail position
Implement a limited form of tail-call optimization for the special
case of recursive functions defined with `cl-labels`. Only self-recursion
is optimized, no attempt is made to handle more complex cases such a mutual
recursion.
The main benefit is to reduce the use of the stack, tho in my limited
tests, this can also improve performance (about half of the way to
a hand-written `while` loop).
(cl--self-tco): New function.
(cl-labels): Use it.
Dmitry Gutov [Sat, 9 Jan 2021 00:08:59 +0000 (02:08 +0200)]
Make sure default-directory relates to the originating buffer
* lisp/progmodes/xref.el (xref--show-xref-buffer):
Pick up default-directory value from the caller
(https://lists.gnu.org/archive/html/emacs-devel/2021-01/msg00551.html).
(xref-show-definitions-buffer-at-bottom): Same.
Stefan Kangas [Fri, 8 Jan 2021 14:26:02 +0000 (15:26 +0100)]
Merge recently added kbd tests
* test/lisp/subr-tests.el (subr--kbd): Merge test...
(subr-test-kbd): ...with this one. Fix thinko in my previous commit.
Thanks to Mattias Engdegård <mattiase@acm.org>.
Add a display-buffer window selection function that's more like XEmacs
* doc/lispref/windows.texi (Buffer Display Action Functions):
Document it.
* lisp/window.el (display-buffer--action-function-custom-type): Add.
(display-buffer): Mention it.
(display-buffer-use-least-recent-window): New function (bug#45688).
* src/window.c (Fwindow_bump_use_time): New function.
F. Jason Park [Thu, 7 Jan 2021 12:43:13 +0000 (13:43 +0100)]
Clear socks protocol scratch after authentication
* lisp/net/socks.el (socks-open-connection): Fix incomplete patch
titled "Append incremental message segments in socks-filter," which
addressed chunk ordering but neglected to zero out the work area
following successful username/password authentication (bug#45162).
* lisp/textmodes/paragraphs.el (mark-paragraph): Revert eb090f65ceb0ae8a90829e911694348583135ba5 (bug#45318). This restores
the behaviour from Emacs 27 -- further work is needed on this patch.
Dmitry Gutov [Wed, 6 Jan 2021 17:41:55 +0000 (19:41 +0200)]
Proof some searches and file listings against symlinks
* lisp/progmodes/project.el (project--files-in-directory):
Make sure the directory includes the trailing slash in case it's
a symlink, discussed in
https://lists.gnu.org/archive/html/emacs-devel/2021-01/msg00345.html.
* lisp/mb-depth.el (minibuffer-depth-indicator): New face.
(minibuffer-depth-setup): Use new face and add a single space between
the depth indicator and the minibuffer prompt.
https://lists.gnu.org/archive/html/emacs-devel/2020-12/msg00230.html
* lisp/emacs-lisp/eieio-core.el (eieio-defclass-autoload): Try to make
the wording of the warning about the obsoleted variable less confusing.
* lisp/emacs-lisp/bytecomp.el (byte-compile-check-variable): Don't
warn for lexical variables (Bug#39169). Fix spurious `or'.
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp/warn-obsolete-variable-bound\.el): New test.
* test/lisp/emacs-lisp/bytecomp-resources/warn-obsolete-variable-bound.el:
New file.
Stefan Monnier [Wed, 6 Jan 2021 02:26:03 +0000 (21:26 -0500)]
* lisp/emacs-lisp/package.el (package-activate-all): Another tweak
`package-quickstart.el` files presume `package-activated-list`
is a bound variable, so make sure this is the case even when `package.el` is
not yet loaded.
Stefan Monnier [Tue, 5 Jan 2021 22:57:15 +0000 (17:57 -0500)]
* lisp/emacs-lisp/autoload.el: Improve last change
It turns out there were other places that used `custom-initialize-delay`
on autoloaded variables and used various hacks to make it work with
`autoload.el`. The new code makes those hacks unneeded.
Also, there's no point trying to "optimize" those rare cases anyway,
so I simplified the `autoload.el` code for those cases.
(make-autoload): For non-trivial cases,
just include the whole `defcustom` instead of trying to mimic it.
Alan Third [Tue, 5 Jan 2021 21:43:12 +0000 (21:43 +0000)]
Prevent stack overflow in GNUstep menu code
* src/nsmenu.m (ns_update_menubar): Always do a deep update for
GNUstep.
([EmacsMenu menuNeedsUpdate:]): Don't update the menu as it should
always have had a deep update.
Refactor tab-bar-mode to -define-keys and -load-buttons (bug#42052)
* lisp/tab-bar.el (tab-bar--define-keys, tab-bar--load-buttons):
Move some code here from 'tab-bar-mode'.
(tab-bar-new-tab-to): Call tab-bar--load-buttons and tab-bar--define-keys.
Stefan Monnier [Tue, 5 Jan 2021 17:28:37 +0000 (12:28 -0500)]
* lisp/emacs-lisp/package.el: Load package-quickstart without package.el
Speed up startup when `package-quickstart` is in use by making it possible
to load the quickstart file without having to load `package.el` at all.
(package-user-dir, package-directory-list, package-quickstart-file):
Preload those variables.
(package--get-activatable-pkg): New fun, extracted from `package-activate`.
(package-activate): Use it.
(package--activate-all): New function, extracted from
`package-activate-all`.
(package-activate-all): Use it and make the function preloaded.
(package--archives-initialize): New function.
(package-install): Use it.
(list-packages): Avoid `switch-to-buffer`.
(package-get-descriptor): New function.
* lisp/startup.el (command-line): Simplify the code now that
package-user-dir and package-directory-list are preloaded.
* lisp/emacs-lisp/autoload.el (make-autoload): Add support for
`:initialize #'custom-initialize-delay` in `defcustom`.