1

I am new to Emacs. I am trying to access a file in the "Emacs" folder on my desktop.

I run the C-x C-f command, then type ~/Desktop/Em.

I then hit TAB, but there's no completion. Emacs says [No Match].

Could someone please explain why the file name doesn't complete? I am working on Mac OS 10.15.6.

enter image description here

9
  • 1
    Why is there a forward slash / before your ~? Try removing that and see if that helps. – 46_and_2 Aug 17 '20 at 21:41
  • 2
    The / is provided by Emacs because you are in the root directory (/). But that shouldn't prevent completion: Emacs will complete /~/whatever the same way it completes ~/whatever. – Drew Aug 17 '20 at 22:55
  • 1
    Do you see the same behavior if you start Emacs with emacs -Q (no init file)? If so, do you have a subdirectory Desktop in your home directory (~)? And do you have a file Emacs in that subdirectory? – Drew Aug 17 '20 at 22:56
  • 3
    The / at the beginning of the path is a side effect of how MacOS starts applications: when you start Emacs as an application, it doesn't get a working directory set, and defaults to the root directory. When you start it from the terminal (with or without -Q), it gets the working directory from the terminal. – jirassimok Aug 18 '20 at 0:08
  • 1
    @finite_diffidence: Please post your solution as an answer. (You can accept your own answer.) Q & A need to stand on their own, to help others. Comments can be deleted at any time. Thx. – Drew Aug 18 '20 at 18:42
0

Following from Drew's response (which also works). I found another answer that solved my issue using Emacs from the Mac launcher bar:

https://apple.stackexchange.com/questions/371888/restore-access-to-file-system-for-emacs-on-macos-catalina

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.