diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 1ebf84c3261..417c323be6b 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -7001,6 +7001,7 @@ Together, the argument @var{writable} and the variable @code{window-persistent-parameters} specify which window parameters are saved by this function. @xref{Window Parameters}. +@vindex window-state-normalize-buffer-name Bind @code{window-state-normalize-buffer-name} to non-@code{nil} to normalize buffer names under @file{uniquify} management by removing its prefixes and suffixes. This helps restore window buffers across Emacs diff --git a/lisp/window.el b/lisp/window.el index 0e6090a6ec1..befbc679b23 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -6308,7 +6308,7 @@ specific buffers." (defun window--state-normalize-buffer-name (buffer) "Normalize BUFFER name, accommodating `uniquify'. If BUFFER is under `uniquify' management, return its `buffer-name' with -its prefixes and suffixes removed; otherwise return BUFFER +its prefixes and suffixes removed; otherwise return BUFFER's `buffer-name'." (or (and window-state-normalize-buffer-name (fboundp 'uniquify-buffer-base-name)