* bug#22727: Managing packages writes the user init file
@ 2016-02-18 0:49 Angelo Graziosi
2016-02-18 16:48 ` Eli Zaretskii
0 siblings, 1 reply; 7+ messages in thread
From: Angelo Graziosi @ 2016-02-18 0:49 UTC (permalink / raw)
To: 22727
I have noticed that just using
Options - Manage Emacs Packages
writes my init file. For example I find these additions in my case:
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(package-selected-packages (quote (tabbar-ruler sr-speedbar))))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
I discovered this only casually..
I think this is not the right thing to do. Why an application should
write a file which belongs to the user?
Maybe there is a better way saving those additions in another file which
the use could customize, more or less as we do with the desktop file or
lock file. For example in my init.el file I have
;; Instead to save in ~/.projects.ede
(setq ede-project-placeholder-cache-file "~/.emacs.d/projects.ede")
;; Instead to save in ~/.emacs.desktop
(setq desktop-base-file-name "~/.emacs.d/desktop")
;; Instead to save in ~/.emacs.desktop.lock
(setq desktop-base-lock-name "~/.emacs.d/desktop.lock")
We could have something like this
;; Instead to save in ~/.emacs.packages_installed
(setq desktop-base-lock-name "~/.emacs.d/packages_installed")
This would be very useful.. :)
TIA,
Angelo.
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#22727: Managing packages writes the user init file
2016-02-18 0:49 bug#22727: Managing packages writes the user init file Angelo Graziosi
@ 2016-02-18 16:48 ` Eli Zaretskii
2016-02-18 18:49 ` Angelo Graziosi
0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2016-02-18 16:48 UTC (permalink / raw)
To: Angelo Graziosi; +Cc: 22727
> From: Angelo Graziosi <angelo.graziosi@alice.it>
> Date: Thu, 18 Feb 2016 01:49:36 +0100
>
> I have noticed that just using
>
> Options - Manage Emacs Packages
>
> writes my init file. For example I find these additions in my case:
>
> (custom-set-variables
> ;; custom-set-variables was added by Custom.
> ;; If you edit it by hand, you could mess it up, so be careful.
> ;; Your init file should contain only one such instance.
> ;; If there is more than one, they won't work right.
> '(package-selected-packages (quote (tabbar-ruler sr-speedbar))))
> (custom-set-faces
> ;; custom-set-faces was added by Custom.
> ;; If you edit it by hand, you could mess it up, so be careful.
> ;; Your init file should contain only one such instance.
> ;; If there is more than one, they won't work right.
> )
>
> I discovered this only casually..
>
> I think this is not the right thing to do. Why an application should write a file which belongs to the user?
This is how Custom behaves since ages ago: when you save
customizations, it writes such forms into your ~/.emacs. The use case
with package managing is therefore not special in any way; rather, you
are proposing to divert the customizations made by Custom to a
separate file. We already have an option to do that, named
'custom-file'; see the node "Saving Customizations" in the Emacs User
Manual. Is that option sufficient to solve your problem in this bug
report? If not, can you tell why not?
It is possible that your objection is somehow limited to what
package.el does, but, as written, it describes a much more broad class
of functionalities, and is not specific to package.el.
For the record, the reason why customizations are by default saved in
~/.emacs is that originally the idea was to teach users how to use
Lisp for customizing Emacs, so that users could progressively migrate
from using Custom to writing their own Lisp, as they gain proficiency.
I don't think we've abandoned this idea, even though I'm not sure it
is working as planned.
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#22727: Managing packages writes the user init file
2016-02-18 16:48 ` Eli Zaretskii
@ 2016-02-18 18:49 ` Angelo Graziosi
2016-02-18 20:29 ` Eli Zaretskii
0 siblings, 1 reply; 7+ messages in thread
From: Angelo Graziosi @ 2016-02-18 18:49 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 22727, johnw
I opened this bug report because John asked me:
http://lists.gnu.org/archive/html/emacs-devel/2016-02/msg00989.html
The problem here is NOT that when one customizes something this is saved
in the init file but that also when one does not customize anything, the
init file is changed, more or less silently. For example clicking
Options -Manage Emacs packages.
Emacs did not exhibit this behavior some time ago (an year? two?)
Maybe you have to reread the full thread starting here:
http://lists.gnu.org/archive/html/emacs-devel/2016-02/msg00958.html
If you think is right that an application changes the user init file,
more or less silently, you can close this bug.
Angelo
Il 18/02/2016 17:48, Eli Zaretskii ha scritto:
>> From: Angelo Graziosi <angelo.graziosi@alice.it>
>> Date: Thu, 18 Feb 2016 01:49:36 +0100
>>
>> I have noticed that just using
>>
>> Options - Manage Emacs Packages
>>
>> writes my init file. For example I find these additions in my case:
>>
>> (custom-set-variables
>> ;; custom-set-variables was added by Custom.
>> ;; If you edit it by hand, you could mess it up, so be careful.
>> ;; Your init file should contain only one such instance.
>> ;; If there is more than one, they won't work right.
>> '(package-selected-packages (quote (tabbar-ruler sr-speedbar))))
>> (custom-set-faces
>> ;; custom-set-faces was added by Custom.
>> ;; If you edit it by hand, you could mess it up, so be careful.
>> ;; Your init file should contain only one such instance.
>> ;; If there is more than one, they won't work right.
>> )
>>
>> I discovered this only casually..
>>
>> I think this is not the right thing to do. Why an application should write a file which belongs to the user?
>
> This is how Custom behaves since ages ago: when you save
> customizations, it writes such forms into your ~/.emacs. The use case
> with package managing is therefore not special in any way; rather, you
> are proposing to divert the customizations made by Custom to a
> separate file. We already have an option to do that, named
> 'custom-file'; see the node "Saving Customizations" in the Emacs User
> Manual. Is that option sufficient to solve your problem in this bug
> report? If not, can you tell why not?
>
> It is possible that your objection is somehow limited to what
> package.el does, but, as written, it describes a much more broad class
> of functionalities, and is not specific to package.el.
>
> For the record, the reason why customizations are by default saved in
> ~/.emacs is that originally the idea was to teach users how to use
> Lisp for customizing Emacs, so that users could progressively migrate
> from using Custom to writing their own Lisp, as they gain proficiency.
> I don't think we've abandoned this idea, even though I'm not sure it
> is working as planned.
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#22727: Managing packages writes the user init file
2016-02-18 18:49 ` Angelo Graziosi
@ 2016-02-18 20:29 ` Eli Zaretskii
2016-02-18 22:04 ` Angelo Graziosi
0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2016-02-18 20:29 UTC (permalink / raw)
To: Angelo Graziosi; +Cc: 22727, johnw
> Cc: 22727@debbugs.gnu.org, johnw@gnu.org
> From: Angelo Graziosi <angelo.graziosi@alice.it>
> Date: Thu, 18 Feb 2016 19:49:15 +0100
>
> The problem here is NOT that when one customizes something this is saved
> in the init file but that also when one does not customize anything, the
> init file is changed, more or less silently. For example clicking
> Options -Manage Emacs packages.
If we solve this part, i.e. avoid modifying .emacs until the user
actually selects some packages to install, would that address your
concerns that triggered this bug report?
As for silent modifications: if the user accepts some options that
should remain in effect for future sessions, that's a reason good
enough to save these settings. This is what Custom does when you save
the customizations for future sessions.
Thanks.
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#22727: Managing packages writes the user init file
2016-02-18 20:29 ` Eli Zaretskii
@ 2016-02-18 22:04 ` Angelo Graziosi
2016-02-19 6:36 ` Nicolas Richard
2016-02-19 9:40 ` Eli Zaretskii
0 siblings, 2 replies; 7+ messages in thread
From: Angelo Graziosi @ 2016-02-18 22:04 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 22727, johnw
Il 18/02/2016 21:29, Eli Zaretskii ha scritto:
>> Cc: 22727@debbugs.gnu.org, johnw@gnu.org
>> From: Angelo Graziosi <angelo.graziosi@alice.it>
>> Date: Thu, 18 Feb 2016 19:49:15 +0100
>>
>> The problem here is NOT that when one customizes something this is saved
>> in the init file but that also when one does not customize anything, the
>> init file is changed, more or less silently. For example clicking
>> Options -Manage Emacs packages.
>
> If we solve this part, i.e. avoid modifying .emacs until the user
> actually selects some packages to install, would that address your
> concerns that triggered this bug report?
No.
1.
As I tried to explain, I haven't opened this report to see fixed an
issue for me. Please read:
http://lists.gnu.org/archive/html/emacs-devel/2016-02/msg00989.html
On emacs-devel there is a discussion in which others think Emacs should
not change the init file when one manages Emacs packages.
2.
Since I discovered this behavior, each time I need to manege packages (I
have some packages installed from MELPA), I save my init file and
restore it after the managing. So I never used those additions and Emacs
seems to work the same. Indeed I don't understand why installing
packages should change MY init file..
3.
Anyway, I am not an Emacs developer so it could be the case that for
some obscure (to me) reason, Emacs needs those additions/informations.
If this is true, why not use another packages configuration files? On
emacs-devel it seems that other users/developers would prefer that..
Given the nature of the addictions,
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(package-selected-packages (quote (bla bla bla))))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
why not to use a separate file also for Options - Customize Emacs? If I
understand the discussion on emacs-devel someone proposes to use
something like "customize-emacs" both for managing packages and
"Customize Emacs". This seems reasonable. Se also
http://lists.gnu.org/archive/html/bug-gnu-emacs/2016-02/msg01034.html,
where I reported a raw example how things could be from the end user POV.
In any case, I can live with current status.
4.
This thread seems to have all the prerequisites to become another of
those endless thread, so please close this bug report (who is interested
could always reopen another) or remove me from the discussion.
Thanks,
Angelo.
>
> As for silent modifications: if the user accepts some options that
> should remain in effect for future sessions, that's a reason good
> enough to save these settings. This is what Custom does when you save
> the customizations for future sessions.
>
> Thanks.
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#22727: Managing packages writes the user init file
2016-02-18 22:04 ` Angelo Graziosi
@ 2016-02-19 6:36 ` Nicolas Richard
2016-02-19 9:40 ` Eli Zaretskii
1 sibling, 0 replies; 7+ messages in thread
From: Nicolas Richard @ 2016-02-19 6:36 UTC (permalink / raw)
To: Angelo Graziosi; +Cc: 22727-done, johnw
Angelo Graziosi <angelo.graziosi@alice.it> writes:
> please close this bug report (who is
> interested could always reopen another)
done.
Note that you can do that yourself by appending -done to the bug number
in the bug address (I did just that).
Nicolas.
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#22727: Managing packages writes the user init file
2016-02-18 22:04 ` Angelo Graziosi
2016-02-19 6:36 ` Nicolas Richard
@ 2016-02-19 9:40 ` Eli Zaretskii
1 sibling, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2016-02-19 9:40 UTC (permalink / raw)
To: 22727, johnw
> Cc: 22727@debbugs.gnu.org, johnw@gnu.org
> From: Angelo Graziosi <angelo.graziosi@alice.it>
> Date: Thu, 18 Feb 2016 23:04:09 +0100
>
> > If we solve this part, i.e. avoid modifying .emacs until the user
> > actually selects some packages to install, would that address your
> > concerns that triggered this bug report?
>
> No.
>
> 1.
>
> As I tried to explain, I haven't opened this report to see fixed an
> issue for me. Please read:
> http://lists.gnu.org/archive/html/emacs-devel/2016-02/msg00989.html
Thanks, I've read that thread before writing the above.
> On emacs-devel there is a discussion in which others think Emacs should
> not change the init file when one manages Emacs packages.
I thought this bug report was supposed to be the place where the issue
is discussed. It sounds strange to me to file a bug, and then discuss
it elsewhere.
> 2.
>
> Since I discovered this behavior, each time I need to manege packages (I
> have some packages installed from MELPA), I save my init file and
> restore it after the managing. So I never used those additions and Emacs
> seems to work the same.
If the stuff written by package.el is not needed, then it should not
write it, I agree.
> Indeed I don't understand why installing packages should change MY
> init file..
Presumably because Emacs needs to know what is installed the next time
you invoke package.el.
> 3.
>
> Anyway, I am not an Emacs developer so it could be the case that for
> some obscure (to me) reason, Emacs needs those additions/informations.
> If this is true, why not use another packages configuration files? On
> emacs-devel it seems that other users/developers would prefer that..
> Given the nature of the addictions,
>
> (custom-set-variables
> ;; custom-set-variables was added by Custom.
> ;; If you edit it by hand, you could mess it up, so be careful.
> ;; Your init file should contain only one such instance.
> ;; If there is more than one, they won't work right.
> '(package-selected-packages (quote (bla bla bla))))
> (custom-set-faces
> ;; custom-set-faces was added by Custom.
> ;; If you edit it by hand, you could mess it up, so be careful.
> ;; Your init file should contain only one such instance.
> ;; If there is more than one, they won't work right.
> )
>
> why not to use a separate file also for Options - Customize Emacs?
As mentioned elsewhere, you can customize the variable custom-file to
have that.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2016-02-19 9:40 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-18 0:49 bug#22727: Managing packages writes the user init file Angelo Graziosi
2016-02-18 16:48 ` Eli Zaretskii
2016-02-18 18:49 ` Angelo Graziosi
2016-02-18 20:29 ` Eli Zaretskii
2016-02-18 22:04 ` Angelo Graziosi
2016-02-19 6:36 ` Nicolas Richard
2016-02-19 9:40 ` Eli Zaretskii
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).