emacs-devel
[Top][All Lists]
Advanced

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

Proposal for 'package-isolate' command


From: Philip Kaludercic
Subject: Proposal for 'package-isolate' command
Date: Tue, 15 Aug 2023 19:52:32 +0000

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Philip Kaludercic <philipk@posteo.net>
>> Cc: emacs-devel@gnu.org
>> Date: Tue, 15 Aug 2023 16:55:03 +0000
>> 
>> +*** New command to start Emacs only with specific packages
>> +The command 'package-isolate' is equivalent to starting Emacs with the
>> +-Q flag and loading specific packages (and their dependencies)
>> +manually.
>
> Seems strange to me to have a command to start another Emacs.  Why not
> implement this as a command-line option instead?  That would be
> consistent with the several options we already have, like -q, -Q, -D,
> which already contrl what happens at startup.

Mainly because this wouldn't support a completing-read interface, that
simplifies prompting the user for a set of packages.

But perhaps the bulk of this command could be implemented as a CLI
option, that this command could wrap?

>> +        (let* ((real (package-desc-dir package))
>> +               (link (expand-file-name (file-name-nondirectory real) elpa)))
>> +          (make-symbolic-link real link t)
>
> Using symbolic links makes the program less portable, so it is best to
> avoid them.

The reason I used them here, instead of just adding the directories
under ~/.config/emacs/elpa/ is that startup.el issues a warning along
the lines of

  Your `load-path' seems to contain your `user-emacs-directory' ...

My previous patch actually included the code that suppresses all
warnings during initialisation, so I've removed this hack.

>> +    (apply #'start-process (concat "*" name "*") nil
>> +           (append (list (or (emacs-executable) "emacs")
>
> I don't think it's a good idea to invoke just "emacs", it could be a
> completely different version of Emacs.
>
>> +DEFUN ("emacs-executable", Femacs_executable, Semacs_executable, 0, 0, "",
>> +       doc: /* Return a string with the file name of the Emacs executable.
>> +If this is not known, nil will be returned instead. */)
>> +  (void)
>
> I don't understand why you need this primitive.  What's wrong with the
> usual paradigm we use everywhere else:
>
>   (expand-file-name invocation-name invocation-directory)

Because I failed to remember it.  This also appears to not have the risk
of returning nil, as my proposed command could have.  I've applies these
and related changes below:

Attachment: 0001-Add-command-to-start-Emacs-with-specific-packages.patch
Description: Text Data


reply via email to

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