I installed Emacs with brew

brew install emacs --with-cocoa
ln -s /usr/local/Cellar/emacs/25.3/Emacs.app /usr/local/bin/
ln -s /usr/local/Cellar/emacs/25.3/Emacs.app /Applications/

and added Homebrew's directory to the PATH in ~/.bashrc

export PATH="/usr/local/Cellar/emacs/25.3/bin:$PATH"

I can open an .md file in Emacs. But I can't change the default opening application of all .md files to Emacs.

In Finder, I right-click on one file, click "Open with", click "Other...", and scroll down to Emacs.app. If I just click Open, the computer proceeds normally. If I check the box "Always open with", then I get an error dialog box with

You can't change the item index.md to always open in the selected application. The item is either locked or damaged, or in a folder you don't have permission to modify (error code -9499).

Error dialog box after setting all .md files to open in Emacs

Similarly, I can right-click on "Get Info", change the application under "Open with" to Emacs, and I get the same error message.

The OS is macOS High Sierra Version 10.13.6. I have the same setup in my home computer running El Capitan and this procedure works fine.

How can I set all .md files to open in Emacs?

You must log in to answer this question.

Browse other questions tagged .