all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#60066: 30.0.50; whitespace-mode modifies buffer
@ 2022-12-14 14:26 Bastian Beranek
  2022-12-14 16:14 ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: Bastian Beranek @ 2022-12-14 14:26 UTC (permalink / raw)
  To: 60066


I have

(add-hook 'c-mode-common-hook 'whitespace-mode)

in my .emacs and I am using emacs master (which includes
whitespace.el). When opening a source file in my project the buffer
immediately is marked as modified and emacs will ask to save the buffer
when trying to kill it.

I was able to trace this back to the above line in my .emacs. If I don't
enable whitespace-mode in the hook the buffer is not marked as modified
when opening the .C file.

With my configuration I would not expect whitespace-mode to make any
changes to the buffer.

I went back to whitespace.el from commit

29eb4596956a74a83ceb4c17835886a23ea0dd20

and the problem is fixed. So I assume it is a recent regression in
whitespace.el.

Thanks for your work on emacs,
Bastian


In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 3.24.35, cairo version 1.17.6) of 2022-12-04 built on inovex-bberanek
Repository revision: 3e00e50ee3d54537b8390b8d386387d01ae7553d
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101004
System Description: Arch Linux

Configured using:
 'configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib
 --localstatedir=/var --mandir=/usr/share/man --with-gameuser=:games
 --with-modules --without-libotf --without-m17n-flt --without-gconf
 --with-native-compilation=yes --with-native-compilation=aot
 --with-xinput2 --with-x-toolkit=gtk3 --without-xaw3d --with-sound=no
 --with-tree-sitter --without-gpm --without-compress-install
 '--program-transform-name=s/\([ec]tags\)/\1.emacs/'
 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions
 -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security
 -fstack-clash-protection -fcf-protection'
 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON
LCMS2 LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG
RSVG SECCOMP SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP
X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB

Important settings:
  value of $LANG: C
  locale-coding-system: nil

Major mode: ELisp/d

Minor modes in effect:
  recentf-mode: t
  whitespace-mode: t
  dap-tooltip-mode: t
  dap-ui-controls-mode: t
  dap-ui-mode: t
  gdb-many-windows: t
  dap-mode: t
  helm-fuzzier-mode: t
  async-bytecomp-package-mode: t
  projectile-mode: t
  yas-global-mode: t
  yas-minor-mode: t
  csv-field-index-mode: t
  global-diff-hl-mode: t
  diff-hl-mode: t
  conda-env-autoactivate-mode: t
  treemacs-filewatch-mode: t
  treemacs-follow-mode: t
  treemacs-git-mode: t
  treemacs-fringe-indicator-mode: t
  winum-mode: t
  smartparens-global-mode: t
  smartparens-mode: t
  company-mode: t
  global-git-commit-mode: t
  magit-auto-revert-mode: t
  auto-revert-mode: t
  server-mode: t
  flx-ido-mode: t
  ido-everywhere: t
  global-subword-mode: t
  subword-mode: t
  shell-dirtrack-mode: t
  global-hi-lock-mode: t
  hi-lock-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  prettify-symbols-mode: t
  tab-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  hs-minor-mode: t

