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