.emacs-defs
author Oleksandr Gavenko <gavenkoa@gmail.com>
Thu, 21 Sep 2017 15:09:27 +0300
changeset 1537 592689d6d222
parent 1285 8e2c4332223d
child 1669 33d096a97345
permissions -rw-r--r--
Some symbols from default composition rules cause Emacs redisplay hang on Windows.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1284
0e25700290c4 Simplify expression.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1278
diff changeset
     1
;; -*- mode: emacs-lisp; coding: utf-8; fill-column: 78; no-byte-compile: t; -*-
1241
4f22d9fe2e5b Byte compile '.emacs-my' and 'my/*.el'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     2
4f22d9fe2e5b Byte compile '.emacs-my' and 'my/*.el'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     3
(defvar my-usr-lisp-dir
4f22d9fe2e5b Byte compile '.emacs-my' and 'my/*.el'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     4
  (expand-file-name "~/usr/share/emacs/site-lisp")
4f22d9fe2e5b Byte compile '.emacs-my' and 'my/*.el'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     5
  "Here live additional lisp packages.")
4f22d9fe2e5b Byte compile '.emacs-my' and 'my/*.el'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     6
4f22d9fe2e5b Byte compile '.emacs-my' and 'my/*.el'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     7
(unless (boundp 'user-emacs-directory)
4f22d9fe2e5b Byte compile '.emacs-my' and 'my/*.el'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     8
  (setq user-emacs-directory "~/.emacs.d/"))
4f22d9fe2e5b Byte compile '.emacs-my' and 'my/*.el'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     9
4f22d9fe2e5b Byte compile '.emacs-my' and 'my/*.el'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    10
(defvar my-lisp-dir
4f22d9fe2e5b Byte compile '.emacs-my' and 'my/*.el'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    11
  (expand-file-name (concat user-emacs-directory "my/"))
4f22d9fe2e5b Byte compile '.emacs-my' and 'my/*.el'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    12
  "Here live my lisp packages.")
4f22d9fe2e5b Byte compile '.emacs-my' and 'my/*.el'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    13
(add-to-list 'load-path my-lisp-dir)
4f22d9fe2e5b Byte compile '.emacs-my' and 'my/*.el'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    14
4f22d9fe2e5b Byte compile '.emacs-my' and 'my/*.el'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    15
(defvar my-lisp-autoload (concat my-lisp-dir "loaddefs.el")
4f22d9fe2e5b Byte compile '.emacs-my' and 'my/*.el'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    16
  "Path to autoload for mode files.")
4f22d9fe2e5b Byte compile '.emacs-my' and 'my/*.el'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    17
(defvar my-lisp-auth (concat user-emacs-directory ".emacs-auth")
4f22d9fe2e5b Byte compile '.emacs-my' and 'my/*.el'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    18
  "Path to auth info for Emacs.")
4f22d9fe2e5b Byte compile '.emacs-my' and 'my/*.el'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    19
(defvar my-lisp-autogen (concat user-emacs-directory ".emacs-autogen")
4f22d9fe2e5b Byte compile '.emacs-my' and 'my/*.el'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    20
  "Path to automatically generated config file. It content depend on
4f22d9fe2e5b Byte compile '.emacs-my' and 'my/*.el'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    21
  installation environment and it was overridden on install.")
4f22d9fe2e5b Byte compile '.emacs-my' and 'my/*.el'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    22
(defvar my-lisp-pre (concat user-emacs-directory ".emacs-pre")
4f22d9fe2e5b Byte compile '.emacs-my' and 'my/*.el'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    23
  "Path to file with pre-settings. Intended for local modifications.")
4f22d9fe2e5b Byte compile '.emacs-my' and 'my/*.el'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    24
(defvar my-lisp-dotemacs (concat user-emacs-directory ".emacs-my")
4f22d9fe2e5b Byte compile '.emacs-my' and 'my/*.el'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    25
  "Path to file with settings. Overwritten on install.")
4f22d9fe2e5b Byte compile '.emacs-my' and 'my/*.el'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    26
(defvar my-lisp-post (concat user-emacs-directory ".emacs-post")
4f22d9fe2e5b Byte compile '.emacs-my' and 'my/*.el'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    27
  "Path to file with post-settings. Intended for local modifications.")
4f22d9fe2e5b Byte compile '.emacs-my' and 'my/*.el'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    28
4f22d9fe2e5b Byte compile '.emacs-my' and 'my/*.el'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    29
(setq custom-file (concat user-emacs-directory ".emacs-custom"))
4f22d9fe2e5b Byte compile '.emacs-my' and 'my/*.el'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    30
(setq save-place-file (concat user-emacs-directory ".emacs-places"))
1285
8e2c4332223d Use newer recommended place for bookmarks.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1284
diff changeset
    31
(setq bookmark-default-file (concat user-emacs-directory "bookmarks"))
1241
4f22d9fe2e5b Byte compile '.emacs-my' and 'my/*.el'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    32
(setq ido-save-directory-list-file (concat user-emacs-directory ".ido.last"))
4f22d9fe2e5b Byte compile '.emacs-my' and 'my/*.el'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    33
4f22d9fe2e5b Byte compile '.emacs-my' and 'my/*.el'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    34
(defun my-load.add-my-loadpaths ()
4f22d9fe2e5b Byte compile '.emacs-my' and 'my/*.el'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    35
  (when (file-directory-p my-usr-lisp-dir)
4f22d9fe2e5b Byte compile '.emacs-my' and 'my/*.el'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    36
    (add-to-list 'load-path my-usr-lisp-dir)
4f22d9fe2e5b Byte compile '.emacs-my' and 'my/*.el'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    37
    (let ((default-directory my-usr-lisp-dir))
4f22d9fe2e5b Byte compile '.emacs-my' and 'my/*.el'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    38
      (normal-top-level-add-subdirs-to-load-path))))
4f22d9fe2e5b Byte compile '.emacs-my' and 'my/*.el'.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    39
1254
19c7b3be9b3a Define special macro to avoid warning about "assignment to free variable".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1241
diff changeset
    40
(defmacro my--eval-after-load (feature &rest forms)
1278
8e47e801be9d Remove qouting from 'my--eval-after-load' macro usage because that code doesn't evaluated.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1254
diff changeset
    41
  (declare (indent defun))
1254
19c7b3be9b3a Define special macro to avoid warning about "assignment to free variable".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1241
diff changeset
    42
  `(,(if (or (not (boundp 'byte-compile-current-file))
19c7b3be9b3a Define special macro to avoid warning about "assignment to free variable".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1241
diff changeset
    43
             (not byte-compile-current-file)
19c7b3be9b3a Define special macro to avoid warning about "assignment to free variable".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1241
diff changeset
    44
             (if (symbolp feature)
19c7b3be9b3a Define special macro to avoid warning about "assignment to free variable".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1241
diff changeset
    45
                 (require feature nil :no-error)
19c7b3be9b3a Define special macro to avoid warning about "assignment to free variable".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1241
diff changeset
    46
               (load feature :no-message :no-error)))
19c7b3be9b3a Define special macro to avoid warning about "assignment to free variable".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1241
diff changeset
    47
         'progn
19c7b3be9b3a Define special macro to avoid warning about "assignment to free variable".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1241
diff changeset
    48
       (message "my--eval-after-load: cannot find %s" feature)
19c7b3be9b3a Define special macro to avoid warning about "assignment to free variable".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1241
diff changeset
    49
       'with-no-warnings)
19c7b3be9b3a Define special macro to avoid warning about "assignment to free variable".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1241
diff changeset
    50
    (eval-after-load ',feature
1284
0e25700290c4 Simplify expression.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1278
diff changeset
    51
      '(funcall (lambda () ,@forms)))))
1254
19c7b3be9b3a Define special macro to avoid warning about "assignment to free variable".
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1241
diff changeset
    52