Load-path shadows:
~/repos/dap-mode/dap-hydra hides ~/.emacs.d/lisp/dap-hydra
~/repos/dap-mode/dap-php hides /home/bberanek/.emacs.d/elpa/dap-mode-20221118.1707/dap-php
~/repos/dap-mode/dap-hydra hides /home/bberanek/.emacs.d/elpa/dap-mode-20221118.1707/dap-hydra
~/repos/dap-mode/dap-go hides /home/bberanek/.emacs.d/elpa/dap-mode-20221118.1707/dap-go
~/repos/dap-mode/dap-swi-prolog hides /home/bberanek/.emacs.d/elpa/dap-mode-20221118.1707/dap-swi-prolog
~/repos/dap-mode/dap-elixir hides /home/bberanek/.emacs.d/elpa/dap-mode-20221118.1707/dap-elixir
~/repos/dap-mode/dap-gdb-lldb hides /home/bberanek/.emacs.d/elpa/dap-mode-20221118.1707/dap-gdb-lldb
~/repos/dap-mode/dap-netcore hides /home/bberanek/.emacs.d/elpa/dap-mode-20221118.1707/dap-netcore
~/repos/dap-mode/dap-launch hides /home/bberanek/.emacs.d/elpa/dap-mode-20221118.1707/dap-launch
~/repos/dap-mode/dap-variables hides /home/bberanek/.emacs.d/elpa/dap-mode-20221118.1707/dap-variables
~/repos/dap-mode/dap-erlang hides /home/bberanek/.emacs.d/elpa/dap-mode-20221118.1707/dap-erlang
~/repos/dap-mode/dap-pwsh hides /home/bberanek/.emacs.d/elpa/dap-mode-20221118.1707/dap-pwsh
~/repos/dap-mode/dap-cpptools hides /home/bberanek/.emacs.d/elpa/dap-mode-20221118.1707/dap-cpptools
~/repos/dap-mode/dap-ruby hides /home/bberanek/.emacs.d/elpa/dap-mode-20221118.1707/dap-ruby
~/repos/dap-mode/dap-lldb hides /home/bberanek/.emacs.d/elpa/dap-mode-20221118.1707/dap-lldb
~/repos/dap-mode/dap-unity hides /home/bberanek/.emacs.d/elpa/dap-mode-20221118.1707/dap-unity
~/repos/dap-mode/dap-mouse hides /home/bberanek/.emacs.d/elpa/dap-mode-20221118.1707/dap-mouse
~/repos/dap-mode/dap-edge hides /home/bberanek/.emacs.d/elpa/dap-mode-20221118.1707/dap-edge
~/repos/dap-mode/dap-node hides /home/bberanek/.emacs.d/elpa/dap-mode-20221118.1707/dap-node
~/repos/dap-mode/dapui hides /home/bberanek/.emacs.d/elpa/dap-mode-20221118.1707/dapui
~/repos/dap-mode/dap-codelldb hides /home/bberanek/.emacs.d/elpa/dap-mode-20221118.1707/dap-codelldb
~/repos/dap-mode/dap-dlv-go hides /home/bberanek/.emacs.d/elpa/dap-mode-20221118.1707/dap-dlv-go
~/repos/dap-mode/dap-mode hides /home/bberanek/.emacs.d/elpa/dap-mode-20221118.1707/dap-mode
~/repos/dap-mode/dap-chrome hides /home/bberanek/.emacs.d/elpa/dap-mode-20221118.1707/dap-chrome
~/repos/dap-mode/dap-python hides /home/bberanek/.emacs.d/elpa/dap-mode-20221118.1707/dap-python
~/repos/dap-mode/dap-kotlin hides /home/bberanek/.emacs.d/elpa/dap-mode-20221118.1707/dap-kotlin
~/repos/dap-mode/dap-overlays hides /home/bberanek/.emacs.d/elpa/dap-mode-20221118.1707/dap-overlays
~/repos/dap-mode/dap-utils hides /home/bberanek/.emacs.d/elpa/dap-mode-20221118.1707/dap-utils
~/repos/dap-mode/dap-firefox hides /home/bberanek/.emacs.d/elpa/dap-mode-20221118.1707/dap-firefox
~/repos/dap-mode/dap-ui hides /home/bberanek/.emacs.d/elpa/dap-mode-20221118.1707/dap-ui
~/repos/lsp-treemacs/lsp-treemacs hides /home/bberanek/.emacs.d/elpa/lsp-treemacs-20221001.1958/lsp-treemacs
~/repos/lsp-treemacs/lsp-treemacs-themes hides /home/bberanek/.emacs.d/elpa/lsp-treemacs-20221001.1958/lsp-treemacs-themes
~/repos/treemacs/src/elisp/treemacs-peek-mode hides /home/bberanek/.emacs.d/elpa/treemacs-20221107.2105/treemacs-peek-mode
~/repos/treemacs/src/elisp/treemacs-faces hides /home/bberanek/.emacs.d/elpa/treemacs-20221107.2105/treemacs-faces
~/repos/treemacs/src/elisp/treemacs-follow-mode hides /home/bberanek/.emacs.d/elpa/treemacs-20221107.2105/treemacs-follow-mode
~/repos/treemacs/src/elisp/treemacs-compatibility hides /home/bberanek/.emacs.d/elpa/treemacs-20221107.2105/treemacs-compatibility
~/repos/treemacs/src/elisp/treemacs-file-management hides /home/bberanek/.emacs.d/elpa/treemacs-20221107.2105/treemacs-file-management
~/repos/treemacs/src/elisp/treemacs-core-utils hides /home/bberanek/.emacs.d/elpa/treemacs-20221107.2105/treemacs-core-utils
~/repos/treemacs/src/elisp/treemacs-tag-follow-mode hides /home/bberanek/.emacs.d/elpa/treemacs-20221107.2105/treemacs-tag-follow-mode
~/repos/treemacs/src/elisp/treemacs-diagnostics hides /home/bberanek/.emacs.d/elpa/treemacs-20221107.2105/treemacs-diagnostics
~/repos/treemacs/src/elisp/treemacs-async hides /home/bberanek/.emacs.d/elpa/treemacs-20221107.2105/treemacs-async
~/repos/treemacs/src/elisp/treemacs-icons hides /home/bberanek/.emacs.d/elpa/treemacs-20221107.2105/treemacs-icons
~/repos/treemacs/src/elisp/treemacs-extensions hides /home/bberanek/.emacs.d/elpa/treemacs-20221107.2105/treemacs-extensions
~/repos/treemacs/src/elisp/treemacs-mode hides /home/bberanek/.emacs.d/elpa/treemacs-20221107.2105/treemacs-mode
~/repos/treemacs/src/elisp/treemacs-header-line hides /home/bberanek/.emacs.d/elpa/treemacs-20221107.2105/treemacs-header-line
~/repos/treemacs/src/elisp/treemacs-mouse-interface hides /home/bberanek/.emacs.d/elpa/treemacs-20221107.2105/treemacs-mouse-interface
~/repos/treemacs/src/elisp/treemacs-macros hides /home/bberanek/.emacs.d/elpa/treemacs-20221107.2105/treemacs-macros
~/repos/treemacs/src/elisp/treemacs hides /home/bberanek/.emacs.d/elpa/treemacs-20221107.2105/treemacs
~/repos/treemacs/src/elisp/treemacs-themes hides /home/bberanek/.emacs.d/elpa/treemacs-20221107.2105/treemacs-themes
~/repos/treemacs/src/elisp/treemacs-annotations hides /home/bberanek/.emacs.d/elpa/treemacs-20221107.2105/treemacs-annotations
~/repos/treemacs/src/elisp/treemacs-tags hides /home/bberanek/.emacs.d/elpa/treemacs-20221107.2105/treemacs-tags
~/repos/treemacs/src/elisp/treemacs-visuals hides /home/bberanek/.emacs.d/elpa/treemacs-20221107.2105/treemacs-visuals
~/repos/treemacs/src/elisp/treemacs-interface hides /home/bberanek/.emacs.d/elpa/treemacs-20221107.2105/treemacs-interface
~/repos/treemacs/src/elisp/treemacs-hydras hides /home/bberanek/.emacs.d/elpa/treemacs-20221107.2105/treemacs-hydras
~/repos/treemacs/src/elisp/treemacs-customization hides /home/bberanek/.emacs.d/elpa/treemacs-20221107.2105/treemacs-customization
~/repos/treemacs/src/elisp/treemacs-rendering hides /home/bberanek/.emacs.d/elpa/treemacs-20221107.2105/treemacs-rendering
~/repos/treemacs/src/elisp/treemacs-bookmarks hides /home/bberanek/.emacs.d/elpa/treemacs-20221107.2105/treemacs-bookmarks
~/repos/treemacs/src/elisp/treemacs-filewatch-mode hides /home/bberanek/.emacs.d/elpa/treemacs-20221107.2105/treemacs-filewatch-mode
~/repos/treemacs/src/elisp/treemacs-dom hides /home/bberanek/.emacs.d/elpa/treemacs-20221107.2105/treemacs-dom
~/repos/treemacs/src/elisp/treemacs-logging hides /home/bberanek/.emacs.d/elpa/treemacs-20221107.2105/treemacs-logging
~/repos/treemacs/src/elisp/treemacs-persistence hides /home/bberanek/.emacs.d/elpa/treemacs-20221107.2105/treemacs-persistence
~/repos/treemacs/src/elisp/treemacs-scope hides /home/bberanek/.emacs.d/elpa/treemacs-20221107.2105/treemacs-scope
~/repos/treemacs/src/elisp/treemacs-workspaces hides /home/bberanek/.emacs.d/elpa/treemacs-20221107.2105/treemacs-workspaces
~/repos/treemacs/src/elisp/treemacs-fringe-indicator hides /home/bberanek/.emacs.d/elpa/treemacs-20221107.2105/treemacs-fringe-indicator
~/repos/treemacs/src/elisp/treemacs-project-follow-mode hides /home/bberanek/.emacs.d/elpa/treemacs-20221107.2105/treemacs-project-follow-mode
/home/bberanek/.emacs.d/elpa/cmake-mode-20220823.1201/cmake-mode hides /usr/share/emacs/site-lisp/cmake-mode
~/.emacs.d/lisp/buff-menu hides /usr/share/emacs/30.0.50/lisp/buff-menu
~/.emacs.d/lisp/whitespace hides /usr/share/emacs/30.0.50/lisp/whitespace
/home/bberanek/.emacs.d/elpa/transient-20221202.1727/transient hides /usr/share/emacs/30.0.50/lisp/transient

