ctietze,
@ctietze@mastodon.social avatar

Anyone here browing SQLite files with using sqlite-mode who has a workaround for having to use `sqlite-mode-open-file'?

I want to use `sqlite-mode-open-file' when opening a .sqlite file automatically.

slackline,
@slackline@mastodon.social avatar

@ctietze Not sqlite specific but I was looking into how to do something when a particular file was opened earlier today and found this post useful...

https://emacs.stackexchange.com/questions/12396/run-command-when-opening-a-file-of-a-specific-filetype

zardoz03,

@slackline
i currently push a closure into magic-mode-alist' that does (sqlite-open-file buffer-file-name)', since it matches on first few characters/bytes rather than file extension.
@ctietze

ctietze,
@ctietze@mastodon.social avatar

@zardoz03 @slackline Didn't know about `magic-mode-alist'! That's super useful!

Works like a charm with this 1 file I have. Need to hone the matcher, probably :)

  • All
  • Subscribed
  • Moderated
  • Favorites
  • emacs
  • DreamBathrooms
  • mdbf
  • ngwrru68w68
  • magazineikmin
  • thenastyranch
  • rosin
  • khanakhh
  • osvaldo12
  • Youngstown
  • slotface
  • Durango
  • kavyap
  • InstantRegret
  • tacticalgear
  • anitta
  • ethstaker
  • provamag3
  • cisconetworking
  • tester
  • GTA5RPClips
  • cubers
  • everett
  • modclub
  • megavids
  • normalnudes
  • Leos
  • JUstTest
  • lostlight
  • All magazines