Subject: bug#39608: defun occur does not use a coherent value for default-directory (fix included)

From: Stéphane Boucher <[email-masked]>
Date: Tue, 3 Mar 2020 17:03:49 +0000

Defun occur only works with the current buffer.  I even provided a patch on how to fix it.

-----Original Message-----
From: Juri Linkov [mailto:[email-masked]] 
Sent: March 2, 2020 5:16 PM
To: Stéphane Boucher <[email-masked]>
Cc: [email-masked]
Subject: Re: bug#39608: defun occur does not use a coherent value for default-directory (fix included)

> When occur creates an *Occur* buffer, the default-directory variable 
> is implicitly set to the default-directory of the buffer the 
> occurences came from.
>
> When occur REUSES an existing *Occur* buffer, it does not update the 
> default-directory variable.

What default-directory do you expect in case of multi-occur that displays occurrences from multiple buffers that might be located in multiple directories?