Features:
(shadow mail-extr emacsbug misearch multi-isearch vc-git recentf
ido-completing-read+ memoize minibuf-eldef whitespace company-oddmuse
company-keywords company-etags etags fileloop company-gtags
company-dabbrev-code company-dabbrev company-files company-clang
company-capf company-cmake company-semantic company-template
company-bbdb company-jedi jedi-core python-environment epc ctable
concurrent deferred tree-sitter-langs tree-sitter-langs-build tar-mode
arc-mode archive-mode tree-sitter-hl tree-sitter tree-sitter-load
tree-sitter-cli tsc tsc-dyn tsc-dyn-get dired-aux tsc-obsolete dap-mouse
dap-ui lsp-treemacs lsp-treemacs-themes gdb-mi bindat gud bui bui-list
bui-info bui-entry bui-core bui-history bui-button bui-utils lsp-lens
dap-python dap-gdb-lldb dap-utils dom xml dap-mode dap-launch posframe
dap-overlays python-black reformatter ccls ccls-member-hierarchy
ccls-inheritance-hierarchy ccls-call-hierarchy ccls-tree ccls-code-lens
ccls-semantic-highlight ccls-common lsp-ui lsp-ui-flycheck lsp-ui-doc
goto-addr lsp-ui-imenu lsp-ui-peek lsp-ui-sideline flycheck lsp-ui-util
lsp-mode lsp-protocol tree-widget spinner network-stream nsm
markdown-mode noutline outline lv cmake-project helm-fuzzier helm
helm-global-bindings helm-easymenu helm-core async-bytecomp helm-source
helm-multi-match helm-lib async projectile lisp-mnt ibuf-ext ibuffer
ibuffer-loaddefs dropdown-list yasnippet-snippets yasnippet csv-mode
sort diff-hl vc-dir ewoc vc vc-dispatcher my-term conda eshell esh-cmd
generator esh-ext esh-opt esh-proc esh-io esh-arg esh-module esh-groups
esh-util pythonic python treesit treemacs treemacs-header-line
treemacs-compatibility treemacs-mode treemacs-bookmarks
treemacs-interface treemacs-extensions treemacs-mouse-interface
treemacs-tags xref treemacs-persistence treemacs-filewatch-mode
treemacs-follow-mode treemacs-rendering treemacs-annotations
treemacs-async treemacs-workspaces treemacs-dom treemacs-visuals
treemacs-fringe-indicator treemacs-scope pulse treemacs-faces
treemacs-icons treemacs-themes treemacs-core-utils pfuture inline
hl-line ht treemacs-logging treemacs-customization treemacs-macros vterm
magit-bookmark bookmark face-remap term ehelp vterm-module term/xterm
xterm cmake-mode rst qt-pro pastebin winum calc-mouse calc-yank calc-ext
calc calc-loaddefs rect calc-macs ivy delsel ivy-faces ivy-overlay colir
smartparens company hide-lines tts-editor buff-menu+ pcase
magit-submodule magit-obsolete magit-popup magit-blame magit-stash
magit-reflog magit-bisect magit-push magit-pull magit-fetch magit-clone
magit-remote magit-commit magit-sequence magit-notes magit-worktree
magit-tag magit-merge magit-branch magit-reset magit-files magit-refs
magit-status magit magit-repos magit-apply magit-wip magit-log
which-func imenu edebug debug backtrace find-func magit-diff smerge-mode
diff diff-mode git-commit log-edit message sendmail yank-media puny
rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util
mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util
ietf-drums mail-prsvr mailabbrev mail-utils gmm-utils mailheader add-log
magit-core magit-autorevert autorevert filenotify magit-margin
magit-transient magit-process with-editor server magit-mode transient
edmacro kmacro magit-git magit-base magit-section crm compat-27
compat-26 compat compat-macs hideshow flx-ido flx ido dired-x dired
dired-loaddefs cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles
cc-align cc-engine cc-vars cc-defs flymake-proc flymake project
thingatpt cap-words superword subword vc-cvs vc-rcs log-view easy-mmode
pcvs-util finder-inf color f f-shortdoc shortdoc dash s
smart-mode-line-atom-one-dark-theme smart-mode-line advice rich-minority
my-atom-one-dark-theme tramp tramp-loaddefs trampver tramp-integration
cus-edit pp wid-edit files-x tramp-compat shell pcomplete parse-time
iso8601 time-date ls-lisp format-spec grep compile text-property-search
comint ansi-osc ansi-color ring hi-lock cus-load disp-table
counsel-autoloads edbi-autoloads winum-autoloads
cpputils-cmake-autoloads jabber-autoloads material-theme-autoloads
atom-one-dark-theme-autoloads multi-term-autoloads csv-mode-autoloads
flycheck-autoloads helm-git-autoloads helm-gtags-autoloads
undo-tree-autoloads multi-vterm-autoloads pkg-info-autoloads
company-restclient-autoloads ag-autoloads python-black-autoloads
treemacs-magit-autoloads google-autoloads qml-mode-autoloads
ccls-autoloads helm-lsp-autoloads mo-git-blame-autoloads
helm-google-autoloads 2048-game-autoloads python-pytest-autoloads
all-the-icons-autoloads tree-sitter-langs-autoloads
smartparens-autoloads ido-vertical-mode-autoloads xml-rpc-autoloads
tree-sitter-autoloads doom-themes-autoloads ibuffer-vc-autoloads
reformatter-autoloads vterm-autoloads conda-autoloads
eterm-256color-autoloads xterm-color-autoloads
multiple-cursors-autoloads xclip-autoloads helm-projectile-autoloads
fsm-autoloads evil-autoloads goto-chg-autoloads diff-hl-autoloads
elpy-autoloads persp-projectile-autoloads perspective-autoloads
go-mode-autoloads epl-autoloads debbugs-autoloads
company-terraform-autoloads terraform-mode-autoloads hcl-mode-autoloads
yaml-mode-autoloads json-reformat-autoloads pastebin-autoloads
pyvenv-autoloads ido-completing-read+-autoloads comp comp-cstr warnings
icons cl-extra help-mode memoize-autoloads package-utils-autoloads
markdown-preview-mode-autoloads web-server-autoloads srv-autoloads
disk-usage-autoloads smart-mode-line-powerline-theme-autoloads
tsc-autoloads queue-autoloads transpose-frame-autoloads babel-autoloads
pcache-autoloads helm-c-yasnippet-autoloads lsp-ui-autoloads
paredit-autoloads flymake-shellcheck-autoloads pythonic-autoloads
rainbow-delimiters-autoloads ggtags-autoloads function-args-autoloads
yasnippet-snippets-autoloads helm-company-autoloads helm-flx-autoloads
cmake-project-autoloads pkgbuild-mode-autoloads 0xc-autoloads
know-your-http-well-autoloads iedit-autoloads emms-autoloads
0x0-autoloads google-contacts-autoloads oauth2-autoloads
helm-fuzzier-autoloads auto-complete-c-headers-autoloads
edit-server-autoloads flx-ido-autoloads flx-autoloads
restclient-autoloads ein-autoloads anaphora-autoloads
graphviz-dot-mode-autoloads lua-mode-autoloads sbt-mode-autoloads
0blayout-autoloads yasnippet-autoloads swiper-autoloads ivy-autoloads
clang-format-autoloads powerline-autoloads ac-etags-autoloads
auto-complete-autoloads realgud-autoloads realgud-recursive-autoloads
load-relative-autoloads cmake-mode-autoloads immaterial-theme-autoloads
magit-popup-autoloads ibuffer-projectile-autoloads projectile-autoloads
company-jedi-autoloads jedi-core-autoloads python-environment-autoloads
epc-autoloads ctable-autoloads concurrent-autoloads deferred-autoloads
auctex-autoloads tex-site use-package-autoloads helm-ag-autoloads
restart-emacs-autoloads websocket-autoloads
highlight-indentation-autoloads helm-ack-autoloads
helm-git-grep-autoloads loc-changes-autoloads scala-mode-autoloads
lsp-java-autoloads dap-mode-autoloads lsp-docker-autoloads
yaml-autoloads lsp-treemacs-autoloads bui-autoloads request-autoloads
lsp-mode-autoloads markdown-mode-autoloads spinner-autoloads
json-mode-autoloads rx json-snatcher-autoloads bind-key-autoloads
smart-mode-line-atom-one-dark-theme-autoloads smart-mode-line-autoloads
rich-minority-autoloads helm-bibtex-autoloads helm-autoloads
popup-autoloads helm-core-autoloads async-autoloads
bibtex-completion-autoloads biblio-autoloads biblio-core-autoloads
f-autoloads parsebib-autoloads magit-svn-autoloads magit-autoloads
magit-section-autoloads git-commit-autoloads with-editor-autoloads
transient-autoloads compat-autoloads treemacs-autoloads cfrs-autoloads
posframe-autoloads ht-autoloads hydra-autoloads lv-autoloads
pfuture-autoloads ace-window-autoloads avy-autoloads s-autoloads
test-simple-autoloads polymode-autoloads window-numbering-autoloads
company-box-autoloads frame-local-autoloads company-autoloads info
dash-autoloads package browse-url url url-proxy url-privacy url-expand
url-methods url-history url-cookie generate-lisp-file url-domsuf
url-util mailcap url-handlers url-parse auth-source cl-seq eieio
eieio-core cl-macs password-cache json subr-x map byte-opt gv bytecomp
byte-compile url-vars cl-loaddefs cl-lib rmc iso-transl tooltip cconv
eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type
elisp-mode mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd
fontset image regexp-opt fringe tabulated-list replace newcomment
text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow
isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax
font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic
indonesian philippine cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs
theme-loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads dbusbind inotify lcms2
dynamic-setting system-font-setting font-render-setting cairo
move-toolbar gtk x-toolkit xinput2 x multi-tty make-network-process
native-compile emacs)

