unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* default.el and version control
@ 2012-08-10 16:06 drain
  0 siblings, 0 replies; 2+ messages in thread
From: drain @ 2012-08-10 16:06 UTC (permalink / raw)
  To: Help-gnu-emacs

I'd like to do one of two things, though answers to both would be useful:

(1) For Emacs to load default.el (containing basic configs), if one of my
inits fails after an experiment, i.e., when one of them produces this
message:

"Warning (initialization): An error occurred while loading
`/home/john/.emacs':"

My .emacs contains eight load commands referring to eight files collected
into one directory, .emacs.d/mylisp.

But I want default.el to be ignored otherwise. Now I've scoured the web and
I still don't understand what directory default.el must be in for the
following command to work (which I added to one of the .el inits my .emacs
is instructed to load):

'(inhibit-default-init t) 

I tried copying default.el to usr/share/emacs23/site-lisp, I added that
address to the .emacs load-path list, didn't work. default.el was not
inhibited.

I'd like the .emacs to run default.el if one of the normal inits (eight of
them collected into a directory) fail to initialize. I want to avoid
bouncing back to vanilla Emacs settings every time an init mistake is made.
In my wl-init.el this isn't a big deal, but miscellany.el and keybindings.el
contain stuff pertaining to basic functionality.

Right now I'll manually load default.el with M-x load-file under these
conditions.

(2) Even better than relying on default.el, I'd like .emacs to load version
controlled backups of these eight init files, going farther and farther back
until loading without error. They are already rerouted to a dedicated
.emacs.d/cache/backups directory with this code:

(setq make-backup-files t ;; do make backups
  backup-by-copying t ;; and copy them here
  backup-directory-alist '(("." . "~/.emacs.d/cache/backups"))
  version-control t
  kept-new-versions 2
  kept-old-versions 5
  delete-old-versions t)



--
View this message in context: http://emacs.1067599.n5.nabble.com/default-el-and-version-control-tp261133.html
Sent from the Emacs - Help mailing list archive at Nabble.com.



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: default.el and version control
       [not found] <mailman.6714.1344614784.855.help-gnu-emacs@gnu.org>
@ 2012-08-11  3:25 ` Jason Rumney
  0 siblings, 0 replies; 2+ messages in thread
From: Jason Rumney @ 2012-08-11  3:25 UTC (permalink / raw)
  To: gnu.emacs.help; +Cc: Help-gnu-emacs

On Saturday, 11 August 2012 00:06:19 UTC+8, drain  wrote:

> I'd like to do one of two things, though answers to both would be useful:
> 
> 
> 
> (1) For Emacs to load default.el (containing basic configs), if one of my
> 
> inits fails after an experiment

> But I want default.el to be ignored otherwise.

Choose a different filename such as "fallback.el". default.el is a standard file for site defaults that is always loaded (unless you specify -q or equivalent suppression options).


> Now I've scoured the web and 
> I still don't understand what directory default.el must be in for the
> following command to work (which I added to one of the .el inits my .emacs 
> is instructed to load):

> '(inhibit-default-init t) 

(setq inhibit-default-init t) should work. The above by itself is not going to do anything (but as part of a custom-set-variable it may work, depending on when the customizations are applied - I recall there may be some delay until after initialization that prevents this particular option from being effective when set by customize)

> I tried copying default.el to usr/share/emacs23/site-lisp, I added that 
> address to the .emacs load-path list, didn't work. default.el was not
> inhibited.

If it is loaded, it is in the right place.

> I'd like the .emacs to run default.el if one of the normal inits (eight of
> 
> them collected into a directory) fail to initialize. I want to avoid
> 
> bouncing back to vanilla Emacs settings every time an init mistake is made.

Try using condition-case around the section of your .emacs that loads these files to catch the error.

> (2) Even better than relying on default.el, I'd like .emacs to load version
> controlled backups of these eight init files, going farther and farther back
> until loading without error.

This is more complex, but again, it should be possible to roll a load-versioned-until-success function using condition-case.




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-08-11  3:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.6714.1344614784.855.help-gnu-emacs@gnu.org>
2012-08-11  3:25 ` default.el and version control Jason Rumney
2012-08-10 16:06 drain

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).