bram85,
@bram85@emacs.ch avatar

This piece #elisp of makes #emacs execute certain code when opening a file with a particular name. This is useful for files that have no clear extension or mode setting.

I use it to enter yaml-mode whenever I open a .clang-format file (which I don't want to pollute with -*- magic).

https://apps.bram85.nl/git/bram/gists/src/commit/ad450efe2064441477a9f5e8bd97cf83efd00e5a/gists/find-file-hook-for-certain-filenames.el

The original code was inspired by this StackExchange post, but I found the implementation quite cumbersome so I rewrote it to make it more condense.

https://emacs.stackexchange.com/a/77480/34645

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