Memory information:
((conses 16 965509 352526)
 (symbols 48 59921 616)
 (strings 32 224882 40416)
 (string-bytes 1 7088505)
 (vectors 16 99164)
 (vector-slots 8 1636183 253546)
 (floats 8 442 624)
 (intervals 56 1879 908)
 (buffers 992 16))





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#60066: 30.0.50; whitespace-mode modifies buffer
  2022-12-14 14:26 bug#60066: 30.0.50; whitespace-mode modifies buffer Bastian Beranek
@ 2022-12-14 16:14 ` Eli Zaretskii
  2022-12-14 16:53   ` Bastian Beranek
  0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2022-12-14 16:14 UTC (permalink / raw)
  To: Bastian Beranek, Richard Hansen; +Cc: 60066

> From: Bastian Beranek <bastian.beischer@gmail.com>
> Date: Wed, 14 Dec 2022 15:26:03 +0100
> 
> 
> I have
> 
> (add-hook 'c-mode-common-hook 'whitespace-mode)
> 
> in my .emacs and I am using emacs master (which includes
> whitespace.el). When opening a source file in my project the buffer
> immediately is marked as modified and emacs will ask to save the buffer
> when trying to kill it.
> 
> I was able to trace this back to the above line in my .emacs. If I don't
> enable whitespace-mode in the hook the buffer is not marked as modified
> when opening the .C file.
> 
> With my configuration I would not expect whitespace-mode to make any
> changes to the buffer.
> 
> I went back to whitespace.el from commit
> 
> 29eb4596956a74a83ceb4c17835886a23ea0dd20
> 
> and the problem is fixed. So I assume it is a recent regression in
> whitespace.el.

