* lisp/net/dictionary-connection.el: Grammar fix
(dictionary-connection-open): Use active voice.
(dictionary-connection-status): Reword and improve formatting.
Alan Mackenzie [Tue, 23 Feb 2021 11:16:24 +0000 (11:16 +0000)]
CC Mode: Fix bug in "state cache" invalidation function.
* lisp/progmodes/cc-engine.el (c-invalidate-state-cache-1): Rewrite part of
it, following the code in c-parse-state-1, to get a proper setting of
c-state-cache-good-pos.
(antlr-mode): Remove compatibility code with older CC-mode.
This somehow appears to fix the error:
In antlr-mode:
progmodes/antlr-mode.el:2426:20: Error: `c-init-language-vars' defined
after use in (c-init-language-vars) (missing `require' of a library
file?)
progmodes/antlr-mode.el:2427:26: Warning: c-init-language-vars called
with 0 arguments, but requires 1
No idea what caused the error to appear after the previous patch either.
Stefan Monnier [Mon, 22 Feb 2021 21:54:59 +0000 (16:54 -0500)]
* lisp/obsolete: Use lexical-binding
Use lexical-binding in all the lisp/obsolete/*.el files.
While at it, removed redundant :group arguments and used #' to quote
functions. Commented out the key bindings which the #' revealed
to lead to non-existing commands, and replaced those revealed to be obsolete.
* lisp/obsolete/cl-compat.el: Use cl-lib.
* lisp/obsolete/cust-print.el: Assume `defalias` exists.
(with-custom-print): Use `declare`.
* lisp/obsolete/landmark.el (landmark, landmark-nslify-wts):
Prefer `apply` to `eval`.
* lisp/obsolete/longlines.el (longlines-mode): Don't use `add-to-list`
on a hook.
* lisp/obsolete/pgg-gpg.el (pgg-gpg-process-region): Use `clear-string`.
* lisp/obsolete/pgg-pgp.el (pgg-pgp-encrypt-region): Remove oddly
unused var `passphrase`.
(pgg-pgp-verify-region): Declare var `jam-zcat-filename-list`.
* lisp/obsolete/pgg-pgp5.el (pgg-pgp5-encrypt-region): Remove oddly
unused var `passphrase`.
(pgg-pgp5-verify-region): Declare var `jam-zcat-filename-list`.
* lisp/obsolete/pgg.el: Remove some XEmacs compatibility code.
(pgg-run-at-time, pgg-cancel-timer, pgg-clear-string): Remove functions.
Use their core equivalent instead.
* lisp/obsolete/rcompile.el (remote-compile): Remove unused vars `l`,
`l-host`, `l-user`, and `localname`.
* lisp/obsolete/starttls.el (starttls-any-program-available):
Use `define-obsolete-function-alias`.
* lisp/obsolete/tls.el (tls-format-message): Delete function, use
`format-message` instead.
* lisp/obsolete/url-ns.el (url-ns-prefs): Use `with-current-buffer`
and `dlet`.
* lisp/obsolete/vip.el (vip-escape-to-emacs): Remove unused var `key`.
(vip-command-argument, vip-read-string, ex-delete, ex-line): Remove
unused var `conditions`.
(ex-map): Use a closure instead of `eval`.
(ex-set): Make it an alias of `set-variable`.
(ex-substitute): Remove unused var `cont`.
Buttonize function values in help (and add a blank line)
* lisp/help-fns.el (describe-variable): Add a newline for better
readability (bug#46702). This also has the side effect of
buttonizing `function-references-like-this' in the "Its value is"
part.
(cond-emacs-xemacs, cond-emacs-xemacs-macfn, defunx, ignore-errors-x):
Remove those functions and macros. Replace every use with the result
of their use.
(antlr-default-directory): Remove function, use the `default-directory`
variable instead.
(antlr-read-shell-command): Remove function, use
`read-shell-command` instead.
(antlr-with-displaying-help-buffer): Remove function, by inlining it at
its only call site.
(antlr-end-of-rule, antlr-beginning-of-rule, antlr-end-of-body)
(antlr-beginning-of-body): Mark them as movement commands.
Juri Linkov [Mon, 22 Feb 2021 17:12:43 +0000 (19:12 +0200)]
* lisp/tab-bar.el: 'C-x t N' bound to tab-new-to supports a negative argument
* lisp/tab-bar.el (tab-bar-new-tab-to): Negative TO-INDEX counts
tabs from the end of the tab bar.
(tab-bar-new-tab): Fix docstring to add reference to
'tab-bar-new-tab-to'.
(tab-prefix-map): Bind "N" to tab-new-to.
Juri Linkov [Mon, 22 Feb 2021 17:08:16 +0000 (19:08 +0200)]
* lisp/tab-bar.el: 'C-x t M' bound to tab-move-to supports a negative argument
* lisp/tab-bar.el (tab-bar-move-tab-to): Negative TO-INDEX counts
tabs from the end of the tab bar.
(tab-bar-move-tab): Fix docstring to add reference to tab-bar-move-tab-to.
(tab-prefix-map): Bind "M" to tab-move-to.
Juri Linkov [Mon, 22 Feb 2021 17:03:42 +0000 (19:03 +0200)]
'Mod-9' bound to 'tab-last' now switches to the last tab like in web browsers
* lisp/tab-bar.el (tab-bar--define-keys): Rebind 0 from
tab-bar-switch-to-recent-tab to its alias tab-recent.
Bind 9 to tab-last.
(tab-bar-switch-to-last-tab): New command.
(tab-last): New alias to tab-bar-switch-to-last-tab.
(tab-bar-switch-to-tab, tab-bar-undo-close-tab): Fix docstrings to
avoid mentioning the term "last" for "most recently used" meaning.
* lisp/obsolete/pgg.el: Enable lexical-binding. Remove XEmacs compat code.
(pgg-save-coding-system, pgg-as-lbt, pgg-process-when-success):
Use `declare`.
(pgg-add-passphrase-to-cache): Remove unused var `new-timer`.
(pgg-decrypt-region): Remove unused var `buf`.
* lisp/org/org-agenda.el (org-let, org-let2): Move from org-macs and
use `declare`.
* lisp/org/org-macs.el (org-let, org-let2): Move these functions that
are inherently harmful to your karma to the only package that uses them.
(org-scroll): Use `pcase` to avoid `eval` and use more readable syntax
for those integers standing for events.
* lisp/progmodes/antlr-mode.el: Enable lexical-binding.
(save-buffer-state-x): Use `declare` and `with-silent-modifications`.
Robert Pluim [Mon, 22 Feb 2021 14:05:48 +0000 (15:05 +0100)]
Skip tests that require Internet when there's no Internet
Bug#46641
The network-stream-tests actually work fine when the local machine has
no IP at all, but cause a crash in the GnuTLS library when there is an
IP configured but the interface is down.
* test/lisp/net/network-stream-tests.el (internet-is-working): New
defvar, checks if we can resolve "google.com".
(connect-to-tls-ipv4-nowait, connect-to-tls-ipv6-nowait)
(open-network-stream-tls-nowait, open-gnutls-stream-new-api-nowait)
(open-gnutls-stream-old-api-nowait): Use it to check for working
Internet access.
* test/src/process-tests.el (internet-is-working): New defvar, checks
if we can resolve "google.com".
(lookup-family-specification, lookup-unicode-domains)
(unibyte-domain-name, lookup-google, non-existent-lookup-failure): Use
it to check for working Internet access.
Robert Pluim [Mon, 22 Feb 2021 13:47:41 +0000 (14:47 +0100)]
Fix hang when running dns-query with no working internet
* lisp/net/dns.el (dns-set-servers): reduce the timeout and retry
count when using 'nslookup' for "localhost".
(dns-query): Check to see if we actually managed to initiate a dns
request before starting a busy-wait for the result.
Stefan Kangas [Mon, 22 Feb 2021 11:17:41 +0000 (12:17 +0100)]
Prefer mailing lists to newsgroups in FAQ
* doc/misc/efaq.texi (Real meaning of copyleft)
(Guidelines for mailing list postings, Mailing list archives)
(Packages that do not come with Emacs): Prefer mailing lists to
newsgroups. (Bug#46633)
Fix compilation of closures with nontrivial doc strings
* lisp/emacs-lisp/bytecomp.el (byte-compile-make-closure):
Use the supplied doc string if it's a literal; fall back to the old
slow way of building a closure otherwise.
Stefan Kangas [Mon, 22 Feb 2021 01:24:25 +0000 (02:24 +0100)]
Convert some textmodes menus to easy-menu-define
* lisp/textmodes/artist.el (artist-menu-map): Convert menu definition
to easy-menu-define.
* lisp/textmodes/conf-mode.el (conf-mode-map):
* lisp/textmodes/nroff-mode.el (nroff-mode-map): Move menu
definition from here...
* lisp/textmodes/conf-mode.el (conf-mode-menu):
* lisp/textmodes/nroff-mode.el (nroff-mode-menu): ...to here, and
convert to use easy-menu-define.
Faster, more compact, and readable closure creation
Simplify closure creation by calling a single function at run time
instead of putting it together from small pieces. This is faster
(by about a factor 2), takes less space on disk and in memory, and
makes internal functions somewhat readable in disassembly listings again.
This is done by creating a prototype function at compile-time whose
closure variables are placeholder values V0, V1... which can be seen
in the disassembly. The prototype is then cloned at run time using
the new make-closure function that replaces the placeholders with
the actual closure variables.
* lisp/emacs-lisp/bytecomp.el (byte-compile-make-closure):
Generate call to make-closure from a prototype function.
* src/alloc.c (Fmake_closure): New function.
(syms_of_alloc): Defsubr it.
* src/data.c (syms_of_data): Defsym byte-code-function-p.
Stefan Kangas [Fri, 19 Feb 2021 11:31:56 +0000 (12:31 +0100)]
Run admin/cus-tests.el tests from test suite
* test/Makefile.in (SUBDIRS): Run tests in new directory "misc",
intended for tests not belonging to any one file.
* test/misc/test-custom-deps.el:
* test/misc/test-custom-libs.el:
* test/misc/test-custom-noloads.el:
* test/misc/test-custom-opts.el: New files.
* test/lisp/custom-tests.el (custom--test-local-option): Move test to
above new file test-custom-opts.el.
* admin/cus-test.el: Document running tests from regular test suite.
* test/file-organization.org (Test Files): Document new test directory
"misc" for tests not belonging to any one file.
* lisp/json.el (json-encode-string): Clarify commentary.
(json--encode-stringlike): New function that covers a subset of
json-encode.
(json-encode-key): Use it for more efficient encoding and
validation, and to avoid mishandling confusable keys like boolean
symbols (bug#42545).
(json-encode-array): Make it clearer that argument can be a list.
(json-encode): Reuse json-encode-keyword and json--encode-stringlike
for a subset of the dispatch logic.
(json-pretty-print): Ensure confusable keys like ":a" survive a
decoding/encoding roundtrip (bug#24252, bug#45032).
* test/lisp/json-tests.el (test-json-encode-string)
(test-json-encode-hash-table, test-json-encode-alist)
(test-json-encode-plist, test-json-pretty-print-object): Test
encoding of confusable keys.
Stefan Kangas [Sun, 21 Feb 2021 09:19:23 +0000 (10:19 +0100)]
Convert bubbles menu to easy-menu-define
* lisp/play/bubbles.el (bubbles-game-theme-menu)
(bubbles-graphics-theme-menu, bubbles-menu, bubbles-mode-map):
Move menu definition from here...
(bubbles-menu): ...to here, and convert to easy-menu-define.
Stefan Kangas [Sat, 20 Feb 2021 16:43:03 +0000 (17:43 +0100)]
Convert makefile-mode menu to easy-menu-define
* lisp/progmodes/make-mode.el (makefile-mode-map): Move menu
definition from here...
(makefile-mode-menu): ...to here, and rewrite using easy-menu-define.
* doc/lispref/commands.texi (Interactive Call): Document it.
* lisp/simple.el (command-completion-using-modes-p): Refactored
out into its own function for reuse...
(command-completion-default-include-p): ... from here.
(execute-extended-command-for-buffer): New command and keystroke
(`M-S-x').
* lisp/emacs-lisp/byte-run.el (byte-run--set-modes): Change from
being a predicate to storing the modes. This allows using the
modes for positive command discovery, too.
* src/data.c (Fcommand_modes): Look at the `command-modes' symbol
property, too.
F. Jason Park [Fri, 5 Feb 2021 13:24:55 +0000 (05:24 -0800)]
Add more auth-related tests for socks.el
* test/lisp/net/socks-tests.el (auth-registration-and-suite-offer)
(filter-response-parsing-v4, filter-response-parsing-v5): Assert
auth-method selection wrangling and socks-filter parsing.
(v5-auth-user-pass, v5-auth-user-pass-blank, v5-auth-none): Show prep
and execution of the SOCKS connect command and proxying of an HTTP
request; simplify fake server. (Bug#46342)
Stefan Monnier [Fri, 19 Feb 2021 17:08:00 +0000 (12:08 -0500)]
* test/lisp/emacs-lisp/edebug-tests.el: Adjust to new `edebug-eval-defun`.
(edebug-tests-trivial-backquote): Adjust to the way `eval-defun`
outputs its result.
(edebug-tests-cl-macrolet): Adjust to the fact that now macro expansion
takes place during the `eval-defun` even when Edebugging.
Glenn Morris [Fri, 19 Feb 2021 16:36:56 +0000 (08:36 -0800)]
Merge from origin/emacs-27
8e8b46ef81 (origin/emacs-27) More accurate documentation of the "r" i... dcb2015a5b Mention the GNU Kind Communications Guidelines in the FAQ 9882e63eea ; * CONTRIBUTE: Another wording change regarding tiny chan... 850f18ef23 Allow newlines in password prompts again in comint c977370dd7 Avoid point movement when visiting image files da64a257a4 ; * CONTRIBUTE: Yet another clarification of significant c... d03f2a6ee9 Avoid assertion violation in callproc.c dcc00bbb19 ; * CONTRIBUTE: Clarify the "15-lines" rule a bit more.
Glenn Morris [Fri, 19 Feb 2021 16:36:55 +0000 (08:36 -0800)]
Merge from origin/emacs-27
4712c75ab8 Clarify when activate-mark-hook is run abedf3a865 Fix language-environment and font selection on MS-Windows 8b8708eadd Fix example in Sequence Functions node in the manual
* lisp/net/newst-treeview.el (newsticker-treeview-jump): Change prompt
string.
(newsticker--group-shift): Move the group when a group is currently
selected. Fix error when explicitly shifting a group. (Fixes first
issue in Bug#41376.)
* lisp/progmodes/cperl-mode.el (cperl--package-regexp):
Avoid double repetition; cperl--ws-or-comment-regexp is already
repeated with 1+.
* test/lisp/textmodes/dns-mode-tests.el
(dns-mode-tests-dns-mode-soa-increment-serial): Escape literal '$'.
* test/lisp/emacs-lisp/rx-tests.el (rx-regexp): Modify test to not
trigger a linting warning while retaining its testing power.
(edebug-all-defs, edebug-all-forms): Don't autoload since the problem
it was working around has been fixed a while back.
(edebug--eval-defun): Rename from `edebug-eval-defun` and simplify by
making it an `:around` advice.
(edebug-install-read-eval-functions)
(edebug-uninstall-read-eval-functions): Adjust accordingly.
(edebug-eval-defun): Redefine as an obsolete wrapper.
* lisp/progmodes/elisp-mode.el (elisp--eval-defun):
Use `load-read-function` so it obeys `edebug-all-(defs|forms)`.
(elisp--eval-defun): Fix recent regression introduced with
`elisp--eval-defun-result`.
Ryan Prior [Thu, 18 Feb 2021 11:48:28 +0000 (12:48 +0100)]
Allow newlines in password prompts again in comint
* lisp/comint.el (comint-password-prompt-regexp): Match all
whitespace (including newline) at the end of the passphrase, not
just space and \t (bug#46609).
(comint-watch-for-password-prompt): Remove trailing newlines from
the prompt (bug#46609).
The argument of the rx `regexp` form is assumed to evaluate to a valid
regexp, but certain kinds of deprecated but still accepted usage were
not handled correctly, such as unescaped literal (special) characters:
(rx "a" (regexp "*")) => "a*" which is wrong.
Handle these cases; there is no extra trouble.
* lisp/emacs-lisp/rx.el (rx--translate-regexp): Force bracketing
of single special characters.
* test/lisp/emacs-lisp/rx-tests.el (rx-regexp): Add test case.
Alan Mackenzie [Wed, 17 Feb 2021 21:15:51 +0000 (21:15 +0000)]
Make goto-line-history buffer local only when so customized
* lisp/simple.el (goto-line-history-local): New customizable option.
(goto-line-history): Define this simply with defvar, not defvar-local.
(goto-line-read-args): Handle goto-line-history-local, and changes to it.
* doc/emacs/basic.texi (Moving Point): Add a paragraph about
goto-line-history-local.
* etc/NEWS: Add an item under "Editing Changes in Emacs 28.1".