]> git.eshelyaron.com Git - emacs.git/log
emacs.git
4 years agoFix bug#45603
Andrea Corallo [Wed, 6 Jan 2021 14:26:38 +0000 (15:26 +0100)]
Fix bug#45603

Reported and reduced by Mauricio Collares.

* lisp/emacs-lisp/comp.el (comp-final): Fix coding system for the
tmp file used to pass data the child processes.
* test/src/comp-tests.el (45603-1): New testcase
* test/src/comp-test-45603.el : New File.

4 years ago* test/src/comp-tests.el (cond-rw-1, not-cons, 45576): Rename three tests.
Andrea Corallo [Mon, 4 Jan 2021 21:16:07 +0000 (22:16 +0100)]
* test/src/comp-tests.el (cond-rw-1, not-cons, 45576): Rename three tests.

4 years ago* Fix a type specifier test
Andrea Corallo [Mon, 4 Jan 2021 21:14:50 +0000 (22:14 +0100)]
* Fix a type specifier test

* test/lisp/emacs-lisp/comp-cstr-tests.el
(comp-cstr-typespec-tests-alist): Fix a testcase.

4 years agoFix type inference for bug#45635
Andrea Corallo [Mon, 4 Jan 2021 21:04:29 +0000 (22:04 +0100)]
Fix type inference for bug#45635

* lisp/emacs-lisp/comp-cstr.el (comp-cstr-union-1-no-mem): Fix
missing mixed pos neg handling.
* test/lisp/emacs-lisp/comp-cstr-tests.el
(comp-cstr-typespec-tests-alist): Add a test.
* test/src/comp-tests.el (45635): New testcase.
* test/src/comp-test-funcs.el (comp-test-45635-f): New function.

4 years ago* lisp/emacs-lisp/comp.el (comp-known-predicates): Some more tweaking.
Andrea Corallo [Sat, 2 Jan 2021 12:22:30 +0000 (13:22 +0100)]
* lisp/emacs-lisp/comp.el (comp-known-predicates): Some more tweaking.

4 years agoFix `functionp' contraining (bug#45576)
Andrea Corallo [Sat, 2 Jan 2021 11:18:39 +0000 (12:18 +0100)]
Fix `functionp' contraining (bug#45576)

* lisp/emacs-lisp/comp.el (comp-known-predicates)
(comp-known-predicates-h): New constants.
(comp-known-predicate-p, comp-pred-to-cstr): New functions.
* lisp/emacs-lisp/cl-macs.el (cl-deftype-satisfies): Don't define.
* test/src/comp-tests.el (comp-test-45576): New testcase.
* test/src/comp-test-funcs.el (comp-test-45576-f): New function.

4 years ago* Rename `dom' slot into `idom' in `comp-block' struct
Andrea Corallo [Sat, 2 Jan 2021 10:30:10 +0000 (11:30 +0100)]
* Rename `dom' slot into  `idom' in `comp-block' struct

* lisp/emacs-lisp/comp.el (comp-block): Rename dom `slot' into
`idom'.
(comp-clean-ssa, comp-compute-dominator-tree)
(comp-compute-dominator-frontiers, comp-dom-tree-walker)
(comp-remove-unreachable-blocks): Update accordingly.

4 years agoMerge remote-tracking branch 'savannah/master' into HEAD
Andrea Corallo [Sat, 2 Jan 2021 09:11:15 +0000 (10:11 +0100)]
Merge remote-tracking branch 'savannah/master' into HEAD

4 years agoruby-smie-rules: Avoid one case of infinite recursion
Dmitry Gutov [Sat, 2 Jan 2021 02:18:59 +0000 (04:18 +0200)]
ruby-smie-rules: Avoid one case of infinite recursion

