]> git.eshelyaron.com Git - emacs.git/log
emacs.git
3 years agoImprove fill-region-as-paragraph when there's a fill prefix
Lars Ingebrigtsen [Sun, 10 Jan 2021 14:04:39 +0000 (15:04 +0100)]
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).

3 years agoMake font locking work in mercury-mode
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).

Copyright-paperwork-exempt: yes

3 years agoHyperlink symbol names without word syntax in Help
Basil L. Contovounesios [Sun, 27 Dec 2020 14:21:50 +0000 (14:21 +0000)]
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.

3 years agoAdd support for 'process-attributes' on OpenBSD
Omar Polo [Sun, 10 Jan 2021 13:25:22 +0000 (14:25 +0100)]
Add support for 'process-attributes' on OpenBSD

* src/sysdep.c (make_lisp_timeval):
(system_process_attributes): Implement for OpenBSD (bug#45729).

3 years ago; * lisp/custom.el (defcustom): Fix last change.
Basil L. Contovounesios [Sun, 10 Jan 2021 13:20:51 +0000 (13:20 +0000)]
; * lisp/custom.el (defcustom): Fix last change.

3 years agoAdd support for flat buttons
Pedro Andres Aranda Gutierrez [Sun, 10 Jan 2021 13:10:18 +0000 (14:10 +0100)]
Add support for flat buttons

* src/xfaces.c (Finternal_set_lisp_face_attribute):
(realize_gui_face): Add support for `flat-button' (bug#45735).

Copyright-paperwork-exempt: yes

3 years agoMinor shortdoc link improvements
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).

3 years agoAdd a link to the manual from the defcustom doc string
Lars Ingebrigtsen [Sun, 10 Jan 2021 12:43:12 +0000 (13:43 +0100)]
Add a link to the manual from the defcustom doc string

* lisp/custom.el (defcustom): Add a link to the manual for the
:type element.

3 years agoRevert recent mm-with-part change
Lars Ingebrigtsen [Sun, 10 Jan 2021 12:30:25 +0000 (13:30 +0100)]
Revert recent mm-with-part change

* lisp/gnus/mm-decode.el (mm-with-part): Revert
23a887e426f81033b0de2f4c93a8525cb31c28da -- this is the wrong
place to handle this peculiarity.

3 years agoMerge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Michael Albinus [Sun, 10 Jan 2021 12:27:10 +0000 (13:27 +0100)]
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs

3 years agoRework parts of Tramp's insert-directory, bug#45691
Michael Albinus [Sun, 10 Jan 2021 12:26:29 +0000 (13:26 +0100)]
Rework parts of Tramp's insert-directory, bug#45691

* lisp/net/tramp-sh.el (tramp-sh-handle-insert-directory): Fix some
unibyte/multibyte inconsistencies.  (Bug#45691)

* test/lisp/net/tramp-tests.el (tramp-test17-insert-directory-one-file):
New test.

3 years agoAdd more mm-decode tests
Lars Ingebrigtsen [Sun, 10 Jan 2021 12:20:49 +0000 (13:20 +0100)]
Add more mm-decode tests

3 years ago* lisp/subr.el (global-map): Doc fix; add cross-reference.
Stefan Kangas [Sat, 9 Jan 2021 11:03:12 +0000 (12:03 +0100)]
* lisp/subr.el (global-map): Doc fix; add cross-reference.

3 years agoCreate new test file for socks.el
F. Jason Park [Sun, 10 Jan 2021 11:40:53 +0000 (12:40 +0100)]
Create new test file for socks.el

* test/lisp/net/socks-tests.el (socks-tests-auth-filter-url-http): Add
SOCKS5 authentication test and fake server (bug#45162).

3 years agoIncrease probability that a process test succeeds.
Philipp Stephani [Sun, 10 Jan 2021 09:14:27 +0000 (10:14 +0100)]
Increase probability that a process test succeeds.

* test/src/process-tests.el
(process-tests/fd-setsize-no-crash/make-process): Work around
potential Emacs bug.

3 years agoRemove a pointless check for WCOREDUMPED.
Philipp Stephani [Sun, 10 Jan 2021 08:50:15 +0000 (09:50 +0100)]
Remove a pointless check for WCOREDUMPED.

WCOREDUMPED can only be used if the process was killed.

* src/process.c (status_convert): Don't check WCOREDUMPED if
WIFEXITED.

3 years agoSupport keyval style beamer frame labels
Tassilo Horn [Sun, 10 Jan 2021 08:40:07 +0000 (09:40 +0100)]
Support keyval style beamer frame labels

* lisp/textmodes/reftex-vars.el (reftex-label-regexps): Support keyval
style beamer frame labels.

3 years agoRemove reference to gnus-bug-create-help-buffer
Eric Abrahamsen [Sat, 9 Jan 2021 17:45:49 +0000 (09:45 -0800)]
Remove reference to gnus-bug-create-help-buffer

* lisp/gnus/gnus-win.el (gnus-buffer-configuration): Variable no
longer exists.

3 years agoDon't unblock SIGCHLD too early.
Philipp Stephani [Sat, 9 Jan 2021 20:17:42 +0000 (21:17 +0100)]
Don't unblock SIGCHLD too early.

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.

3 years agoCount Flymake diagnostics in modeline by severity, not type
João Távora [Sat, 9 Jan 2021 18:49:49 +0000 (18:49 +0000)]
Count Flymake diagnostics in modeline by severity, not type

Originally reported in https://github.com/joaotavora/eglot/issues/588
by Pankaj Jangid.

* lisp/progmodes/flymake.el (flymake--mode-line-counter): Count
diagnostics by severity level, not by type.
(Version): Bump to 1.1.1

3 years ago* lisp/emacs-lisp/cl-macs.el (cl--self-tco): Fix build of gnus-agent.el
Stefan Monnier [Sat, 9 Jan 2021 16:35:53 +0000 (11:35 -0500)]
* lisp/emacs-lisp/cl-macs.el (cl--self-tco): Fix build of gnus-agent.el

Don't burp on "naked" variable let bindings.

3 years agoFix cl-concatenate use in macros
Eli Zaretskii [Sat, 9 Jan 2021 12:12:14 +0000 (14:12 +0200)]
Fix cl-concatenate use in macros

* lisp/emacs-lisp/cl-macs.el (inline): Remove cl-concatenate.
(Bug#45610)

3 years ago* lisp/emacs-lisp/cl-macs.el: Optimize self-calls in tail position
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.

* lisp/subr.el (letrec): Optimize single-binding corner case.

* test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs--labels): Add tests
to check that TCO is working.

3 years agoMake sure default-directory relates to the originating buffer
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.

3 years ago* lisp/subr.el (letrec): Optimize some non-recursive bindings
Stefan Monnier [Fri, 8 Jan 2021 23:44:13 +0000 (18:44 -0500)]
* lisp/subr.el (letrec): Optimize some non-recursive bindings

* lisp/emacs-lisp/macroexp.el (macroexp--fgrep): Look inside bytecode
objects as well.

* test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs--labels):
* test/lisp/subr-tests.el (subr--tests-letrec): New tests.

3 years ago* lisp/emacs-lisp/cl-generic.el (cl--generic-lambda): Fix last change
Stefan Monnier [Fri, 8 Jan 2021 23:28:47 +0000 (18:28 -0500)]
* lisp/emacs-lisp/cl-generic.el (cl--generic-lambda): Fix last change

3 years ago* lisp/emacs-lisp/macroexp.el (macroexp--fgrep): Rename from `pcase--fgrep`
Stefan Monnier [Fri, 8 Jan 2021 22:57:26 +0000 (17:57 -0500)]
* lisp/emacs-lisp/macroexp.el (macroexp--fgrep): Rename from `pcase--fgrep`

* lisp/emacs-lisp/cl-generic.el (cl--generic-fgrep): Delete.
(cl--generic-lambda): Use `macroexp--pacse` instead.

* lisp/emacs-lisp/pcase.el (pcase--fgrep): Rename to `macroexp--fgrep`.

3 years agoMerge recently added kbd tests
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>.

3 years agoLift define-prefix-command to Lisp
Stefan Kangas [Fri, 8 Jan 2021 14:16:02 +0000 (15:16 +0100)]
Lift define-prefix-command to Lisp

* lisp/subr.el (define-prefix-command): New defun.
* src/keymap.c (Fdefine_prefix_command): Remove DEFUN.
(syms_of_keymap): Remove defsubr for Fdefine_prefix_command.
* test/lisp/subr-tests.el (subr-test-define-prefix-command): New
test.

3 years ago* test/lisp/subr-tests.el (subr-test-kbd): New test.
Stefan Kangas [Fri, 8 Jan 2021 11:27:32 +0000 (12:27 +0100)]
* test/lisp/subr-tests.el (subr-test-kbd): New test.

3 years agoRemove unused DEFSYM
Stefan Kangas [Thu, 7 Jan 2021 18:01:55 +0000 (19:01 +0100)]
Remove unused DEFSYM

* src/minibuf.c (syms_of_minibuf) <Qhistory_length>: Remove unused
DEFSYM.

3 years agoFix syntax of space characters
Eli Zaretskii [Fri, 8 Jan 2021 11:53:28 +0000 (13:53 +0200)]
Fix syntax of space characters

* lisp/international/characters.el (tbl): Give all the space
characters whose Unicode General Category is Zs the 'space'
syntax.  (Bug#45660)

3 years ago* test/lisp/net/tramp-tests.el (tramp-test31-interrupt-process):
Michael Albinus [Fri, 8 Jan 2021 08:58:31 +0000 (09:58 +0100)]
* test/lisp/net/tramp-tests.el (tramp-test31-interrupt-process):

Tag it :unstable on hydra.

3 years ago* lisp/tab-bar.el: Improve tab-bar-show (bug#45556)
Juri Linkov [Thu, 7 Jan 2021 18:08:44 +0000 (20:08 +0200)]
* lisp/tab-bar.el: Improve tab-bar-show (bug#45556)

* lisp/tab-bar.el (tab-bar-show): Change :set lambda to update all frames.
Improve docstring.

3 years ago* lisp/mb-depth.el (minibuffer-depth-indicator): Add :group 'minibuffer'.
Juri Linkov [Thu, 7 Jan 2021 17:56:59 +0000 (19:56 +0200)]
* lisp/mb-depth.el (minibuffer-depth-indicator): Add :group 'minibuffer'.

3 years agoRemove an outdated comment
Stefan Kangas [Thu, 7 Jan 2021 17:51:50 +0000 (18:51 +0100)]
Remove an outdated comment

* lisp/subr.el: Remove comment to reflect recent change in the
definition of global-map, esc-map and ctl-x-map.

3 years agoFurther display-buffer doc changes
Lars Ingebrigtsen [Thu, 7 Jan 2021 15:47:26 +0000 (16:47 +0100)]
Further display-buffer doc changes

* lisp/window.el (display-buffer): `display-buffer-alist' is
apparently the variable the user should be directed towards.

3 years agoMerge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Michael Albinus [Thu, 7 Jan 2021 15:43:45 +0000 (16:43 +0100)]
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs

3 years ago* test/lisp/filenotify-tests.el (file-notify-test07-many-events-remote):
Michael Albinus [Thu, 7 Jan 2021 15:43:27 +0000 (16:43 +0100)]
* test/lisp/filenotify-tests.el (file-notify-test07-many-events-remote):

Mark it as unstable also on emba.

3 years agoAdd a display-buffer window selection function that's more like XEmacs
Lars Ingebrigtsen [Thu, 7 Jan 2021 15:35:48 +0000 (16:35 +0100)]
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.

3 years agoFix typo in last display-buffer doc string change
Lars Ingebrigtsen [Thu, 7 Jan 2021 15:00:58 +0000 (16:00 +0100)]
Fix typo in last display-buffer doc string change

* lisp/window.el (display-buffer): Fix typo in last doc string change.

3 years agoEdit the display-buffer doc string slightly
Lars Ingebrigtsen [Thu, 7 Jan 2021 14:45:05 +0000 (15:45 +0100)]
Edit the display-buffer doc string slightly

* lisp/window.el (display-buffer): Reword the start of the doc
string (bug#45688).

3 years agoAdd work-around for nnmaildir encoding problem
Lars Ingebrigtsen [Thu, 7 Jan 2021 14:12:23 +0000 (15:12 +0100)]
Add work-around for nnmaildir encoding problem

* lisp/gnus/mm-decode.el (mm-with-part): Fix problem with
multipart 8bit encoded posts from nnmaildir (bug#44307).

3 years agoAdd tests for mm-decode.el
Lars Ingebrigtsen [Thu, 7 Jan 2021 13:32:28 +0000 (14:32 +0100)]
Add tests for mm-decode.el

3 years agoClear socks protocol scratch after authentication
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).

3 years agoFix quoting problem in pop3-uidl-save
Andreas Schwab [Thu, 7 Jan 2021 12:20:43 +0000 (13:20 +0100)]
Fix quoting problem in pop3-uidl-save

* lisp/net/pop3.el (pop3-uidl-save): Quote strings properly
(bug#43896).

3 years agoRevert mark-paragraph change and add tests
Lars Ingebrigtsen [Thu, 7 Jan 2021 12:08:45 +0000 (13:08 +0100)]
Revert mark-paragraph change and add tests

* lisp/textmodes/paragraphs.el (mark-paragraph): Revert
eb090f65ceb0ae8a90829e911694348583135ba5 (bug#45318).  This restores
the behaviour from Emacs 27 -- further work is needed on this patch.

3 years ago* test/Makefile.in (WRITE_LOG): Mark also problematic tests for emba.
Michael Albinus [Thu, 7 Jan 2021 09:14:37 +0000 (10:14 +0100)]
* test/Makefile.in (WRITE_LOG): Mark also problematic tests for emba.

3 years agoUpdate a substitute-command-keys test
Glenn Morris [Thu, 7 Jan 2021 01:19:17 +0000 (17:19 -0800)]
Update a substitute-command-keys test

* test/lisp/help-tests.el (help-tests-substitute-command-keys/keymaps):
Update for "Pretty-print keys without <> around modifiers" change.

3 years agoFix some failing tests in BSD systems
Daniel Martín [Wed, 6 Jan 2021 20:53:40 +0000 (22:53 +0200)]
Fix some failing tests in BSD systems

* test/lisp/progmodes/xref-tests.el
(xref--xref-file-name-display-is-abs)
(xref--xref-file-name-display-is-relative-to-project-root):
Accommodate some older versions of BSD find
(https://lists.gnu.org/archive/html/emacs-devel/2021-01/msg00156.html).

3 years agoProof some searches and file listings against symlinks
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/progmodes/xref.el (xref-matches-in-directory): Same.

* lisp/cedet/semantic/symref/grep.el (semantic-symref-perform-search):
Same.

3 years ago* lisp/mb-depth.el (minibuffer-depth-indicator): New face.
Gabriel do Nascimento Ribeiro [Wed, 6 Jan 2021 18:27:26 +0000 (20:27 +0200)]
* 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

Copyright-paperwork-exempt: yes

3 years agoFix obsolete variable warnings about class names
Michael Heerdegen [Tue, 22 Dec 2020 04:44:47 +0000 (05:44 +0100)]
Fix obsolete variable warnings about class names

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

3 years ago* lisp/play/dunnet.el: Run the game when loaded via `--batch -l dunnet`
Stefan Monnier [Wed, 6 Jan 2021 02:29:41 +0000 (21:29 -0500)]
* lisp/play/dunnet.el: Run the game when loaded via `--batch -l dunnet`

(dun--batch): Rename from `dun-batch` and don't autoload.
(dunnet): Delegate to `dun--batch` when in batch mode.

3 years ago* lisp/emacs-lisp/package.el (package-activate-all): Another tweak
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.

3 years ago* lisp/emacs-lisp/autoload.el: Improve last change
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.

* lisp/mail/rmail.el (rmail-spool-directory): Remove hacks.
* lisp/info.el (Info-default-directory-list): Remove `progn` hack.

* lisp/custom.el (custom-declare-variable)
(custom-handle-all-keywords): Don't use pseudo-group `nil`.

3 years agoPrevent stack overflow in GNUstep menu code
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.

3 years ago* lisp/subr.el (remove-hook): Add default value (bug#45393)
Juri Linkov [Tue, 5 Jan 2021 18:59:51 +0000 (20:59 +0200)]
* lisp/subr.el (remove-hook): Add default value (bug#45393)

3 years ago* lisp/tab-bar.el (tab-bar-tab-name-format-function): New defcustom.
Juri Linkov [Tue, 5 Jan 2021 18:55:29 +0000 (20:55 +0200)]
* lisp/tab-bar.el (tab-bar-tab-name-format-function): New defcustom.

(tab-bar-tab-name-format-default): New function as the default value.
(tab-bar-make-keymap-1): Funcall tab-bar-tab-name-format-function.

3 years ago* lisp/tab-bar.el (toggle-frame-tab-bar): New command (bug#45556)
Juri Linkov [Tue, 5 Jan 2021 18:43:22 +0000 (20:43 +0200)]
* lisp/tab-bar.el (toggle-frame-tab-bar): New command (bug#45556)

3 years agoRefactor tab-bar-mode to -define-keys and -load-buttons (bug#42052)
James N. V. Cash [Tue, 5 Jan 2021 18:35:35 +0000 (20:35 +0200)]
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.

Copyright-paperwork-exempt: yes

3 years agoFix process-tests on MS-Windows
Eli Zaretskii [Tue, 5 Jan 2021 18:26:38 +0000 (20:26 +0200)]
Fix process-tests on MS-Windows

It was again broken by recent changes.
* test/src/process-tests.el
(process-tests/fd-setsize-no-crash/make-serial-process): Skip test
on MS-Windows.

3 years ago* lisp/emacs-lisp/package.el: Load package-quickstart without package.el
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`.

3 years agoruby-mode: eliminate redundant regexp branch
Mattias Engdegård [Tue, 5 Jan 2021 11:01:32 +0000 (12:01 +0100)]
ruby-mode: eliminate redundant regexp branch

* lisp/progmodes/ruby-mode.el (ruby-add-log-current-method):
Since ruby-operator-re matches dot, don't include both in regexp.
This pacifies relint.

3 years ago; * lisp/subr.el (ctl-x-map): Fix typo in kill-buffer binding.
Mattias Engdegård [Tue, 5 Jan 2021 10:27:41 +0000 (11:27 +0100)]
; * lisp/subr.el (ctl-x-map): Fix typo in kill-buffer binding.

3 years agoPretty-print keys without <> around modifiers (bug#45536)
Mattias Engdegård [Tue, 29 Dec 2020 15:55:06 +0000 (16:55 +0100)]
Pretty-print keys without <> around modifiers (bug#45536)

Be consistent when pretty-printing keys: put modifiers outside <>,
thus the more logical C-M-<return> instead of <C-M-return>.

* src/keymap.c (Fsingle_key_description):
Skip modifier prefix before adding <>.
* doc/lispref/help.texi (Describing Characters): Update example.
* doc/lispref/debugging.texi (Backtraces):
* doc/lispref/minibuf.texi (Text from Minibuffer):
Use @kbd instead of @key.
* etc/NEWS: Announce the change.
* test/src/keymap-tests.el (keymap--key-description):
* test/lisp/subr-tests.el (subr--kbd): New tests.

3 years ago* lisp/filesets.el (filesets-external-viewers): Tighten regexp.
Mattias Engdegård [Tue, 5 Jan 2021 09:27:36 +0000 (10:27 +0100)]
* lisp/filesets.el (filesets-external-viewers): Tighten regexp.

3 years agoperl-mode: Display here-docs as strings instead of comments
Harald Jörg [Tue, 5 Jan 2021 09:15:04 +0000 (10:15 +0100)]
perl-mode: Display here-docs as strings instead of comments

* lisp/progmodes/perl-mode.el
(perl-syntax-propertize-function): Handle HERE doc starter
lines ending in a comment.
(perl-heredoc): New face for HERE docs, inheriting from
font-lock-string-face.
(perl-font-lock-syntactic-face-function): Apply the new face
to HERE docs (Bug#23461).

* test/lisp/progmodes/cperl-mode-tests.el
(cperl-test--run-bug-10483): Skip for Perl mode.  The test
explicitly calls a function of CPerl mode.

3 years ago* lisp/subr.el (esc-map): Initialize inside declaration
Stefan Monnier [Tue, 5 Jan 2021 04:20:44 +0000 (23:20 -0500)]
* lisp/subr.el (esc-map): Initialize inside declaration

* src/commands.h (meta_map):
* src/keymap.c (meta_map): Delete variable.
(syms_of_keymap): Don't initialize esc-map here.
(initial_define_key):
* src/keymap.h (initial_define_key): Delete function.

* src/keyboard.c (keys_of_keyboard): Don't initialize esc-map here.

* src/window.h (keys_of_window):
* src/window.c (keys_of_window): Delete function.
* src/lisp.h (keys_of_casefiddle):
* src/casefiddle.c (keys_of_casefiddle): Delete function.
* src/emacs.c (main): Don't call them.

3 years ago* lisp/subr.el (ctl-x-map): Initialize inside the declaration.
Stefan Monnier [Tue, 5 Jan 2021 04:11:07 +0000 (23:11 -0500)]
* lisp/subr.el (ctl-x-map): Initialize inside the declaration.

* src/command.h (control_x_map):
* src/keymap.c (control_x_map): Delete variable.
(syms_of_keymap):
* src/keyboard.c (keys_of_keyboard):
* src/casefiddle.c (keys_of_casefiddle):
* src/window.c (keys_of_window): Move initialization of ctl-x-map to
subr.el.

* src/lisp.h (syms_of_buffer):
* src/buffer.c (keys_of_buffer): Delete function.
* src/emacs.c (main): Don't call it.

3 years ago* lisp/subr.el (global-map): Initialize inside declaration.
Stefan Monnier [Tue, 5 Jan 2021 03:57:21 +0000 (22:57 -0500)]
* lisp/subr.el (global-map): Initialize inside declaration.

* src/commands.h (global_map):
* src/keymap.c (global_map): Delete variable.
(syms_of_keymap): Don't initialize global_map here.
(keys_of_keymap): Delete function.
* src/lisp.h (keys_of_cmds):
* src/cmds.c (keys_of_cmds): Delete function.
* src/emacs.c (main): Don't call them.

* src/window.c (keys_of_window): Don't initialize global_map here.
* src/keyboard.c (keys_of_keyboard): Don't initialize global_map here.

3 years agoUse lexical-binding in the remaining preloaded files
Stefan Monnier [Tue, 5 Jan 2021 01:57:42 +0000 (20:57 -0500)]
Use lexical-binding in the remaining preloaded files

* lisp/widget.el:
* lisp/w32-fns.el:
* lisp/textmodes/fill.el:
* lisp/term/common-win.el:
* lisp/scroll-bar.el:
* lisp/rfn-eshadow.el:
* lisp/menu-bar.el:
* lisp/language/tibetan.el:
* lisp/language/thai.el:
* lisp/language/misc-lang.el:
* lisp/language/lao.el:
* lisp/language/korean.el:
* lisp/language/japanese.el:
* lisp/language/indian.el:
* lisp/language/hebrew.el:
* lisp/language/european.el:
* lisp/language/ethiopic.el:
* lisp/language/english.el:
* lisp/language/cyrillic.el:
* lisp/language/chinese.el:
* lisp/jka-cmpr-hook.el:
* lisp/international/ucs-normalize.el:
* lisp/international/mule.el:
* lisp/international/mule-conf.el:
* lisp/international/iso-transl.el:
* lisp/international/fontset.el:
* lisp/international/characters.el:
* lisp/format.el:
* lisp/facemenu.el:
* lisp/electric.el:
* lisp/dos-w32.el:
* lisp/dos-fns.el:
* lisp/disp-table.el:
* lisp/cus-face.el:
* lisp/composite.el:
* lisp/bindings.el:
* admin/unidata/blocks.awk:
* admin/charsets/eucjp-ms.awk:
* admin/charsets/cp51932.awk: Use `lexical-binding`.

3 years ago* lisp/filesets.el: Use lexical-binding
Stefan Monnier [Mon, 4 Jan 2021 23:23:43 +0000 (18:23 -0500)]
* lisp/filesets.el: Use lexical-binding

Remove redundant `:group` args.  Require cl-lib and seq.
Fix various O(n²) bug and flag a few remaining ones.

(filesets-external-viewers): Simplify regexps.  Use \' instead of $.
Remove useless :constraint-flag properties.
(filesets-convert-path-list): η-reduce.
(filesets-eviewer-constraint-p): Mark :constraint-flag as obsolete.
(filesets-spawn-external-viewer): Can't use `run-hooks` on
lexical variable.
(filesets-filter-list): Fix O(n²) bug.
(filesets-ormap): Simplify.
(filesets-some, filesets-member, filesets-sublist): Make them
obsolete aliases.
(filesets-reset-fileset): Simplify.
(filesets-directory-files): Use `push`.
(filesets-spawn-external-viewer): Use `mapconcat` to fix O(n²) bug.
(filesets-cmd-get-args): Use `mapcan` to fix O(n²) bug.
(filesets-run-cmd): Use `mapconcat` and `mapcan` to fix O(n²) bugs.
(filesets-ingroup-collect-finder): Use dynamic scoping.
(filesets-ingroup-collect-files): Use `nreverse` to fix O(n²) bug.
(filesets-ingroup-collect-build-menu): Use `mapcan` to fix O(n²) bug.

3 years agoMake a process tests a bit more robust.
Philipp Stephani [Mon, 4 Jan 2021 21:08:39 +0000 (22:08 +0100)]
Make a process tests a bit more robust.

* test/src/process-tests.el
(process-tests/fd-setsize-no-crash/make-process): Allow for processes
to fail before 'exec'.

3 years ago* lisp/cedet/srecode/semantic.el: Use lexical-binding
Stefan Monnier [Mon, 4 Jan 2021 20:34:12 +0000 (15:34 -0500)]
* lisp/cedet/srecode/semantic.el: Use lexical-binding

(srecode-semantic-insert-tag): Can't use `run-hook-with-args` on
lexical variable.

3 years ago* lisp/mail/reporter.el: Use lexical-binding
Stefan Monnier [Mon, 4 Jan 2021 20:31:58 +0000 (15:31 -0500)]
* lisp/mail/reporter.el: Use lexical-binding

(reporter--run-functions): New function.
(reporter-dump-state): Use it and simplify the code.

3 years ago* lisp/erc/erc.el (erc-process-input-line): Undo confused last change
Stefan Monnier [Mon, 4 Jan 2021 20:25:29 +0000 (15:25 -0500)]
* lisp/erc/erc.el (erc-process-input-line): Undo confused last change

3 years agoruby-add-log-current-method: Support methods with symbolic names
Dmitry Gutov [Mon, 4 Jan 2021 19:13:33 +0000 (21:13 +0200)]
ruby-add-log-current-method: Support methods with symbolic names

* lisp/progmodes/ruby-mode.el (ruby-add-log-current-method):
Support methods with symbolic names.

3 years agoDo not assume Xrender merely because Cairo
Paul Eggert [Mon, 4 Jan 2021 18:33:43 +0000 (10:33 -0800)]
Do not assume Xrender merely because Cairo

Problem reported by Andrea Corallo in:
https://lists.gnu.org/r/emacs-devel/2021-01/msg00225.html
* src/xterm.c (x_term_init) [USE_CAIRO && !HAVE_XRENDER]:
Do not call XRenderQueryExtension.

3 years agoFix broken build on AIX 7.2
Paul Eggert [Sun, 3 Jan 2021 19:19:48 +0000 (11:19 -0800)]
Fix broken build on AIX 7.2

Without this fix, the build on AIX 7.2 with xlc fails in the ‘CCLD
temacs’ step with the diagnostic ‘ld: 0711-317 ERROR: Undefined
symbol: BC’.  This is because -lcurses does not define BC etc.
* configure.ac: When building terminfo.o, define
TERMINFO_DEFINES_BC if the library defines BC etc.
* src/terminfo.c (UP, BC, PC): Define depending on
TERMINFO_DEFINES_BC, not on TERMINFO.

(cherry picked from commit 632917461a7c1893a83979a3873b51d4da3b8a42)

3 years agoMerge from origin/emacs-27
Glenn Morris [Mon, 4 Jan 2021 15:50:26 +0000 (07:50 -0800)]
Merge from origin/emacs-27

99cc0045eb (origin/emacs-27) Update two user option names in the Widg...

3 years ago; Merge from origin/emacs-27
Glenn Morris [Mon, 4 Jan 2021 15:50:26 +0000 (07:50 -0800)]
; Merge from origin/emacs-27

The following commit was skipped:

32c960bdc6 Mention -lcurses problem on AIX

3 years agoMerge from origin/emacs-27
Glenn Morris [Mon, 4 Jan 2021 15:50:25 +0000 (07:50 -0800)]
Merge from origin/emacs-27

2e09efdb68 Revert previous patch which was installed into wrong branch.

3 years ago; Merge from origin/emacs-27
Glenn Morris [Mon, 4 Jan 2021 15:50:25 +0000 (07:50 -0800)]
; Merge from origin/emacs-27

The following commit was skipped:

585997d05a Fix broken build on AIX 7.2

3 years agoMerge from origin/emacs-27
Glenn Morris [Mon, 4 Jan 2021 15:50:25 +0000 (07:50 -0800)]
Merge from origin/emacs-27

a7c2793efe Fix last change

3 years ago; Merge from origin/emacs-27
Glenn Morris [Mon, 4 Jan 2021 15:50:25 +0000 (07:50 -0800)]
; Merge from origin/emacs-27

The following commit was skipped:

ec1e1f80e6 Add a reference between the Strings node and Search/Replace

3 years agoMerge from origin/emacs-27
Glenn Morris [Mon, 4 Jan 2021 15:50:25 +0000 (07:50 -0800)]
Merge from origin/emacs-27

90c782e92e Merge branch 'emacs-27' of git.savannah.gnu.org:/srv/git/e...

3 years ago; Merge from origin/emacs-27
Glenn Morris [Mon, 4 Jan 2021 15:50:25 +0000 (07:50 -0800)]
; Merge from origin/emacs-27

The following commit was skipped:

f0deca159d (emacs-27) ; Auto-commit of loaddefs files.

3 years agoMerge from origin/emacs-27
Glenn Morris [Mon, 4 Jan 2021 15:50:22 +0000 (07:50 -0800)]
Merge from origin/emacs-27

7384ec6416 Add warning comments abound binding keys in Isearch maps

3 years ago; Merge from origin/emacs-27
Glenn Morris [Mon, 4 Jan 2021 15:50:22 +0000 (07:50 -0800)]
; Merge from origin/emacs-27

The following commit was skipped:

3711339f92 Fix crash in ns_mouse_position (bug#45541)

3 years agoFix error in tramp-sh-handle-insert-directory
Michael Albinus [Mon, 4 Jan 2021 15:32:32 +0000 (16:32 +0100)]
Fix error in tramp-sh-handle-insert-directory

* lisp/net/tramp-sh.el (tramp-sh-handle-insert-directory): Let buffer be
unibyte when applying numbers returned with the ls --dired option.
Reported by Justus Piater <Justus-dev@Piater.name>.

* test/lisp/net/tramp-tests.el (tramp--test-check-files): Extend test.

3 years agoUpdate two user option names in the Widget manual
Mauro Aranda [Mon, 4 Jan 2021 12:58:10 +0000 (09:58 -0300)]
Update two user option names in the Widget manual

* doc/misc/widget.texi (Basic Types): The user options
widget-glyph-directory and widget-glyph-enable were renamed long ago
to widget-image-directory and widget-image-enable, but the manual
kept calling them by their old names.  Update the names.

3 years agoFix build for --enable-checking=structs
Basil L. Contovounesios [Mon, 4 Jan 2021 13:09:40 +0000 (13:09 +0000)]
Fix build for --enable-checking=structs

The last change to lisp.h only added comments in Lisp_String, so the
portable dumper need not be changed.

* src/pdumper.c (dump_string): Update hash for Lisp_String.

3 years agoDon't skip widgets when moving backward
Mauro Aranda [Mon, 4 Jan 2021 13:02:20 +0000 (10:02 -0300)]
Don't skip widgets when moving backward

* lisp/wid-edit.el (widget-move): Remove code that caused
widget-backward to skip an immediate previous widget when moving
backward from the start of a widget.  (Bug#45623)

* test/lisp/wid-edit-tests.el (widget-test-widget-backward): New test.

3 years agoFix off-by-one error in mode-line-compact code
Amin Bandali [Mon, 4 Jan 2021 09:48:08 +0000 (10:48 +0100)]
Fix off-by-one error in mode-line-compact code

* src/xdisp.c (display_mode_line): Fix off-by-one error that would
chop off the final non-space character when compacting (bug#45646).

3 years agoFix computation of Lines in nnmaildir
Lars Ingebrigtsen [Mon, 4 Jan 2021 09:42:13 +0000 (10:42 +0100)]
Fix computation of Lines in nnmaildir

* lisp/gnus/nnmaildir.el (nnmaildir--update-nov): Lines is -1 if
it's not present; not 0 (probably) (bug#45650).

3 years ago* src/print.c (print_vectorlike): Use `HASH_TABLE_SIZE`
Stefan Monnier [Mon, 4 Jan 2021 06:00:33 +0000 (01:00 -0500)]
* src/print.c (print_vectorlike): Use `HASH_TABLE_SIZE`

3 years ago* src/xdisp.c (syms_of_xdisp): New var redisplay-skip-fontification-on-input
Stefan Monnier [Mon, 4 Jan 2021 05:59:56 +0000 (00:59 -0500)]
* src/xdisp.c (syms_of_xdisp): New var redisplay-skip-fontification-on-input

(handle_fontified_prop): Use it.

* src/keyboard.h (input_was_pending): Declare.
* src/keyboard.c (input_was_pending): Make non-static.

3 years ago* lisp/erc/erc.el: Use `run-hook-with-args` for `erc-pre-send-functions`
Stefan Monnier [Mon, 4 Jan 2021 05:21:02 +0000 (00:21 -0500)]
* lisp/erc/erc.el: Use `run-hook-with-args` for `erc-pre-send-functions`

(erc-process-input-line): A function can be `listp`.
(erc-send-input): Use `run-hook-with-args` for `erc-pre-send-functions`.
(erc-display-command): Comment out, unused.

3 years ago* lisp/calc/calc-yank.el (calc-edit-mode): Make it into a proper major mode
Stefan Monnier [Mon, 4 Jan 2021 05:01:58 +0000 (00:01 -0500)]
* lisp/calc/calc-yank.el (calc-edit-mode): Make it into a proper major mode

Also make `calc-edit-handler` hold a function instead of an expression.

(calc-original-buffer, calc-return-buffer, calc-one-window)
(calc-edit-handler, calc-restore-trail, calc-allow-ret)
(calc-edit-top): Give them a default value.
(calc--edit-mode): New function extracted from old `calc-edit-mode`.
(calc-edit-return, calc-edit-finish): Don't need to test `boundp` any more.
(calc-edit-finish): Allow `calc-edit-handler` to be a function.

(calc-edit, calc-alg-edit):

* lisp/calc/calc-prog.el (calc-edit-user-syntax, calc-user-define-edit):
* lisp/calc/calc-embed.el (calc-embedded-edit):
* lisp/calc/calc-sel.el (calc-edit-selection):
* lisp/calc/calc-store.el (calc-edit-variable):
Use `calc--edit-mode` and make first arg into a function.

* lisp/calc/calc-ext.el (calc-init-extensions): Autoload `calc--edit-mode`
instead of `calc-edit-mode`.