Richard, could you please look into this?  It sounds like your recent
changes to whitespace.el could be the culprit for this regression.  I
guess something like with-silent-modifications is missing somewhere?





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#60066: 30.0.50; whitespace-mode modifies buffer
  2022-12-14 16:14 ` Eli Zaretskii
@ 2022-12-14 16:53   ` Bastian Beranek
  2022-12-14 17:02     ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: Bastian Beranek @ 2022-12-14 16:53 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 60066, Richard Hansen

On Wed, Dec 14, 2022 at 5:15 PM Eli Zaretskii <eliz@gnu.org> wrote:
>
> > From: Bastian Beranek <bastian.beischer@gmail.com>
> > Date: Wed, 14 Dec 2022 15:26:03 +0100
> >
> >
> > I have
> >
> > (add-hook 'c-mode-common-hook 'whitespace-mode)
> >
> > in my .emacs and I am using emacs master (which includes
> > whitespace.el). When opening a source file in my project the buffer
> > immediately is marked as modified and emacs will ask to save the buffer
> > when trying to kill it.
> >
> > I was able to trace this back to the above line in my .emacs. If I don't
> > enable whitespace-mode in the hook the buffer is not marked as modified
> > when opening the .C file.
> >
> > With my configuration I would not expect whitespace-mode to make any
> > changes to the buffer.
> >
> > I went back to whitespace.el from commit
> >
> > 29eb4596956a74a83ceb4c17835886a23ea0dd20
> >
> > and the problem is fixed. So I assume it is a recent regression in
> > whitespace.el.
>
> Richard, could you please look into this?  It sounds like your recent
> changes to whitespace.el could be the culprit for this regression.  I
> guess something like with-silent-modifications is missing somewhere?