* lisp/progmodes/ruby-mode.el (ruby-smie-rules):
Avoid one case of infinite recursion (bug#29107).

4 years agoFix GNUstep warnings
Alan Third [Sat, 19 Dec 2020 20:46:55 +0000 (20:46 +0000)]
Fix GNUstep warnings

* src/nsterm.h: EmacsSurface is only required if NS_DRAW_TO_BUFFER is
defined.
* src/nsterm.m (ns_judge_scroll_bars): Remove unused variable.
* src/nsmenu.m (update_frame_tool_bar):
(ns_update_menubar): Remove unused variables.

4 years agoImprove drawing performance on macOS
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.

4 years agobibtex-mode: Handle biblatex field aliases (bug#44976)
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.

4 years agoFix CCL_MOD typo
Paul Eggert [Fri, 1 Jan 2021 20:57:26 +0000 (12:57 -0800)]
Fix CCL_MOD typo

* src/ccl.c (ccl_driver): Fix typo that disabled the
checks for undefined behavior with integer remainder.
Problem caught by Oracle Studio 12.6.

4 years agoAdd overflow check for INPUT_EVENT_POS_MIN
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.

4 years agoPort to Solaris 10
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.

4 years agoNew file scratch_buffer_dupfree.c
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.

4 years ago; Auto-commit of loaddefs files.
Glenn Morris [Fri, 1 Jan 2021 14:30:23 +0000 (06:30 -0800)]
; Auto-commit of loaddefs files.

4 years agoAdd `throw' to non returning functions
Andrea Corallo [Fri, 1 Jan 2021 13:13:02 +0000 (14:13 +0100)]
Add `throw' to non returning functions

* lisp/emacs-lisp/comp.el (comp-known-type-specifiers): Add throw.

4 years agoxref-show-definitions-completing-read: Default to the first location
Dmitry Gutov [Fri, 1 Jan 2021 13:18:41 +0000 (15:18 +0200)]
xref-show-definitions-completing-read: Default to the first location

* lisp/progmodes/xref.el (xref-show-definitions-completing-read):
Default to the first location.

4 years ago; * lisp/emacs-lisp/comp.el (comp-compute-dominator-tree): Reindent.
Andrea Corallo [Fri, 1 Jan 2021 12:53:08 +0000 (13:53 +0100)]
; * lisp/emacs-lisp/comp.el (comp-compute-dominator-tree): Reindent.

4 years ago* lisp/emacs-lisp/comp.el (comp-compute-dominator-tree): Fix.
Andrea Corallo [Fri, 1 Jan 2021 11:00:04 +0000 (12:00 +0100)]
* lisp/emacs-lisp/comp.el (comp-compute-dominator-tree): Fix.

4 years ago* Clean unreachable block using dominance tree to handle circularities
Andrea Corallo [Fri, 1 Jan 2021 10:09:00 +0000 (11:09 +0100)]
* Clean unreachable block using dominance tree to handle circularities

With this commit unreachable basic blocks are pruned automatically by
comp-ssa relying on dominance analysis.  This solves the issue of
unreachable cluster of basic blocks referencing each other.

* lisp/emacs-lisp/comp.el (comp-block-lap): New `no-ret' slot.
(comp-compute-dominator-tree): Update.
(comp-remove-unreachable-blocks): New functions.
(comp-ssa): Update to call `comp-remove-unreachable-blocks'.
(comp-clean-orphan-blocks): Delete.
(comp-rewrite-non-locals): Update and simplify.

4 years ago* src/comp.c (Fcomp__compile_ctxt_to_file): Fix hash table iteration.
Andrea Corallo [Fri, 1 Jan 2021 11:27:39 +0000 (12:27 +0100)]
* src/comp.c (Fcomp__compile_ctxt_to_file): Fix hash table iteration.

4 years agoIntroduce 'unreachable' LIMPLE operator
Andrea Corallo [Thu, 31 Dec 2020 16:37:13 +0000 (17:37 +0100)]
Introduce 'unreachable' LIMPLE operator

Introduce 'unreachable' as LIMPLE operater so we can handle correctly
in the CFG functions throwing values or signaling errors.

* src/comp.c (retrive_block): Better error diagnostic.
(emit_limple_insn): Add `unreachable'.
(compile_function): Fix block iteration.
(syms_of_comp): Define 'Qunreachable'.
* lisp/emacs-lisp/comp.el (comp-block): New variable.
(comp-block-lap): Add `non-ret-insn' slot.
(comp-branch-op-p): New predicate.
(comp-limple-lock-keywords): Color `unreachable' as red.
(comp-compute-edges): Add `unreachable'.
(comp-fwprop-call): Store non returning function call.
(comp-fwprop*): Update.
(comp-clean-orphan-blocks, comp-rewrite-non-locals): New functions.
(comp-fwprop): Call `comp-rewrite-non-locals'.
* test/src/comp-tests.el (comp-tests-type-spec-tests): Add two
tests.
* test/src/comp-test-funcs.el (comp-test-non-local-1)
(comp-test-non-local-2, comp-test-non-local-3)
(comp-test-non-local-4): New functions.

4 years ago; ruby-smie--bosp: Fix the breakage
Dmitry Gutov [Fri, 1 Jan 2021 12:35:57 +0000 (14:35 +0200)]
; ruby-smie--bosp: Fix the breakage

4 years agoFix a compilation warning.
Philipp Stephani [Fri, 1 Jan 2021 11:39:14 +0000 (12:39 +0100)]
Fix a compilation warning.

ruby-mode uses 'cl-evenp' at runtime, so cl-lib must be available at
runtime as well.

* lisp/progmodes/ruby-mode.el (cl-lib): Require at runtime as well.

4 years ago* Fix two predicates for missing negation handling
Andrea Corallo [Thu, 31 Dec 2020 14:32:51 +0000 (15:32 +0100)]
* Fix two predicates for missing negation handling

* lisp/emacs-lisp/comp-cstr.el (comp-cstr-empty-p)
(comp-cstr-null-p): Fix missing negation handling.

4 years ago* lisp/emacs-lisp/comp.el (comp-limple-lock-keywords): Color returns as red.
Andrea Corallo [Thu, 31 Dec 2020 14:27:24 +0000 (15:27 +0100)]
* lisp/emacs-lisp/comp.el (comp-limple-lock-keywords): Color returns as red.

4 years ago* Add `comp-insert-insn'
Andrea Corallo [Thu, 31 Dec 2020 10:27:53 +0000 (11:27 +0100)]
* Add `comp-insert-insn'

* lisp/emacs-lisp/comp.el (comp-insert-insn): New inline.
(comp-emit-call-cstr): Split logic and call `comp-insert-insn'.

4 years agoRemove stray copy of image-tests.el
Paul Eggert [Fri, 1 Jan 2021 10:03:46 +0000 (02:03 -0800)]
Remove stray copy of image-tests.el

* test/manual/image-circular-tests.el: Remove a stray copy of
image-tests.el that was appended to this file.  Found by its
duplicate copyright notice.

4 years agoUpdate from Gnulib by running admin/merge-gnulib.
Paul Eggert [Fri, 1 Jan 2021 09:51:18 +0000 (01:51 -0800)]
Update from Gnulib by running admin/merge-gnulib.

4 years agoMerge from origin/emacs-27
Paul Eggert [Fri, 1 Jan 2021 09:28:16 +0000 (01:28 -0800)]
Merge from origin/emacs-27

33d159c36f Fix copyright years by hand

4 years ago; Merge from origin/emacs-27
Paul Eggert [Fri, 1 Jan 2021 09:14:59 +0000 (01:14 -0800)]
; Merge from origin/emacs-27

The following commit was skipped:

8c1fe1e5ef Update copyright year to 2021

4 years agoMerge from origin/emacs-27
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

4 years agoUpdate copyright year to 2021
Paul Eggert [Fri, 1 Jan 2021 09:13:56 +0000 (01:13 -0800)]
Update copyright year to 2021

Run "TZ=UTC0 admin/update-copyright".

4 years agoFix some mistaken shell delinting
Paul Eggert [Fri, 1 Jan 2021 09:12:04 +0000 (01:12 -0800)]
Fix some mistaken shell delinting

* admin/merge-gnulib, admin/update-copyright, make-dist:
Revert recent mistaken changes that were put in merely to
pacify a shellcheck linter.

4 years agoFix copyright years by hand
Paul Eggert [Fri, 1 Jan 2021 08:33:28 +0000 (00:33 -0800)]
Fix copyright years by hand

These are dates that admin/update-copyright did not update.

4 years agoUpdate copyright year to 2021
Paul Eggert [Fri, 1 Jan 2021 07:48:14 +0000 (07:48 +0000)]
Update copyright year to 2021

Run "TZ=UTC0 admin/update-copyright $(git ls-files)".

4 years agoRevert recent add-to-ordered-list changes
Lars Ingebrigtsen [Fri, 1 Jan 2021 04:48:02 +0000 (05:48 +0100)]
Revert recent add-to-ordered-list changes

* doc/lispref/lists.texi (List Variables): Revert.

* lisp/subr.el (add-to-ordered-list): Revert recent changes
because the semantics are too muddled.

4 years agoCC Mode: increment version numbers to 5.35 due to standalone release
Alan Mackenzie [Thu, 31 Dec 2020 20:32:14 +0000 (20:32 +0000)]
CC Mode: increment version numbers to 5.35 due to standalone release

* doc/misc/cc-mode.texi.  Increment the mode to 5.35, twice.

* lisp/progmodes/cc-defs.el.  Increment the mode to "5.35.1".

4 years agoImprove documentation of 'network-lookup-address-info'
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.

4 years agoruby-mode: Optimize expression expansion too
Dmitry Gutov [Thu, 31 Dec 2020 18:59:00 +0000 (20:59 +0200)]
ruby-mode: Optimize expression expansion too

This speeds up syntax-propertize almost 2x.

* lisp/progmodes/ruby-mode.el (ruby-syntax-propertize):
Optimize expression expansion too.
(ruby-syntax-propertize-expansion, ruby-font-lock-keywords)
(ruby-expression-expansion-re): Update to match.

4 years agoruby-syntax-propertize: Optimize two rules a little
Dmitry Gutov [Thu, 31 Dec 2020 17:50:48 +0000 (19:50 +0200)]
ruby-syntax-propertize: Optimize two rules a little

* lisp/progmodes/ruby-mode.el (ruby-syntax-propertize):
Optimize two rules a little.

4 years agoruby-mode: Recognize setter symbols
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).

* test/lisp/progmodes/ruby-mode-resources/ruby.rb:
Add corresponding indentation examples.

4 years agoFix type declaration of two Flymake customization variables
João Távora [Thu, 31 Dec 2020 16:04:32 +0000 (16:04 +0000)]
Fix type declaration of two Flymake customization variables

* lisp/progmodes/flymake.el (flymake-mode-line-format)
(flymake-mode-line-counter-format): Fix type declaration.

4 years agoFix process-tests on MS-Windows
Eli Zaretskii [Thu, 31 Dec 2020 14:50:19 +0000 (16:50 +0200)]
Fix process-tests on MS-Windows

* test/src/process-tests.el (process-tests--fd-setsize-test): On
MS-Windows start the pipe processes in the "stopped" condition.

4 years agoMust explicitly create unpropertized strings in mode-line
João Távora [Thu, 31 Dec 2020 13:40:09 +0000 (13:40 +0000)]
Must explicitly create unpropertized strings in mode-line

Otherwise, an innocent string like " " will mysteriously
pickup properties from some other minor mode.

Making this a separate commit in hopes of raising attention to this
possible bug.

* lisp/progmodes/flymake.el (flymake--mode-line-counter): Must
explicily create a new string unpropertized string

4 years agoMake Flymake mode-line indicator customizable (bug#33740)
João Távora [Thu, 31 Dec 2020 13:14:26 +0000 (13:14 +0000)]
Make Flymake mode-line indicator customizable (bug#33740)

* lisp/progmodes/flymake.el (flymake-mode): Use
flymake-mode-line-format.
(flymake--mode-line-format): Remove.
(flymake-mode-line-counter-format, flymake-mode-line-format): New
defcustom.
(flymake-mode-line-title, flymake-mode-line-exception)
(flymake-mode-line-counters, flymake-error-counter)
(flymake-warning-counter, flymake-note-counter): New variables.
(flymake--mode-line-title, flymake--mode-line-exception)
(flymake--mode-line-counters, flymake--mode-line-counter): New
helpers.

* doc/misc/flymake.texi (Customizable variables): Mention
flymake-mode-line-format and flymake-mode-line-counter-format

* etc/NEWS: Mention Flymake's customizable mode-line.

4 years agoProtect elisp-flymake-checkdoc against boundless diagnostics
João Távora [Thu, 31 Dec 2020 13:24:32 +0000 (13:24 +0000)]
Protect elisp-flymake-checkdoc against boundless diagnostics

These would be the kind of "This file needs a ;;Code section" and
such.

* lisp/progmodes/elisp-mode.el (elisp-flymake-checkdoc): Resist
checkdoc diagnostics with no end position.

4 years ago* test/src/process-tests.el: Let timeouts fail the tests. Fix some docstrings
Michael Albinus [Thu, 31 Dec 2020 14:00:41 +0000 (15:00 +0100)]
* test/src/process-tests.el: Let timeouts fail the tests.  Fix some docstrings

4 years agoCC Mode. Fix AWK Mode fontification bug, remove some unused variables
Alan Mackenzie [Thu, 31 Dec 2020 12:14:54 +0000 (12:14 +0000)]
CC Mode.  Fix AWK Mode fontification bug, remove some unused variables

* lisp/progmodes/cc-awk.el (awk-font-lock-keywords): Replace a hard use of
c-preprocessor-face-name by an `eval' expression which evaluates it.

* lisp/progmodes/cc-engine.el (c-in-knr-argdecl, c-laomib-put-cache)
(c-laomib-fix-elt): Remove unused bound variables.

4 years agoUnbreak process tests if 'errno' is not installed.
Philipp Stephani [Thu, 31 Dec 2020 12:17:11 +0000 (13:17 +0100)]
Unbreak process tests if 'errno' is not installed.

* test/src/process-tests.el (process-tests--EMFILE-message): Don't
signal an error if the 'errno' binary is unavailable.

4 years agoFix some shellcheck linter warnings
Stefan Kangas [Thu, 31 Dec 2020 11:11:31 +0000 (12:11 +0100)]
Fix some shellcheck linter warnings

* admin/diff-tar-files:
* admin/merge-gnulib:
* admin/merge-pkg-config:
* admin/update-copyright:
* build-aux/git-hooks/prepare-commit-msg:
* make-dist: Fix some shellcheck linter warnings.

4 years agoMinor cleanup in doc.c
Stefan Kangas [Wed, 30 Dec 2020 19:52:43 +0000 (20:52 +0100)]
Minor cleanup in doc.c

* src/doc.c (get_doc_string, Fdocumentation)
(Fdocumentation_property, store_function_docstring):
Minor cleanup.

4 years agoAdd lexical-binding cookie to autoload files
Stefan Kangas [Thu, 31 Dec 2020 05:35:49 +0000 (06:35 +0100)]
Add lexical-binding cookie to autoload files

* build-aux/update-subdirs:
* lisp/emacs-lisp/autoload.el (autoload-rubric): Add lexical-binding
cookie to generated files (bug#44854).

4 years agoFix duplicated entry in gnus-mime-action-alist
Daniel Martín [Thu, 31 Dec 2020 05:00:24 +0000 (06:00 +0100)]
Fix duplicated entry in gnus-mime-action-alist

* lisp/gnus/gnus-art.el (gnus-mime-action-alist): Remove duplicated
"toggle display" entry and call the appropriate function for the "view
as charset" action (bug#45561).

4 years agoAllow add-to-ordered-list to use a test predicate
Lars Ingebrigtsen [Thu, 31 Dec 2020 04:28:47 +0000 (05:28 +0100)]
Allow add-to-ordered-list to use a test predicate

* doc/lispref/lists.texi (List Variables): Update manual.

* lisp/subr.el (add-to-ordered-list): Allow using a test
predicate, and make slightly more efficient (bug#45539).

4 years agoAdd test for add-to-ordered-list
Lars Ingebrigtsen [Thu, 31 Dec 2020 04:00:45 +0000 (05:00 +0100)]
Add test for add-to-ordered-list

4 years agoAdd some tests to find-func.el
Daniel Martín [Thu, 31 Dec 2020 03:31:22 +0000 (04:31 +0100)]
Add some tests to find-func.el

4 years agoMinor improvements to FD_SETSIZE overflow checks.
Philipp Stephani [Wed, 30 Dec 2020 21:36:07 +0000 (22:36 +0100)]
Minor improvements to FD_SETSIZE overflow checks.

* src/process.c (Fmake_serial_process): Add port to error data.
(connect_network_socket): Add an explanatory comment.

4 years agoManually limit file descriptors that we select on to FD_SETSIZE.
Philipp Stephani [Wed, 30 Dec 2020 22:43:07 +0000 (23:43 +0100)]
Manually limit file descriptors that we select on to FD_SETSIZE.

This works even if another thread or process resets the resource limit
for open file descriptors, e.g., using 'prlimit' on GNU/Linux.

* src/process.c (create_process, create_pty, Fmake_pipe_process)
(Fmake_serial_process, connect_network_socket)
(server_accept_connection): Limit file descriptors to FD_SETSIZE.
* test/src/process-tests.el (process-tests--with-raised-rlimit): New
helper macro.
(process-tests--fd-setsize-test): Rename from
'process-tests--with-many-pipes'.  Increase resource limit during test
if possible.
(process-tests/fd-setsize-no-crash/make-process)
(process-tests/fd-setsize-no-crash/make-pipe-process)
(process-tests/fd-setsize-no-crash/make-network-process)
(process-tests--new-pty): Rename callers.

4 years agoFix a potential unit test breakage on GNU/Linux.
Philipp Stephani [Wed, 30 Dec 2020 23:05:14 +0000 (00:05 +0100)]
Fix a potential unit test breakage on GNU/Linux.

* test/src/process-tests.el
(process-tests/fd-setsize-no-crash/make-process): Allow special exit
codes that can happen if terminal setup fails in the child process.

4 years agoFix an incorrect Edebug specification.
Philipp Stephani [Wed, 30 Dec 2020 22:13:19 +0000 (23:13 +0100)]
Fix an incorrect Edebug specification.

* test/src/process-tests.el (process-tests--with-many-pipes): Fix
incorrect Edebug specification.

4 years agoConsistently check for FD_SETSIZE overflow.
Philipp Stephani [Wed, 30 Dec 2020 21:33:22 +0000 (22:33 +0100)]
Consistently check for FD_SETSIZE overflow.

Previously this was only checked in a few places.  Now assert that
file descriptors are within the expected range whenever we'd otherwise
introduce undefined behavior.

* src/process.c (add_read_fd, add_process_read_fd, delete_read_fd)
(recompute_max_desc, delete_write_fd, compute_input_wait_mask)
(compute_non_process_wait_mask, compute_non_keyboard_wait_mask)
(compute_write_mask, clear_waiting_thread_info)
(update_processes_for_thread_death, Fset_process_thread)
(create_process, create_pty, Fmake_pipe_process)
(Fprocess_datagram_address, Fset_process_datagram_address)
(Fmake_serial_process, finish_after_tls_connection)
(connect_network_socket, deactivate_process)
(server_accept_connection, wait_reading_process_output)
(read_process_output, read_and_dispose_of_process_output)
(send_process, Fcontinue_process, Fprocess_send_eof)
(Fprocess_filter_multibyte_p, keyboard_bit_set)
(add_timer_wait_descriptor, setup_process_coding_systems): Add
assertions to document and check that file descriptors are within the
expected range when used as file descriptor set elements or array
subscripts.

4 years agoExtend and overhaul FD_SETSIZE overflow tests.
Philipp Stephani [Wed, 30 Dec 2020 21:28:06 +0000 (22:28 +0100)]
Extend and overhaul FD_SETSIZE overflow tests.

Instead of trying to generate the right number of processes,
pre-create lots of unused pipe processes until creation fails.  Extend
the tests to the 'pty' connection type and other kinds of process
objects.

* test/src/process-tests.el (process-tests--ignore-EMFILE)
(process-tests--with-buffers, process-tests--with-processes)
(process-tests--with-many-pipes, process-tests--with-temp-file)
(process-tests--with-temp-directory): New helper macros.
(process-tests/fd-setsize-no-crash/make-process): Renamed from
'process-tests/fd-setsize-no-crash'.  Fail on timeout.  Also test the
'pty' connection type.  Pre-create lots of pipe processes so we reach
the FD_SETSIZE limit faster.  Ignore EMFILE more precisely, if
possible.
(process-tests/fd-setsize-no-crash/make-pipe-process)
(process-tests/fd-setsize-no-crash/make-network-process)
(process-tests/fd-setsize-no-crash/make-serial-process): New tests
that test FD_SETSIZE limits for other kinds of processes.
(process-tests--EMFILE-message): New helper function and cache
variable.
(process-tests--new-pty): New helper function.

4 years ago* src/nsterm.m (ns_select): Fix off-by-one error, and add assertion
Philipp Stephani [Wed, 30 Dec 2020 21:17:52 +0000 (22:17 +0100)]
* src/nsterm.m (ns_select): Fix off-by-one error, and add assertion

4 years ago; * test/src/process-tests.el: Fix comment style.
Philipp Stephani [Wed, 30 Dec 2020 21:16:26 +0000 (22:16 +0100)]
; * test/src/process-tests.el: Fix comment style.

4 years agoCC Mode: correct the handling of empty strings
Alan Mackenzie [Wed, 30 Dec 2020 18:31:56 +0000 (18:31 +0000)]
CC Mode: correct the handling of empty strings

In particular, have the macro cache invalidated after its last use in
c-before-change.

* lisp/progmodes/cc-langs.el (c-get-state-before-change-functions): Remove
c-invalidate-macro-cache from the entries it's in, moving it to....

* lisp/progmodes/cc-mode.el (c-before-change): Call c-invalidate-macro-cache
directly from the functions, after the call to c-invalidate-state-cache.

4 years agoFix Help menu on macOS
Alan Third [Wed, 30 Dec 2020 15:39:26 +0000 (15:39 +0000)]
Fix Help menu on macOS

* src/nsmenu.m (ns_update_menubar): Make sure to reset the help menu
when we move it to another submenu.

4 years ago* Order function types in aphabetical order
Andrea Corallo [Wed, 30 Dec 2020 12:50:23 +0000 (13:50 +0100)]
* Order function types in aphabetical order

* lisp/emacs-lisp/comp.el (comp-known-type-specifiers): Reorder in
aphabetical order and comment.

4 years ago* Add more function type specifiers
Andrea Corallo [Tue, 29 Dec 2020 18:41:28 +0000 (19:41 +0100)]
* Add more function type specifiers

* lisp/emacs-lisp/comp.el (comp-known-type-specifiers): Add more
type specifiers.

4 years agoUse standard key symbols in NS menu entries
Mattias Engdegård [Wed, 30 Dec 2020 12:06:47 +0000 (13:06 +0100)]
Use standard key symbols in NS menu entries

* src/nsmenu.m (skipspc): Remove.
(key_symbols, prettify_key): New.
([EmacsMenu fillWithWidgetValue:]): Call prettify_key.

4 years ago; * src/nsmenu.m: Undo unintentional change
Mattias Engdegård [Wed, 30 Dec 2020 12:04:26 +0000 (13:04 +0100)]
; * src/nsmenu.m: Undo unintentional change

4 years agoRemove redundant 'function's around lambda in align.el
Stefan Kangas [Wed, 30 Dec 2020 12:06:27 +0000 (13:06 +0100)]
Remove redundant 'function's around lambda in align.el

* lisp/align.el (align-rules-list, align-exclude-rules-list)
(align-vhdl-rules-list, align-highlight-rule): Remove redundant
'function's around lambda.

4 years agoAdd 'project-relative' as value for 'xref-file-name-display'
Dmitry Gutov [Wed, 30 Dec 2020 11:48:45 +0000 (13:48 +0200)]
Add 'project-relative' as value for 'xref-file-name-display'

* lisp/progmodes/xref.el (xref-file-name-display): Document new value.
(xref-location-group ((l xref-file-location))): Handle the new value.
(xref--project-root): Extract from the default method of
'xref-backend-references' so it can be used in above's new code.
Also fix an old bug in the "backward compat" branch.

* lisp/progmodes/xref.el (xref--project-root-memo): New variable.

* test/lisp/progmodes/xref-tests.el: Add test cases for the three
possible settings of 'xref-file-name-display'.

Co-authored-by: Tobias Rittweiler <trittweiler@gmail.com>
4 years agoFix some over-wide docstrings
Stefan Kangas [Wed, 30 Dec 2020 11:38:20 +0000 (12:38 +0100)]
Fix some over-wide docstrings

* lisp/cedet/semantic/analyze/refs.el
(semantic-analyze-refs-proto)
(semantic-analyze-refs-impl):
* lisp/cedet/semantic/symref.el
(semantic-symref-hit-to-tag-via-buffer):
* lisp/emacs-lisp/chart.el (chart-axis-draw):
* lisp/emacs-lisp/cl-macs.el (cl-defstruct, cl-loop):
* lisp/emacs-lisp/eieio-core.el (eieio--add-new-slot):
* lisp/eshell/em-unix.el (eshell/info):
* lisp/gnus/deuglify.el (gnus-outlook-rearrange-article):
* lisp/gnus/gnus-agent.el (gnus-agent-read-article-number):
* lisp/gnus/gnus-util.el (gnus-put-overlay-excluding-newlines)
(gnus-put-text-property-excluding-newlines):
* lisp/gnus/message.el (message-sort-headers):
* lisp/gnus/nntp.el (nntp-with-open-group)
(nntp-with-open-group-function):
* lisp/gnus/nnvirtual.el (nnvirtual-create-mapping):
* lisp/mail/feedmail.el (feedmail-fiddle-list-of-fiddle-plexes)
(feedmail-queue-reminder, feedmail-mail-send-hook-splitter):
* lisp/net/dictionary.el (dictionary-do-matching):
* lisp/obsolete/longlines.el (longlines-auto-wrap):
* lisp/org/ob-sql.el (org-babel-sql-dbstring-vertica):
* lisp/org/ol-bbdb.el (org-bbdb-date-list):
* lisp/progmodes/cc-cmds.el (c-mark-function):
* lisp/progmodes/cperl-mode.el (cperl-add-tags-recurse)
(cperl-add-tags-recurse-noxs-fullpath)
(cperl-add-tags-recurse-noxs):
* lisp/progmodes/etags.el (tags-search):
* lisp/progmodes/verilog-mode.el (verilog-delete-auto-buffer)
(verilog-auto-re-search-do, verilog-expand-vector-internal):
* lisp/textmodes/reftex-parse.el (reftex-init-section-numbers):
* lisp/textmodes/reftex-toc.el
(reftex-toc-load-all-files-for-promotion):
* lisp/textmodes/sgml-mode.el (html-mode):
* lisp/textmodes/table.el (table--transcoord-cache-to-table)
(table--transcoord-table-to-cache, table--remove-eol-spaces)
(table--region-in-cell-p, table-goto-bottom-right-corner)
(table-split-cell-horizontally):
* lisp/url/url-handlers.el (url-insert):
* lisp/vc/ediff-util.el (ediff-inferior-compare-regions): Fix doc
strings to not exceed 80-column limits.  (Bug#44858)

4 years agoPlug NS memory leaks (bug#45502)
Mattias Engdegård [Wed, 30 Dec 2020 10:33:42 +0000 (11:33 +0100)]
Plug NS memory leaks (bug#45502)

* src/nsmenu.m ([EmacsMenu addItemWithWidgetValue:attributes:]):
Mark allocated and owned objects for autorelease.

4 years agoAdd variables read-char-choice-use-read-key and y-or-n-p-use-read-key
Juri Linkov [Wed, 30 Dec 2020 09:54:01 +0000 (11:54 +0200)]
Add variables read-char-choice-use-read-key and y-or-n-p-use-read-key

* lisp/subr.el (read-char-choice-use-read-key): New variable.
(read-char-choice): Use read-char-from-minibuffer when
read-char-choice-use-read-key is nil.
(y-or-n-p-use-read-key): New variable.
(y-or-n-p): Restore old code that calls read-key to use it when
y-or-n-p-use-read-key is non-nil.

* lisp/dired-aux.el (dired--no-subst-ask, dired-query):
* lisp/files.el (files--ask-user-about-large-file)
(hack-local-variables-confirm):
* lisp/userlock.el (ask-user-about-supersession-threat):
* lisp/wid-edit.el (widget-choose): Revert to use read-char-choice
instead of read-char-from-minibuffer.

https://lists.gnu.org/archive/html/emacs-devel/2020-12/msg01919.html

4 years ago* src/dbusbind.c (XD_BASIC_DBUS_TYPE): Fix error in declaration.
Michael Albinus [Wed, 30 Dec 2020 09:49:48 +0000 (10:49 +0100)]
* src/dbusbind.c (XD_BASIC_DBUS_TYPE): Fix error in declaration.

4 years agoIn Isearch bind 'C-s M-y' to isearch-yank-pop-only with old code (bug#45483)
Juri Linkov [Wed, 30 Dec 2020 09:30:57 +0000 (11:30 +0200)]
In Isearch bind 'C-s M-y' to isearch-yank-pop-only with old code (bug#45483)

* lisp/isearch.el (isearch-menu-bar-yank-map, isearch-mode-map):
(isearch-forward): Use isearch-yank-pop-only instead of isearch-yank-pop.
(isearch-yank-pop): Mention isearch-yank-pop-only.
(isearch-yank-pop-only): New command with old body from Emacs 27.

4 years ago; * etc/NEWS: Move entry to correct heading.
Stefan Kangas [Wed, 30 Dec 2020 09:06:07 +0000 (10:06 +0100)]
; * etc/NEWS: Move entry to correct heading.

4 years agoMinor cleanup in keymap.c
Stefan Kangas [Wed, 30 Dec 2020 08:43:38 +0000 (09:43 +0100)]
Minor cleanup in keymap.c

* src/keymap.c (get_keymap, keymap_parent, Fset_keymap_parent)
(store_in_keymap, Fdefine_key, Flookup_key, define_as_prefix)
(silly_event_symbol_error, current_minor_maps)
(Fcurrent_active_maps, Fkey_binding, Flocal_key_binding)
(Fminor_mode_key_binding, Fdefine_prefix_command)
(Faccessible_keymaps, Fdescribe_buffer_bindings)
(describe_vector, Fwhere_is_internal): Minor cleanup.

4 years agoAlso count symbol plists in memory-report
Lars Ingebrigtsen [Wed, 30 Dec 2020 07:29:06 +0000 (08:29 +0100)]
Also count symbol plists in memory-report

* lisp/emacs-lisp/memory-report.el (memory-report--symbol-plist):
New function.
(memory-report): Use it.

4 years agoRevert "Switch add-to-ordered-list to eql"
Lars Ingebrigtsen [Wed, 30 Dec 2020 07:07:27 +0000 (08:07 +0100)]
Revert "Switch add-to-ordered-list to eql"

This reverts commit b4fd857ead728a06380250c5336c1ab94a7c2f7a.

I misunderstood the purposed of the function.

4 years ago; Fix my previous commit
Stefan Kangas [Wed, 30 Dec 2020 07:36:04 +0000 (08:36 +0100)]
; Fix my previous commit

* test/src/chartab-tests.el (chartab-test-char-table-extra-slot): Fix
test.

4 years agoAdd some char-table tests
Stefan Kangas [Wed, 30 Dec 2020 07:29:38 +0000 (08:29 +0100)]
Add some char-table tests

* test/src/chartab-tests.el (chartab-test-char-table-p)
(chartab-test-char-table-subtype)
(chartab-test-char-table-parent)
(chartab-test-char-table-extra-slot): New tests.

4 years agoSwitch add-to-ordered-list to eql
Lars Ingebrigtsen [Wed, 30 Dec 2020 03:48:13 +0000 (04:48 +0100)]
Switch add-to-ordered-list to eql

* doc/lispref/lists.texi (List Variables): Update documentation.

* lisp/subr.el (add-to-ordered-list): Switch to eql (bug#45539).

4 years agoImprove the `long' computation of `mode-line-compact'
Lars Ingebrigtsen [Wed, 30 Dec 2020 02:34:17 +0000 (03:34 +0100)]
Improve the `long' computation of `mode-line-compact'

* src/xdisp.c (display_mode_line): Compute `long' based on total
window width, and use the passed-in window instead of the selected
window.

4 years agoAdd caveat about the `long' `mode-line-compact' setting
Lars Ingebrigtsen [Wed, 30 Dec 2020 02:30:56 +0000 (03:30 +0100)]
Add caveat about the `long' `mode-line-compact' setting

* doc/lispref/modes.texi (Mode Line Basics): Elaborate on the
`long' setting.

4 years agoMinor refactoring of xref-tests
Tobias Rittweiler [Tue, 8 Dec 2020 08:59:15 +0000 (09:59 +0100)]
Minor refactoring of xref-tests

* test/lisp/progmodes/xref-tests.el (xref-tests-data-dir):
Rename to 'xref-tests--data-dir'.
(xref-tests--matches-in-data-dir, xref-tests--locations-in-data-dir):
New functions.  Factored out from test cases and updated usage sites
to use them.

4 years agoDon't calculate macOS menu data for GNUstep (bug#45502)
Alan Third [Tue, 29 Dec 2020 20:29:00 +0000 (20:29 +0000)]
Don't calculate macOS menu data for GNUstep (bug#45502)

* src/nsmenu.m ([EmacsMenu fillWithWidgetValue:]): #ifdef out code
that has no effect on GNUstep and autorelease alloc'd objects.

4 years ago* src/Makefile.in (DO_CODESIGN): Fix architecture for Apple Silicon
Artem Loenko [Tue, 29 Dec 2020 19:41:14 +0000 (20:41 +0100)]
* src/Makefile.in (DO_CODESIGN): Fix architecture for Apple Silicon

4 years agoUse explicit "--color=auto" in grep mode to support both GNU grep and ripgrep
Juri Linkov [Tue, 29 Dec 2020 19:41:24 +0000 (21:41 +0200)]
Use explicit "--color=auto" in grep mode to support both GNU grep and ripgrep

* lisp/progmodes/grep.el (grep-highlight-matches):
(grep-compute-defaults, grep-expand-template):
Use "--color=auto" instead of "--color" (bug#44983).

4 years ago* lisp/x-dnd.el (x-dnd-get-drop-x-y): Add safer check for top/left (bug#45277)
Juri Linkov [Tue, 29 Dec 2020 19:37:31 +0000 (21:37 +0200)]
* lisp/x-dnd.el (x-dnd-get-drop-x-y): Add safer check for top/left (bug#45277)

4 years agoA better fix for process-tests on MS-Windows
Eli Zaretskii [Tue, 29 Dec 2020 19:30:59 +0000 (21:30 +0200)]
A better fix for process-tests on MS-Windows

* src/w32.c (pipe2): When forcibly closing pipe handles due to
overflow of FD_SETSIZE, set the handles to -1, to avoid assertion
violations in emacs_close.

* test/src/process-tests.el (process-tests/fd-setsize-no-crash):
No need to skip this test anymore.

4 years agoFix process-tests on MS-Windows
Eli Zaretskii [Tue, 29 Dec 2020 18:41:46 +0000 (20:41 +0200)]
Fix process-tests on MS-Windows

* test/src/process-tests.el (process-tests/fd-setsize-no-crash):
Skip this test on windows-nt systems, as we cannot use more than
FD_SETSIZE file descriptors there: if we try, we crash.

4 years agoxref-show-definitions-completing-read: Tune up completion
Dmitry Gutov [Tue, 29 Dec 2020 18:24:46 +0000 (20:24 +0200)]
xref-show-definitions-completing-read: Tune up completion

* lisp/minibuffer.el (completion-category-defaults)
Use 'substring' completion style for 'xref-location' category by
default.

* lisp/progmodes/xref.el (xref-show-definitions-completing-read):
Assign the 'xref-location' category to the completions. Pass
REQUIRE-MATCH=t.

4 years agoInstrument process-tests.el for timeouts on emba
Michael Albinus [Tue, 29 Dec 2020 17:40:23 +0000 (18:40 +0100)]
Instrument process-tests.el for timeouts on emba

4 years agoAdd a regression test for Bug#24325.
Philipp Stephani [Tue, 29 Dec 2020 17:18:28 +0000 (18:18 +0100)]
Add a regression test for Bug#24325.

* test/src/process-tests.el (process-tests/fd-setsize-no-crash): New
unit test.

4 years agoFix missing negation handling in a bunch of predicates
Andrea Corallo [Tue, 29 Dec 2020 16:39:15 +0000 (17:39 +0100)]
Fix missing negation handling in a bunch of predicates

* lisp/emacs-lisp/comp.el (comp-mvar-fixnum-p)
(comp-mvar-symbol-p, comp-mvar-cons-p): Consider neg slot.
* test/src/comp-tests.el (comp-test-not-cons): New test.
* test/src/comp-test-funcs.el (comp-test-not-cons-f): New
function.