Re: [Q] startup hook: How do I detect if the current buffer has been opened programmatically?

2024-04-11 Thread Max Nikulin
On 09/04/2024 00:31, Rudi C wrote: I want to automatically preview all LaTeX fragments if the buffer was opened by the user Be careful and limit automatic preview to files you created yourself. Doing so for an arbitrary file downloaded from net might cause huge amount of garbage files in

Re: [Q] startup hook: How do I detect if the current buffer has been opened programmatically?

2024-04-09 Thread Rudi C
`find-file-hook` seems not to have false negatives, at least. Using `(window-live-p (get-buffer-window (current-buffer) 'visible))` has false negatives for me (i.e., it returns nil for some interactive buffers). Thanks, everyone. On Tue, Apr 9, 2024 at 11:06 PM Karthik Chikmagalur <

Re: [Q] startup hook: How do I detect if the current buffer has been opened programmatically?

2024-04-09 Thread Karthik Chikmagalur
>> Org-mode occasionally opens files automatically, for instance, when >> inserting or opening ID links, or during certain searches. I need to >> determine if a buffer was opened programmatically or manually by the user >> within the startup hooks. This distinction is important because, e.g., I >>

Re: [Q] startup hook: How do I detect if the current buffer has been opened programmatically?

2024-04-09 Thread Ihor Radchenko
Rudi C writes: > Org-mode occasionally opens files automatically, for instance, when > inserting or opening ID links, or during certain searches. I need to > determine if a buffer was opened programmatically or manually by the user > within the startup hooks. This distinction is important

[Q] startup hook: How do I detect if the current buffer has been opened programmatically?

2024-04-08 Thread Rudi C
Org-mode occasionally opens files automatically, for instance, when inserting or opening ID links, or during certain searches. I need to determine if a buffer was opened programmatically or manually by the user within the startup hooks. This distinction is important because, e.g., I want to