>> Maybe you can come up with some advanced technique to do that but here I >> would have to define a variable to save the current (user provided) >> `split-window-preferred-function' and call the function I save there >> within the body of the function provided by dired. > > I'd use something like > > (lexical-let ((oldfun split-window-preferred-function)) > (let ((split-window-preferred-function > (lambda () (with-selected-window TOTO (funcall oldfun))))) > BLABLA)) We probably need something like in the attached patch but my knowledge of closures within Elisp is very limited. > The above coding should be close to "standard practice" for locally > rebinding a *-function variable. The "extra variable" doesn't matter, > it's not like we count variables. > > Maybe what you're getting at is that we should make a hook to influence > the window-choice. Maybe so. But it doesn't seem urgent. I was aiming at an extra variable to work around "advanced techniques" like closures. `lexical-let' doesn't even indent reasonably :-( martin