1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-27 07:41:28 -08:00
Commit graph

145561 commits

Author SHA1 Message Date
Juri Linkov
ffdb91c6b3 '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.
2021-02-22 19:03:42 +02:00
Juri Linkov
2601aa9105 * lisp/tab-bar.el (tab-bar--undefine-keys): New function from tab-bar-mode. 2021-02-22 18:56:47 +02:00
Stefan Monnier
8d5dfafab7 Prefer declare over a put of list-indent-function.
While at it, I enabled lexical-binding in the affected files.

* lisp/cedet/semantic/sb.el: Enable lexical-binding.
(semantic-sb-with-tag-buffer): Use `declare`.

* lisp/cedet/semantic/bovine/el.el: Enable lexical-binding.
(semantic-elisp-setup-form-parser): Use `declare`.

* lisp/emacs-lisp/ert.el:
* lisp/emacs-lisp/ert-x.el: Remove redundant `put`.

* lisp/emulation/cua-rect.el: Enable lexical-binding.
(cua--rectangle-operation, cua--rectangle-aux-replace): Use `declare`.

* lisp/mh-e/mh-acros.el: Enable lexical-binding.
(mh-do-in-gnu-emacs, mh-do-in-xemacs, mh-funcall-if-exists, defun-mh)
(defmacro-mh, with-mh-folder-updating, mh-in-show-buffer)
(mh-do-at-event-location, mh-iterate-on-messages-in-region)
(mh-iterate-on-range): Use `declare`.

* lisp/mh-e/mh-compat.el: Enable lexical-binding.
(mh-flet): Use `declare`.

* lisp/mh-e/mh-e.el: Enable lexical-binding.
(defgroup-mh, defcustom-mh, defface-mh): Use `declare`.

* lisp/net/sieve.el: Enable lexical-binding.  Remove redundant :group args.
(sieve-activate, sieve-remove, sieve-edit-script): Remove unused arg
from the interactive spec.
(sieve-deactivate-all): Remove unused var `name`.
(sieve-change-region): Use `declare`.

* lisp/obsolete/fast-lock.el: Enable lexical-binding.
Remove redundant :group args.  Remove XEmacs compat code.
(save-buffer-state): Remove macro.
(fast-lock-add-properties): Use `with-silent-modifications` instead.

* lisp/obsolete/lazy-lock.el: Enable lexical-binding.
Remove redundant :group args.
(do-while): Use `declare`.
(save-buffer-state): Remove macro.
(lazy-lock-fontify-rest-after-change, lazy-lock-defer-line-after-change)
(lazy-lock-defer-rest-after-change, lazy-lock-after-fontify-buffer)
(lazy-lock-after-unfontify-buffer, lazy-lock-fontify-region):
Use `with-silent-modifications` instead.

* 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`.

* lisp/international/mule-util.el (with-coding-priority):
* lisp/cedet/ede/proj-comp.el (proj-comp-insert-variable-once):
* lisp/org/org-element.el (org-element-map):
* test/lisp/emacs-lisp/bytecomp-tests.el (test-byte-comp-compile-and-load):
* test/lisp/emacs-lisp/generator-tests.el (cps-testcase): Use `declare`.
2021-02-22 11:54:17 -05:00
Lars Ingebrigtsen
f1fa35f091 Fix ANSI coloring problem in large outputs in eshell
* lisp/ansi-color.el (ansi-color-apply-on-region): Ensure that we
fontize from where we left off, and don't skip to the end of the
region (bug#46332).
2021-02-22 16:47:38 +01:00
Julian Scheid
f8d8759059 cl-extra: Fix docstring retrieval
* lisp/emacs-lisp/cl-extra.el (cl--describe-class-slots): Fix
docstring retrieval (bug#46662).
2021-02-22 16:06:58 +01:00
Robert Pluim
a728135a2b 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.
2021-02-22 15:48:06 +01:00
Robert Pluim
934dcc2157 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.
2021-02-22 15:48:06 +01:00
Lars Ingebrigtsen
0c170c64b1 Simplify comint-watch-for-password-prompt
* lisp/comint.el (comint-watch-for-password-prompt): Simplify by
using `string-trim'.
2021-02-22 15:47:30 +01:00
Lars Ingebrigtsen
c1712f5507 Fix prompt for the `M-S-x' command
* lisp/simple.el (read-extended-command): Further kludge the
hard-coded "M-x" prompt for the new `M-S-x' command.
2021-02-22 15:32:34 +01:00
Stefan Kangas
331e49df45 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)
2021-02-22 12:17:41 +01:00
Stefan Kangas
7466b10346 Improve wrong number of args error message in propertize
* src/editfns.c (Fpropertize): Improve error message.
(syms_of_editfns) <Qpropertize>: New DEFSYM.
* test/src/editfns-tests.el
(propertize/error-wrong-number-of-args): New test.
2021-02-22 11:56:12 +01:00
Mattias Engdegård
88a02e4c89 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.
2021-02-22 11:46:04 +01:00
Lars Ingebrigtsen
0fb6f05bcb Fix up previous conf-mode.el and nroff-mode.el change slightly
* lisp/textmodes/conf-mode.el (conf-mode-map): Remove variable now
unused.

