Using "Emacs Configure" **and** modifying .emacs

classic Classic list List threaded Threaded
67 messages Options
1234
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Using "Emacs Configure" **and** modifying .emacs

Ronald Fischer-6
I'm using the Emacs Configure method
(Options/ConfigureEmacs/BrowseCustomizationGroups) to configure Emacs.
However, some configurations settings must be done by manually setting
the customizataion variables (at least according the FAQ) in the .emacs
file.

Now, the interactive emacs configuration **also** modifies .emacs. What
do I have to do to keep my settings and thos Emacs is writing, apart? I
don't want Emacs to override my settings, and I don't want the Emacs
configuration tool to get confused, just because my .emacs file contains
things I  have put there.

Ronald

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Using "Emacs Configure" **and** modifying .emacs

Drew Adams
> What do I have to do to keep my settings and thos Emacs is writing, apart? I
> don't want Emacs to override my settings, and I don't want the Emacs
> configuration tool to get confused, just because my .emacs file contains
> things I  have put there.

Set variable `custom-file' to a file other than your init file.
Customize will then use that for the settings it writes, instead
of using your init file.

At an appropriate point in your init file, load the value of `custom-file'.
For example:

 (setq custom-file  "/my/path/to/my-customizations.el")))
 (load-file custom-file) ; Load your customizations.

See the Emacs manual, node `Saving Customizations' for more info about
`custom-file'.

Note that even though `custom-file' is a user option, you can't easily
let Customize manage it - just set it using `setq'.

(IMHO, *everyone* should use variable `custom-file', to keep Customize
away from their init file.)

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using "Emacs Configure" **and** modifying .emacs

Óscar Fuentes
In reply to this post by Ronald Fischer-6
Ronald Fischer <[hidden email]> writes:

> I'm using the Emacs Configure method
> (Options/ConfigureEmacs/BrowseCustomizationGroups) to configure Emacs.
> However, some configurations settings must be done by manually setting
> the customizataion variables (at least according the FAQ) in the .emacs
> file.
>
> Now, the interactive emacs configuration **also** modifies .emacs. What
> do I have to do to keep my settings and thos Emacs is writing, apart? I
> don't want Emacs to override my settings, and I don't want the Emacs
> configuration tool to get confused, just because my .emacs file contains
> things I  have put there.
>
> Ronald

I don't fully understand your question, but for keeping apart the settings you
make with what you call the "Configure method":

(setq custom-file "~/my-customizations.el")
(load custom-file 't)


If you already have something like

(custom-set-variables
 ...
 )

in your .emacs, move it to the customizations file mentioned above.


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using "Emacs Configure" **and** modifying .emacs

Emanuel Berg-4
In reply to this post by Ronald Fischer-6
Ronald Fischer wrote:

> I'm using the Emacs Configure method
> (Options/ConfigureEmacs/BrowseCustomizationGroups)
> to configure Emacs. However, some
> configurations settings must be done by
> manually setting the customizataion variables
> (at least according the FAQ)

True, and the FAQ could also have told you that
doing things "manually" will enable you to do
much more than to specify certain pre-defined
settings, with a crowded and confusing
interface to juggle with in the bargain.

> Now, the interactive emacs configuration
> **also** modifies .emacs. What do I have to do
> to keep my settings and thos Emacs is writing,
> apart? I don't want Emacs to override my
> settings

Good intuition! One of many reasons not to
use Configure.

--
underground experts united
http://user.it.uu.se/~embe8573


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using "Emacs Configure" **and** modifying .emacs

Emanuel Berg-4
In reply to this post by Drew Adams
Drew Adams wrote:

> (IMHO, *everyone* should use variable
> `custom-file', to keep Customize away from
> their init file.)

(IMO, *no one* should use Customize, an even
better way to keep Customize away from their
init files.)

--
underground experts united
http://user.it.uu.se/~embe8573


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using "Emacs Configure" **and** modifying .emacs

Dan Espen
In reply to this post by Ronald Fischer-6
Drew Adams <[hidden email]> writes:

>> What do I have to do to keep my settings and thos Emacs is writing, apart? I
>> don't want Emacs to override my settings, and I don't want the Emacs
>> configuration tool to get confused, just because my .emacs file contains
>> things I  have put there.
>
> Set variable `custom-file' to a file other than your init file.
> Customize will then use that for the settings it writes, instead
> of using your init file.
>
> At an appropriate point in your init file, load the value of `custom-file'.
> For example:
>
>  (setq custom-file  "/my/path/to/my-customizations.el")))
>  (load-file custom-file) ; Load your customizations.
>
> See the Emacs manual, node `Saving Customizations' for more info about
> `custom-file'.
>
> Note that even though `custom-file' is a user option, you can't easily
> let Customize manage it - just set it using `setq'.
>
> (IMHO, *everyone* should use variable `custom-file', to keep Customize
> away from their init file.)

I'm doing fine using customize and manual changes to .emacs.

Emacs keeps all it's changes in one place in the .emacs without
any special care on my part.  So far anyway.


--
Dan Espen
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Using "Emacs Configure" **and** modifying .emacs

Drew Adams
> > (IMHO, *everyone* should use variable `custom-file', to
> > keep Customize away from their init file.)
>
> I'm doing fine using customize and manual changes to .emacs.

I guess you mean that you use Customize and make manual
changes to your init file, but you do not use `custom-file'.

> Emacs keeps all it's changes in one place in the .emacs
> without any special care on my part.  So far anyway.

Yes, it does.  And provided you make your manual changes only
in _other_ places in the file, the two of you can cohabit that
space copacetically.  Certainly doable.  Been there; done that.

But is it generally a good idea to let a program modify a file
that you also edit manually?

IMO, that's just asking for trouble, like using the same
container for cleaning fluid and fruit juice, making sure to
wash it carefully in between.  Doable.  But not worth it.

And it provides NO benefit (that I can see).  What reason is
there NOT to just point to a separate sandbox for Customize
to play with and mess around in?  Simple, one-time.  End of
story.  No?

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Using "Emacs Configure" **and** modifying .emacs

Drew Adams
> And provided you make your manual changes only in _other_
> places in the file, the two of you can cohabit that space
> copacetically.

Actually, even that is not quite correct.  If you use the
same functions Customize uses, `custom-set-variables' and
`custom-set-faces', then Customize will be only too happy
to walk all over your changes.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using "Emacs Configure" **and** modifying .emacs

Dan Espen
In reply to this post by Dan Espen
Drew Adams <[hidden email]> writes:

>> > (IMHO, *everyone* should use variable `custom-file', to
>> > keep Customize away from their init file.)
>>
>> I'm doing fine using customize and manual changes to .emacs.
>
> I guess you mean that you use Customize and make manual
> changes to your init file, but you do not use `custom-file'.
>
>> Emacs keeps all it's changes in one place in the .emacs
>> without any special care on my part.  So far anyway.
>
> Yes, it does.  And provided you make your manual changes only
> in _other_ places in the file, the two of you can cohabit that
> space copacetically.  Certainly doable.  Been there; done that.
>
> But is it generally a good idea to let a program modify a file
> that you also edit manually?

Maybe, Emacs seems to manage the situation.

> IMO, that's just asking for trouble, like using the same
> container for cleaning fluid and fruit juice, making sure to
> wash it carefully in between.  Doable.  But not worth it.
>
> And it provides NO benefit (that I can see).  What reason is
> there NOT to just point to a separate sandbox for Customize
> to play with and mess around in?  Simple, one-time.  End of
> story.  No?

The benefit is having all your customizations in one place.

No need to email me, I'm reading Usenet gnu.emacs.help.

--
Dan Espen
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using "Emacs Configure" **and** modifying .emacs

Emanuel Berg-4
Dan Espen wrote:

> No need to email me, I'm reading Usenet
> gnu.emacs.help.

Perhaps you should switch to gmane.emacs.help
as gnu.emacs.help seems not to get all messages
anymore and there is no communication as to
what have changed.

--
underground experts united
http://user.it.uu.se/~embe8573


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using "Emacs Configure" **and** modifying .emacs

Ronald Fischer-6
In reply to this post by Emanuel Berg-4
> > Now, the interactive emacs configuration
> > **also** modifies .emacs. What do I have to do
> > to keep my settings and thos Emacs is writing,
> > apart? I don't want Emacs to override my
> > settings
>
> Good intuition! One of many reasons not to
> use Configure.

... except that the FAQ explicitly suggest using Configure, when you
want to learn from it, how to customize Emacs:

https://www.gnu.org/software/emacs/manual/html_mono/efaq.html#Using-Customize

Funnily, when you search the FAQ how to do certain common
configurations, the suggestions always say that you should modify your
.emacs.... Kind of contradiciting.

Ronald

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using "Emacs Configure" **and** modifying .emacs

Dan Espen
In reply to this post by Dan Espen
Emanuel Berg <[hidden email]> writes:

> Dan Espen wrote:
>
>> No need to email me, I'm reading Usenet
>> gnu.emacs.help.
>
> Perhaps you should switch to gmane.emacs.help
> as gnu.emacs.help seems not to get all messages
> anymore and there is no communication as to
> what have changed.

Like my .emacs, gnu.emacs.help seems to be working fine.

no "gmane" on Eternal.september, I'm not ready to slow gnus
down with another server.

--
Dan Espen
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using "Emacs Configure" **and** modifying .emacs

Emanuel Berg-4
Dan Espen wrote:

> Like my .emacs, gnu.emacs.help seems to be
> working fine.

It works great for the messages there, and if
they are all or close to all, no harm.

And I have no data as to the actual
discrepancy, if any, just a hunch.

gnu.emacs.help isn't always gnu.emacs.help
either, depending on server. This is something
I noted on nntp.aioe.org.

> no "gmane" on Eternal.september, I'm not
> ready to slow gnus down with another server.

True that, Usenet is faster than Gmane and in
particular gmane.emacs.help is very slow.

I have asked why on gmane.emacs.gnus.general
but no one seems to know or if they do they
ain't telling.

--
underground experts united
http://user.it.uu.se/~embe8573


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using "Emacs Configure" **and** modifying .emacs

Emanuel Berg-4
In reply to this post by Ronald Fischer-6
Ronald Fischer wrote:

> Funnily, when you search the FAQ how to do
> certain common configurations, the
> suggestions always say that you should modify
> your .emacs.... Kind of contradiciting.

Well, what is it that you want to configure?

I would say that 98% of what people do with
Configure (that is productive, discounting
learning to figure out how to get lost in
the UI) - 98% of this can be done with

    (setq whatever some-value)

which is as simple as it gets.

--
underground experts united
http://user.it.uu.se/~embe8573


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using "Emacs Configure" **and** modifying .emacs

HASM-3
In reply to this post by Ronald Fischer-6
Emanuel Berg <[hidden email]> writes:

> I would say that 98% of what people do with
> Configure ... 98% of this can be done with
>     (setq whatever some-value)
> which is as simple as it gets.

I tend to agree with this, and have my init file(s) full of those.

However, and I forgot a bit all the details, but once I asked in the
mail list that handles one of the packages I use how to setq something
and was told to use configure instead, that was why configure was
created, and that using setqs wouldn't do it properly.

-- HASM
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using "Emacs Configure" **and** modifying .emacs

Tomas Nordin-2
In reply to this post by Emanuel Berg-4
Emanuel Berg <[hidden email]> writes:

> I would say that 98% of what people do with
> Configure (that is productive, discounting
> learning to figure out how to get lost in
> the UI) - 98% of this can be done with
>
>     (setq whatever some-value)
>
> which is as simple as it gets.

I tend to use that approach as well. But I am helped some times using
customize to browse options available in a hierarchical structure.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using "Emacs Configure" **and** modifying .emacs

notbob
In reply to this post by Emanuel Berg-4
On 2017-08-11, Tomas Nordin <[hidden email]> wrote:

> Emanuel Berg <[hidden email]> writes:

>>     (setq whatever some-value)

> I tend to use that approach as well. But I am helped some times using
> customize to browse options available in a hierarchical structure.

....and that is the problem.  What are the "some-value"?  I tried 2-3
variables until someone in this newsgroups gave me the proper value,
which at the time I was not even aware.

nb


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using "Emacs Configure" **and** modifying .emacs

Emanuel Berg-4
In reply to this post by HASM-3
HASM wrote:

> However, and I forgot a bit all the details,
> but once I asked in the mail list that
> handles one of the packages I use how to setq
> something and was told to use configure
> instead, that was why configure was created,
> and that using setqs wouldn't do it properly.

As long as you setq to a value that makes
sense, it shouldn't be a problem.

--
underground experts united
http://user.it.uu.se/~embe8573


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using "Emacs Configure" **and** modifying .emacs

Emanuel Berg-4
In reply to this post by notbob
notbob wrote:

> ....and that is the problem. What are the
> "some-value"? I tried 2-3 variables until
> someone in this newsgroups gave me the proper
> value, which at the time I was not
> even aware.

Yes, and that is a fine way of doing it!

    1) think
    2) use the help system or manual
    3) experiment
    4) ask a friend (or NG)

--
underground experts united
http://user.it.uu.se/~embe8573


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using "Emacs Configure" **and** modifying .emacs

notbob
In reply to this post by notbob
On 2017-08-11, Emanuel Berg <[hidden email]> wrote:

>     4) ask a friend (or NG)

Asking this newsgroup is not always a solution.  

I've asked the same question 5-6 yrs apart.  The first time my
question was not answered.  The second time, it was fully answered.

I have zero idea why.  ;)

nb
1234
Loading...