It might be worth pointing out that there are no actual differences
between the buffer and its on-disk counterpart, but still emacs
considers the buffer to be modified, as if a change was made and
reverted (but not through undo).





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#60066: 30.0.50; whitespace-mode modifies buffer
  2022-12-14 16:53   ` Bastian Beranek
@ 2022-12-14 17:02     ` Eli Zaretskii
  2022-12-15  0:31       ` Michael Heerdegen
  0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2022-12-14 17:02 UTC (permalink / raw)
  To: Bastian Beranek; +Cc: 60066, rhansen

> From: Bastian Beranek <bastian.beischer@gmail.com>
> Date: Wed, 14 Dec 2022 17:53:54 +0100
> Cc: Richard Hansen <rhansen@rhansen.org>, 60066@debbugs.gnu.org
> 
> It might be worth pointing out that there are no actual differences
> between the buffer and its on-disk counterpart, but still emacs
> considers the buffer to be modified, as if a change was made and
> reverted (but not through undo).

That's most probably because whitespace.el puts text properties on
some buffer text.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#60066: 30.0.50; whitespace-mode modifies buffer
  2022-12-14 17:02     ` Eli Zaretskii
@ 2022-12-15  0:31       ` Michael Heerdegen
  2022-12-19  4:45         ` Richard Hansen
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Heerdegen @ 2022-12-15  0:31 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 60066, Bastian Beranek, rhansen

