emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sqlite3


From: Juri Linkov
Subject: Re: sqlite3
Date: Sun, 12 Dec 2021 10:34:47 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu)

>> I don't think we currently have a way to deal with that, but it would be
>> good to add one, because sqlite files aren't the one files which are
>> typically large and for which we want to have a specialized mode which
>> gives access to its content without loading it all upfront
>> (e.g. archive-mode could benefit from such a thing).
> ...
> So perhaps the way to make this workable, we should introduce a new
> thing that short-circuits most of the logic in...  `find-file-noselect'?
> Like a `special-file-alist' (with the same syntax as `auto-mode-alist')
> that calls out to functions to interpret the file and present us with a
> buffer in the correct mode.

Actually, `find-file-noselect' already contains what is needed,
but for directories:

  (if (file-directory-p filename)
      (or (and find-file-run-dired
               (run-hook-with-args-until-success
                'find-directory-functions
                (if find-file-visit-truename
                    (abbreviate-file-name (file-truename filename))
                  filename)))
          (error "%s is a directory" filename))

This could be adapted to files the same way by adding a new similar hook
`find-file-functions'.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]