From 5c7dd8a783fa2503f042f6671279e5fca38c35cb Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 1 Jan 2018 00:21:42 -0800 Subject: Update copyright year to 2018 Run admin/update-copyright. --- test/src/coding-tests.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/src/coding-tests.el') diff --git a/test/src/coding-tests.el b/test/src/coding-tests.el index e0cefa94356..a3ca71514b0 100644 --- a/test/src/coding-tests.el +++ b/test/src/coding-tests.el @@ -1,6 +1,6 @@ ;;; coding-tests.el --- tests for text encoding and decoding -;; Copyright (C) 2013-2017 Free Software Foundation, Inc. +;; Copyright (C) 2013-2018 Free Software Foundation, Inc. ;; Author: Eli Zaretskii ;; Author: Kenichi Handa -- cgit v1.2.1 From 26bed8ba10eeaf0a340a8d0d760c5578dddec867 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 1 Jan 2019 00:59:58 +0000 Subject: Update copyright year to 2019 Run 'TZ=UTC0 admin/update-copyright $(git ls-files)'. --- test/src/coding-tests.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/src/coding-tests.el') diff --git a/test/src/coding-tests.el b/test/src/coding-tests.el index a3ca71514b0..1a08c1e1a18 100644 --- a/test/src/coding-tests.el +++ b/test/src/coding-tests.el @@ -1,6 +1,6 @@ ;;; coding-tests.el --- tests for text encoding and decoding -;; Copyright (C) 2013-2018 Free Software Foundation, Inc. +;; Copyright (C) 2013-2019 Free Software Foundation, Inc. ;; Author: Eli Zaretskii ;; Author: Kenichi Handa -- cgit v1.2.1 From 365e01cc9f64ce6ca947ccfd8612d60763280a37 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 1 Jan 2020 00:19:43 +0000 Subject: Update copyright year to 2020 Run "TZ=UTC0 admin/update-copyright $(git ls-files)". --- test/src/coding-tests.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/src/coding-tests.el') diff --git a/test/src/coding-tests.el b/test/src/coding-tests.el index 1a08c1e1a18..094a1fad8fa 100644 --- a/test/src/coding-tests.el +++ b/test/src/coding-tests.el @@ -1,6 +1,6 @@ ;;; coding-tests.el --- tests for text encoding and decoding -;; Copyright (C) 2013-2019 Free Software Foundation, Inc. +;; Copyright (C) 2013-2020 Free Software Foundation, Inc. ;; Author: Eli Zaretskii ;; Author: Kenichi Handa -- cgit v1.2.1 From 962562cde45071f74a37854a299e88470a4ecd49 Mon Sep 17 00:00:00 2001 From: Mattias Engdegård Date: Sun, 5 Apr 2020 11:27:36 +0200 Subject: Fix inverted NOCOPY encode/decode parameter (bug#40407) In {encode,decode}-coding-string, the NOCOPY parameter had the opposite effect to what was intended and documented. This 18 year old bug (introduced in 4031e2bf0a) only affected calls with CODING-SYSTEM being nil. * src/coding.c (code_convert_string): Correct use of NOCOPY. * test/src/coding-tests.el (coding-nocopy-trivial): New test. --- test/src/coding-tests.el | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/src/coding-tests.el') diff --git a/test/src/coding-tests.el b/test/src/coding-tests.el index 094a1fad8fa..110ff126964 100644 --- a/test/src/coding-tests.el +++ b/test/src/coding-tests.el @@ -375,6 +375,14 @@ (with-temp-buffer (insert-file-contents (car file)))))) (insert (format "%s: %s\n" (car file) result))))))) +(ert-deftest coding-nocopy-trivial () + "Check that the NOCOPY parameter works for the trivial coding system." + (let ((s "abc")) + (should-not (eq (decode-coding-string s nil nil) s)) + (should (eq (decode-coding-string s nil t) s)) + (should-not (eq (encode-coding-string s nil nil) s)) + (should (eq (encode-coding-string s nil t) s)))) + ;; Local Variables: ;; byte-compile-warnings: (not obsolete) ;; End: -- cgit v1.2.1 From 4ed39549e3f9dbfeb2aea0e2674a7701dbc0e5ea Mon Sep 17 00:00:00 2001 From: Mattias Engdegård Date: Fri, 3 Apr 2020 16:01:01 +0200 Subject: Avoid expensive recoding for ASCII identity cases (bug#40407) Optimise for the common case of encoding or decoding an ASCII-only string using an ASCII-compatible coding, for file names in particular. * src/coding.c (string_ascii_p): New function. (code_convert_string): Return the input string for ASCII-only inputs and ASCII-compatible codings. * test/src/coding-tests.el (coding-nocopy-ascii): New test. --- test/src/coding-tests.el | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test/src/coding-tests.el') diff --git a/test/src/coding-tests.el b/test/src/coding-tests.el index 110ff126964..93e6709d442 100644 --- a/test/src/coding-tests.el +++ b/test/src/coding-tests.el @@ -383,6 +383,17 @@ (should-not (eq (encode-coding-string s nil nil) s)) (should (eq (encode-coding-string s nil t) s)))) +(ert-deftest coding-nocopy-ascii () + "Check that the NOCOPY parameter works for ASCII-only strings." + (let* ((uni (apply #'string (number-sequence 0 127))) + (multi (string-to-multibyte uni))) + (dolist (s (list uni multi)) + (dolist (coding '(us-ascii iso-latin-1 utf-8)) + (should-not (eq (decode-coding-string s coding nil) s)) + (should-not (eq (encode-coding-string s coding nil) s)) + (should (eq (decode-coding-string s coding t) s)) + (should (eq (encode-coding-string s coding t) s)))))) + ;; Local Variables: ;; byte-compile-warnings: (not obsolete) ;; End: -- cgit v1.2.1 From faf996dc6e963a8dd74e9e794ded0467dd78ea18 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Thu, 9 Apr 2020 12:18:30 +0300 Subject: Fix decoding ASCII strings with embedded CR characters * src/coding.c (string_ascii_p): Return a negative value if an all-ASCII string STR includes the CR character, otherwise a positive value. (code_convert_string): If the string is ASCII, but includes CR characters, use the fast path only if EOL doesn't need to be decoded. (Bug#40519) * test/src/coding-tests.el (coding-nocopy-ascii): Add tests for bug#40519. --- test/src/coding-tests.el | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'test/src/coding-tests.el') diff --git a/test/src/coding-tests.el b/test/src/coding-tests.el index 93e6709d442..83a06b8179e 100644 --- a/test/src/coding-tests.el +++ b/test/src/coding-tests.el @@ -387,6 +387,23 @@ "Check that the NOCOPY parameter works for ASCII-only strings." (let* ((uni (apply #'string (number-sequence 0 127))) (multi (string-to-multibyte uni))) + (dolist (s (list uni multi)) + (dolist (coding '(us-ascii-unix iso-latin-1-unix utf-8-unix)) + (should-not (eq (decode-coding-string s coding nil) s)) + (should-not (eq (encode-coding-string s coding nil) s)) + (should (eq (decode-coding-string s coding t) s)) + (should (eq (encode-coding-string s coding t) s))))) + (let* ((uni (apply #'string (number-sequence 15 127))) + (multi (string-to-multibyte uni))) + (dolist (s (list uni multi)) + (dolist (coding '(us-ascii iso-latin-1 utf-8)) + (should-not (eq (decode-coding-string s coding nil) s)) + (should-not (eq (encode-coding-string s coding nil) s)) + (should (eq (decode-coding-string s coding t) s)) + (should (eq (encode-coding-string s coding t) s))))) + (let* ((uni (apply #'string (number-sequence 0 127))) + (multi (string-to-multibyte uni)) + (inhibit-eol-conversion t)) (dolist (s (list uni multi)) (dolist (coding '(us-ascii iso-latin-1 utf-8)) (should-not (eq (decode-coding-string s coding nil) s)) -- cgit v1.2.1 From 786887cf439450ce7d8d6fbe624e8c434e50d469 Mon Sep 17 00:00:00 2001 From: Mattias Engdegård Date: Wed, 8 Apr 2020 17:13:39 +0200 Subject: Don't crash with invalid argument in check-coding-systems-region * src/coding.c (Fcheck_coding_systems_region): Don't crash if the third arg contains something that isn't a coding system. * test/src/coding-tests.el (coding-check-coding-systems-region): New test. --- test/src/coding-tests.el | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/src/coding-tests.el') diff --git a/test/src/coding-tests.el b/test/src/coding-tests.el index 83a06b8179e..8d92bcdcd1a 100644 --- a/test/src/coding-tests.el +++ b/test/src/coding-tests.el @@ -411,6 +411,14 @@ (should (eq (decode-coding-string s coding t) s)) (should (eq (encode-coding-string s coding t) s)))))) +(ert-deftest coding-check-coding-systems-region () + (should (equal (check-coding-systems-region "aå" nil '(utf-8)) + nil)) + (should (equal (check-coding-systems-region "aåbγc" nil + '(utf-8 iso-latin-1 us-ascii)) + '((iso-latin-1 3) (us-ascii 1 3)))) + (should-error (check-coding-systems-region "å" nil '(bad-coding-system)))) + ;; Local Variables: ;; byte-compile-warnings: (not obsolete) ;; End: -- cgit v1.2.1 From d3e2c88041b4844422bda64b1ee51678dc8a2e88 Mon Sep 17 00:00:00 2001 From: Mattias Engdegård Date: Thu, 9 Apr 2020 12:04:22 +0200 Subject: Fix ASCII-only conversion logic (bug#40407) To sidestep conversion altogether when EOL conversion applies, we must either be encoding a string without NL, or decoding without CR. * src/coding.c (string_ascii_p): Revert to a pure predicate. (code_convert_string): Fix logic. Don't use uninitialised ascii_p (removed). Use memchr to detect CR or LF in string when needed. * test/src/coding-tests.el (coding-nocopy-ascii): Update tests to include encodings with explicit EOL conversions. --- test/src/coding-tests.el | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) (limited to 'test/src/coding-tests.el') diff --git a/test/src/coding-tests.el b/test/src/coding-tests.el index 8d92bcdcd1a..9f6fac3edd8 100644 --- a/test/src/coding-tests.el +++ b/test/src/coding-tests.el @@ -388,29 +388,38 @@ (let* ((uni (apply #'string (number-sequence 0 127))) (multi (string-to-multibyte uni))) (dolist (s (list uni multi)) + ;; Encodings without EOL conversion. (dolist (coding '(us-ascii-unix iso-latin-1-unix utf-8-unix)) (should-not (eq (decode-coding-string s coding nil) s)) (should-not (eq (encode-coding-string s coding nil) s)) (should (eq (decode-coding-string s coding t) s)) - (should (eq (encode-coding-string s coding t) s))))) - (let* ((uni (apply #'string (number-sequence 15 127))) + (should (eq (encode-coding-string s coding t) s))) + + ;; With EOL conversion inhibited. + (let ((inhibit-eol-conversion t)) + (dolist (coding '(us-ascii iso-latin-1 utf-8)) + (should-not (eq (decode-coding-string s coding nil) s)) + (should-not (eq (encode-coding-string s coding nil) s)) + (should (eq (decode-coding-string s coding t) s)) + (should (eq (encode-coding-string s coding t) s)))))) + + ;; Check identity decoding with EOL conversion for ASCII except CR. + (let* ((uni (apply #'string (delq ?\r (number-sequence 0 127)))) (multi (string-to-multibyte uni))) (dolist (s (list uni multi)) - (dolist (coding '(us-ascii iso-latin-1 utf-8)) + (dolist (coding '(us-ascii-dos iso-latin-1-dos utf-8-dos mac-roman-mac)) (should-not (eq (decode-coding-string s coding nil) s)) - (should-not (eq (encode-coding-string s coding nil) s)) - (should (eq (decode-coding-string s coding t) s)) - (should (eq (encode-coding-string s coding t) s))))) - (let* ((uni (apply #'string (number-sequence 0 127))) - (multi (string-to-multibyte uni)) - (inhibit-eol-conversion t)) + (should (eq (decode-coding-string s coding t) s))))) + + ;; Check identity encoding with EOL conversion for ASCII except LF. + (let* ((uni (apply #'string (delq ?\n (number-sequence 0 127)))) + (multi (string-to-multibyte uni))) (dolist (s (list uni multi)) - (dolist (coding '(us-ascii iso-latin-1 utf-8)) - (should-not (eq (decode-coding-string s coding nil) s)) + (dolist (coding '(us-ascii-dos iso-latin-1-dos utf-8-dos mac-roman-mac)) (should-not (eq (encode-coding-string s coding nil) s)) - (should (eq (decode-coding-string s coding t) s)) (should (eq (encode-coding-string s coding t) s)))))) + (ert-deftest coding-check-coding-systems-region () (should (equal (check-coding-systems-region "aå" nil '(utf-8)) nil)) -- cgit v1.2.1 From e18c24b35a7cf9bb1b91288b706fa448ed28a7c2 Mon Sep 17 00:00:00 2001 From: Mattias Engdegård Date: Thu, 9 Apr 2020 16:19:14 +0200 Subject: Set last-coding-system-used upon ASCII conversion bypass (bug#40407) Spotted by Kazuhiro Ito. * src/coding.c (code_convert_string): Set Vlast_coding_system if appropriate. * test/src/coding-tests.el (coding-nocopy-ascii): Add test. --- test/src/coding-tests.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'test/src/coding-tests.el') diff --git a/test/src/coding-tests.el b/test/src/coding-tests.el index 9f6fac3edd8..a741e233d39 100644 --- a/test/src/coding-tests.el +++ b/test/src/coding-tests.el @@ -393,7 +393,8 @@ (should-not (eq (decode-coding-string s coding nil) s)) (should-not (eq (encode-coding-string s coding nil) s)) (should (eq (decode-coding-string s coding t) s)) - (should (eq (encode-coding-string s coding t) s))) + (should (eq (encode-coding-string s coding t) s)) + (should (eq last-coding-system-used coding))) ;; With EOL conversion inhibited. (let ((inhibit-eol-conversion t)) -- cgit v1.2.1 From c52f8863a536c003980c8fcc24dfb48dfb2353a8 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Fri, 24 Apr 2020 15:28:22 +0200 Subject: Use lexical-binding in most src tests * test/src/charset-tests.el: * test/src/chartab-tests.el: * test/src/cmds-tests.el: * test/src/coding-tests.el (top-level) (generate-ascii-file, generate-mostly-nonascii-file): * test/src/doc-tests.el: * test/src/floatfns-tests.el: * test/src/font-tests.el: * test/src/keymap-tests.el: * test/src/process-tests.el (top-level) (process-test-sentinel-wait-function-working-p) (process-test-stderr-buffer, process-test-stderr-filter): * test/src/textprop-tests.el: * test/src/thread-tests.el: * test/src/timefns-tests.el: * test/src/undo-tests.el: * test/src/xml-tests.el: Use lexical-binding. --- test/src/coding-tests.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'test/src/coding-tests.el') diff --git a/test/src/coding-tests.el b/test/src/coding-tests.el index a741e233d39..c438ae22ce3 100644 --- a/test/src/coding-tests.el +++ b/test/src/coding-tests.el @@ -1,4 +1,4 @@ -;;; coding-tests.el --- tests for text encoding and decoding +;;; coding-tests.el --- tests for text encoding and decoding -*- lexical-binding: t -*- ;; Copyright (C) 2013-2020 Free Software Foundation, Inc. @@ -296,7 +296,7 @@ ;;; decoder, not for regression testing. (defun generate-ascii-file () - (dotimes (i 100000) + (dotimes (_i 100000) (insert-char ?a 80) (insert "\n"))) @@ -309,13 +309,13 @@ (insert "\n"))) (defun generate-mostly-nonascii-file () - (dotimes (i 30000) + (dotimes (_i 30000) (insert-char ?a 80) (insert "\n")) - (dotimes (i 20000) + (dotimes (_i 20000) (insert-char ?À 80) (insert "\n")) - (dotimes (i 10000) + (dotimes (_i 10000) (insert-char ?あ 80) (insert "\n"))) -- cgit v1.2.1 From 78eacf31e8fe182801ad1943fac717b75fcf286b Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 23 Sep 2020 13:35:55 +0200 Subject: ; Fix many typos in symbols in docs and comments --- test/src/coding-tests.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/src/coding-tests.el') diff --git a/test/src/coding-tests.el b/test/src/coding-tests.el index 094a1fad8fa..899025b4c91 100644 --- a/test/src/coding-tests.el +++ b/test/src/coding-tests.el @@ -143,7 +143,7 @@ ;; Optional 5th arg TRANSLATOR is a function to translate the original ;; file contents to match with the expected result of decoding. For ;; instance, when a file of dos eol-type is read by unix eol-type, -;; `decode-test-lf-to-crlf' must be specified. +;; `coding-tests-lf-to-crlf' must be specified. (defun coding-tests (content-type write-coding read-coding detected-coding &optional translator) -- cgit v1.2.1 From ba05d005e5a81bc123ad8da928b1bccb6b160e7a Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 1 Jan 2021 01:13:56 -0800 Subject: Update copyright year to 2021 Run "TZ=UTC0 admin/update-copyright". --- test/src/coding-tests.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/src/coding-tests.el') diff --git a/test/src/coding-tests.el b/test/src/coding-tests.el index 82883a045c8..0bdcff22ce5 100644 --- a/test/src/coding-tests.el +++ b/test/src/coding-tests.el @@ -1,6 +1,6 @@ ;;; coding-tests.el --- tests for text encoding and decoding -*- lexical-binding: t -*- -;; Copyright (C) 2013-2020 Free Software Foundation, Inc. +;; Copyright (C) 2013-2021 Free Software Foundation, Inc. ;; Author: Eli Zaretskii ;; Author: Kenichi Handa -- cgit v1.2.1 From 71b14f28068d9327eb236b8577ccbddd65e3b38b Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Thu, 22 Apr 2021 04:11:02 +0200 Subject: Avoid lowering gc-cons-threshold * lisp/cedet/semantic/wisent/comp.el (wisent--compile-grammar): * lisp/international/mule-cmds.el (ucs-names): * lisp/progmodes/ebrowse.el (ebrowse-read): * test/src/coding-tests.el (benchmark-decoder): Avoid lowering gc-cons-treshold. --- test/src/coding-tests.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/src/coding-tests.el') diff --git a/test/src/coding-tests.el b/test/src/coding-tests.el index 0bdcff22ce5..0309b2b1ad6 100644 --- a/test/src/coding-tests.el +++ b/test/src/coding-tests.el @@ -359,7 +359,7 @@ (delete-region (point-min) (point)))))) (defun benchmark-decoder () - (let ((gc-cons-threshold 4000000)) + (let ((gc-cons-threshold (max gc-cons-threshold 4000000))) (insert "Without optimization:\n") (dolist (files test-file-list) (dolist (file (cdr files)) -- cgit v1.2.1 From 3b7b181bded1bddb2505eda1224a5631cbf04c1b Mon Sep 17 00:00:00 2001 From: Mattias Engdegård Date: Mon, 9 Aug 2021 11:20:00 +0200 Subject: Use string-search instead of string-match[-p] `string-search` is easier to understand, less error-prone, much faster, does not pollute the regexp cache, and does not mutate global state. Use it where applicable and obviously safe (erring on the conservative side). * admin/authors.el (authors-canonical-file-name) (authors-scan-change-log): * lisp/apropos.el (apropos-command) (apropos-documentation-property, apropos-symbols-internal): * lisp/arc-mode.el (archive-arc-summarize) (archive-zoo-summarize): * lisp/calc/calc-aent.el (math-read-factor): * lisp/calc/calc-ext.el (math-read-big-expr) (math-format-nice-expr, math-format-number-fancy): * lisp/calc/calc-forms.el (math-read-angle-brackets): * lisp/calc/calc-graph.el (calc-graph-set-range): * lisp/calc/calc-keypd.el (calc-keypad-press): * lisp/calc/calc-lang.el (tex, latex, math-read-big-rec): * lisp/calc/calc-prog.el (calc-fix-token-name) (calc-user-define-permanent, math-define-exp): * lisp/calc/calc.el (calc-record, calcDigit-key) (calc-count-lines): * lisp/calc/calcalg2.el (calc-solve-for, calc-poly-roots) (math-do-integral): * lisp/calc/calcalg3.el (calc-find-root, calc-find-minimum) (calc-get-fit-variables): * lisp/cedet/ede/speedbar.el (ede-tag-expand): * lisp/cedet/semantic/java.el (semantic-java-expand-tag): * lisp/cedet/semantic/sb.el (semantic-sb-show-extra) (semantic-sb-expand-group): * lisp/cedet/semantic/wisent/python.el (semantic-python-instance-variable-p): * lisp/cus-edit.el (get): * lisp/descr-text.el (describe-text-sexp): * lisp/dired-aux.el (dired-compress-file): * lisp/dired-x.el (dired-make-relative-symlink): * lisp/dired.el (dired-glob-regexp): * lisp/dos-fns.el (dos-convert-standard-filename, dos-8+3-filename): * lisp/edmacro.el (edmacro-format-keys): * lisp/emacs-lisp/eieio-opt.el (eieio-sb-expand): * lisp/emacs-lisp/eieio-speedbar.el (eieio-speedbar-object-expand): * lisp/emacs-lisp/lisp-mnt.el (lm-keywords-list): * lisp/emacs-lisp/warnings.el (display-warning): * lisp/emulation/viper-ex.el (viper-ex-read-file-name) (ex-print-display-lines): * lisp/env.el (read-envvar-name, setenv): * lisp/epa-mail.el (epa-mail-encrypt): * lisp/epg.el (epg--start): * lisp/erc/erc-backend.el (erc-parse-server-response): * lisp/erc/erc-dcc.el (erc-dcc-member): * lisp/erc/erc-speedbar.el (erc-speedbar-expand-server) (erc-speedbar-expand-channel, erc-speedbar-expand-user): * lisp/erc/erc.el (erc-send-input): * lisp/eshell/em-glob.el (eshell-glob-entries): * lisp/eshell/esh-proc.el (eshell-needs-pipe-p): * lisp/eshell/esh-util.el (eshell-convert): * lisp/eshell/esh-var.el (eshell-envvar-names): * lisp/faces.el (x-resolve-font-name): * lisp/ffap.el (ffap-file-at-point): * lisp/files.el (wildcard-to-regexp, shell-quote-wildcard-pattern): * lisp/forms.el (forms--update): * lisp/frameset.el (frameset-filter-unshelve-param): * lisp/gnus/gnus-art.el (article-decode-charset): * lisp/gnus/gnus-kill.el (gnus-kill-parse-rn-kill-file): * lisp/gnus/gnus-mlspl.el (gnus-group-split-fancy): * lisp/gnus/gnus-msg.el (gnus-summary-resend-message-insert-gcc) (gnus-inews-insert-gcc): * lisp/gnus/gnus-rfc1843.el (rfc1843-decode-article-body): * lisp/gnus/gnus-search.el (gnus-search-indexed-parse-output) (gnus-search--complete-key-data): * lisp/gnus/gnus-spec.el (gnus-parse-simple-format): * lisp/gnus/gnus-sum.el (gnus-summary-refer-article): * lisp/gnus/gnus-util.el (gnus-extract-address-components) (gnus-newsgroup-directory-form): * lisp/gnus/gnus-uu.el (gnus-uu-grab-view): * lisp/gnus/gnus.el (gnus-group-native-p, gnus-short-group-name): * lisp/gnus/message.el (message-check-news-header-syntax) (message-make-message-id, message-user-mail-address) (message-make-fqdn, message-get-reply-headers, message-followup): * lisp/gnus/mm-decode.el (mm-dissect-buffer): * lisp/gnus/nnheader.el (nnheader-insert): * lisp/gnus/nnimap.el (nnimap-process-quirk) (nnimap-imap-ranges-to-gnus-ranges): * lisp/gnus/nnmaildir.el (nnmaildir--ensure-suffix): * lisp/gnus/nnmairix.el (nnmairix-determine-original-group-from-path): * lisp/gnus/nnrss.el (nnrss-match-macro): * lisp/gnus/nntp.el (nntp-find-group-and-number): * lisp/help-fns.el (help--symbol-completion-table-affixation): * lisp/help.el (help-function-arglist): * lisp/hippie-exp.el (he-concat-directory-file-name): * lisp/htmlfontify.el (hfy-relstub): * lisp/ido.el (ido-make-prompt, ido-complete, ido-copy-current-word) (ido-exhibit): * lisp/image/image-converter.el (image-convert-p): * lisp/info-xref.el (info-xref-docstrings): * lisp/info.el (Info-toc-build, Info-follow-reference) (Info-backward-node, Info-finder-find-node) (Info-speedbar-expand-node): * lisp/international/mule-diag.el (print-fontset-element): * lisp/language/korea-util.el (default-korean-keyboard): * lisp/linum.el (linum-after-change): * lisp/mail/ietf-drums.el (ietf-drums-parse-address): * lisp/mail/mail-utils.el (mail-dont-reply-to): * lisp/mail/rfc2047.el (rfc2047-encode-1, rfc2047-decode-string): * lisp/mail/rfc2231.el (rfc2231-parse-string): * lisp/mail/rmailkwd.el (rmail-set-label): * lisp/mail/rmailsum.el (rmail-header-summary): * lisp/mail/smtpmail.el (smtpmail-maybe-append-domain) (smtpmail-user-mail-address): * lisp/mail/uce.el (uce-reply-to-uce): * lisp/man.el (Man-default-man-entry): * lisp/mh-e/mh-alias.el (mh-alias-gecos-name) (mh-alias-minibuffer-confirm-address): * lisp/mh-e/mh-comp.el (mh-forwarded-letter-subject): * lisp/mh-e/mh-speed.el (mh-speed-parse-flists-output): * lisp/mh-e/mh-utils.el (mh-collect-folder-names-filter) (mh-folder-completion-function): * lisp/minibuffer.el (completion--make-envvar-table) (completion-file-name-table, completion-flex-try-completion) (completion-flex-all-completions): * lisp/mpc.el (mpc--proc-quote-string, mpc-cmd-special-tag-p) (mpc-constraints-tag-lookup): * lisp/net/ange-ftp.el (ange-ftp-send-cmd) (ange-ftp-allow-child-lookup): * lisp/net/mailcap.el (mailcap-mime-types): * lisp/net/mairix.el (mairix-search-thread-this-article): * lisp/net/pop3.el (pop3-open-server): * lisp/net/soap-client.el (soap-decode-xs-complex-type): * lisp/net/socks.el (socks-filter): * lisp/nxml/nxml-outln.el (nxml-highlighted-qname): * lisp/nxml/rng-cmpct.el (rng-c-expand-name, rng-c-expand-datatype): * lisp/nxml/rng-uri.el (rng-uri-file-name-1): * lisp/obsolete/complete.el (partial-completion-mode) (PC-do-completion): * lisp/obsolete/longlines.el (longlines-encode-string): * lisp/obsolete/nnir.el (nnir-compose-result): * lisp/obsolete/terminal.el (te-quote-arg-for-sh): * lisp/obsolete/tpu-edt.el (tpu-check-search-case): * lisp/obsolete/url-ns.el (isPlainHostName): * lisp/pcmpl-unix.el (pcomplete/scp): * lisp/play/dunnet.el (dun-listify-string2, dun-get-path) (dun-unix-parse, dun-doassign, dun-cat, dun-batch-unix-interface): * lisp/progmodes/ebnf2ps.el: (ebnf-eps-header-footer-comment): * lisp/progmodes/gdb-mi.el (gdb-var-delete) (gdb-speedbar-expand-node, gdbmi-bnf-incomplete-record-result): * lisp/progmodes/gud.el (gud-find-expr): * lisp/progmodes/idlw-help.el (idlwave-do-context-help1): * lisp/progmodes/idlw-shell.el (idlwave-shell-mode) (idlwave-shell-filter-hidden-output, idlwave-shell-filter): * lisp/progmodes/idlwave.el (idlwave-skip-label-or-case) (idlwave-routine-info): * lisp/progmodes/octave.el (inferior-octave-completion-at-point): * lisp/progmodes/sh-script.el (sh-add-completer): * lisp/progmodes/sql.el (defun): * lisp/progmodes/xscheme.el (xscheme-process-filter): * lisp/replace.el (query-replace-compile-replacement) (map-query-replace-regexp): * lisp/shell.el (shell--command-completion-data) (shell-environment-variable-completion): * lisp/simple.el (display-message-or-buffer): * lisp/speedbar.el (speedbar-dired, speedbar-tag-file) (speedbar-tag-expand): * lisp/subr.el (split-string-and-unquote): * lisp/tar-mode.el (tar-extract): * lisp/term.el (term-command-hook, serial-read-name): * lisp/textmodes/bibtex.el (bibtex-print-help-message): * lisp/textmodes/ispell.el (ispell-lookup-words, ispell-filter) (ispell-parse-output, ispell-buffer-local-parsing): * lisp/textmodes/reftex-cite.el (reftex-do-citation): * lisp/textmodes/reftex-parse.el (reftex-notice-new): * lisp/textmodes/reftex-ref.el (reftex-show-entry): * lisp/textmodes/reftex.el (reftex-compile-variables): * lisp/textmodes/tex-mode.el (tex-send-command) (tex-start-tex, tex-append): * lisp/thingatpt.el (thing-at-point-url-at-point): * lisp/tmm.el (tmm-add-one-shortcut): * lisp/transient.el (transient-format-key): * lisp/url/url-auth.el (url-basic-auth) (url-digest-auth-directory-id-assoc): * lisp/url/url-news.el (url-news): * lisp/url/url-util.el (url-parse-query-string): * lisp/vc/vc-cvs.el (vc-cvs-parse-entry): * lisp/wid-browse.el (widget-browse-sexp): * lisp/woman.el (woman-parse-colon-path, woman-mini-help) (WoMan-getpage-in-background, woman-negative-vertical-space): * lisp/xml.el: * test/lisp/emacs-lisp/check-declare-tests.el (check-declare-tests-warn): * test/lisp/files-tests.el (files-tests-file-name-non-special-dired-compress-handler): * test/lisp/net/network-stream-tests.el (server-process-filter): * test/src/coding-tests.el (ert-test-unibyte-buffer-dos-eol-decode): Use `string-search` instead of `string-match` and `string-match-p`. --- test/src/coding-tests.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/src/coding-tests.el') diff --git a/test/src/coding-tests.el b/test/src/coding-tests.el index 0309b2b1ad6..134f5676709 100644 --- a/test/src/coding-tests.el +++ b/test/src/coding-tests.el @@ -56,7 +56,7 @@ (set-buffer-multibyte nil) (insert (encode-coding-string "あ" 'euc-jp) "\xd" "\n") (decode-coding-region (point-min) (point-max) 'euc-jp-dos) - (should-not (string-match-p "\^M" (buffer-string))))) + (should-not (string-search "\^M" (buffer-string))))) ;; Return the contents (specified by CONTENT-TYPE; ascii, latin, or ;; binary) of a test file. -- cgit v1.2.1 From 8bb28e740dd2cc8058d7833dd60b0ef9a8765c1b Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sun, 26 Sep 2021 01:53:56 +0200 Subject: ; Minor stylistic checkdoc fixes in test/**/*.el --- test/src/coding-tests.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/src/coding-tests.el') diff --git a/test/src/coding-tests.el b/test/src/coding-tests.el index 134f5676709..1c585ea5377 100644 --- a/test/src/coding-tests.el +++ b/test/src/coding-tests.el @@ -434,4 +434,4 @@ ;; End: (provide 'coding-tests) -;; coding-tests.el ends here +;;; coding-tests.el ends here -- cgit v1.2.1 From 19dcb237b5b02b36580294ab309124f346a66024 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 1 Jan 2022 02:45:51 -0500 Subject: ; Add 2022 to copyright years. --- test/src/coding-tests.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/src/coding-tests.el') diff --git a/test/src/coding-tests.el b/test/src/coding-tests.el index 1c585ea5377..de4ddb546df 100644 --- a/test/src/coding-tests.el +++ b/test/src/coding-tests.el @@ -1,6 +1,6 @@ ;;; coding-tests.el --- tests for text encoding and decoding -*- lexical-binding: t -*- -;; Copyright (C) 2013-2021 Free Software Foundation, Inc. +;; Copyright (C) 2013-2022 Free Software Foundation, Inc. ;; Author: Eli Zaretskii ;; Author: Kenichi Handa -- cgit v1.2.1 From d8d13f2fccadfdd999a818a5c320f6d0f0d428fe Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Mon, 8 Aug 2022 13:18:36 +0200 Subject: Remove redundant local variables in tests * test/lisp/calc/calc-tests.el: * test/lisp/progmodes/python-tests.el: Remove redundant local variables. * test/src/coding-tests.el: Pacify byte-compiler without using local variable. --- test/src/coding-tests.el | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'test/src/coding-tests.el') diff --git a/test/src/coding-tests.el b/test/src/coding-tests.el index de4ddb546df..f65d575d0c2 100644 --- a/test/src/coding-tests.el +++ b/test/src/coding-tests.el @@ -61,16 +61,17 @@ ;; Return the contents (specified by CONTENT-TYPE; ascii, latin, or ;; binary) of a test file. (defun coding-tests-file-contents (content-type) - (let* ((ascii "ABCDEFGHIJKLMNOPQRSTUVWXYZ\n") - (latin (concat ascii "ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ\n")) - (binary (string-to-multibyte - (concat (string-as-unibyte latin) - (unibyte-string #xC0 #xC1 ?\n))))) - (cond ((eq content-type 'ascii) ascii) - ((eq content-type 'latin) latin) - ((eq content-type 'binary) binary) - (t - (error "Invalid file content type: %s" content-type))))) + (with-suppressed-warnings ((obsolete string-as-unibyte)) + (let* ((ascii "ABCDEFGHIJKLMNOPQRSTUVWXYZ\n") + (latin (concat ascii "ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ\n")) + (binary (string-to-multibyte + (concat (string-as-unibyte latin) + (unibyte-string #xC0 #xC1 ?\n))))) + (cond ((eq content-type 'ascii) ascii) + ((eq content-type 'latin) latin) + ((eq content-type 'binary) binary) + (t + (error "Invalid file content type: %s" content-type)))))) ;; Generate FILE with CONTENTS encoded by CODING-SYSTEM. ;; whose encoding specified by CODING-SYSTEM. @@ -429,9 +430,5 @@ '((iso-latin-1 3) (us-ascii 1 3)))) (should-error (check-coding-systems-region "å" nil '(bad-coding-system)))) -;; Local Variables: -;; byte-compile-warnings: (not obsolete) -;; End: - (provide 'coding-tests) ;;; coding-tests.el ends here -- cgit v1.2.1