Eli Zaretskii <eliz@gnu.org> writes:

> That's most probably because whitespace.el puts text properties on
> some buffer text.

One guess would be `whitespace--update-bob-eob' where already an
`inhibit-read-only' binding had been added.

But I didn't check, it's only a guess.  There could be several places.

Michael.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#60066: 30.0.50; whitespace-mode modifies buffer
  2022-12-15  0:31       ` Michael Heerdegen
@ 2022-12-19  4:45         ` Richard Hansen
  2022-12-19 10:13           ` Bastian Beranek
  2022-12-19 13:46           ` Eli Zaretskii
  0 siblings, 2 replies; 9+ messages in thread
From: Richard Hansen @ 2022-12-19  4:45 UTC (permalink / raw)
  To: Michael Heerdegen, Eli Zaretskii; +Cc: 60066, Bastian Beranek


[-- Attachment #1.1.1: Type: text/plain, Size: 67 bytes --]

Control: tags -1 patch

The attached patch should fix this bug.

[-- Attachment #1.1.2: 0001-whitespace-Fix-unintended-change-in-buffer-modificat.patch --]
[-- Type: text/x-patch, Size: 4733 bytes --]

From e23e8e7c7c6458dcaebed8d34bcaee9f818521ce Mon Sep 17 00:00:00 2001
From: Richard Hansen <rhansen@rhansen.org>
Date: Sun, 18 Dec 2022 23:04:00 -0500
Subject: [PATCH] whitespace: Fix unintended change in buffer modification
 status

* 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.
---
 lisp/whitespace.el            | 28 ++++++++++++++++------------
 test/lisp/whitespace-tests.el | 11 +++++++++++
 2 files changed, 27 insertions(+), 12 deletions(-)

diff --git a/lisp/whitespace.el b/lisp/whitespace.el
index 2c1520ec6a..558be1841a 100644
--- a/lisp/whitespace.el
+++ b/lisp/whitespace.el
@@ -2283,10 +2283,11 @@ whitespace--empty-at-bob-matcher
                 (save-excursion (goto-char whitespace-point)
                                 (line-beginning-position)))))
     (when (= p 1)
-      ;; See the comment in `whitespace--update-bob-eob' for why this
-      ;; text property is added here.
-      (put-text-property 1 whitespace-bob-marker
-                         'font-lock-multiline t))
+      (with-silent-modifications
+        ;; See the comment in `whitespace--update-bob-eob' for why
+        ;; this text property is added here.
+        (put-text-property 1 whitespace-bob-marker
+                           'font-lock-multiline t)))
     (when (< p e)
       (set-match-data (list p e))
       (goto-char e))))
