GNU bug report logs - #33871
27.0.50; Revert Dired window saved in window configuration

Previous Next

Package: emacs;

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


Message #107 received at 33871 <at> debbugs.gnu.org (full text, mbox):

From: martin rudalics <rudalics <at> gmx.at>
To: Juri Linkov <juri <at> linkov.net>
Cc: 33871 <at> debbugs.gnu.org
Subject: Re: bug#33871: 27.0.50; Revert Dired window saved in window
 configuration
Date: Mon, 19 Feb 2024 10:42:46 +0100
> 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.