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

Tyler
  • 21,719
  • 1
  • 52
  • 92
  • 1
    Why is there a forward slash `/` before your `~`? Try removing that and see if that helps. – Cousin Dupree Aug 17 '20 at 21:41
  • Thanks, the forward slash is put in by Emacs automatically. The screenshot works if I manually complete the path (i.e. type in ~/Desktop/Emacs) – finite_diffidence Aug 17 '20 at 21:51
  • 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
  • Emacs -Q seems to fix the issue! What is going on? Is there a way to make this default behaviour? – finite_diffidence Aug 17 '20 at 22:58
  • Ok @Drew, I managed to fix it: Seems to be a permission issue: https://apple.stackexchange.com/questions/371888/restore-access-to-file-system-for-emacs-on-macos-catalina – finite_diffidence Aug 17 '20 at 23:11
  • 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 00: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
  • 1
    Does this answer your question? [How to Restore File System Access in macOS Catalina](https://emacs.stackexchange.com/questions/53026/how-to-restore-file-system-access-in-macos-catalina) – Tyler May 17 '21 at 19:26

1 Answers1

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