@@ -2307,10 +2308,11 @@ whitespace--empty-at-eob-matcher
 empty lines will no longer be EoB empty lines.  Highlighting
 those lines can be distracting.)"
   (when (= limit (1+ (buffer-size)))
-    ;; See the comment in `whitespace--update-bob-eob' for why this
-    ;; text property is added here.
-    (put-text-property whitespace-eob-marker limit
-                       'font-lock-multiline t))
+    (with-silent-modifications
+      ;; See the comment in `whitespace--update-bob-eob' for why this
+      ;; text property is added here.
+      (put-text-property whitespace-eob-marker limit
+                         'font-lock-multiline t)))
   (let ((b (max (point) whitespace-eob-marker
                 whitespace-bob-marker ; See comment in the bob func.
                 (save-excursion (goto-char whitespace-point)
@@ -2452,8 +2454,9 @@ whitespace--update-bob-eob
             (save-match-data
               (when (looking-at whitespace-empty-at-bob-regexp)
                 (set-marker whitespace-bob-marker (match-end 1))
-                (put-text-property (match-beginning 1) (match-end 1)
-                                   'font-lock-multiline t))))
+                (with-silent-modifications
+                  (put-text-property (match-beginning 1) (match-end 1)
+                                     'font-lock-multiline t)))))
           (when (or (null end)
                     (>= end (save-excursion
                               (goto-char whitespace-eob-marker)
@@ -2466,8 +2469,9 @@ whitespace--update-bob-eob
               (when (whitespace--looking-back
                      whitespace-empty-at-eob-regexp)
                 (set-marker whitespace-eob-marker (match-beginning 1))
-                (put-text-property (match-beginning 1) (match-end 1)
-                                   'font-lock-multiline t)))))))))
+                (with-silent-modifications
+                  (put-text-property (match-beginning 1) (match-end 1)
+                                     'font-lock-multiline t))))))))))
 
 \f
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
diff --git a/test/lisp/whitespace-tests.el b/test/lisp/whitespace-tests.el
index 330fc335ea..7079c1ea5e 100644
--- a/test/lisp/whitespace-tests.el
+++ b/test/lisp/whitespace-tests.el
@@ -334,6 +334,17 @@ whitespace-tests--empty-bob-eob-read-only-buffer
                                         "«:whitespace-empty:\n"
                                         "»")))))
 
+(ert-deftest whitespace-tests--empty-bob-eob-modified ()
+  "Regression test for Bug#60066."
+  (whitespace-tests--with-test-buffer '()
+    (insert "\nx\n\n")
+    (goto-char 2)
+    (set-buffer-modified-p nil)
+    (let ((whitespace-style '(face empty)))
+      (whitespace-mode 1)
+      (should (not (buffer-modified-p))))))
+
+
 (ert-deftest whitespace-tests--indirect-clone-breaks-base-markers ()
   "Specific regression test for Bug#59618."
   (whitespace-tests--with-test-buffer '(face empty)
-- 
2.39.0


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* bug#60066: 30.0.50; whitespace-mode modifies buffer
  2022-12-19  4:45         ` Richard Hansen
@ 2022-12-19 10:13           ` Bastian Beranek
  2022-12-19 13:46             ` Eli Zaretskii
  2022-12-19 13:46           ` Eli Zaretskii
  1 sibling, 1 reply; 9+ messages in thread
From: Bastian Beranek @ 2022-12-19 10:13 UTC (permalink / raw)
  To: Richard Hansen; +Cc: Michael Heerdegen, Eli Zaretskii, 60066

On Mon, Dec 19, 2022 at 5:45 AM Richard Hansen <rhansen@rhansen.org> wrote:
>
> Control: tags -1 patch
>
> The attached patch should fix this bug.

Thank you, this works for me.

Bastian





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#60066: 30.0.50; whitespace-mode modifies buffer
  2022-12-19 10:13           ` Bastian Beranek
@ 2022-12-19 13:46             ` Eli Zaretskii
  0 siblings, 0 replies; 9+ messages in thread
From: Eli Zaretskii @ 2022-12-19 13:46 UTC (permalink / raw)
  To: Bastian Beranek; +Cc: michael_heerdegen, 60066-done, rhansen

> From: Bastian Beranek <bastian.beischer@gmail.com>
> Date: Mon, 19 Dec 2022 11:13:34 +0100
> Cc: Michael Heerdegen <michael_heerdegen@web.de>, Eli Zaretskii <eliz@gnu.org>, 60066@debbugs.gnu.org
> 
> On Mon, Dec 19, 2022 at 5:45 AM Richard Hansen <rhansen@rhansen.org> wrote:
> >
> > Control: tags -1 patch
> >
> > The attached patch should fix this bug.
> 
> Thank you, this works for me.

Thanks for testing, I've now installed the fix on the emacs-29 branch,
and I'm closing the bug.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#60066: 30.0.50; whitespace-mode modifies buffer
  2022-12-19  4:45         ` Richard Hansen
  2022-12-19 10:13           ` Bastian Beranek
@ 2022-12-19 13:46           ` Eli Zaretskii
  1 sibling, 0 replies; 9+ messages in thread
From: Eli Zaretskii @ 2022-12-19 13:46 UTC (permalink / raw)
  To: Richard Hansen; +Cc: michael_heerdegen, 60066, bastian.beischer

> Date: Sun, 18 Dec 2022 23:45:03 -0500
> Cc: Bastian Beranek <bastian.beischer@gmail.com>, 60066@debbugs.gnu.org
> From: Richard Hansen <rhansen@rhansen.org>
> 
> The attached patch should fix this bug.

Thanks, installed.





^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-12-19 13:46 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-14 14:26 bug#60066: 30.0.50; whitespace-mode modifies buffer Bastian Beranek
2022-12-14 16:14 ` Eli Zaretskii
2022-12-14 16:53   ` Bastian Beranek
2022-12-14 17:02     ` Eli Zaretskii
2022-12-15  0:31       ` Michael Heerdegen
2022-12-19  4:45         ` Richard Hansen
2022-12-19 10:13           ` Bastian Beranek
2022-12-19 13:46             ` Eli Zaretskii
2022-12-19 13:46           ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.