* lisp/textmodes/nroff-mode.el (nroff-mode-map): Remove variable
now unused.
2021-02-22 05:10:13 +01:00
Glenn Morris
80df15baf3 * test/misc/test-custom-libs.el (test-custom-libs): Skip on hydra. 2021-02-21 19:11:19 -08:00
Glenn Morris
af17b74a7a * test/misc/test-custom-noloads.el (custom-test-load): Unstable. 2021-02-21 18:58:14 -08:00
Stefan Kangas
02f846ce9e 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.
2021-02-22 02:24:25 +01:00
Mattias Engdegård
d0c47652e5 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.
2021-02-21 21:58:25 +01:00
Stefan Kangas
2790c6a572 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.
2021-02-21 20:20:40 +01:00
Stefan Kangas
ff759b1d0a Fix interactive mode tagging for man and woman
* lisp/man.el (man-common): New mode inheriting special-mode.
(Man-mode):
* lisp/woman.el (woman-mode): Inherit from man-common.

* lisp/man.el (man-follow, Man-update-manpage)
(Man-fontify-manpage, Man-cleanup-manpage, Man-next-section)
(Man-previous-section, Man-goto-section)
(Man-goto-see-also-section, Man-follow-manual-reference)
(Man-kill, Man-goto-page, Man-next-manpage)
(Man-previous-manpage): Change interactive mode tag to man-common.

This was discussed in:
https://lists.gnu.org/r/emacs-devel/2021-02/msg01619.html
2021-02-21 20:09:10 +01:00
Lars Ingebrigtsen
24166be166 Declare that ignore' and undefined' shouldn't be completed over
* lisp/subr.el (ignore, undefined): Declare that these shouldn't
be completed over.
2021-02-21 19:26:39 +01:00
Lars Ingebrigtsen
d15a42ac45 Use undefined' instead of ignore' in wdired
* lisp/wdired.el (wdired-mode-map): Use `undefined' here instead
of `ignore' to give the user more feedback.
2021-02-21 14:04:18 +01:00
Basil L. Contovounesios
908f251e19 Fix json.el encoding of confusable object keys
* 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.
2021-02-21 12:53:45 +00:00
Stefan Kangas
767608ef56 Make unused variable menu-bar-handwrite-map obsolete
* lisp/play/handwrite.el (menu-bar-handwrite-map): Make unused
variable obsolete.
2021-02-21 10:49:07 +01:00
Stefan Kangas
1b9e233493 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.
2021-02-21 10:49:07 +01:00
Stefan Kangas
669b911c66 ; Fix previous easy-menu-define conversion
* lisp/emacs-lisp/re-builder.el (reb-mode-menu):
* lisp/progmodes/make-mode.el (makefile-mode-menu): Replace :button
attribute with :style and :selected.
2021-02-21 10:49:07 +01:00
Stefan Kangas
df932bef91 * etc/NEWS.19: Add entry for 'easy-menu-define'. 2021-02-21 10:49:07 +01:00
Stefan Kangas
2c26eb1115 Convert some progmodes menus to easy-menu-define
* lisp/progmodes/asm-mode.el (asm-mode-map):
* lisp/progmodes/grep.el (grep-mode-map):
* lisp/progmodes/m4-mode.el (m4-mode-map):
* lisp/progmodes/sh-script.el (sh-mode-map): Move menu definition from here...
* lisp/progmodes/asm-mode.el (asm-mode-menu):
* lisp/progmodes/grep.el (grep-menu-map):
* lisp/progmodes/m4-mode.el (m4-mode-menu):
* lisp/progmodes/sh-script.el (sh-mode-menu): ...to here, and rewrite
using easy-menu-define.
2021-02-21 10:49:07 +01:00
Michael Albinus
3010794753 Clarification of password handling in Tramp manual
* doc/misc/tramp.texi (Password handling): Describe, how to
suppress `auth-sources' for Tramp.
(Remote shell setup, Remote processes)
(Cleanup remote connections, Frequently Asked Questions):
Handle reference to Emacs manual.
2021-02-21 10:24:56 +01:00
Alan Third
e6842038c9 Fix memory leak
* src/nsterm.m ([EmacsSurface dealloc]): Release will remove all
objects and free the memory.
2021-02-20 20:42:11 +00:00
Stefan Kangas
cf95b53405 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.
2021-02-20 17:43:03 +01:00
F. Jason Park
a6234bb5b4 Mute noisy test fixture for socks.el
* test/lisp/net/socks-tests.el:
(socks-tests-perform-hello-world-http-request): Bind
'inhibit-message' non-nil when in batch mode.
(Bug#46342)
2021-02-20 17:15:44 +02:00
Lars Ingebrigtsen
496bed5cf4 Change command-completion-using-modes-p to defun
* lisp/simple.el (command-completion-using-modes-p): Change into a
defun for now because of a build problem.
2021-02-20 15:43:26 +01:00
Lars Ingebrigtsen
006d0ae396 Mention `M-S-x' in the Emacs manual.
* doc/emacs/m-x.texi (M-x): Mention `M-S-x' in the Emacs manual.
2021-02-20 15:37:28 +01:00
Eli Zaretskii
4c4c2eab7e ; Fix typos in last change
* etc/NEWS: Improve wording.
* lisp/simple.el (execute-extended-command-for-buffer): Fix typo.
2021-02-20 16:24:03 +02:00
Lars Ingebrigtsen
e3e3133f80 Add a new command for mode-specific commands
* 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').
2021-02-20 15:12:45 +01:00
Lars Ingebrigtsen
12578d6aca Change how (declare (modes store the data
* 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.
2021-02-20 14:29:41 +01:00
Lars Ingebrigtsen
825aed11d2 Add the `always' function
* doc/lispref/functions.texi (Calling Functions): Document it.
* lisp/subr.el (always): New function.

