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.
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.
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`.
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.
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.
Alan Third [Sun, 3 Jan 2021 16:15:18 +0000 (16:15 +0000)]
Fix child frame restacking on NS (bug#41422)
* src/nsfns.m (Fns_frame_restack): Use new restackWindow method.
* src/nsterm.m ([EmacsWindow orderFront:]):
([EmacsWindow makeKeyAndOrderFront:]):
(nswindow_orderedIndex_sort):
([EmacsWindow orderBack:]):
([EmacsWindow restackWindow:above:]): Override superclass methods to
handle child windows the way we want.
Alan Third [Sat, 2 Jan 2021 18:19:39 +0000 (18:19 +0000)]
Fix NS toolbar image release crash (bug#43973)
The toolbar fails to make a proper copy of EmacsImage objects, so
releasing the copy incorrectly released instance variables from the
original objects.
* src/nsimage.m ([EmacsImage copyWithZone:]): New function to enable
correct copying of EmacsImage.
Mauro Aranda [Sat, 2 Jan 2021 14:59:36 +0000 (11:59 -0300)]
Fix Quit button in dictionary buffer
* lisp/net/dictionary.el (dictionay-close): Changing the arity of the
function in cc5f2803785c5dc785f09a292313cf799e8d29bb was a mistake.
Restore it, but mark the argument as unused to avoid a
wrong-number-of-arguments error when using the Quit button.
Avoid printing stacktraces when it probably wouldn't work anyway.
* src/eval.c (signal_or_quit): Don't try to call the debugger if it's
inhibited or we are about to dump or bootstrap. In those cases the
debugger probably wouldn't work anyway.
The test 'process-tests/fd-setsize-no-crash/make-process' used to call
'sleep' to ensure that enough processes are live to trigger a
FD_SETSIZE overflow. However, we can just call 'cat' instead and
close standard input when done. That way, we only wait as long as
needed.
* process-tests.el
(process-tests/fd-setsize-no-crash/make-process): Invoke 'cat' instead
of 'sleep'. Close standard input to exit the 'cat' processes.
The 'process-tty-name' already provides the TTY name, we don't have
interrogate the TTY host.
* test/src/process-tests.el
(process-tests/fd-setsize-no-crash/make-serial-process): Use
'process-tty-name' instead of having the TTY host print its TTY
name. Check whether TTY names are unique.
(process-tests--new-pty, process-tests--with-temp-file): Remove;
no longer used.
Alan Third [Wed, 16 Dec 2020 21:12:04 +0000 (21:12 +0000)]
Improve drawing performance on macOS
* configure.ac: Require IOSurface framework.
* src/nsterm.h: New EmacsSurface class and update EmacsView
definitions.
* src/nsterm.m (ns_update_end):
(ns_unfocus): Use new unfocusDrawingBuffer method.
(ns_draw_window_cursor): Move ns_focus to before we set colors.
([EmacsView dealloc]):
([EmacsView viewDidResize:]): Handle new EmacsSurface class.
([EmacsView initFrameFromEmacs:]): Remove reference to old method.
([EmacsView createDrawingBuffer]): Remove method.
([EmacsView focusOnDrawingBuffer]):
([EmacsView windowDidChangeBackingProperties:]): Use new EmacsSurface
class.
([EmacsView unfocusDrawingBuffer]): New method.
([EmacsView copyRect:to:]): Get information from the context instead
of direct from the IOSurface.
([EmacsView updateLayer]): Use new EmacsSurface class.
([EmacsView copyRect:to:]): Use memcpy to copy bits around instead of
using NS image functions.
([EmacsSurface initWithSize:ColorSpace:]):
([EmacsSurface dealloc]):
([EmacsSurface getSize]):
([EmacsSurface getContext]):
([EmacsSurface releaseContext]):
([EmacsSurface getSurface]):
([EmacsSurface copyContentsTo:]): New class and methods.
Roland Winkler [Fri, 1 Jan 2021 22:35:15 +0000 (16:35 -0600)]
bibtex-mode: Handle biblatex field aliases (bug#44976)
* lisp/textmodes/bibtex.el (bibtex-biblatex-entry-alist): Define
field aliases.
(bibtex-vec-incr): Remove.
(bibtex-format-entry, bibtex-validate): Check for field aliases.
(bibtex--skip-field-aliases): New function.
(bibtex-field-list): Use it.
Paul Eggert [Fri, 1 Jan 2021 20:55:35 +0000 (12:55 -0800)]
Add overflow check for INPUT_EVENT_POS_MIN
* src/keyboard.c (INPUT_EVENT_POS_MIN): Don’t assume (-1 -
INPUT_EVENT_POS_MAX) fits into ptrdiff_t. This fixes a
purely-theoretical problem that cannot occur on two’s-complement
arithmetic. The Solaris 10 compiler still complains incorrectly,
but oh well.
Paul Eggert [Fri, 1 Jan 2021 20:52:55 +0000 (12:52 -0800)]
Port to Solaris 10
* configure.ac: Instead of AC_CHECK_HEADER, use AC_COMPILE_IFELSE
with X11/Intrinsic.h when checking for X11/extensions/Xrender.h.
This suppresses a bogus "report a bug to bug-gnu-emacs" diagnostic
from 'configure' in Solaris 10.
(SETUP_SLAVE_PTY): Adjust to recent renaming of forkin to
std_in in callproc.c. Needed on Solaris and Unixware.
* lib-src/Makefile.in (LIB_GETRANDOM, LIBS_ETAGS): New vars,
needed because on Solaris 10 the Gnulib tempname module now needs
the -lrt library for clock_gettime. Throw in the LIB_GETRANDOM
stuff too while we’re at it; from getrandom.m4 it seems to be
needed for MingW.
(LIBS_MOVE, etags_libs): Use them.
* src/callproc.c [SETUP_SLAVE_PTY]: Include sys/stream.h
and sys/stropts.h, for SETUP_SLAVE_PTY’s definiens.
* src/process.c [NEED_BSDTTY]: Don’t include bsdtty.h; hasn’t been
needed in years.
[USG5_4]: Don’t include sys/stream.h or sys/stropts.h; these
directives havbe been moved to callproc.c because the only use of
SETUP_SLAVE_PTY is there now.
Paul Eggert [Fri, 1 Jan 2021 16:45:41 +0000 (08:45 -0800)]
New file scratch_buffer_dupfree.c
* lib/malloc/scratch_buffer_dupfree.c: New file, from Gnulib
(originally from glibc 2.33 code).
This is needed on macOS and some other platforms;
I forgot to commit it in the most recent Gnulib update.
Paul Eggert [Fri, 1 Jan 2021 09:14:58 +0000 (01:14 -0800)]
Merge from origin/emacs-27
74a77ef299 Improve documentation of 'network-lookup-address-info' c6d5555646 Display messages sent using ERC's /say c156723769 Fix Rmail summary display when From: header is malformed
Eli Zaretskii [Thu, 31 Dec 2020 20:27:30 +0000 (22:27 +0200)]
Improve documentation of 'network-lookup-address-info'
* src/process.c (Fnetwork_lookup_address_info):
* doc/lispref/processes.texi (Misc Network): Document the error
message emitted by 'network-lookup-address-info' when it fails.
Dmitry Gutov [Thu, 31 Dec 2020 16:39:22 +0000 (18:39 +0200)]
ruby-mode: Recognize setter symbols
* lisp/progmodes/ruby-mode.el (ruby-syntax-propertize):
Add a rule for setter symbols (bug#42846).
(ruby-font-lock-keywords): Remove dead code, left over from before
commit 26f9c507.
* lisp/progmodes/ruby-mode.el (ruby-smie--bosp):
Handle '=' being part of a symbol (bug#42846).