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