all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Enable and customize modes for Emacs. Suggest techniques.
@ 2011-08-05  9:39 Oleksandr Gavenko
  0 siblings, 0 replies; only message in thread
From: Oleksandr Gavenko @ 2011-08-05  9:39 UTC (permalink / raw)
  To: help-gnu-emacs

I use '.emacs-pre' for

   (add-to-list 'load-path "~/dir")

like things. My '.emacs' load this file before any other action.

I maintain '.emacs' under VCS but as '.emacs-pre' different
for different host it is out of the VCS.

In old days of Emacs 22.x I use:

   (add-to-list 'load-path "~/remember-2.0")
   (require 'remember)

in '.emacs-pre'. As Emacs 23.x come I put:

   (when (>= emacs-major-version 23)
     (require 'remember))

to '.emacs'.

Below (require 'remember) code I use:

(when (featurep 'remember)
   (add-to-list 'xxx-alist "xxx-conf")
   )

so firstly mode loading then customized (NOTE: add-to-list fail if
xxx-alist is not defined).

Next I think move from '.emacs-pre' all 'require' and put to
'.emacs':

   (condition-case nil
     (require 'remember)
     (file-error nil)
     )

or more shortly:

   (ignore-errors
     (require 'remember)
     )

so .emacs-pre use only for 'load-path' setup.
This code allow avoid version checks and (load/require ...)
in '.emacs-pre'.

Also I learn:

   (eval-after-load 'xxx
     '(progn
         (add-to-list 'xxx-alist "xxx-conf")
       ))

to speedup Emacs loading (NOTE: this code come
from requirement to update xxx-alist value, not to set own value).

I also use:

	for file in $(FILES_MODE_EL); do \
		cp -f $$file $(HOME)/.emacs.d/my-lisp; \
	done
	$(EMACS) --batch \
		--eval='(let ( (generated-autoload-file 
"~/.emacs.d/my-lisp/autoload-my.el") ) (update-directory-autoloads 
"~/.emacs.d/my-lisp") )'

in Makefile to setup autoloads for own modes.

Please give another tips, may be I missing something useful?




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-08-05  9:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-05  9:39 Enable and customize modes for Emacs. Suggest techniques Oleksandr Gavenko

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.