Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Changes in emacs.el

7 views
Skip to first unread message

Cecil Westerhof

unread,
Oct 31, 2012, 7:06:15 AM10/31/12
to
I made an earlier comment about this, but I did some investigation
now.

Sometimes I get a message that .emacs is read-only. This is true,
because it is a link to an emacs.el file that is owned by root and
read-only for the user.
I get the question: do you want to write? If I say yes, it fails and
my message/article is not send. If I say no it is also not send.

I could live with it, because when I try to send it again, it
succeeds. But annoying it is.

When looking more closely I found that two things are changed.

I have a custom-set-variables section and beside changing the sequence
it adds (beside other things):
;; 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.
'(canlock-password "…")
'(delete-selection-mode nil)
'(mark-even-if-inactive t)

It also adds:
(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 do not have a custom-set-faces in the emacs.el.

Why does emacs tries to change .emacs and can I circumvebt this?

--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof

Michael Heerdegen

unread,
Oct 31, 2012, 9:45:30 AM10/31/12
to info-gnu...@gnu.org
I think you must only set `custom-file'. From the doc:

| File used for storing customization information.
| The default is nil, which means to use your init file
| as specified by `user-init-file'. If the value is not nil,
| it should be an absolute file name.


Regards,

Michael.

Cecil Westerhof

unread,
Oct 31, 2012, 1:16:32 PM10/31/12
to
Op woensdag 31 okt 2012 14:45 CET schreef Michael Heerdegen:
I now added:
(setq custom-file "~/.emacs.d/.emacs-custom.el")
(load custom-file t nil t t)

There is only one problem:
;; Your init file should contain only one such instance.

Now there will be two. I will see if this is going to give problems.


Also: why does Emacs do this? I never do anything with custom.

Michael Heerdegen

unread,
Nov 1, 2012, 3:40:42 PM11/1/12
to info-gnu...@gnu.org, Ce...@decebal.nl
Cecil Westerhof <Ce...@decebal.nl> writes:

> I now added:
> (setq custom-file "~/.emacs.d/.emacs-custom.el")
> (load custom-file t nil t t)
>
> There is only one problem:
> ;; Your init file should contain only one such instance.
>
> Now there will be two. I will see if this is going to give problems.

If you have a separate custom file, your init file can contain as much
`custom-set-variables' or `custom-set-faces' as you want, AFAIK. The
limitation only exists so that Emacs can automatically edit it and can
be sure it doesn't miss anything. If you have a separate custom file,
you can do what you want in your init file, because it's then not
subject to automatic editing.

Of course, it would be better style to avoid `custom-set-variables' in
your init file and use standard Elisp instead (I mean `setq',
`setq-default' etc.).

> Also: why does Emacs do this? I never do anything with custom.

I know that some code in vanilla Emacs or third party packages use the
customization file for storing settings. You need not use the
customization interface for this to happen. It is arguable if this is
always necessary, but I can live with it.

In your case, this was the apparently the cause:

Gnus supports Cancel Locks in News.

This means a header `Cancel-Lock' is inserted in news
posting. It is used to determine if you wrote an article or
not (for canceling and superseding). Gnus generates a random
password string the first time you post a message, and saves
it in your `~/.emacs' using the Custom system. While the
variable is called `canlock-password', it is not security
sensitive data. Publishing your canlock string on the web
will not allow anyone to be able to anything she could not
already do. The behavior can be changed by customizing
`message-insert-canlock'.



Regards,

Michael.

Cecil Westerhof

unread,
Dec 26, 2012, 6:36:31 PM12/26/12
to
Op woensdag 31 okt 2012 18:16 CET schreef Cecil Westerhof:

>>> Why does emacs tries to change .emacs and can I circumvebt this?
>>
>> I think you must only set `custom-file'. From the doc:
>>
>> | File used for storing customization information.
>> | The default is nil, which means to use your init file
>> | as specified by `user-init-file'. If the value is not nil,
>> | it should be an absolute file name.
>
> I now added:
> (setq custom-file "~/.emacs.d/.emacs-custom.el")
> (load custom-file t nil t t)

It looks like my problem is solved. I did not get the error anymore.
0 new messages