aboutsummaryrefslogtreecommitdiffstats
path: root/test/src/buffer-tests.el (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Prefer ert-with-temp-directory in testsStefan Kangas2025-02-231-16/+10
| | | | | | | | | | | * test/lisp/dired-aux-tests.el (dired-test-bug30624): * test/lisp/emacs-lisp/track-changes-tests.el (track-changes-tests--random): * test/src/buffer-tests.el (test-buffer-chars-modified-ticks): * test/src/fileio-tests.el (fileio-tests--symlink-failure) (fileio-tests--insert-file-interrupt) (fileio-tests--circular-after-insert-file-functions): Prefer ert-with-temp-directory to using make-temp-file directly.
* Prefer incf to cl-incf in testsStefan Kangas2025-02-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-reify-function): * test/lisp/emacs-lisp/cl-extra-tests.el (cl-getf): * test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs-loop-for-as-arith-order-side-effects) (cl-macs-loop-for-as-equals-then, cl-macs-loop-do, cl-macs-loop-finally) (cl-macs-loop-in-ref, cl-macs-loop-being-elements-of-ref) (cl-macs-test--symbol-macrolet, cl-the): * test/lisp/emacs-lisp/cl-seq-tests.el (cl-lib-test-remove) (cl-lib-test-remove-if-not): * test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el (edebug-test-code-range): * test/lisp/emacs-lisp/edebug-tests.el (edebug-tests-deduplicate): * test/lisp/emacs-lisp/generator-tests.el (cps-while-incf): (cps-test-iter-cleanup-once-only): * test/lisp/emacs-lisp/hierarchy-tests.el (hierarchy-labelfn-button-if-does-not-button-unless-condition) (hierarchy-labelfn-button-if-does-button-when-condition): * test/lisp/emacs-lisp/let-alist-tests.el (let-alist-evaluate-once): * test/lisp/emacs-lisp/lisp-mode-tests.el (indent-sexp, lisp-indent-region): * test/lisp/emacs-lisp/map-tests.el (test-map-elt-gv) (test-setf-map-with-function): * test/lisp/emacs-lisp/multisession-tests.el (multi-test-sqlite-simple) (multi-test-sqlite-busy, multi-test-files-simple) (multi-test-files-busy): * test/lisp/emacs-lisp/oclosure-tests.el (oclosure-test, oclosure-test-mutate): * test/lisp/emacs-lisp/track-changes-tests.el (track-changes-tests--random): * test/lisp/files-tests.el (files-tests--with-buffer-offer-save): * test/lisp/net/shr-tests.el (shr-test/zoom-image): * test/lisp/replace-tests.el (replace-tests-with-undo): * test/src/buffer-tests.el (test-overlay-randomly): * test/src/data-tests.el (test-bool-vector-bv-from-hex-string): * test/src/fns-tests.el (fns-tests-sort): * test/src/json-tests.el (json-insert/signal, json-insert/throw): * test/src/minibuf-tests.el (minibuf-tests--strings-to-symbol-alist) (minibuf-tests--strings-to-string-alist) (minibuf-tests--strings-to-string-hashtable) (minibuf-tests--strings-to-symbol-hashtable): * test/src/process-tests.el (make-process/file-handler/found): Prefer incf to cl-incf.
* Prefer decf to cl-decfStefan Kangas2025-02-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/auth-source-pass.el (auth-source-pass--find-match-many): * lisp/calendar/time-date.el (decoded-time-add) (decoded-time--alter-month, decoded-time--alter-day): * lisp/dired.el (dired--move-to-next-line): * lisp/dom.el (dom-pp): * lisp/emacs-lisp/cl-macs.el (cl--transform-lambda): * lisp/emacs-lisp/cl-print.el (cl-print-to-string-with-limit): * lisp/emacs-lisp/cl-seq.el (cl-fill, cl-replace, cl-substitute): * lisp/emacs-lisp/comp-cstr.el (comp--range-union) (comp--range-intersection): * lisp/emacs-lisp/comp.el (comp-vec-prepend, comp--emit-narg-prologue): * lisp/emacs-lisp/edebug.el (edebug--strip-instrumentation): * lisp/emacs-lisp/eldoc.el (eldoc--invoke-strategy): * lisp/emacs-lisp/pp.el (pp--format-definition): * lisp/emacs-lisp/smie.el (smie-config--guess-1): * lisp/eshell/esh-io.el (eshell-close-handle, eshell-set-output-handle): * lisp/gnus/gnus-async.el (gnus-async-prefetch-article): * lisp/gnus/gnus-group.el (gnus-group-mark-group) (gnus-group-yank-group): * lisp/gnus/gnus-salt.el (gnus-tree-forward-line): * lisp/gnus/gnus-score.el (gnus-decay-scores): * lisp/gnus/gnus-srvr.el (gnus-browse-toggle-subscription-at-point): * lisp/gnus/gnus-sum.el (gnus-build-sparse-threads, gnus-parent-headers) (gnus-update-marks, gnus-summary-work-articles) (gnus-summary-refer-parent-article, gnus-summary-next-thread) (gnus-read-header, gnus-summary-insert-new-articles): * lisp/gnus/gnus-topic.el (gnus-topic-forward-topic): * lisp/gnus/gnus.el (gnus-short-group-name): * lisp/gnus/message.el (message-remove-first-header) (message-shorten-references, message-insert-screenshot): * lisp/gnus/mm-url.el (mm-url-insert): * lisp/gnus/nnselect.el (nnselect-push-info): * lisp/ibuffer.el (ibuffer-backward-line, ibuffer-forward-line) (ibuffer-map-lines): * lisp/icomplete.el (icomplete--render-vertical): * lisp/image/image-dired-external.el (image-dired-create-thumb-1): * lisp/image/image-dired.el (image-dired-delete-char): * lisp/mail/ietf-drums-date.el (ietf-drums-date--tokenize-string): * lisp/mh-e/mh-utils.el (mh-sub-folders-parse): * lisp/minibuffer.el (minibuffer-completion-help): * lisp/mpc.el (mpc-cmd-move, mpc-songpointer-refresh-hairy): * lisp/net/eww.el (eww-process-text-input): * lisp/net/pop3.el (pop3-wait-for-messages, pop3-uidl-stat) (pop3-uidl-dele): * lisp/net/shr-color.el (shr-color-hue-to-rgb): * lisp/play/5x5.el (5x5-up, 5x5-left): * lisp/play/decipher.el (decipher-read-alphabet, decipher--digram-total) (decipher-analyze-buffer): * lisp/play/hanoi.el (hanoi-insert-ring, hanoi-move-ring): * lisp/profiler.el (profiler-format-number) (profiler-calltree-build-unified): * lisp/progmodes/antlr-mode.el (antlr-next-rule, antlr-indent-line): * lisp/progmodes/c-ts-common.el (c-ts-common-statement-offset): * lisp/progmodes/ebrowse.el (ebrowse-cyclic-display-next/previous-member-list): * lisp/progmodes/hideif.el (hif-backward-comment): * lisp/progmodes/js.el (js-beginning-of-defun, js-end-of-defun) (js-ts--syntax-propertize): * lisp/progmodes/typescript-ts-mode.el (tsx-ts--syntax-propertize-captures): * lisp/rect.el (rectangle--*-char): * lisp/term.el (term-emulate-terminal): * lisp/textmodes/reftex-cite.el (reftex-do-citation): * lisp/textmodes/reftex-index.el (reftex-index-next-phrase): * lisp/textmodes/reftex-parse.el (reftex-init-section-numbers): * lisp/textmodes/reftex-sel.el (reftex-select-unmark): * lisp/textmodes/reftex.el (reftex-silence-toc-markers): * lisp/treesit.el (treesit-navigate-thing): * lisp/vc/diff-mode.el (diff-sanity-check-context-hunk-half, (diff-sanity-check-hunk): * lisp/vc/pcvs-util.el (cvs-first): * lisp/vc/smerge-mode.el (smerge-get-current): * lisp/vc/vc-hg.el (vc-hg--glob-to-pcre): * test/lisp/net/socks-tests.el (socks-tests-perform-hello-world-http-request): * test/src/buffer-tests.el (test-overlay-randomly): Prefer decf to cl-defc in all code where we can.
* Update copyright year to 2025Paul Eggert2025-01-011-1/+1
| | | | Run "TZ=UTC0 admin/update-copyright".
* Standardize possessive apostrophe usage in manuals, docs, and commentsStefan Kangas2024-07-251-1/+1
| | | | | See the note in admin/notes/documentation. Ref: https://lists.gnu.org/r/emacs-devel/2012-02/msg00649.html
* ; Add 2024 to copyright yearsPo Lu2024-01-021-1/+1
|
* (report_overlay_modification): Fix bug#65929Stefan Monnier2023-09-131-0/+1
| | | | | | | | | | | | | | Somehow the new overlay code in Emacs-29 changed slightly the test to decide when to run the `modification-hooks` of overlays, with the consequence that these hook functions end up being executed also when text is deleted right after an empty overlay, which is contrary to Emacs-28 behavior as well as contrary to the Texinfo doc. * src/buffer.c (report_overlay_modification): Better reproduce the Emacs-28 code. * test/src/buffer-tests.el (overlay-modification-hooks): Add corresponding test.
* Rename with/without-narrowing to with/without-restrictionEli Zaretskii2023-02-131-16/+16
| | | | | | | | | | | | | | | | | * doc/lispref/commands.texi: * doc/lispref/display.texi: * doc/lispref/positions.texi: * etc/NEWS: * lisp/subr.el: * src/buffer.c: * src/editfns.c: * src/keyboard.c: * src/xdisp.c: * test/src/buffer-tests.el: Rename with-narrowing and without-narrowing to with-restriction and without-restriction. Likewise with internal--with-narrowing and internal--without-narrowing. All callers and documentation changed.
* Add an extensive test for labeled (locked) narrowingGregory Heytings2023-02-091-0/+106
| | | | * test/src/buffer-tests.el (test-labeled-narrowing): New test.
* Fix buffer-list-update-hook for indirect buffersBasil L. Contovounesios2023-01-171-20/+26
| | | | | | | | | | | | | | | | | | Fmake_indirect_buffer can be told whether to run buffer hooks since bug#49160, but until now it ran buffer-list-update-hook irrespective of this. * src/buffer.c (Fmake_indirect_buffer): Don't run buffer-list-update-hook when called with a non-nil INHIBIT-BUFFER-HOOKS argument. (run_buffer_list_update_hook): Don't special-case NULL argument, as no such callers remain. * test/src/buffer-tests.el (buffer-tests-inhibit-buffer-hooks-indirect): Test whether indirect buffer hooks are run regardless of whether base buffer hooks are inhibited. Check that all three buffer hooks, not just kill-buffer-query-functions, are inhibited.
* ; Add 2023 to copyright years.Eli Zaretskii2023-01-011-1/+1
|
* Reduce buffer-tests noisiness even moreEli Zaretskii2022-11-161-5/+5
| | | | | | | | * test/src/buffer-tests.el (test-kill-buffer-auto-save-default) (test-kill-buffer-auto-save-delete-yes) (test-kill-buffer-auto-save-delete-no) (test-buffer-modifications, test-restore-buffer-modified-p): Shut up auto-save messages. (Bug#59028)
* Reduce buffer-tests noisiness when run in batch mode.Matt Armstrong2022-11-161-42/+35
| | | | | | | * test/src/buffer-tests.el (overlay-modification-hooks): Remove noisy `message' calls and use `ert-info' to log context of test failures. (bug#59028) (overlay-tests-start-recording-modification-hooks): ditto.
* ; Fix typosStefan Kangas2022-11-111-1/+1
|
* Rewrite the `kill-buffer-delete-auto-save' tests (bug#59028)Matt Armstrong2022-11-101-58/+85
| | | | | | | | | | | | | | | | | | These tests had been annoying to me when run in interactive mode. They failed to bind `kill-buffer-delete-auto-save' as needed, so they depended on the user's settings, and they failed to mock out the "Buffer modified, save?" prompt. * test/src/buffer-tests.el (test-kill-buffer-auto-save): New helper function that mocks the two different kinds of prompts that occur when killing modified buffers that visit a file. Tests fail if expected prompts are not issued. (test-kill-buffer-auto-save-default): Use it, and explicitly bind `kill-buffer-delete-auto-save' to nil. (test-kill-buffer-auto-save-delete): Delete it. (test-kill-buffer-auto-save-delete-yes): New test for the "yes" half of the old `test-kill-buffer-auto-save-delete'. (test-kill-buffer-auto-save-delete-yes): Ditto for the "no" half.
* itree.c and buffer-tests.el: Incorporate code review feedbackMatt Armstrong2022-11-061-12/+17
| | | | | | | | * src/itree.c: Improve wording in `itree_insert_gap` comment. * test/src/buffer-tests.el (test-overlay-insert-before-markers-at-start): Don't rely on (point-min) being 1. (test-overlay-insert-before-markers-at-end): ditto. (test-overlay-insert-before-markers-empty): ditto.
* buffer.c: evaporate overlays in all indirect buffersStefan Monnier2022-11-051-1/+0
| | | | | | | | | | | | | | | | | | | This fixes bug#58928. The patch works by moving the `evaporate_overlays` check closer to `itree_delete_gap`. * src/buffer.c (adjust_overlays_for_delete_in_buffer): New function, integrating the functionality of `evaporate_overlays`. (adjust_overlays_for_delete): Use it. (evaporate_overlays): Delete function. * src/buffer.h (evaporate_overlays): Delete declaration. * src/insdel.c (adjust_markers_for_replace): Minor optimization. (adjust_after_replace, replace_range, replace_range_2, del_range_2): Don't call `evaporate_overlays`. * test/src/buffer-tests.el (buffer-tests--overlays-indirect-evaporate): Remove the `:expected-result :failed` attribute.
* Add a test for overlay evaporation across indirect buffersMatt Armstrong2022-11-051-0/+36
| | | | | | * test/src/buffer-tests.el (buffer-tests--overlays-indirect-evaporate): Test evaporation of overlays triggered by deleting text in base and in indirect buffers. Test doesn't pass at the moment.
* Tweak the overlay related `insert-before-markers' testsMatt Armstrong2022-11-051-22/+39
| | | | | | | | | | | | | | | * test/src/buffer-tests.el (test-overlay-insert-before-markers-empty): Move code down to the other tests related to insertion. Test all front/rear insert combinations. To make the test more clear, at least to me, hard code all character positions. (test-overlay-insert-before-markers-at-start): For both front-advance modes verify that `insert-before-markers' at and overlay's start advances it. (test-overlay-insert-before-markers-at-end): For both rear-advance modes test that `insert-before-markers' at an overlay's end advances it. (test-overlay-insert-before-markers-non-empty): Delete, replaced by the two tests above.
* itree: Reproduce markers's behavior more faithfully (bug#58928)Stefan Monnier2022-11-031-0/+22
| | | | | | | | | | | | | | | | | | | | | The most obvious problem was the lack of support for `insert-before-markers`, but the behavior was also different in a few other cases. * src/itree.h (itree_insert_gap): * src/itree.c (itree_insert_gap): Add `before_markers` arg. * src/lisp.h (adjust_overlays_for_insert): * src/buffer.c (adjust_overlays_for_insert): Add `before_markers` arg. * src/insdel.c (adjust_markers_for_replace, adjust_markers_for_insert) (adjust_markers_for_delete): Adjust overlays directly from here. (insert_1_both, insert_from_string_1, insert_from_gap) (insert_from_buffer_1, adjust_after_replace, replace_range) (replace_range_2, del_range_2): Don't adjust overlays explicitly here any more. * test/src/buffer-tests.el (test-overlay-insert-before-markers-empty) (test-overlay-insert-before-markers-non-empty): New tests.
* src/buffer.c: Fix interaction between overlays & indirect buffers (bug#58928)Stefan Monnier2022-11-011-0/+21
| | | | | | | | | | * src/buffer.c (adjust_overlays_for_insert) (adjust_overlays_for_delete): Repeat for all buffers sharing the same text. * src/itree.c (itree_insert_gap, itree_delete_gap): Allow an empty tree. * test/src/buffer-tests.el (buffer-tests--overlays-indirect-bug58928): New test.
* Add `get-pos-property' tests covering bug#58706Matt Armstrong2022-10-221-0/+43
| | | | | | | * test/src/buffer-tests.el (get-pos-property-overlay-beg): New test. (get-pos-property-overlay-empty-rear-advance): ditto. (get-pos-property-overlay-past-rear-advance): ditto. (get-pos-property-overlay-at-narrowed-end): ditto.
* Fix a narrow-to-region vs. overlays-at bugMatt Armstrong2022-10-211-12/+27
| | | | | | | | | | | | | | | | | | See bug#58703. * src/buffer.c (overlays_in): Add a new TRAILING arg expressing the behavior wanted by `overlays-at', namely to include all overlays beginning at the POS passed to `overlays-at', even if POS is the end of the narrowed region. Pass true and the search range is extended to ZV+1 if END is greater than ZV, just as is done for EMPTY. (overlays_at): Pass 'true' for the new trailing arg. At present this is the only caller passing 'true'. (mouse_face_overlay_overlaps): Pass 'false' for the new trailing arg. (disable_line_numbers_overlay_at_eob): ditto. (Foverlays_in): ditto. * src/editfns.c (overlays_around): ditto. * test/src/buffer-tests.el (sorted-overlays): Add a spot test for this.
* Fix handling of overlays that begin at END in 'overlays_in'Matt Armstrong2022-10-211-0/+45
| | | | | | | | | | | | | | | | | When passed EMPTY, 'overlays_in' should return empty overlays at END. It was doing so, but it was also returning any other overlay that happened to begin at END. bug#58672 * src/buffer.c (overlays_in): Don't return overlays at END unless they are empty overlays. (disable_line_numbers_overlay_at_eob): Pass 'false' instead of 'NULL' for the bool 'empty' arg. * test/src/buffer-tests.el (sorted-overlays-in): New helper function. (test-overlays-in-empty-range): New test exhaustively covering these edge conditions. (test-overlays-in-empty-range-bug58672): Simple test for one case.
* src/textprop.c (get_char_property_and_overlay): Fix bug#58479Stefan Monnier2022-10-141-0/+8
| | | | | | | | | Correct `get-char-property` which failed to ignore empty overlays. * src/textprop.c (get_char_property_and_overlay): Make sure the overlay covers the character. * test/src/buffer-tests.el (buffer-tests--overlay-bug58479): New test. * src/buffer.h (buffer_has_overlays): Avoid `interval_tree_size`.
* ; * test/src/buffer-tests.el: Remove unecessary `message' calls.Matt Armstrong2022-10-091-2/+0
|
* ; * test/src/buffer-tests.el (test-overlay-randomly): new test.Matt Armstrong2022-10-081-0/+92
|
* Merge 'master' into noverlayStefan Monnier2022-09-251-172/+651
|\
| * Add basic test coverage for overlay modification hooksMatt Armstrong2022-09-041-0/+193
| | | | | | | | | | | | | | | | * test/src/buffer-tests.el: (overlay-modification-hooks) new ert-deftest. (overlay-tests-start-recording-modification-hooks): New function. (overlay-tests-get-recorded-modification-hooks): New function (bug#57150).
| * Update buffer's chars-modified tick when inserting from gapEli Zaretskii2022-07-211-0/+20
| | | | | | | | | | | | | | | | * src/insdel.c (insert_from_gap): Update buffer's chars-modified tick. (Bug#56393) * test/src/buffer-tests.el (test-buffer-chars-modified-ticks): New test.
| * Fix buffer-testsEli Zaretskii2022-07-071-2/+6
| | | | | | | | | | * test/src/buffer-tests.el (test-restore-buffer-modified-p): Don't assume turning on auto-save-mode cannot auto-save immediately.
| * Clean up a test file in /tmpLars Ingebrigtsen2022-05-241-1/+5
| | | | | | | | | | * test/src/buffer-tests.el (test-restore-buffer-modified-p): Clean up autosave file in /tmp.
| * Adjust restore-buffer-modified-p autosaved logicLars Ingebrigtsen2022-05-121-0/+10
| | | | | | | | | | | | | | | | | | * doc/lispref/buffers.texi (Buffer Modification): Adjust documentation. * src/buffer.c (Frestore_buffer_modified_p): Fix up the logic around `autosaved': It means "the buffer is modified, and also autosaved".
| * Reimplement recent with-silent-modifications auto-save changesLars Ingebrigtsen2022-05-101-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/buffers.texi (Buffer Modification): Document buffer-modified-p returning `autosaved'. * lisp/subr.el (with-silent-modifications): Use restore-buffer-modified-p instead of altering the buffer modiff (since this has other side effects like not updating after async `display' changes. * src/buffer.c (Fbuffer_modified_p): Allow returning whether the buffer has been autosaved after changes. (Frestore_buffer_modified_p): Allow adjusting whether the buffer has been autosaved after changes. * src/fileio.c (Fdo_auto_save): Refill the doc string.
| * Silence byte-compiler in two testsStefan Kangas2022-02-041-1/+1
| | | | | | | | | | | | * test/lisp/electric-tests.el (electric-pair-define-test-form): * test/src/buffer-tests.el (buffer-tests--make-test-name): Silence byte-compiler by defining defuns also at run time.
| * Merge from origin/emacs-28Eli Zaretskii2022-01-011-1/+1
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 836be7a112 ; * etc/refcards/ru-refcard.tex: Update Copyright year. 86cbc6ee4a * lisp/net/tramp-sh.el: Adapt copyright year ebe8772f65 ; Minor fixes related to copyright years 23c1ee6989 ; * test/manual/etags/ETAGS.good_N: Adjust to copyright ye... 8d3fc7ec89 * src/xfaces.c (face_for_font): Make 'hash' be uintptr_t. 19dcb237b5 ; Add 2022 to copyright years. # Conflicts: # etc/NEWS # etc/refcards/ru-refcard.tex # lib/cdefs.h # lisp/erc/erc-dcc.el # lisp/erc/erc-imenu.el # lisp/erc/erc-replace.el # lisp/image-dired.el # lisp/progmodes/xref.el # m4/alloca.m4 # m4/byteswap.m4 # m4/errno_h.m4 # m4/getopt.m4 # m4/gnulib-common.m4 # m4/inttypes.m4 # m4/stddef_h.m4 # m4/stdint.m4 # m4/sys_socket_h.m4
| | * ; Add 2022 to copyright years.Eli Zaretskii2022-01-011-1/+1
| | |
| * | Eliminate ERT test name clashes (bug#51941)Mattias EngdegÄrd2021-11-181-39/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * test/lisp/electric-tests.el (js-mode-braces-with-layout-and-indent): * test/lisp/emacs-lisp/cl-lib-tests.el (cl-lib-test-fifth): * test/lisp/thingatpt-tests.el (test-symbol-thing-2): Remove duplicated tests. * test/lisp/emacs-lisp/generator-tests.el (cps-loop): * test/lisp/emacs-lisp/ring-tests.el (ring-tests-insert): * test/lisp/help-tests.el (help-tests-substitute-command-keys/no-change): * test/lisp/net/netrc-tests.el (test-netrc-credentials): * test/lisp/progmodes/elisp-mode-tests.el (elisp-completes-functions-after-let-bindings): * test/lisp/thingatpt-tests.el (test-symbol-thing-3): * test/src/buffer-tests.el (deftest-overlayp-1, buffer-tests--*): * test/src/buffer-tests.el (test-buffer-swap-text-1): * test/src/data-tests.el (binding-test-set-constant-nil) (data-tests-logcount): Rename clashing tests.
| * | Prefer ert-with-temp-(directory|file) in most remaining testsStefan Kangas2021-11-081-40/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * test/lisp/auth-source-tests.el (auth-source-test-searches): * test/lisp/autorevert-tests.el (auto-revert-test00-auto-revert-mode) (auto-revert-test01-auto-revert-several-files) (auto-revert-test02-auto-revert-deleted-file) (auto-revert-test03-auto-revert-tail-mode) (auto-revert-test04-auto-revert-mode-dired) (auto-revert-test05-global-notify) (auto-revert-test06-write-file) (auto-revert-test07-auto-revert-several-buffers): * test/lisp/calendar/icalendar-tests.el (icalendar-tests--do-test-cycle): * test/lisp/custom-tests.el (custom-theme--load-path): * test/lisp/dired-aux-tests.el (dired-test-bug27496) (with-dired-bug28834-test): * test/lisp/emacs-lisp/bytecomp-tests.el (test-byte-comp-compile-and-load) (bytecomp-tests--dest-mountpoint) (bytecomp-tests--target-file-no-directory): * test/lisp/emacs-lisp/gv-tests.el (gv-tests--in-temp-dir): * test/lisp/eshell/eshell-tests.el (with-temp-eshell) (eshell-test-command-result): * test/lisp/info-xref-tests.el (info-xref-test-makeinfo): * test/lisp/vc/vc-tests.el (vc-test--create-repo) (vc-test--register, vc-test--state, vc-test--working-revision) (vc-test--checkout-model, vc-test--rename-file) (vc-test--version-diff): * test/src/buffer-tests.el (test-kill-buffer-auto-save-delete): * test/src/comp-tests.el (comp-tests-bootstrap): * test/src/process-tests.el (process-test-quoted-batfile): Prefer 'ert-with-temp-(directory|file)' to using 'make-temp-file' directly.
| * | Prefer ert-with-temp-(directory|file)Stefan Kangas2021-11-071-19/+19
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * test/lisp/abbrev-tests.el (read-write-abbrev-file-test) (read-write-abbrev-file-test-with-props) (abbrev-edit-save-to-file-test): * test/lisp/auth-source-tests.el (auth-source-test-netrc-create-secret) (auth-source-delete): * test/lisp/autoinsert-tests.el (autoinsert-tests-auto-insert-file): * test/lisp/bookmark-tests.el (with-bookmark-test-save-load): * test/lisp/buff-menu-tests.el (buff-menu-24962): * test/lisp/calendar/icalendar-tests.el (icalendar-tests--do-test-export): * test/lisp/calendar/todo-mode-tests.el (with-todo-test): * test/lisp/dired-tests.el (dired-test-bug27243-01, dired-test-bug27243-02) (dired-test-bug27243-03, dired-test-bug27631) (dired-test-bug27968, dired-test-with-temp-dirs): * test/lisp/dired-x-tests.el (dired-test-bug25942): * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--with-temp-file): * test/lisp/emacs-lisp/check-declare-tests.el (check-declare-tests-scan) (check-declare-tests-verify-mismatch): * test/lisp/emacs-lisp/edebug-tests.el (edebug-tests-with-normal-env): * test/lisp/emacs-lisp/package-tests.el (with-package-test) (package-test-signed): * test/lisp/emacs-lisp/testcover-tests.el (testcover-tests-markup-region) (testcover-tests-run-test-case): * test/lisp/emulation/viper-tests.el (viper-test-undo-kmacro): * test/lisp/epg-tests.el (with-epg-tests): * test/lisp/eshell/em-hist-tests.el (eshell-write-readonly-history): * test/lisp/eshell/em-ls-tests.el (em-ls-test-bug27631): * test/lisp/ffap-tests.el (ffap-tests-25243): * test/lisp/files-tests.el (files-tests-bug-18141) (files-tests-read-file-in-~, files-tests-make-directory) (files-tests-copy-directory, files-tests-executable-find) (files-tests-dont-rewrite-precious-files) (files-tests--save-some-buffers): * test/lisp/ls-lisp-tests.el (ls-lisp-test-bug27631): * test/lisp/mail/uudecode-tests.el (uudecode-tests-decode-region-internal) (uudecode-tests-decode-region-external): * test/lisp/net/browse-url-tests.el (browse-url-tests-delete-temp-file): * test/lisp/progmodes/elisp-mode-tests.el (xref--case-insensitive): * test/lisp/progmodes/etags-tests.el (etags-buffer-local-tags-table-list): * test/lisp/progmodes/flymake-tests.el (ruby-backend): * test/lisp/progmodes/python-tests.el (python-tests-with-temp-file): * test/lisp/progmodes/sql-tests.el (with-sql-test-connect-harness): * test/lisp/saveplace-tests.el (saveplace-test-save-place-to-alist/file) (saveplace-test-forget-unreadable-files) (saveplace-test-place-alist-to-file): * test/lisp/so-long-tests/spelling-tests.el: * test/lisp/textmodes/reftex-tests.el (reftex-locate-bibliography-files) (reftex-parse-from-file-test): * test/lisp/thumbs-tests.el (thumbs-tests-thumbsdir/create-if-missing): * test/lisp/vc/vc-bzr-tests.el (vc-bzr-test-bug9726) (vc-bzr-test-bug9781, vc-bzr-test-faulty-bzr-autoloads): * test/lisp/vc/diff-mode-tests.el (diff-mode-test-ignore-trailing-dashes): * test/lisp/vc/ediff-ptch-tests.el (ediff-ptch-test-bug26084): * test/lisp/wdired-tests.el (wdired-test-bug32173-01) (wdired-test-bug32173-02, wdired-test-symlink-name) (wdired-test-unfinished-edit-01, wdired-test-bug34915) (wdired-test-bug39280): * test/src/buffer-tests.el (test-kill-buffer-auto-save-default): * test/src/filelock-tests.el (filelock-tests--fixture): * test/src/inotify-tests.el (inotify-file-watch-simple): * test/src/undo-tests.el (undo-test-file-modified): Prefer 'ert-with-temp-(directory|file)' to using 'make-temp-file' directly. In some cases, this is just cleanup, but in several cases this fixes bugs where an error would have lead to us not cleaning up.
| * Add new variable 'kill-buffer/delete-auto-save-files'Lars Ingebrigtsen2021-08-231-0/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/emacs/files.texi (Auto Save Files): Document it. * lisp/cus-start.el (standard): Add customize form. * lisp/files.el (delete-auto-save-files): Move definition to C (since it's used in the C layer). * src/buffer.c (Fkill_buffer): Use the new variable (and remove the old code that apparently didn't trigger for kill-buffer/delete-auto-save-files. (syms_of_buffer): Add new variable kill-buffer-delete-auto-save-files and move definition of delete-auto-save-files here (bug#21612).
| * Make overlays-in treat zero-length overlays at point-max consistentlyLars Ingebrigtsen2021-08-161-1/+22
| | | | | | | | | | | | | | | | * doc/lispref/display.texi (Finding Overlays): Adjust documentation. * src/buffer.c (overlays_in): Treat the end of the buffer and the end of the narrowed-to buffer the same (bug#19422). (Foverlays_in): Adjust doc string.
| * Avoid byte-compilation warningEli Zaretskii2021-07-221-2/+2
| | | | | | | | | | * test/src/buffer-tests.el (buffer-tests-inhibit-buffer-hooks): Avoid byte-compiler warning. (Bug#49667)
| * Mention `overlays-in' in the `overlays-at' doc stringLars Ingebrigtsen2021-07-201-0/+13
| | | | | | | | | | * src/buffer.c (Foverlays_at): Mention `overlays-in' in the doc string (bug#459).
| * Add inhibit-buffer-hooks to `make-indirect-buffer'Lars Ingebrigtsen2021-07-191-1/+2
| | | | | | | | | | | | | | * doc/lispref/buffers.texi (Indirect Buffers): Document it (bug#49160). * src/buffer.c (Fmake_indirect_buffer): Allow controlling whether to inhibit buffer hooks.
| * Make make-indirect-buffer inherit inhibit-buffer-hook from base bufferdickmao2021-07-191-0/+24
| | | | | | | | | | | | | | * src/buffer.c (Fmake_indirect_buffer): Match base buffer's inhibit-buffer-hooks. * test/src/buffer-tests.el (buffer-tests-inhibit-buffer-hooks-indirect): Add a test (bug#49160).
| * Update copyright year to 2021Paul Eggert2021-01-011-1/+1
| | | | | | | | Run "TZ=UTC0 admin/update-copyright".
| * Inhibit buffer hooks in temporary buffersBasil L. Contovounesios2020-12-201-3/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Give get-buffer-create an optional argument to inhibit buffer hooks in internal or temporary buffers for efficiency (bug#34765). * etc/NEWS: Announce new parameter of get-buffer-create and generate-new-buffer, and that with-temp-buffer and with-temp-file now inhibit buffer hooks. * doc/lispref/buffers.texi (Buffer Names): Fix typo. (Creating Buffers): Document new parameter of get-buffer-create and generate-new-buffer. (Buffer List, Killing Buffers): Document when buffer hooks are inhibited. (Current Buffer): * doc/lispref/files.texi (Writing to Files): Document that with-temp-buffer and with-temp-file inhibit buffer hooks. * doc/lispref/internals.texi (Buffer Internals): Document inhibit_buffer_hooks flag. Remove stale comment. * doc/misc/gnus-faq.texi (FAQ 5-8): * lisp/simple.el (shell-command-on-region): Fix indentation. * lisp/files.el (kill-buffer-hook): Document when hook is inhibited. (create-file-buffer): * lisp/gnus/gnus-uu.el (gnus-uu-unshar-article): * lisp/international/mule.el (load-with-code-conversion): * lisp/mh-e/mh-xface.el (mh-x-image-url-fetch-image): * lisp/net/imap.el (imap-open): * lisp/net/mailcap.el (mailcap-maybe-eval): * lisp/progmodes/flymake-proc.el (flymake-proc--read-file-to-temp-buffer) (flymake-proc--copy-buffer-to-temp-buffer): Simplify. * lisp/subr.el (generate-new-buffer): Forward new optional argument to inhibit buffer hooks to get-buffer-create. (with-temp-file, with-temp-buffer, with-output-to-string): * lisp/json.el (json-encode-string): Inhibit buffer hooks in buffer used. * src/buffer.c (run_buffer_list_update_hook): New helper function. (Fget_buffer_create): Use it. Add optional argument to set inhibit_buffer_hooks flag instead of comparing the buffer name to Vcode_conversion_workbuf_name. All callers changed. (Fmake_indirect_buffer, Frename_buffer, Fbury_buffer_internal) (record_buffer): Use run_buffer_list_update_hook. (Fkill_buffer): Document when buffer hooks are inhibited. Use run_buffer_list_update_hook. (init_buffer_once): Inhibit buffer hooks in Vprin1_to_string_buffer. (Vkill_buffer_query_functions, Vbuffer_list_update_hook): Document when hooks are inhibited. * src/buffer.h (struct buffer): Update inhibit_buffer_hooks commentary. * src/coding.h (Vcode_conversion_workbuf_name): * src/coding.c (Vcode_conversion_workbuf_name): Make static again since it is no longer needed in src/buffer.c. (code_conversion_restore, code_conversion_save, syms_of_coding): Prefer boolean over integer constants. * src/fileio.c (Finsert_file_contents): Inhibit buffer hooks in " *code-converting-work*" buffer. * src/window.c (Fselect_window): Fix grammar. Mention window-selection-change-functions alongside buffer-list-update-hook. * test/src/buffer-tests.el: Fix requires. (buffer-tests-inhibit-buffer-hooks): New test.
| * Merge from origin/emacs-27Glenn Morris2020-06-071-0/+1
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 35661ef943 (origin/emacs-27) Fix typo in "(elisp) Type Keywords" 1af0e95fec Gnus nnir-summary-line-format has no effect dd366b5d3b Improve documentation of 'window-text-pixel-size' fbd49f969e * src/xdisp.c (Fwindow_text_pixel_size): Doc fix. (Bug#41... d8593fd19f Minor improvements to EDE and EIEIO manuals 3916e63f9e Have Fido mode also imitate Ido mode in ignore-case options cc35b197c7 Update package-menu-quick-help bf09106256 Improve documentation of 'sort-subr' 73749efa13 Update Ukrainian transliteration 30a7ee505a Fix Arabic shaping when eww/shr fill the text to be rendered 7d323f07c0 Silence some byte-compiler warnings in tests cf473e742f * test/lisp/battery-tests.el: New file. b07e3b1d97 Improve format-spec documentation (bug#41571) # Conflicts: # test/lisp/emacs-lisp/package-tests.el
| | * Silence some byte-compiler warnings in testsBasil L. Contovounesios2020-06-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * test/lisp/emacs-lisp/cl-generic-tests.el: * test/lisp/progmodes/elisp-mode-tests.el: Declare functions referred to within macroexpansions. (xref-elisp-overloadable-no-default) (xref-elisp-overloadable-co-located-default) (xref-elisp-overloadable-separate-default): Prefix unused arguments with underscore. * test/lisp/international/ccl-tests.el: * test/lisp/wdired-tests.el: * test/lisp/emacs-lisp/package-tests.el: Declare functions used. (package-test-update-archives, package-test-signed): Use revert-buffer in place of its obsolete alias package-menu-refresh. * test/lisp/eshell/eshell-tests.el: * test/lisp/mail/footnote-tests.el: * test/src/buffer-tests.el: Require dependencies used. * test/lisp/image/exif-tests.el: Remove unneeded (require 'seq). (test-exit-direct-ascii-value): Actually perform the test. * test/lisp/progmodes/sql-tests.el (sql-test-add-existing-product): Fix typo. * test/lisp/simple-tests.el (with-shell-command-dont-erase-buffer): * test/src/data-tests.el (test-bool-vector-bv-from-hex-string) (test-bool-vector-apply-mock-op): Remove unused local variables.