help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: emacsformacos: cannot access mac folders: Documents/Downloads


From: Daniel Martín
Subject: Re: emacsformacos: cannot access mac folders: Documents/Downloads
Date: Sat, 27 Mar 2021 13:20:39 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (darwin)

Uwe Brauer <oub@mat.ucm.es> writes:

>
> Not sure, if you compile from master then this problem does not occur it
> seems to be more of a emacsformacosx thing

Because of the way this protection feature works and the different ways
you can build and run an Emacs binary for macOS, the casuistic is a bit
complex.  I'll try to summarize it:

If you compile Emacs from the GNU repository on a macOS system, you have
two ways to run the program:

a) You can run "make" and then execute "src/emacs".  In this case, Emacs
will inherit the privacy permissions of your terminal.  If your terminal
does not already have permission to access personal folders, the first
time you visit something in a personal folder from Emacs you will see a
prompt "<Your terminal> would like to access files in your <Personal
folder> folder".

b) Alternatively, you can run "make install" and then double click on
the "nextstep/Emacs.app" bundle, or move it to a more permanent
directory, like /Applications.  This is already the recommended way for
developers to run the NS native port of Emacs, and the procedure is
described in detail in "nextstep/INSTALL" from the Emacs repository.
The first time Emacs needs to visit something in a personal folder it
will prompt you in a similar way as a), but in the prompt it will show
as "Emacs" making the request and not your terminal program, provided
that you executed Emacs from the graphical user interface (for example,
from Launchpad).

If you prefer to use the version packaged from emacsformacosx.org, or
similarly you installed Emacs using a popular package manager like
Homebrew, there's a crucial difference: Emacs.app/Contents/MacOS/Emacs
is *not* a binary, but a Ruby script.  Why do the packagers use a custom
launcher written in Ruby?  It's a convenience for users so that a single
download can contain Emacs binaries for all supported macOS versions.
The Ruby launcher is maintained separately at
https://github.com/caldwell/build-emacs

This extra Ruby launcher is a nuisance for granting access to personal
folders, because a prompt won't appear and you'll need to grant full
disk access to "/usr/bin/ruby" manually.  There is an open bug report in
the "build-emacs" project to improve this:
https://github.com/caldwell/build-emacs/issues/94

I'm happy to contribute this explanation to the Emacs manuals if you
want (perhaps to the FAQ?), so that users can understand why they can't
access their personal folders in Emacs without resorting to do an online
search which in most cases do not offer the full explanation.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]