From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: sqlite3 Date: Sat, 11 Dec 2021 13:33:45 +0200 Message-ID: <83ee6jqsti.fsf@gnu.org> References: <87tufmjyai.fsf@gnus.org> <877dcil2sj.fsf@ericabrahamsen.net> <87czm98qi1.fsf@gnu.org> <87o85tcwm0.fsf@ericabrahamsen.net> <874k7ljwkr.fsf@gnus.org> <87fsr5cuzq.fsf@ericabrahamsen.net> <878rwx8mdn.fsf@gnu.org> <87r1aphuei.fsf@gnus.org> <837dcex6ub.fsf@gnu.org> <83a6h9tu1c.fsf@gnu.org> <83mtl7r1c5.fsf@gnu.org> <87fsqzihsb.fsf@gnus.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16504"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Dec 11 12:34:33 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mw0e9-00046n-0J for ged-emacs-devel@m.gmane-mx.org; Sat, 11 Dec 2021 12:34:33 +0100 Original-Received: from localhost ([::1]:39978 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mw0e7-0007Ry-Ev for ged-emacs-devel@m.gmane-mx.org; Sat, 11 Dec 2021 06:34:31 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:48402) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mw0dY-0006mR-G5 for emacs-devel@gnu.org; Sat, 11 Dec 2021 06:33:56 -0500 Original-Received: from [2001:470:142:3::e] (port=57552 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mw0dY-0002fH-5A; Sat, 11 Dec 2021 06:33:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=dQXp/3/V0XI/UbsI5SzV4y04/SwGNrb4OLcymsAhcz4=; b=I+y5Q16O67zW xqGS8KyctPx6WyZPB6cWBeGXe1DheK4DZrjUm3e+IcNehVT+S9c5W0xttICBp8wAoJiQ5CCPebuig mV76uR44jJl1+P1l5zu3WexLh3OruhVmbcJbnGhY5XbG9AEgOChNmrzQ2AnvZTthaW6zoayoBAWO/ Yq16fWAes/JhCKFbwhy38f7K+PMQaLjFUkpBroln1kBzkOghCZ/0Esegul291cTk6gnaCHnPKKTSJ VsPnU90jRUAmiw2EBM6KIP597k6J37mrbTQTnE6O97ogvAqGcb/NB8ti56ZNj9z6XMzAd04TZg5/F 5b0qNVgVTK3SdyW2Fkp2rg==; Original-Received: from [87.69.77.57] (port=2406 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mw0dX-0004Es-Pw; Sat, 11 Dec 2021 06:33:56 -0500 In-Reply-To: <87fsqzihsb.fsf@gnus.org> (message from Lars Ingebrigtsen on Sat, 11 Dec 2021 10:59:16 +0100) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:281673 Archived-At: > From: Lars Ingebrigtsen > Cc: emacs-devel@gnu.org > Date: Sat, 11 Dec 2021 10:59:16 +0100 > > I've added a `sqlite-mode-open-file' command, but perhaps it'd be nice > to make `C-x C-f foo.sqlite3 RET' call that automatically? Probably. But is .sqlite3 indeed the extension to use? I don't have even a single .sqlite3 file on my system here, but gobs of *.sqlite files. > `auto-mode-alist' wouldn't be appropriate, I guess, since we don't want > to load the files into Emacs... So is `file-name-handler-alist' still > the way to handle stuff like that? I thought I vaguely remembered there > being a simpler thing to handle just `find-file*' and friends, but > grepping around, I can't see anything obvious. AFAIK, all our auto-mode facilities assume we visit the file first. I won't recommend using file-name handlers for this, as it could be problematic for local files. How about reading just the few first bytes of the file and recognizing its magic signature instead?