1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-16 09:50:25 +00:00
Commit Graph

3896 Commits

Author SHA1 Message Date
Mattias Engdegård
90aab73f8d More string-search optimisations
All-ASCII strings cannot have substrings with non-ASCII characters in
them; use this fact to avoid searching entirely.

* src/fns.c (Fstring_search): For multibyte non-ASCII needle and
unibyte haystack, don't check if the haystack is all-ASCII; it's a
waste of time. For multibyte non-ASCII needle and multibyte
all-ASCII haystack, fail immediately.
* test/src/fns-tests.el (string-search): Add more test cases.
2020-11-19 14:58:48 +01:00
Alan Mackenzie
ab9a23e029 Enhance syntax-tests.el to test nestable comments (Lisp style)
Also add some tests for braces and parse-partial-sexp amongst Lisp style
comments.

* test/src/syntax-tests.el (\;-in, \;-out): Add syntax for { and }.
(top-level): Add new tests for Lisp style comments.
(\#|-in, \#|-out): New functions.
(top-level): Add new tests for nested Lisp style comments, and mixtures of
nested comments with "ordinary" comments.

* test/src/syntax-resources/syntax-comments.txt (top-level): Add new test
fragments for #|...|#, etc.
2020-11-17 16:51:49 +00:00
Stefan Kangas
27655f9f38 Test that substitute-command-keys preserves text properties
* test/lisp/help-tests.el
(help-substitute-command-keys/preserves-text-properties): New test.
(Bug#17052)
2020-11-17 02:21:17 +01:00
Harald Jörg
f5f9e10097 perl-mode and cperl-mode: Recognize regex after "return"
* lisp/progmodes/cperl-mode.el (cperl-find-pods-heres): Add
"return" to the keywords which start a regex.

* lisp/progmodes/perl-mode.el (defconst): Add "return" to
'perl--syntax-exp-intro-keywords' (Bug#26850).

* test/lisp/progmodes/cperl-mode-tests.el (cperl-test-bug-28650):
New test (bug#26850).
2020-11-17 00:20:26 +01:00
Glenn Morris
4a8c1120f5 Merge from origin/emacs-27
75723ec212 (origin/emacs-27) ; * lisp/emacs-lisp/benchmark.el (benchm...
53e2a612ad ; * lib-src/make-fingerprint.c: Update commentary.
286c632772 Reformat argument commentary in etags.c
4ec740866a Make the invocation of combine-change-calls in comment-reg...
66bcec8838 * lisp/progmodes/cc-langs.el (c-<>-notable-chars-re): Fix ...
03eeab469e ; Update the expected result files in test/manual/etags.
d875a22bc6 Update the various INSTALL files

# Conflicts:
#	INSTALL
2020-11-16 09:05:31 -08:00
Stefan Kangas
f08e6538dc Run menu-item :filter function before showing binding
* lisp/help.el (describe-map): Fix running `menu-item' :filter
functions.  This fixes a mistake in the previous conversion of this
defun from the old C function describe_map.  See the discussion in
Bug#39149.
* test/src/keymap-tests.el
(keymap---get-keyelt/runs-menu-item-filter)
(describe-buffer-bindings/menu-item-filter-show-binding)
(describe-buffer-bindings/menu-item-filter-hide-binding):
New tests.
(keymap-tests--test-menu-item-filter): New defun.
2020-11-15 00:54:07 +01:00
Stefan Kangas
61dca6e92a Don't quote lambdas in several places
* lisp/align.el (align-highlight-rule):
* lisp/bookmark.el (bookmark-maybe-sort-alist):
* lisp/emacs-lisp/advice.el (ad-read-advice-name)
(ad-retrieve-args-form, ad-make-hook-form, defadvice)
(ad-with-originals):
* lisp/foldout.el (foldout-inhibit-key-bindings):
* lisp/gnus/gnus-bookmark.el (gnus-bookmark-maybe-sort-alist):
* lisp/mail/rfc822.el (rfc822-addresses-1):
* lisp/net/eudcb-ldap.el (eudc-ldap-cleanup-record-simple):
* lisp/net/net-utils.el (network-connection-to-service):
* lisp/net/socks.el (socks-build-auth-list):
* lisp/org/ox-odt.el (org-odt--image-size):
* lisp/pcomplete.el (pcomplete-command-completion-function)
(pcomplete-default-completion-function, pcomplete-opt):
* lisp/progmodes/cperl-mode.el (cperl-highlight-charclass)
(cperl-tags-hier-init, cperl-tags-treeify)
(cperl-next-interpolated-REx, cperl-time-fontification):
* lisp/shadowfile.el (shadow-copy-files, shadow-shadows-of-1)
(shadow-save-buffers-kill-emacs):
* lisp/strokes.el (strokes-renormalize-to-grid):
* lisp/tempo.el (tempo-insert, tempo-forward-mark)
(tempo-backward-mark):
* lisp/textmodes/artist.el (artist-submit-bug-report):
* lisp/textmodes/ispell.el (ispell-complete-word):
* lisp/url/url-auth.el (url-get-authentication):
* lisp/url/url-cache.el (url-cache-create-filename-human-readable):
* lisp/vcursor.el (vcursor-find-window):
* test/lisp/textmodes/reftex-tests.el
(reftex-parse-bibtex-entry-test): Don't quote lambdas.
2020-11-14 17:04:23 +01:00
Pablo Barbáchano
8700319109 Add an option to preserve ANSI sequences
* lisp/ansi-color.el Add an option to preserve the ANSI sequences
* test/lisp/ansi-color-tests.el: Add tests (bug#44589).
2020-11-14 16:24:38 +01:00
Stefan Kangas
08b1028c1e Use lexical-binding in fortune.el and add tests
* lisp/play/fortune.el: Use lexical-binding.  Remove redundant
:group args.
(fortune-in-buffer): Quote function symbol as such.
* test/lisp/play/fortune-resources/fortunes:
* test/lisp/play/fortune-tests.el: New files.
* .gitignore: Ignore generated file fortunes.dat.
2020-11-14 15:55:08 +01:00
Eli Zaretskii
03eeab469e ; Update the expected result files in test/manual/etags. 2020-11-14 15:59:31 +02:00
Michael Albinus
297f89f7e4 Some minor Tramp fixes, resulting from test campaign
* lisp/net/tramp.el (tramp-handle-write-region):
* lisp/net/tramp-adb.el (tramp-adb-handle-write-region):
* lisp/net/tramp-sh.el (tramp-sh-handle-write-region):
* lisp/net/tramp-smb.el (tramp-smb-handle-write-region): Use `current-time'
if needed.

* lisp/net/tramp-gvfs.el (tramp-gvfs-gio-mapping):
(tramp-gvfs-do-copy-or-rename-file): Remove "gvfs-rename", it is
not trustworthy.

* test/lisp/net/tramp-tests.el (tramp-test07-file-exists-p): Check also for
symlinked files in trash.
(tramp-test20-file-modes): Revert last change, it was a thinko.
2020-11-13 16:55:08 +01:00
Stefan Kangas
dcd2361801 * test/lisp/help-fns-tests.el: Silence byte-compiler. 2020-11-12 03:27:26 +01:00
Stefan Kangas
3ee56c7e42 * test/lisp/hfy-cmap-resources/rgb.txt: Add comment line. 2020-11-12 03:20:39 +01:00
Michael Albinus
658952a57a Some minor changes to Tramp, do not merge with master
* lisp/net/tramp.el (tramp-handle-directory-files)
(tramp-handle-directory-files-and-attributes):
* lisp/net/tramp-adb.el
(tramp-adb-handle-directory-files-and-attributes):
* lisp/net/tramp-rclone.el (tramp-rclone-handle-directory-files):
* lisp/net/tramp-sh.el (tramp-sh-handle-directory-files-and-attributes):
* lisp/net/tramp-smb.el (tramp-smb-handle-directory-files): Add _COUNT.
Make the functions forward compatible.

* lisp/net/tramp-gvfs.el (tramp-gvfs-enabled):
Increase `max-specpdl-size' temporarily.

* test/lisp/net/tramp-tests.el (tramp--test-share-p): New defun.
(tramp-test05-expand-file-name-relative): Use it.
2020-11-11 13:24:50 +01:00
Harald Jörg
9038890ae2 Cleanup of the test file for cperl-mode
* test/lisp/progmodes/cperl-mode-tests.el
(cperl--run-test-cases): New macro, factored out from various
indentation / rewriting tests.  Contains documentation of the
format used by the cperl-mode-resources files.
(cperl-test-bug-19709): Replace 'next-line' by 'forward-line'.
(cperl-test-indent-exp),
(cperl-test-indent-styles),
(cperl-test-bug-30393): Use the new macro.
(cperl-test-bug-19709): Make fit for Emacs 26.
(cperl-test-indent-styles): Skip for Perl mode (bug#44561).
2020-11-11 10:42:44 +01:00
Stefan Kangas
8ece715af6 Add test for substitute-command-keys with command remap
* test/lisp/help-tests.el (help-tests-remap-map): New variable.
(help-tests-substitute-command-keys/remap): New test.
(help-tests-substitute-command-keys/keymaps)
(help-tests-substitute-command-keys/undefined-map): Fix indentation.
2020-11-09 21:43:53 +01:00
Mattias Engdegård
d8a31b0c03 Better warning suppression in rx-tests
* test/lisp/emacs-lisp/rx-tests.el (rx-compat): Use with-no-warnings
instead of with-suppressed-warnings which complains when running
the test interactively.
2020-11-09 18:05:08 +01:00
Mattias Engdegård
78e1646bf7 Fix pcase rx form snag with '?' and '??' (bug#44532)
This is a regression from Emacs 26.
Reported by Phillip Stephani.

* lisp/emacs-lisp/rx.el (rx--pcase-transform): Process ? and ?? correctly.
* test/lisp/emacs-lisp/rx-tests.el (rx-pcase): Add test case.

(cherry picked from commit 575b0681d9)
2020-11-09 18:59:24 +02:00
Mattias Engdegård
575b0681d9 Fix pcase rx form snag with '?' and '??' (bug#44532)
This is a regression from Emacs 26.
Reported by Phillip Stephani.

* lisp/emacs-lisp/rx.el (rx--pcase-transform): Process ? and ?? correctly.
* test/lisp/emacs-lisp/rx-tests.el (rx-pcase): Add test case.
2020-11-09 17:28:37 +01:00
Harald Jörg
8dc237270f cperl-mode: Indentation of ')' follows customisation
* lisp/progmodes/cperl-mode.el (cperl-style-alist): Add
cperl-close-paren-offset to the settings for PBP style.

* test/lisp/progmodes/cperl-mode-tests.el (cperl-bug19709):
New test to verify correct indentation of closing parentheses (Bug#19709).

* test/lisp/progmodes/cperl-mode-resources/cperl-bug-19709.pl:
New test case with code from the bug report.

* test/lisp/progmodes/cperl-mode-resources/cperl-indent-styles.pl:
Add a new test clause for cperl-close-paren-offset.
2020-11-09 15:25:47 +01:00
Stefan Kangas
3289b96abd Remove test for return value of set-keymap-parent
* test/src/keymap-tests.el
(keymap-keymap-set-parent/returns-parent): Remove test for the return
value of set-keymap-parent.  It is not clear that returning the value
is a very good idea.
Problem pointed out by Stefan Monnier <monnier@iro.umontreal.ca>.
2020-11-09 11:48:56 +01:00
Mauro Aranda
423b6b6229 Add test for recent change in enable-theme
* test/lisp/custom-tests.el (custom-test-enable-theme-keeps-settings):
Enabling a theme should not change the theme settings, so test for
that.  See
https://lists.gnu.org/archive/html/emacs-devel/2020-11/msg00232.html
2020-11-07 09:53:21 -03:00
Stefan Kangas
6df06148e5 Add some more tests for keymap.c
* test/src/keymap-tests.el (keymap-make-keymap)
(keymap-make-sparse-keymap, keymap-keymapp)
(keymap-keymap-parent, keymap-keymap-set-parent/returns-parent)
(keymap-copy-keymap/is-equal, keymap-copy-keymap/is-not-eq)
(keymap-lookup-key, keymap-apropos-internal)
(keymap-apropos-internal/predicate): New tests.
(keymap-tests--make-keymap-test): New defun.
2020-11-07 07:55:50 +01:00
Mattias Engdegård
6e9564f09a Fix javac message parsing column number off-by-one
* lisp/progmodes/compile.el (compilation-error-regexp-alist-alist):
'javac': Column numbers are 1-based by default; remove subtraction and
η-reduce.  Translate regexp to rx (mechanised).
* test/lisp/progmodes/compile-tests.el (compile-tests--test-regexps-data):
Adapt 'javac' test cases to the change.
2020-11-06 17:16:00 +01:00
Mattias Engdegård
093a6bec52 Update gdb-mi-tests
* test/lisp/progmodes/gdb-mi-tests.el (gdb-mi-parse-value):
Make test pass after the change in gdb-mi-decode-strings default value.
2020-11-06 15:37:17 +01:00
Mattias Engdegård
0c5eb1c7e7 Reduce integer-output-format to print-integers-as-characters
The variable now only controls whether characters are printed, not
the radix.  Control chars are printed in human-readable syntax
only when special escapes such as ?\n are available.  Spaces,
formatting and combining chars are excluded (bug#44155).
Done in collaboration with Juri Linkov.

* src/character.c (graphic_base_p):
* src/print.c (named_escape): New functions.
(print_object): Change semantics as described above.
(syms_of_print): Rename integer-output-format.  Update doc string.
* doc/lispref/streams.texi (Output Variables):
* etc/NEWS:
* test/src/print-tests.el (print-integers-as-characters):
Rename and update according to new semantics.  The test now passes.
2020-11-06 13:55:32 +01:00
Stefan Kangas
1efcec2717 Add more tests for where-is-internal
* test/src/keymap-tests.el (keymap-where-is-internal)
(keymap-where-is-internal/firstonly-t)
(keymap-where-is-internal/menu-item)
(keymap-where-is-internal/advertised-binding)
(keymap-where-is-internal/advertised-binding-respect-remap)
(keymap-where-is-internal/remap)
(keymap-where-is-internal/shadowed): New tests.
(keymap-where-is-internal/preferred-modifier-is-a-string):
Rename from keymap-where-is-internal-test.
2020-11-06 04:59:37 +01:00
Stefan Kangas
38a109e58c ; Silence byte-compiler warnings in tests
* test/lisp/emacs-lisp/easy-mmode-tests.el (easy-mmode--minor-mode):
* test/lisp/progmodes/cperl-mode-tests.el (cperl-bug30393):
Silence byte-compiler.
2020-11-05 18:25:40 +01:00
Michael Albinus
334e2ab440 Still fixes for Tramp directory-files-*
* lisp/net/tramp.el (tramp-handle-directory-files):
* lisp/net/tramp-adb.el
(tramp-adb-handle-directory-files-and-attributes): Fix COUNT.

* lisp/net/tramp-crypt.el (tramp-crypt-handle-directory-files):
Implement COUNT.

* lisp/net/tramp-gvfs.el (tramp-gvfs-dbus-byte-array-to-string):
* lisp/net/tramp-integration.el (tramp-eshell-directory-change):
Use `nbutlast'.

* lisp/net/tramp-rclone.el (tramp-rclone-handle-delete-directory)
(tramp-rclone-handle-delete-file): Reorder cache flushing.
(tramp-rclone-handle-directory-files):
Use `tramp-compat-directory-files'.

* lisp/net/tramp-sh.el (tramp-sh-handle-directory-files-and-attributes):
Fix NOSORT and COUNT.

* lisp/net/tramp-smb.el (tramp-smb-handle-directory-files): Fix NOSORT.

* test/lisp/net/tramp-tests.el (tramp--test-share-p): New defun.
(tramp-test05-expand-file-name-relative): Use it.
(tramp-test16-directory-files)
(tramp-test19-directory-files-and-attributes): Strengthen test.
(tramp-test20-file-modes): Simplify check.
2020-11-05 17:36:04 +01:00
Stefan Kangas
37c0208aaa ; Silence byte-compiler warning in xdisp-tests.el
* test/src/xdisp-tests.el (xdisp-tests--minibuffer-scroll): Silence
byte-compiler.
2020-11-05 15:44:17 +01:00
Eric Abrahamsen
7fad12c59b New gnus-search library
This library provides a fundamental reworking of the search
functionality previously found in nnir.el.  It uses class-based search
engines to interface with external searching facilities, and a parsed
search query syntax that can search multiple engines.

* lisp/gnus/gnus-search.el: New library containing search
functionality for Gnus.
* doc/misc/gnus.texi: Document.
* lisp/gnus/gnus-group.el (gnus-group-make-search-group,
gnus-group-read-ephemeral-search-group): Remove references to nnir,
change meaning of prefix argument, change values of nnselect-function
and nnselect-args.
* lisp/gnus/nnselect.el: Replace references to nnir
(nnselect-request-article): Use gnus-search functions, and search
criteria.
(nnselect-request-thread, nnselect-search-thread): Use gnus-search
thread search.
(gnus-summary-make-search-group): Switch to use gnus-search function
and arguments.
* test/lisp/gnus/search-tests.el: Tests for new functionality.
2020-11-03 21:20:17 -08:00
Michael Albinus
2fffc1dfdf Some Tramp fixes for directory-files-* and delete-*
* lisp/files.el (delete-directory): Simplify check for trash.

* lisp/net/ange-ftp.el (ange-ftp-delete-file): Implement TRASH.

* lisp/net/tramp-compat.el (tramp-compat-directory-files)
(tramp-compat-directory-files-and-attributes)
(tramp-compat-directory-empty-p): New defaliases.

* lisp/net/tramp.el (tramp-handle-directory-files-and-attributes)
(tramp-skeleton-delete-directory):
* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-delete-directory): Use them.

* lisp/net/tramp-sh.el (tramp-sh-handle-directory-files-and-attributes):
Implement COUNT.

* test/lisp/net/tramp-tests.el (tramp-test14-delete-directory):
Do not run trash test for ange-ftp.
(tramp-test16-directory-files)
(tramp-test19-directory-files-and-attributes): Check COUNT argument.
2020-11-03 18:47:32 +01:00
Harald Jörg
84f74136d3 cperl-mode: Fix indentation for Emacs 26
* lisp/progmodes/cperl-mode.el (cperl-mode): Add a fix
which is only required for Emacs versions older than 27.

* test/lisp/progmodes/cperl-mode-tests.el (cperl-bug30393):
Add a test to verify correct indentation (bug#30393).
2020-11-03 15:28:40 +01:00
Harald Jörg
2800513af5 cperl-mode: Skip a test for older Emacsen (preparing for ELPA)
* test/lisp/progmodes/cperl-mode-tests.el (cperl-bug37127):
Skip this test for older Emacsen.  The bug has been fixed
in Emacs, but outside of CPerl mode, and therefore will not
be available for older versions via ELPA.
2020-11-03 00:11:12 +01:00
Michael Albinus
e654b41c6f Fix some glitches in recent directory-files-* changes
* doc/lispref/files.texi (Contents of Directories):
Fix description of directory-files, directory-empty-p and
directory-files-and-attributes.

* etc/NEWS: Fix entry for directory-files-and-attributes.  Fix typos.

* lisp/dired.el (directory-empty-p): Move function from here ...

* lisp/files.el (directory-empty-p): ... to here.

* lisp/net/ange-ftp.el (ange-ftp-directory-files): Call `nreverse' later.

* lisp/net/tramp.el (tramp-handle-directory-files):
* lisp/net/tramp-adb.el
(tramp-adb-handle-directory-files-and-attributes): Do not call
`nreverse'.

* src/dired.c (Fdirectory_files)
(Fdirectory_files_and_attributes): Fix docstrings.

* test/src/dired-tests.el: Removed.  Tests moved to
test/lisp/dired-tests.el.

* test/lisp/dired-tests.el (dired-test-bug27899): Tag it :unstable.
(dired-test-directory-files)
(dired-test-directory-files-and-attributes): New tests.
2020-11-02 17:56:06 +01:00
Michael Albinus
554495006e Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into master 2020-11-02 17:53:00 +01:00
Arthur Miller
0806075520 Add directory-empty-p and new argument COUNT for directory-files-*
* doc/lispref/files.texi (Contents of Directories): Mention COUNT
argument of directory-files.  Add directory-empty-p.

* etc/NEWS: Mention directory-empty-p and directory-files changes.

* lisp/dired.el (directory-empty-p): New defun.

* lisp/net/ange-ftp.el (ange-ftp-directory-files)
(ange-ftp-directory-files-and-attributes):
* lisp/net/tramp.el (tramp-handle-directory-files)
(tramp-handle-directory-files-and-attributes):
* lisp/net/tramp-adb.el
(tramp-adb-handle-directory-files-and-attributes):
* lisp/net/tramp-rclone.el (tramp-rclone-handle-directory-files):
* lisp/net/tramp-sh.el (tramp-sh-handle-directory-files-and-attributes):
* lisp/net/tramp-smb.el (tramp-smb-handle-directory-files): Add new COUNT
argument.

* src/dired.c (directory_files_internal): Implement new
RETURN_COUNT argument.
(Fdirectory_files, Fdirectory_files_and_attributes): Add new COUNT
argument.

* src/lisp.h (directory_files_internal): Add RETURN_COUNT to declaration.

* src/sysdep.c (list_system_processes): Add Qnil to
directory_files_internal call.

* test/src/dired-tests.el (directory-files-and-attributes-tests):
New file.
2020-11-02 12:38:27 +01:00
Lars Ingebrigtsen
5cea77af41 Partially revert previous define-minor-mode change
* lisp/emacs-lisp/easy-mmode.el (easy-mmode--arg-docstring):
Only document the values we want to support, not the ones we
actually support.
(define-minor-mode): Partially revert to previous behaviour.
2020-11-02 10:17:08 +01:00
Stefan Kangas
8ad9932f11 Don't bind standard-output in substitute-command-keys
This fixes a regression with regards to the old C version of
substitute-command-keys.

* lisp/help.el (substitute-command-keys): Don't bind standard-output.
See Bug#39149.
* test/lisp/help-tests.el
(help-tests--was-in-buffer): New variable.
(help-substitute-command-keys/menu-filter-in-correct-buffer): New
test.
2020-11-01 18:58:12 +01:00
Stefan Kangas
ce1856ec09 Insert describe-map-tree header into original buffer
* lisp/help.el (describe-map-tree): Insert header into the original
buffer, not in standard-output.
* test/src/keymap-tests.el
(describe-buffer-bindings/header-in-current-buffer)
(describe-buffer-bindings/returns-nil): New tests.
Ref: https://debbugs.gnu.org/39149#31
2020-11-01 15:53:43 +01:00
Lars Ingebrigtsen
2a4b0da28c Make minor mode ARG work as documented
* lisp/emacs-lisp/easy-mmode.el (easy-mmode--arg-docstring):
Clarify when minor modes are switched on/off when called from lisp
(bug#44341).
(define-minor-mode): Make calls from Lisp switch the mode on/off
as documented.
2020-11-01 15:00:44 +01:00
Michael Albinus
06585bb939 Trash remote files to local trash (Bug#44216)
* doc/misc/tramp.texi (Frequently Asked Questions): Add trashing.

* lisp/net/tramp-adb.el (tramp-adb-handle-delete-directory)
(tramp-adb-handle-delete-file):
* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-delete-directory)
(tramp-gvfs-handle-delete-file):
* lisp/net/tramp-sh.el (tramp-sh-handle-delete-directory)
(tramp-sh-handle-delete-file):
* lisp/net/tramp-smb.el (tramp-smb-handle-delete-directory)
(tramp-smb-handle-delete-file):
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-delete-directory)
(tramp-sudoedit-handle-delete-file): Implement local trash.  (Bug#44216)

* lisp/net/tramp-crypt.el (tramp-crypt-handle-delete-directory)
(tramp-crypt-handle-delete-file): Do not trash.

* lisp/net/tramp.el (tramp-skeleton-delete-directory): New defmacro.

* test/lisp/net/tramp-tests.el (tramp-test07-file-exists-p)
(tramp-test14-delete-directory): Add trashing.
2020-11-01 12:42:29 +01:00
Juri Linkov
5d9e456c3e New variable integer-output-format to print integers as characters (bug#44155)
* doc/lispref/streams.texi (Output Variables): Add integer-output-format.

* src/print.c (print_object): In case of Lisp_Int, print integers
as characters when Vinteger_output_format is Qt, and in hex format
when Vinteger_output_format is 16.
(Vinteger_output_format): New variable.

* test/src/print-tests.el (print-integer-output-format): New test.
2020-10-31 22:11:02 +02:00
Stefan Kangas
f9cac26dc1 * test/README: Document TEST_BACKTRACE_LINE_LENGTH. 2020-10-31 20:27:39 +01:00
Mattias Engdegård
0cbcc6223a 'assoc' is not side-effect-free; constprop its pure subset
Since a supplied test function can do anything, assoc is not
side-effect-free (bug#44018).  However, with only two arguments it is
pure and should be optimised accordingly.

* lisp/emacs-lisp/byte-opt.el (side-effect-free-fns): Remove 'assoc'.
(byte-optimize-assoc): Constant-propagate through 2-arg assoc calls.
* test/lisp/emacs-lisp/bytecomp-tests.el
(byte-opt-testsuite-arith-data): Add test cases.
2020-10-31 14:31:43 +01:00
Stefan Monnier
7103192cd2 * src/xdisp.c (syms_of_xdisp) <"scroll-minibuffer-conservatively">: New var
Fix bug#44070, which causes the minibuffer display to jump upon minor edit

(redisplay_window): Obey it.
* lisp/simple.el (end-of-buffer): Obey it.

* test/src/xdisp-tests.el (xdisp-tests--in-minibuffer): New macro,
extracted from `xdisp-tests--minibuffer-resizing`.
(xdisp-tests--minibuffer-resizing): Use it.
(xdisp-tests--minibuffer-scroll): New test.
2020-10-31 09:07:53 -04:00
Mattias Engdegård
c3a20804a8 Trim and explain set of safe forms for 'unsafep' (bug#44018)
* lisp/emacs-lisp/unsafep.el:
Add comment explaining the policy for which forms can be considered
'safe' in the sense of unsafep.  Remove ones that didn't make the cut:

 play-sound-file (large attack surface)
 catch, throw (alter program flow, inject data)
 replace-regexp-in-string (execute arbitary code)
 error, signal (deceptive messages)

* test/lisp/emacs-lisp/unsafep-tests.el (unsafep-tests--unsafe):
Add test cases.
* etc/NEWS: Announce the change.
2020-10-31 13:42:07 +01:00
Mattias Engdegård
a78c6141bc Parse GDB/MI results directly instead of going via JSON (bug#44173)
Translating GDB/MI into JSON is an unnecessary and fragile detour
that made it hard to deal with octal escapes in strings correctly.
Parse GDB/MI directly instead.

* lisp/progmodes/gdb-mi.el (gdb-mi-decode-strings): Adjust doc string.
(gdb-mi-decode, gud-gdbmi-marker-filter): Remove gdb-mi-decode.
(gdb-jsonify-buffer): Remove.
(gdb-mi--parse-tuple-or-list, gdb-mi--parse-c-string)
(gdb-mi--parse-value, gdb-mi--parse-result-or-value)
(gdb-mi--parse-results, gdb-mi--fix-key, gdb-mi--extend-fullname)
(gdb-mi--c-string-from-string): New functions.
(gdb-json-read-buffer, gdb-json-string, gdb-json-partial-output):
Rename to gdb-mi--read-buffer, gdb-mi--from-string and
gdb-mi--partial-output respectively.  Remove useless FIX-LIST
argument.  FIX-KEY is now a symbol, not a string. All callers updated.
(gdb-tooltip-print, gdbmi-bnf-log-stream-output, gdb-internals)
(gdb-console, gdb-done-or-error, gdb-get-source-file-list)
(gdb-get-prompt, gdb-get-source-file):
Use gdb-mi--c-string-from-string instead of 'read'.
* test/lisp/progmodes/gdb-mi-tests.el: New file.
2020-10-31 13:42:07 +01:00
Jared Finder
2a6337a6c4 Fix unit tests broken by changes to xt-mouse.el
* test/lisp/xt-mouse-tests.el (xt-mouse-tracking-basic)
(xt-mouse-tracking-utf-8): Update expected escape sequence.
2020-10-31 09:57:00 +02:00
Eli Zaretskii
8800d8c640 Revert "Temporarily mark two failing tests"
This reverts commit a8426f4672.
A proper fix for the test is about to be installed shortly.
2020-10-31 09:56:14 +02:00