* lisp/emacs-lisp/byte-opt.el (side-effect-free-fns): Mark it as
side effect free.
2021-02-20 13:44:19 +01:00
F. Jason Park
43703a06b9 Use raw bytes for SOCKS 4 IP addresses
* lisp/net/socks.el: (socks--open-network-stream, socks-send-command):
* test/lisp/net/socks-tests.el: (socks-tests-v4-basic): (Bug#46342).
2021-02-20 13:03:12 +02:00
F. Jason Park
acf7160920 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)
2021-02-20 13:02:33 +02:00
Stefan Kangas
d184895a42 Convert re-builder menu to easy-menu-define
* lisp/emacs-lisp/re-builder.el (reb-mode-map): Move menu
definition from here...
(reb-mode-menu): ...to here, and rewrite using easy-menu-define.
2021-02-20 07:55:04 +01:00
Stefan Kangas
7b12747e2f Convert finder menu to easy-menu-define
* lisp/finder.el (finder-mode-map): Move menu definition from
here...
(finder-mode-menu): ...to here, and rewrite using
easy-menu-define.
2021-02-20 07:55:04 +01:00
Stefan Kangas
c85c8e7d42 Add toolbar for help-mode
* lisp/help-mode.el (help-mode): Add toolbar.
(help-mode-tool-bar-map): New variable.
(help-mode-menu): Disable forward/backward items when stack is empty.

(help-bookmark-make-record, help-bookmark-jump): Minor doc fixes.
2021-02-20 06:43:03 +01:00
Stefan Kangas
b612f1a41f * lisp/woman.el: Doc fix; remove redundant setup info. 2021-02-20 04:21:35 +01:00
Thomas Fitzsimmons
5f539581a4 * lisp/url/url-http.el (url-http): Fix docstring typo. 2021-02-19 17:32:59 -05:00
Thomas Fitzsimmons
7366859fe0 ntlm-tests: Remove missing dependency warnings
* test/lisp/net/ntlm-tests.el: Remove warnings about dependencies
not being present.
2021-02-19 17:11:42 -05:00
Thomas Fitzsimmons
ade9c22c04 ntlm-tests: Skip tests if dependencies are too old
* test/lisp/net/ntlm-tests.el (ntlm-tests--dependencies-present):
Add version and functionality checks.

Co-authored-by: Michael Albinus <michael.albinus@gmx.de>
2021-02-19 17:11:42 -05:00
Alan Third
283f98353f Fix frame contents scaling bug on macOS (bug#46155)
Discussion in bug#46406.

* src/nsterm.m ([EmacsView focusOnDrawingBuffer:]): Set the scale
factor for the backing layer.
2021-02-19 19:37:02 +00:00
Stefan Monnier
b6eccad06c * lisp/emacs-lisp/bytecomp.el: Don't warn for repeated _ args
(byte-compile-check-lambda-list): Skip warnings of repeated arg for
those that are declared as unused anyway.
2021-02-19 12:51:36 -05:00
Stefan Monnier
9b7eed33f9 * 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.
2021-02-19 12:08:00 -05:00
Glenn Morris
1d50050af7 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.
2021-02-19 08:36:56 -08:00