summaryrefslogtreecommitdiff
path: root/lisp/whitespace.el
AgeCommit message (Collapse)Author
2026-03-23; * lisp/whitespace.el (whitespace-global-modes): Grammar fix.Sean Whitton
2026-03-23Fix recent whitespace.el changesBasil L. Contovounesios
* etc/NEWS (Changes in Specialized Modes and Packages in Emacs 31.1): Announce new user option whitespace-global-mode-buffers (bug#79230). * lisp/whitespace.el (whitespace-global-modes): Improve docstring grammar. (whitespace-global-mode-buffers): Make default value match *scratch* exactly for backward compatibility. Fix custom :type. (whitespace-enable-predicate): Prefer any over seq-find.
2026-03-19New option to enable global-whitespace-mode in special-buffers (bug#79230)Ihor Radchenko
* lisp/whitespace.el (whitespace-global-mode-buffers): New custom option. (whitespace-enable-predicate): Use it. (whitespace-global-modes): Refer to the new option.
2026-01-12; whitespace-global-modes: Replace "automagically".Sean Whitton
2026-01-01; Add 2026 to copyright years.Sean Whitton
2025-08-16; Fix last change (bug#77544)Eli Zaretskii
* lisp/whitespace.el (whitespace-style): Bump :version. Doc fix. (whitespace-page-delimiter): Add :version. (whitespace-page-delimiters-mode): Doc fix.
2025-08-16whitespace-mode: New style to prettify page delimiters characters.Elías Gabriel Pérez
This new style for 'whitespace-style' displays the page delimiter characters "^L" as pretty horizontal lines. (Bug#77544) This also add a new minor mode to toggle these visualization. * lisp/whitespace.el (whitespace-style): Add page-delimiters option. (whitespace-page-delimiter): New face. (whitespace--page-delimiters-keyword): New variable. (whitespace-page-delimiters-mode): New minor mode. (whitespace-style-face-p, whitespace-color-on): Rework for display the page-delimiters.
2025-06-07Avoid whitespace-mode breaking standard-display-unicode-special-glyphsEli Zaretskii
* lisp/whitespace.el (whitespace-display-char-on): Copy from 'standard-display-table' if 'buffer-display-table' is nil. This avoids overwriting display-table customizations by features that modify 'standard-display-table' for global effects. (Bug#78522)
2025-05-04whitespace.el: Collaborate better with `combine-after-change-calls`Stefan Monnier
* lisp/whitespace.el: Remove redundant `:group` arguments. Prefer #' to quote function names. (whitespace-buffer-changed): Delete function. (whitespace-color-on): Don't touch `before-change-functions`. (whitespace--update-bob-eob): Set `whitespace-buffer-changed` here, instead. (whitespace-post-command-hook): Apply De Morgan. (whitespace--empty-at-bob-matcher, whitespace-post-command-hook) (whitespace--update-bob-eob): Use `point-min` and `point-max`.
2025-01-27; Fix byte-compilation warningsStefan Kangas
2025-01-01Update copyright year to 2025Paul Eggert
Run "TZ=UTC0 admin/update-copyright".
2024-09-21Merge from origin/emacs-30Eli Zaretskii
ecfebb5abb8 ; Always set 'emoji--insert-buffer' 35e356f958a Fix font-lock of last character before EOB under 'whitesp... 01ebe6de895 Fix 'whitespace-mode' with 'missing-newline-at-eof'
2024-09-21Fix font-lock of last character before EOB under 'whitespace-mode'Stefan Monnier
* lisp/whitespace.el (whitespace-color-on): Don't use OVERRIDE in font-lock-keywords; instead, use 'prepend' in the call to 'font-lock-add-keywords'. (Bug#73332)
2024-09-21Fix 'whitespace-mode' with 'missing-newline-at-eof'Eli Zaretskii
* lisp/whitespace.el (whitespace-post-command-hook): Refontify when point moves if 'missing-newline-at-eof' is in 'whitespace-active-style'. (Bug#73332)
2024-06-29Make whitespace.el's cleanup add missing final newlineBjörn Lindström
* lisp/whitespace.el (whitespace-cleanup-region): If cleaning up at end of file, add missing newline if indicated by 'whitespace-style'. (Bug#71499) * etc/NEWS: Announce the change in behavior.
2024-04-24Fix handling of glyph codes in whitespace.elEli Zaretskii
* lisp/whitespace.el (whitespace-display-vector-p): Support glyph codes, not just plain characters. See https://lists.gnu.org/archive/html/help-gnu-emacs/2024-04/msg00248.html for the details.
2024-01-21doc: Delete extraneous quotes around keysStefan Kangas
* lisp/allout.el (allout-outlinify-sticky): * lisp/auth-source.el (auth-sources): * lisp/buff-menu.el (Buffer-menu-delete) (Buffer-menu-delete-backwards, Buffer-menu-save) (Buffer-menu-execute, Buffer-menu-select): * lisp/calendar/todo-mode.el (todo-show) (todo-show-categories-table, todo-top-priorities-overrides): * lisp/desktop.el (desktop-save-mode): * lisp/dired-aux.el (dired-do-kill-lines, dired-do-copy): * lisp/edmacro.el (edit-kbd-macro): * lisp/emulation/viper-cmd.el (viper-ask-level): * lisp/emulation/viper-init.el (viper-expert-level): * lisp/filesets.el (filesets-add-buffer): * lisp/follow.el (follow-mode): * lisp/gnus/gnus-group.el (gnus-group-mode): * lisp/gnus/gnus-sum.el (gnus-summary-mode): * lisp/ibuffer.el (ibuffer-mode): * lisp/international/ogonek.el (ogonek-informacja) (ogonek-information): * lisp/isearch.el (search-default-mode): * lisp/macros.el (apply-macro-to-region-lines): * lisp/mail/supercite.el (sc-mail-field-query) (sc-insert-reference, sc-insert-citation): * lisp/play/decipher.el (decipher-make-checkpoint): (decipher-restore-checkpoint): * lisp/progmodes/idlw-shell.el (idlwave-shell-mode): * lisp/progmodes/idlwave.el (idlwave-store-inquired-class): * lisp/progmodes/prolog.el (prolog-mode, prolog-inferior-mode): * lisp/progmodes/sh-script.el (sh-set-shell): * lisp/progmodes/vhdl-mode.el (vhdl-compiler-alist) (vhdl-modify-date-prefix-string) (vhdl-modify-date-on-saving, vhdl-mode): * lisp/server.el (server-start): * lisp/subr.el (locate-library): * lisp/tempo.el (tempo-marks, tempo-use-tag-list): * lisp/time.el (world-clock): * lisp/vc/vc-hooks.el (vc-mode): * lisp/whitespace.el (whitespace-report-region): * lisp/windmove.el (windmove-delete-in-direction): Doc fix: Delete extraneous quotes around keys.
2024-01-02Merge from savannah/emacs-29Po Lu
dc4e6b13296 ; Update copyright years in more files 64b37776318 ; Run set-copyright from admin.el 8e1c56ae467 ; Add 2024 to copyright years # Conflicts: # doc/misc/modus-themes.org # doc/misc/texinfo.tex # etc/NEWS # etc/refcards/ru-refcard.tex # etc/themes/modus-operandi-theme.el # etc/themes/modus-themes.el # etc/themes/modus-vivendi-theme.el # lib/alloca.in.h # lib/binary-io.h # lib/c-ctype.h # lib/c-strcasecmp.c # lib/c-strncasecmp.c # lib/careadlinkat.c # lib/cloexec.c # lib/close-stream.c # lib/diffseq.h # lib/dup2.c # lib/filemode.h # lib/fpending.c # lib/fpending.h # lib/fsusage.c # lib/getgroups.c # lib/getloadavg.c # lib/gettext.h # lib/gettime.c # lib/gettimeofday.c # lib/group-member.c # lib/malloc.c # lib/md5-stream.c # lib/md5.c # lib/md5.h # lib/memmem.c # lib/memrchr.c # lib/nanosleep.c # lib/save-cwd.h # lib/sha1.c # lib/sig2str.c # lib/stdlib.in.h # lib/strtoimax.c # lib/strtol.c # lib/strtoll.c # lib/time_r.c # lib/xalloc-oversized.h # lisp/auth-source-pass.el # lisp/emacs-lisp/lisp-mnt.el # lisp/emacs-lisp/timer.el # lisp/info-look.el # lisp/jit-lock.el # lisp/loadhist.el # lisp/mail/rmail.el # lisp/net/ntlm.el # lisp/net/webjump.el # lisp/progmodes/asm-mode.el # lisp/progmodes/project.el # lisp/progmodes/sh-script.el # lisp/textmodes/flyspell.el # lisp/textmodes/reftex-toc.el # lisp/textmodes/reftex.el # lisp/textmodes/tex-mode.el # lisp/url/url-gw.el # m4/alloca.m4 # m4/clock_time.m4 # m4/d-type.m4 # m4/dirent_h.m4 # m4/dup2.m4 # m4/euidaccess.m4 # m4/fchmodat.m4 # m4/filemode.m4 # m4/fsusage.m4 # m4/getgroups.m4 # m4/getloadavg.m4 # m4/getrandom.m4 # m4/gettime.m4 # m4/gettimeofday.m4 # m4/gnulib-common.m4 # m4/group-member.m4 # m4/inttypes.m4 # m4/malloc.m4 # m4/manywarnings.m4 # m4/mempcpy.m4 # m4/memrchr.m4 # m4/mkostemp.m4 # m4/mktime.m4 # m4/nproc.m4 # m4/nstrftime.m4 # m4/pathmax.m4 # m4/pipe2.m4 # m4/pselect.m4 # m4/pthread_sigmask.m4 # m4/readlink.m4 # m4/realloc.m4 # m4/sig2str.m4 # m4/ssize_t.m4 # m4/stat-time.m4 # m4/stddef_h.m4 # m4/stdint.m4 # m4/stdio_h.m4 # m4/stdlib_h.m4 # m4/stpcpy.m4 # m4/strnlen.m4 # m4/strtoimax.m4 # m4/strtoll.m4 # m4/time_h.m4 # m4/timegm.m4 # m4/timer_time.m4 # m4/timespec.m4 # m4/unistd_h.m4 # m4/warnings.m4 # nt/configure.bat # nt/preprep.c # test/lisp/register-tests.el
2024-01-02; Add 2024 to copyright yearsPo Lu
2023-12-30; Prefer finder keyword "text" to deprecated keyword "wp"Stefan Kangas
2023-11-23Adjust affected callers of derived-mode-p` to use the new conventionStefan Monnier
* lisp/align.el (align-rules-list): Prefer `derived-mode-p` over `provided-mode-derived-p`. (align--rule-should-run): * lisp/window.el (display-buffer-reuse-mode-window): * lisp/whitespace.el (whitespace-enable-predicate): * lisp/transient.el (transient--do-suffix-p): * lisp/so-long.el (so-long--set-auto-mode): * lisp/simple.el (command-completion-with-modes-p): * lisp/progmodes/tcl.el (tcl-current-word): * lisp/progmodes/idlwave.el (idlwave-fix-keywords): * lisp/progmodes/gdb-mi.el (gdb, gdb-locals-mode-map) (gdb-registers-mode-map, gdb-function-buffer-p): * lisp/progmodes/c-ts-mode.el (c-ts-mode--indent-style-setter) (c-ts-mode-set-style): * lisp/progmodes/bug-reference.el (bug-reference--try-setup-gnus-article): * lisp/help-fns.el (help-fns--list-local-commands): * lisp/emulation/viper.el (viper-mode) (viper-this-major-mode-requires-vi-state): * lisp/emacs-lisp/easy-mmode.el (easy-mmode--globalized-predicate-p): * lisp/dired.el (dired-hide-details-mode, dired-click-to-select-mode): * lisp/calendar/todo-mode.el (todo-reset-nondiary-marker) (todo-reset-done-string, todo-reset-comment-string): * lisp/vc/vc.el (vc-deduce-backend): Use new calling convention for `derived-mode-p` and `provided-mode-derived-p`.
2023-01-01Merge from origin/emacs-29Eli Zaretskii
cae528457c ; Add 2023 to copyright years. b394359261 Improve documentation of 'isearch-open-overlay-temporary' ab3210e709 Document 'use-package' in the 2 main manuals # Conflicts: # etc/refcards/ru-refcard.tex # lib/explicit_bzero.c # m4/explicit_bzero.m4
2023-01-01; Add 2023 to copyright years.Eli Zaretskii
2022-12-31whitespace: Use `define-globalized-minor-mode' for global modeRichard Hansen
* lisp/whitespace.el (global-whitespace-mode): Fix interoperability between `whitespace-mode' and `global-whitespace-mode' by using `define-globalized-minor-mode'. (Bug#60334) * test/lisp/whitespace-tests.el (whitespace-tests--global): Add a regression test.
2022-12-21whitespace: Avoid mutating original buffer's markers in clonesRichard Hansen
* lisp/whitespace.el (whitespace--clone): New hook function that is run after cloning a buffer that copies `whitespace-bob-marker' and `whitespace-eob-marker' and changes the copies to point to the new buffer (Bug#59618). (whitespace-color-on): Register the hook function. (whitespace-color-off): Unregister the hook function. * test/lisp/whitespace-tests.el (whitespace-tests--with-test-buffer): New macro. (whitespace-tests--check-markers): New function. (whitespace-tests--indirect-clone-breaks-base-markers) (whitespace-tests--indirect-clone-markers) (whitespace-tests--regular-clone-markers): New tests.
2022-12-19whitespace: Fix unintended change in buffer modification statusRichard Hansen
* lisp/whitespace.el (whitespace--empty-at-bob-matcher) whitespace--empty-at-eob-matcher, whitespace--update-bob-eob): Silently add the `font-lock-multiline' text property when highlighting beginning-of-buffer and end-of-buffer empty lines to prevent Emacs from running modification hooks or considering the buffer to be modified (Bug#60066). * test/lisp/whitespace-tests.el (whitespace-tests--empty-bob-eob-modified): Add a regression test.
2022-11-21; Fix typos (misspelled symbols)Stefan Kangas
2022-11-01Merge from origin/emacs-28Stefan Kangas
1862df834c ; * src/search.c (Fmatch_data): Doc fix. 15fc5225b1 ; * lisp/whitespace.el (whitespace-trailing): Fix a typo. 9f3c896f7c ; * doc/emacs/text.texi (Quotation Marks): Typo fix. (Bug... # Conflicts: # src/search.c
2022-10-29; * lisp/whitespace.el (whitespace-trailing): Fix a typo.Eli Zaretskii
2022-10-28Merge from origin/emacs-28Stefan Kangas
510020d30d ; Improve doc strings in whitespace.el # Conflicts: # lisp/whitespace.el
2022-10-27; Improve doc strings in whitespace.elEli Zaretskii
* lisp/whitespace.el (whitespace-hspace-regexp) (whitespace-space-regexp, whitespace-tab-regexp) (whitespace-trailing-regexp, whitespace-space-before-tab-regexp) (whitespace-indentation-regexp, whitespace-empty-at-bob-regexp) (whitespace-empty-at-eob-regexp) (whitespace-space-after-tab-regexp) (whitespace-big-indent-regexp, whitespace-line-column) (whitespace-display-mappings, whitespace-global-modes) (whitespace-action, whitespace-style, whitespace-space) (whitespace-hspace, whitespace-tab, whitespace-trailing) (whitespace-space-before-tab, whitespace-indentation) (whitespace-big-indent, whitespace-empty) (whitespace-space-after-tab): Doc fixes.
2022-09-26Fix whitespace-mode in read-only buffersLars Ingebrigtsen
* lisp/whitespace.el (whitespace--update-bob-eob): Don't bug out in read-only buffers (bug#58082).
2022-09-11whitespace: Redo BoB/EoB empty line highlightingRichard Hansen
* lisp/whitespace.el (whitespace--empty-at-bob-matcher, whitespace--empty-at-eob-matcher, whitespace--update-bob-eob, whitespace-color-off, whitespace-color-on, whitespace-empty-at-bob-regexp, whitespace-empty-at-eob-regexp, whitespace-looking-back, whitespace-post-command-hook): Redo the `empty' line highlighting logic to ensure that a buffer change causes all affected `empty' lines to become (un)highlighted (bug#37467). Also, for improved UX, don't highlight BoB empty lines at or below point (not just when point is at 1), or EoB empty lines at or above point (not just when point is `eobp'). (whitespace-bob-marker, whitespace-eob-marker): Clarify documentation. * test/lisp/whitespace-tests.el (whitespace--with-test-buffer, whitespace--fu, whitespace-tests--empty-bob, whitespace-tests--empty-eob): Add tests.
2022-09-11whitespace: Include empty final line in BoB empty matchRichard Hansen
* lisp/whitespace.el (whitespace-empty-at-bob-regexp): Include any last line trailing whitespace in the BoB empty line match to ensure that those characters get highlighted.
2022-09-11whitespace: Reset `whitespace-buffer-changed' when refontifyingRichard Hansen
* lisp/whitespace.el (whitespace-post-command-hook): Add missing reset of `whitespace-buffer-changed' back to nil between commands.
2022-09-11; whitespace: Use `defvar-local' for buffer-local varsRichard Hansen
2022-09-11; whitespace: Delete unused `whitespace-font-lock-refontify' varRichard Hansen
2022-07-15Fix whitespace-mode display table restoration logicLars Ingebrigtsen
* lisp/whitespace.el (whitespace-display-char-on): Fix the saving logic -- `whitespace-mode' is on by this point (bug#48583).
2022-07-02; Fix typos.Mattias Engdegård
2022-06-20whitespace: Redraw if indentation or line length changesRichard Hansen
* lisp/whitespace.el (whitespace-color-on): Convert the indentation matcher from a static regular expression to a function so that changes to `indent-tabs-mode' and `tab-width' are picked up the next time `font-lock-flush' runs. (whitespace--indentation-matcher): The new function matcher. (whitespace--variable-watcher): New variable watcher that calls `font-lock-flush' if `whitespace-mode' is enabled for the buffer. (whitespace--watched-vars): List of variables to watch. (whitespace-unload-function): Un-watch the variables. (bug#56103).
2022-06-15whitespace.el: New whitespace style `lines-char'Miha Rihtaršič
* lisp/whitespace.el (whitespace-style): (whitespace-style-value-list): (whitespace-toggle-option-alist): (global-whitespace-toggle-options): (whitespace-help-text): (whitespace-interactive-char): (whitespace-style-face-p): (whitespace-color-on): (whitespace-lines-regexp): New whitespace style `lines-char', which highlights only the first character over the whitespace-line-column limit (bug#55980).
2022-06-12Merge from origin/emacs-28Stefan Kangas
cbd2c87a5d ; Fix last change in whitespace.el. 52ad2b53cb Fix doc strings in whitespace.el
2022-06-11; Fix last change in whitespace.el.Eli Zaretskii
2022-06-11Fix doc strings in whitespace.elEli Zaretskii
* lisp/whitespace.el (whitespace-style, whitespace-action): Untabify the doc strings. (Bug#55904)
2022-01-01Merge from origin/emacs-28Eli Zaretskii
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
2022-01-01; Add 2022 to copyright years.Eli Zaretskii
2021-10-21Remove redundant #' before lambdaStefan Kangas
* admin/unidata/unidata-gen.el (unidata-gen-table) (unidata-gen-table-symbol, unidata-gen-table-integer) (unidata-gen-table-numeric, unidata-gen-table-word-list) (unidata-describe-decomposition): * lisp/apropos.el (apropos-user-option): * lisp/bookmark.el (bookmark-bmenu-search): * lisp/composite.el (unicode-category-table): * lisp/elec-pair.el (electric-pair--balance-info): * lisp/electric.el (electric-quote-chars): * lisp/emulation/cua-base.el (cua-rectangle-mark-key): * lisp/epa-hook.el (epa-file-encrypt-to): * lisp/faces.el (face-font-selection-order) (face-font-family-alternatives, face-font-registry-alternatives) (face-valid-attribute-values, tty-run-terminal-initialization): * lisp/files.el (recover-file, file-expand-wildcards): * lisp/frame.el (frames-on-display-list): * lisp/help-at-pt.el (help-at-pt-display-when-idle): * lisp/help-fns.el (help-fns--face-attributes): * lisp/ido.el (ido-mode, ido-unc-hosts): * lisp/isearch.el (isearch-highlight-regexp) (isearch-highlight-lines-matching-regexp): * lisp/language/indian.el (script-regexp-alist): * lisp/language/lao.el: * lisp/leim/quail/ipa.el (ipa-x-sampa-prepend-to-keymap-entry): * lisp/mh-e/mh-folder.el (mh-process-commands): * lisp/mh-e/mh-mime.el (mh-display-with-external-viewer): * lisp/ps-mule.el (ps-mule-end-job): * lisp/ps-print.el (ps-color-scale, ps-background-pages) (ps-background-text, ps-background-image, ps-background) (ps-begin-job, ps-print-translation-table): * lisp/recentf.el (recentf-sort-ascending) (recentf-sort-descending, recentf-sort-basenames-ascending) (recentf-sort-basenames-descending) (recentf-sort-directories-ascending) (recentf-sort-directories-descending): * lisp/replace.el (occur-engine-add-prefix): * lisp/select.el (xselect--encode-string): * lisp/server.el (server-use-tcp): * lisp/ses.el (ses-sort-column): * lisp/sort.el (sort-columns): * lisp/term/ns-win.el (window-system-initialization): * lisp/tree-widget.el (tree-widget-image-formats): * lisp/whitespace.el (whitespace-report-region): Remove redundant #' before lambda.
2021-09-26; Fix some recent fixes to doc stringsEli Zaretskii
* lisp/whitespace.el (whitespace-empty-at-bob-regexp): * lisp/vc/vc-dir.el (vc-dir-child-files-and-states): * lisp/vc/vc-annotate.el (vc-annotate-show-changeset-diff-revision-at-line): * lisp/vc/ediff.el (ediff-merge-with-ancestor-command): * lisp/gnus/nnvirtual.el (nnvirtual-update-xref-header) (nnvirtual-map-article): * lisp/emulation/viper-init.el (viper-ESC-keyseq-timeout): * lisp/emulation/viper-cmd.el (viper-set-parsing-style-toggling-macro): * lisp/cedet/data-debug.el (data-debug-insert-hash-table-button): "The first line of a doc string must be a complete sentence." Also, fix some awkward wording in doc strings while at that.
2021-09-26; Adjust overly long docstrings to fit 80 charactersStefan Kangas
2021-09-23;* lisp/whitespace.el (whitespace-display-window): Add doc-string.Martin Rudalics