GNU bug report logs -
#33871
27.0.50; Revert Dired window saved in window configuration
Previous Next
Reported by: Juri Linkov <juri <at> linkov.net>
Date: Tue, 25 Dec 2018 21:43:01 UTC
Severity: minor
Found in version 27.0.50
Fixed in version 30.0.50
Done: Juri Linkov <juri <at> linkov.net>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> Ok, let's add the WINDOW argument. This means that most hooks
> will need to call 'with-selected-window' explicitly. But maybe
> there will be hooks that don't need to select a window.
(setq-default window-set-context-function
(lambda (w)
(let ((point (window-point w)))
(with-current-buffer (window-buffer w)
`((front-context-string
. ,(buffer-substring-no-properties
point (min (+ point 16) (point-max))))
(rear-context-string
. ,(buffer-substring-no-properties
point (max (- point 16) (point-min)))))))))
should suffice to make 'buffer-substring-no-properties' work. Note that
if you select the window beforehand, 'selected-window' will not return a
meaningful value in the body of the function called. This is a problem
of many "hooks" like 'mode-line-format' or 'window-configuration-hook'.
The comfort you get comes at the price of a lack of generality.
martin
This bug report was last modified 1 year and 103 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.