[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Enable and customize modes for Emacs. Suggest techniques.

From: Oleksandr Gavenko
Subject: Enable and customize modes for Emacs. Suggest techniques.
Date: Fri, 05 Aug 2011 12:39:38 +0300
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20110624 Thunderbird/5.0

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

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

or more shortly:

    (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
        (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; \
        $(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?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]