--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/.dir-locals.el Fri Mar 13 19:26:20 2015 +0200
@@ -0,0 +1,2 @@
+((rst-mode . ((fill-column . 80)))
+ (sh-mode . ((sh-basic-offset . 2))))
--- a/.emacs Fri Mar 13 14:20:23 2015 +0200
+++ b/.emacs Fri Mar 13 19:26:20 2015 +0200
@@ -9,47 +9,9 @@
;; ======================================================================
;; Load path.
-
-(defvar my-usr-lisp-dir
- (expand-file-name "~/usr/share/emacs/site-lisp")
- "Here live additional lisp packages.")
-(when (file-directory-p my-usr-lisp-dir)
- (add-to-list 'load-path my-usr-lisp-dir)
- (let ((default-directory my-usr-lisp-dir))
- (normal-top-level-add-subdirs-to-load-path)))
-
-(unless (boundp 'user-emacs-directory)
- (setq user-emacs-directory "~/.emacs.d/"))
-
-(defvar my-lisp-dir
- (expand-file-name (concat user-emacs-directory "my/"))
- "Here live my lisp packages.")
-(add-to-list 'load-path my-lisp-dir)
-
-(setq custom-file (concat user-emacs-directory ".emacs-custom"))
-(if (file-exists-p custom-file)
- (load custom-file))
-
-(defvar my-lisp-autoload (concat my-lisp-dir "loaddefs.el")
- "Path to autoload for mode files.")
-(defvar my-lisp-auth (concat user-emacs-directory ".emacs-auth")
- "Path to auth info for Emacs.")
-(defvar my-lisp-autogen (concat user-emacs-directory ".emacs-autogen")
- "Path to automatically generated config file. It content depend on
- installation environment and it was overridden on install.")
-(defvar my-lisp-pre (concat user-emacs-directory ".emacs-pre")
- "Path to file with pre-settings. Intended for local modifications.")
-(defvar my-lisp-dotemacs (concat user-emacs-directory ".emacs-my")
- "Path to file with settings. Overwritten on install.")
-(defvar my-lisp-post (concat user-emacs-directory ".emacs-post")
- "Path to file with post-settings. Intended for local modifications.")
-
-(setq save-place-file (concat user-emacs-directory ".emacs-places"))
-(setq bookmark-default-file (concat user-emacs-directory ".emacs.bmk"))
-(setq ido-save-directory-list-file (concat user-emacs-directory ".ido.last"))
+(load "~/.emacs.d/.emacs-defs")
+(my-load.add-my-loadpaths)
(mapc
- (lambda (fname)
- (if (file-exists-p fname)
- (load fname)))
+ (lambda (fname) (load fname t))
(list custom-file my-lisp-autogen my-lisp-auth my-lisp-pre my-lisp-autoload my-lisp-dotemacs my-lisp-post))
--- a/.emacs-autogen.sh Fri Mar 13 14:20:23 2015 +0200
+++ b/.emacs-autogen.sh Fri Mar 13 19:26:20 2015 +0200
@@ -113,13 +113,28 @@
fi
}
-# Remove old auto-generated config and fill it by standard header.
-echo ";; -*- mode: emacs-lisp; coding: utf-8; fill-column: 78 -*-
+print_emacs_sources_dir() {
+ print_header
+ if [[ -d ~/devel/emacs/emacs/src ]]; then
+ echo '(setq find-function-C-source-directory "~/devel/emacs/emacs/src")'
+ else
+ ls ~/devel/emacs/src/emacs.c ~/devel/emacs/emacs*/src/emacs.c 2>/dev/null | {
+ read f
+ printf '(setq find-function-C-source-directory "%s")' ${f%emacs.c}
+ }
+ fi
+}
+
+cat >$cfg <<EOF
+;; -*- mode: emacs-lisp; coding: utf-8; fill-column: 78 -*-
;;
;; For load order see README.
-" >$cfg
+EOF
check_platform
-print_speller >>$cfg
-print_man >>$cfg
+{
+ print_speller
+ print_man
+ print_emacs_sources_dir
+} >>$cfg
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/.emacs-defs Fri Mar 13 19:26:20 2015 +0200
@@ -0,0 +1,51 @@
+;; -*- mode: emacs-lisp; coding: utf-8; fill-column: 78 -*-
+
+(defvar my-usr-lisp-dir
+ (expand-file-name "~/usr/share/emacs/site-lisp")
+ "Here live additional lisp packages.")
+
+(unless (boundp 'user-emacs-directory)
+ (setq user-emacs-directory "~/.emacs.d/"))
+
+(defvar my-lisp-dir
+ (expand-file-name (concat user-emacs-directory "my/"))
+ "Here live my lisp packages.")
+(add-to-list 'load-path my-lisp-dir)
+
+(defvar my-lisp-autoload (concat my-lisp-dir "loaddefs.el")
+ "Path to autoload for mode files.")
+(defvar my-lisp-auth (concat user-emacs-directory ".emacs-auth")
+ "Path to auth info for Emacs.")
+(defvar my-lisp-autogen (concat user-emacs-directory ".emacs-autogen")
+ "Path to automatically generated config file. It content depend on
+ installation environment and it was overridden on install.")
+(defvar my-lisp-pre (concat user-emacs-directory ".emacs-pre")
+ "Path to file with pre-settings. Intended for local modifications.")
+(defvar my-lisp-dotemacs (concat user-emacs-directory ".emacs-my")
+ "Path to file with settings. Overwritten on install.")
+(defvar my-lisp-post (concat user-emacs-directory ".emacs-post")
+ "Path to file with post-settings. Intended for local modifications.")
+
+(setq custom-file (concat user-emacs-directory ".emacs-custom"))
+(setq save-place-file (concat user-emacs-directory ".emacs-places"))
+(setq bookmark-default-file (concat user-emacs-directory ".emacs.bmk"))
+(setq ido-save-directory-list-file (concat user-emacs-directory ".ido.last"))
+
+(defun my-load.add-my-loadpaths ()
+ (when (file-directory-p my-usr-lisp-dir)
+ (add-to-list 'load-path my-usr-lisp-dir)
+ (let ((default-directory my-usr-lisp-dir))
+ (normal-top-level-add-subdirs-to-load-path))))
+
+(defmacro my--eval-after-load (feature &rest forms)
+ `(,(if (or (not (boundp 'byte-compile-current-file))
+ (not byte-compile-current-file)
+ (if (symbolp feature)
+ (require feature nil :no-error)
+ (load feature :no-message :no-error)))
+ 'progn
+ (message "my--eval-after-load: cannot find %s" feature)
+ 'with-no-warnings)
+ (eval-after-load ',feature
+ `(funcall (function ,(lambda () ,@forms))))))
+
--- a/.emacs-my Fri Mar 13 14:20:23 2015 +0200
+++ b/.emacs-my Fri Mar 13 19:26:20 2015 +0200
@@ -12,9 +12,12 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(message "recentf")
-(setq recentf-save-file "~/.recentf")
+(eval-and-compile
+ (require 'recentf))
+
+(setq recentf-save-file (concat user-emacs-directory ".recentf"))
(when (eq system-type 'cygwin)
- (setq recentf-save-file "~/.recentf-cygwin"))
+ (setq recentf-save-file (concat user-emacs-directory ".recentf-cygwin")))
(setq recentf-auto-cleanup 600)
;; Prevent TRAMP to login on remote host when loading. Its take time and ask passwords!
@@ -25,7 +28,6 @@
"\\.png\\'"))
(setq recentf-max-saved-items 10000)
-(require 'recentf)
(recentf-mode t)
(global-set-key (kbd "\e\eq") 'recentf-open-files)
@@ -79,7 +81,7 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(message "user info")
-;; Set in ~/.emacs-auth:
+;; Set in ~/.emacs.d/.emacs-auth:
;; (setq user-full-name "Oleksandr Gavenko")
;; (setq user-mail-address "gavenkoa@gmail.com")
;; (setq user-nick "gavenkoa")
@@ -136,6 +138,51 @@
obarray))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(message "lisp, elisp")
+
+(setq list-command-history-max 256)
+
+(add-hook 'emacs-lisp-mode-hook 'turn-on-eldoc-mode)
+(add-hook 'lisp-interaction-mode-hook 'turn-on-eldoc-mode)
+(add-hook 'ielm-mode-hook 'turn-on-eldoc-mode)
+
+(defun my-emacs-lisp-mode-hook ()
+ (setq tab-width 8))
+(add-hook 'emacs-lisp-mode-hook 'my-emacs-lisp-mode-hook)
+
+(defun my-elisp-find-tag ()
+ (interactive)
+ (require 'etags)
+ (ring-insert find-tag-marker-ring (point-marker))
+ (unless (find-variable-at-point)
+ (find-function-at-point)
+ ))
+;; Goto elisp definition.
+(define-key emacs-lisp-mode-map (kbd "M-.") 'my-elisp-find-tag)
+
+(if (not (fboundp 'global-prettify-symbols-mode))
+ ;; http://www.emacswiki.org/emacs/PrettyLambda
+ (font-lock-add-keywords
+ 'emacs-lisp-mode
+ `(("(\\<\\(lambda\\)\\>"
+ (1 (progn (compose-region (match-beginning 1) (match-end 1) ,(make-char 'greek-iso8859-7 107)) font-lock-keyword-face)) )))
+ (global-prettify-symbols-mode 1))
+
+(defun my-dump-funcs ()
+ "Dump all function calls in current buffer. Useful to explore
+elisp API from somebody else files."
+ (interactive)
+ (let* ( (cur-buffer (current-buffer)) (new-buffer (get-buffer-create (concat (buffer-name cur-buffer) "-funcs.el"))) symb )
+ (while (search-forward-regexp "([[:alnum:]*]" nil t)
+ (setq symb (thing-at-point 'symbol))
+ (with-current-buffer new-buffer
+ (insert-string symb)
+ (insert-char ?\n 1)))
+ (switch-to-buffer new-buffer)
+ (shell-command-on-region (point-min) (point-max) "sort -u" nil t)
+ ))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(message "mode groups")
(defmacro my-defun-rename-symb-tree (name doc func)
@@ -149,7 +196,7 @@
((listp tree)
(mapcar ',name tree)
)
- (t (error "Only tree of symbols allowed."))
+ (t (error "Only tree of symbols allowed"))
)))
(my-defun-rename-symb-tree
@@ -365,8 +412,8 @@
(message "shell, bash, Cygwin, MSYS")
(defvar my-use-windows-shell nil
- "If t 'cmdproxy.exe' will be used as shell. Affect on M-x shell like
- commands. If nil, 'sh' will be used." )
+ "If t 'cmdproxy.exe' will be used as shell.
+Affect on \\[shell] like commands. If nil, 'sh' will be used." )
(defun follow-cygwin-symlink ()
"Follow new-style (and also UCS-16) Cygwin symlinks."
@@ -450,7 +497,7 @@
(setq term-buffer-maximum-size (lsh 1 14))
-(eval-after-load 'term
+(my--eval-after-load term
'(progn
(defun my-term-send-delete-word-forward () (interactive) (term-send-raw-string "\ed"))
(defun my-term-send-delete-word-backward () (interactive) (term-send-raw-string "\e\C-h"))
@@ -639,7 +686,7 @@
(setq grep-highlight-matches nil)
(setq grep-use-null-device nil)
-(eval-after-load 'grep
+(my--eval-after-load grep
'(progn
(add-to-list 'grep-find-ignored-directories "build" t)
(add-to-list 'grep-find-ignored-directories "dist" t)
@@ -869,9 +916,8 @@
(setq ido-file-extensions-order '(".java" ".c" ".py" ".xml" ".txt" ".el" ".ini" ".cfg" ".cnf" ".log"))
-(setq ido-ignore-buffers
- '("\\` "))
-(setq ido-ignore-extensions t) ; From completion-ignored-extensions.
+(setq ido-ignore-buffers '("\\` "))
+(setq ido-ignore-extensions nil) ; From completion-ignored-extensions.
(setq ido-case-fold t)
;; ido-ignore-directories
;; ido-ignore-files
@@ -954,7 +1000,7 @@
(setq my-yas-root-directory "~/.emacs.d/my-yas")
(setq yas/ignore-filenames-as-triggers t)
-;; (eval-after-load 'yasnippet
+;; (my--eval-after-load yasnippet
;; '(progn
;; (cond
;; ((listp yas/root-directory) (add-to-list 'yas/root-directory my-yas-root-directory))
@@ -1070,7 +1116,7 @@
(when (fboundp 'auto-image-file-mode)
(auto-image-file-mode 1))
-(eval-after-load 'image-file
+(my--eval-after-load image-file
'(progn
;; Exclude .svg image from supported image list, as Emacs doesn't come
;; with SVG shared library.
@@ -1236,7 +1282,7 @@
(add-hook 'rst-adjust-hook 'rst-toc-update)
(unless window-system
- (eval-after-load 'rst
+ (my--eval-after-load rst
'(progn
(custom-set-faces
'(rst-level-1-face ((t (:background "yellow"))) t)
@@ -1281,7 +1327,7 @@
;%r (TeX-style-check TeX-print-style)
;%s master-file-name without extention
;%v yap command view line
-;(eval-after-load "tex"
+;(my--eval-after-load "tex"
; '(progn
; (add-to-list 'TeX-command-list
; (list "->PS landscape for pdf"
@@ -1341,7 +1387,7 @@
;; Add `my-fix-for-automake-info-lookup' entries to the end of doc-spec for
;; some modes.
-(eval-after-load 'info-look
+(my--eval-after-load info-look
'(progn
(mapc
(lambda (mode)
@@ -1593,7 +1639,7 @@
(require 'ecomplete)
(setq message-mail-alias-type '(abbrev ecomplete))
-(eval-after-load 'message
+(my--eval-after-load message
'(progn
(require 'mailabbrev)
(define-key message-mode-map "\e\t" 'mail-abbrev-complete-alias)
@@ -1674,9 +1720,9 @@
(let ( (gnus-interactive-exit nil) )
(gnus-group-exit)
))
-(eval-after-load 'gnus '(add-hook 'kill-emacs-hook 'my-kill-gnus))
-
-(eval-after-load 'gnus-art
+(my--eval-after-load gnus '(add-hook 'kill-emacs-hook 'my-kill-gnus))
+
+(my--eval-after-load gnus-art
'(progn
(setq gnus-visible-headers (concat gnus-visible-headers "\\|^Archived-At"))
))
@@ -1752,7 +1798,7 @@
(interactive)
(browse-url (w3m-anchor)))
-(eval-after-load 'w3m
+(my--eval-after-load w3m
'(progn
(define-key w3m-minor-mode-map (kbd "RET") #'my-w3m-view-url)
(define-key w3m-minor-mode-map (kbd "S-RET") #'w3m-safe-view-this-url)
@@ -1763,7 +1809,7 @@
(add-hook 'gnus-group-mode-hook 'gnus-topic-mode)
-(eval-after-load 'gnus '(progn (gnus-demon-add-handler 'gnus-demon-scan-news 10 t)))
+(my--eval-after-load gnus '(progn (gnus-demon-add-handler 'gnus-demon-scan-news 10 t)))
;; Show prefix and 'To' field instead 'From' for my mails.
(setq gnus-summary-to-prefix "==> ")
@@ -1877,7 +1923,7 @@
))
;; Increase the score for followups to a sent article.
-(eval-after-load 'gnus-score
+(my--eval-after-load gnus-score
'(progn
;; (add-hook 'message-sent-hook 'gnus-score-followup-article)
(add-hook 'message-sent-hook 'gnus-score-followup-thread)
@@ -1895,7 +1941,7 @@
"subject" subj
's (- gnus-score-interactive-default-score) (current-time-string)))))
(gnus-summary-kill-same-subject unmark))
-(eval-after-load 'gnus-sum
+(my--eval-after-load gnus-sum
'(define-key gnus-summary-mode-map (kbd "C-k") #'my-gnus-summary-kill-same-subject))
(defun my-gnus.mark-thread-as-read ()
@@ -1909,7 +1955,7 @@
(gnus-summary-mark-article (gnus-summary-article-number) gnus-del-mark))
(when (or (not (gnus-summary-search-forward)) (eq (gnus-summary-thread-level) 0))
(throw 'exit nil)) )))
-(eval-after-load 'gnus-sum
+(my--eval-after-load gnus-sum
'(define-key gnus-summary-mode-map (kbd "H-k") #'my-gnus.mark-thread-as-read))
(defun my-gnus-thread-score-function (&rest scores)
@@ -1927,7 +1973,7 @@
(gnus-id-to-thread (mail-header-id (gnus-summary-article-header)))))))
;; Especially highlight my message and replays to me.
-(eval-after-load 'gnus-sum
+(my--eval-after-load gnus-sum
'(progn
(defface my-gnus-own-unread-face nil
"Use this face to display own postings in Summary Buffer")
@@ -1962,7 +2008,7 @@
;; ("^comp" "comp.SCORE")))
;; Make C-Up, C-Down more like across paragraph moving.
-(eval-after-load 'gnus
+(my--eval-after-load gnus
'(progn
(define-key gnus-summary-mode-map [(meta up)] '(lambda() (interactive) (scroll-other-window -1)))
(define-key gnus-summary-mode-map [(meta down)] '(lambda() (interactive) (scroll-other-window 1)))
@@ -2014,7 +2060,7 @@
jabber-alert-presence-message-function (lambda (who oldstatus newstatus statustext) nil)
)
-(eval-after-load 'jabber
+(my--eval-after-load jabber
'(progn
;; Redefine standard binding for sending message form RET to C-RET.
(define-key jabber-chat-mode-map (kbd "RET") 'newline)
@@ -2113,9 +2159,9 @@
erc-server-reconnect-attempts 2)
(setq
- erc-log-channels-directory "~/.irc"
+ erc-log-channels-directory "~/.emacs.d/.irc"
erc-log-file-coding-system 'utf-8-unix)
-(eval-after-load 'erc
+(my--eval-after-load erc
(lambda ()
(require 'erc-log)
(mkdir erc-log-channels-directory t)))
@@ -2153,6 +2199,9 @@
(mapc (lambda (hook) (add-hook hook (lambda () (setq fill-column my-fill-column)) ))
(append my-devel-mode-hook-list my-text-mode-hook-list))
+(mapc (lambda (mode) (add-hook (my-mode2hook mode) #'hs-minor-mode))
+ '(c-mode c++-mode java-mode js-mode lisp-mode emacs-lisp-mode))
+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(message "diff, patch, ediff, emerge")
@@ -2169,7 +2218,7 @@
;; (add-hook 'diff-mode-hook 'my-diff-auto-refine-mode-on)
(when window-system
- (eval-after-load 'diff-mode
+ (my--eval-after-load diff-mode
'(progn
(set-face-foreground 'diff-added-face "DarkGreen")
(set-face-foreground 'diff-removed-face "DarkRed")
@@ -2292,7 +2341,7 @@
;; Show error in EN locale to easy search how fix problem in docs and Internet.
(setq compilation-environment '("LANG=C"))
-(eval-after-load 'compile
+(my--eval-after-load compile
'(progn
;; My funny error messages.
(add-to-list 'compilation-error-regexp-alist '("^\\( +\\[csc\\] \\|\\)\\(.*\\)(\\([0-9]*\\),\\([0-9]*\\)):" 2 3 4))
@@ -2324,7 +2373,7 @@
)
(comint-send-string (get-buffer-process (current-buffer)) (concat string "\n"))
)
-(eval-after-load 'compile
+(my--eval-after-load compile
'(progn
(define-key compilation-mode-map [C-return] 'my-comint-send-string)
))
@@ -2351,6 +2400,7 @@
;; (setq default-abbrev-mode t)
;; (setq save-abbrevs t)
+(global-set-key (kbd "M-/") 'hippie-expand)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(message "TAGS, etags, ctags, GNU GLOBAL")
@@ -2393,10 +2443,12 @@
;; For debug use 'semantic-debug-idle-function' and 'semantic-debug-idle-work-function'.
-(when (or
- (and (= emacs-major-version 23) (>= emacs-minor-version 2))
- (>= emacs-major-version 24) )
- (require 'cedet))
+(eval-and-compile
+ (when (or
+ (and (= emacs-major-version 23) (>= emacs-minor-version 2))
+ (>= emacs-major-version 24) )
+ (require 'cedet)
+ (require 'mode-local)))
(when (featurep 'cedet)
(require 'semantic)
@@ -2506,7 +2558,7 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(message "fvwm-mode")
-(eval-after-load 'fvwm-mode
+(my--eval-after-load fvwm-mode
(setq fvwm-fvwmcommand-path (executable-find "FvwmCommand")))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -2536,48 +2588,6 @@
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-(message "lisp, elisp")
-
-(setq list-command-history-max 256)
-
-(add-hook 'emacs-lisp-mode-hook 'turn-on-eldoc-mode)
-(defun my-emacs-lisp-mode-hook ()
- (setq tab-width 8))
-(add-hook 'emacs-lisp-mode-hook 'my-emacs-lisp-mode-hook)
-
-(defun my-elisp-find-tag ()
- (interactive)
- (require 'etags)
- (ring-insert find-tag-marker-ring (point-marker))
- (unless (find-variable-at-point)
- (find-function-at-point)
- ))
-;; Goto elisp definition.
-(define-key emacs-lisp-mode-map (kbd "M-.") 'my-elisp-find-tag)
-
-(if (not (fboundp 'global-prettify-symbols-mode))
- ;; http://www.emacswiki.org/emacs/PrettyLambda
- (font-lock-add-keywords
- 'emacs-lisp-mode
- `(("(\\<\\(lambda\\)\\>"
- (1 (progn (compose-region (match-beginning 1) (match-end 1) ,(make-char 'greek-iso8859-7 107)) font-lock-keyword-face)) )))
- (global-prettify-symbols-mode 1))
-
-(defun my-dump-funcs ()
- "Dump all function calls in current buffer. Useful to explore
-elisp API from somebody else files."
- (interactive)
- (let* ( (cur-buffer (current-buffer)) (new-buffer (get-buffer-create (concat (buffer-name cur-buffer) "-funcs.el"))) symb )
- (while (search-forward-regexp "([[:alnum:]*]" nil t)
- (setq symb (thing-at-point 'symbol))
- (with-current-buffer new-buffer
- (insert-string symb)
- (insert-char ?\n 1)))
- (switch-to-buffer new-buffer)
- (shell-command-on-region (point-min) (point-max) "sort -u" nil t)
- ))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(message "c-mode, cc-mode, c++-mode")
;; Minor mode that highlights suspicious C and C++ constructions.
@@ -2662,13 +2672,13 @@
(setq python-indent 4)
-(eval-after-load 'python-mode
+(my--eval-after-load python-mode
'(when (and (boundp 'py-version) (equal py-version "5.1.0"))
(setq-default py-which-shell py-python-command)
;; (py-toggle-shells 'cpython)
))
-(eval-after-load 'python
+(my--eval-after-load python
'(define-key inferior-python-mode-map "\C-c\C-f" 'python-describe-symbol))
;; Enable "M-/", "C-c g", "C-c d", "C-c f" shortcuts.
@@ -2736,7 +2746,7 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(message "SML, Standard ML")
-(eval-after-load 'sml
+(my--eval-after-load sml
'(progn
(define-key sml-mode-map (kbd "C-c C-p") 'sml-send-function)
))
@@ -2749,7 +2759,10 @@
(add-to-list 'auto-mode-alist '("\\.js$" . javascript-generic-mode))
)
-(eval-after-load 'js '(modify-syntax-entry ?$ "w" js-mode-syntax-table))
+(my--eval-after-load js '(modify-syntax-entry ?$ "w" js-mode-syntax-table))
+
+(setq js-indent-level 4)
+;; js-curly-indent-offset, js-expr-indent-offset, js-paren-indent-offset, js-square-indent-offset, js-switch-indent-offset
;; BUG: all single char comments do not stop highlighting on end of line but
;; go to end of buffer. To fix use code:
@@ -2809,6 +2822,17 @@
(setq wesnoth-base-indent 2)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(message "css")
+
+(setq css-indent-offset 4)
+
+;; (package-install 'css-eldoc)
+
+(my--eval-after-load css-mode
+ (when (fboundp 'css-eldoc-enable)
+ (css-eldoc-enable)))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(message "htmlize")
(setq
@@ -2884,12 +2908,12 @@
(add-to-list 'auto-mode-alist '("\.rng\\'" . nxml-mode))
(add-to-list 'auto-mode-alist '("\.xul\\'" . nxml-mode))
-(eval-after-load 'nxml-mode '(define-key nxml-mode-map [C-return] 'nxml-complete))
+(my--eval-after-load nxml-mode '(define-key nxml-mode-map [C-return] 'nxml-complete))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(message "relax ng, rng")
-(eval-after-load 'rng-loc '(add-to-list 'rng-schema-locating-files "~/.emacs.d/rnc/schemas.xml"))
+(my--eval-after-load rng-loc '(add-to-list 'rng-schema-locating-files "~/.emacs.d/rnc/schemas.xml"))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(message "web-mode")
@@ -2937,7 +2961,7 @@
)
(setq sgml-set-face t) ; for highlighting in sgml
-(eval-after-load 'sgml-mode
+(my--eval-after-load sgml-mode
'(progn
(unless (featurep 'psgml)
(setq html-tag-alist
@@ -2988,13 +3012,13 @@
;; isar-display:show-consts t
)
-(eval-after-load 'proof
+(my--eval-after-load proof
'(progn
;; (proof-maths-menu-toggle 1)
;; (unicode-tokens-mode 1)
;; (proof-imenu-toggle 1)
))
-(eval-after-load 'isar
+(my--eval-after-load isar
'(progn
(define-key isar-mode-map (kbd "C-c C-m") 'proof-goto-point)
))
@@ -3035,7 +3059,7 @@
make-backup-files t
;; In other case (by renaming) you loose original file creation date.
backup-by-copying t
- backup-directory-alist '(("." . "~/.backup")) ; don't litter my fs tree
+ backup-directory-alist '(("." . "~/.emacs.d/.backup")) ; don't litter my fs tree
delete-old-versions t ; delete excess backup versions silently
kept-old-versions 1 ; store first original version
kept-new-versions 3 ; store last 3 version
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/.hgignore Fri Mar 13 19:26:20 2015 +0200
@@ -0,0 +1,4 @@
+syntax: glob
+
+.devel/
+.tmp/
--- a/Makefile Fri Mar 13 14:20:23 2015 +0200
+++ b/Makefile Fri Mar 13 19:26:20 2015 +0200
@@ -24,6 +24,7 @@
# Helper definition.
which = $(firstword $(foreach item,$(subst :, ,$(PATH)),$(wildcard $(item)/$1)))
+curdir := $(realpath .)
################################################################
# Platform/environment definition.
@@ -90,11 +91,7 @@
if [ -f ~/$$f ]; then [ -f $(emacsdir)/$$f ] && mv ~/$$f $(emacsdir)/$$f.1 || mv ~/$$f $(emacsdir); fi; \
if [ -f $(mylispdir)/$$f ]; then [ -f $(emacsdir)/$$f ] && mv $(mylispdir)/$$f $(emacsdir)/$$f.2 || mv $(mylispdir)/$$f $(emacsdir); fi; \
done; \
-for f in `find $(mylispdir) -maxdepth 1 -type f -name '.emacs?*'`; do \
- fn=$${f##*/}; \
- [ -f $(emacsdir)/$$fn ] && mv $$f $(emacsdir)/$$fn.3 || mv $$f $(emacsdir); \
-done; \
-make install
+mv ~/.recentf ~/.ido.last $(emacsdir) || true
.PHONY: install-all
install-all: install
@@ -109,12 +106,15 @@
[ -f $(emacsdir)/$$file ] || cp $$file $(emacsdir)/$$file; \
done
cp .emacs $(emacsdir)/init.el
- cp .emacs-my $(emacsdir)/.emacs-my
+ cp .emacs-defs .emacs-my $(emacsdir)
mkdir -p $(emacsdir)/server $(HOME)/.gnus/scores
cp all.SCORE $(HOME)/.gnus/scores
cp -f $(EL_FILES) $(mylispdir); \
+ ./.emacs-autogen.sh $(emacsdir)/.emacs-autogen; \
$(EMACS) -Q --batch --eval='(let ((generated-autoload-file "$(mylispdir)/loaddefs.el")) (update-directory-autoloads "$(mylispdir)"))'
- ./.emacs-autogen.sh $(emacsdir)/.emacs-autogen
+ \
+$(EMACS) -Q --batch --eval='(load "$(curdir)/.emacs-defs")' --eval='(my-load.add-my-loadpaths)' --eval='(load "$(emacsdir)/.emacs-pre")' \
+ --eval='(byte-compile-file "$(emacsdir)/.emacs-my")' --eval='(byte-force-recompile "$(mylispdir)")'
cp -r srecode/ $(HOME)/.emacs.d/
.PHONY: uninstall
--- a/README.rst Fri Mar 13 14:20:23 2015 +0200
+++ b/README.rst Fri Mar 13 19:26:20 2015 +0200
@@ -5,34 +5,29 @@
=====================
.. contents::
-Copyright (C) 2010 by Oleksandr Gavenko <gavenkoa@gmail.com>
-
-You can do anything with this file without any warranty.
+:Author: Oleksandr Gavenko <gavenkoa@gmail.com>
Config files structure.
=======================
-Main Emacs config file is '~/.emacs'. I decide don't store beside it all
-customisations. Instead it simply load files in such order:
+I use ``~/.emacs.d/init.d`` as main entry point for customisation. Tha file load
+anoth files in such order:
- '~/.emacs-autogen'
- It content depend on installation environment. Automatically
- generated.
- '~/.emacs-pre'
- For manually written customisation (usually for updating
- load-path) which can affect on '.emacs-my'. Will not be
- overridden on install.
- '~/.emacs.d/my-lisp/autoload-my.el'
- For defining autoload function for modes (instead loading all
- mode files to save startup time). Automatically generated.
- '~/.emacs-custom.el'
- For storing customisations by Emacs itself. Some settings from
- this file can effect on loaded elisp files from .emacs-my.
- Will not be overridden on install.
- '~/.emacs-my'
- Here main customisations placed.
- '~/.emacs-post'
- For storing connection settings, passwords and enabling modes
- added to load-path in ~/.emacs-pre. Will not be overridden on
- install.
+ ``~/.emacs.d/.emacs-autogen``
+ Hold environment info discovered during installing. Automatically generated.
+ ``~/.emacs.d/.emacs-pre``
+ For manually written customisation (usually for updating load-path) which
+ can affect on ``.emacs-my``. Will not be overridden on install.
+ ``~/.emacs.d/my/loaddefs.el``
+ Definition for my modes autoload functions. Automatically generated.
+ ``~/.emacs.d/.emacs-custom``
+ For storing customisations by Emacs itself. Some settings from this file can
+ effect on loaded elisp files from .emacs-my. Will not be overridden on
+ install.
+ ``~/.emacs.d/.emacs-my``
+ Here main customisations is placed.
+ ``~/.emacs.d/.emacs-post``
+ For storing connection settings, passwords and enabling modes added to
+ load-path in ``~/.emacs.d/.emacs-pre``. Will not be overridden on install.
+
--- a/debian-doc.el Fri Mar 13 14:20:23 2015 +0200
+++ b/debian-doc.el Fri Mar 13 19:26:20 2015 +0200
@@ -47,11 +47,11 @@
;; (insert-file-contents file))
(insert "\n-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-\n\n")
(insert-file-contents file)
- (end-of-buffer)))
+ (goto-char (point-max))))
(directory-files debian-doc-dir t)))
(read-only-mode 1)
(debian-doc-mode)
- (beginning-of-buffer)))
+ (goto-char (point-min))))
;;;###autoload
(defun debian-doc-visit ()
@@ -61,12 +61,12 @@
(debian-doc)
(unless debian-doc-completion-list
(save-excursion
- (beginning-of-buffer)
+ (goto-char (point-min))
(while (setq start (search-forward "Document: " nil t))
(end-of-line)
(push (buffer-substring-no-properties start (point)) debian-doc-completion-list))))
(when (setq word (completing-read "Package: " debian-doc-completion-list nil t))
- (beginning-of-buffer)
+ (goto-char (point-min))
(search-forward (concat "Document: " word) nil t)
(recenter-top-bottom))))
(define-key debian-doc-mode-map (kbd "RET") 'debian-doc-visit-at-point)
--- a/dict-mode.el Fri Mar 13 14:20:23 2015 +0200
+++ b/dict-mode.el Fri Mar 13 19:26:20 2015 +0200
@@ -16,7 +16,7 @@
;;; Code:
-(setq dict-c5-mode-map (make-sparse-keymap))
+(defvar dict-c5-mode-map (make-sparse-keymap))
;; (define-key dict-c5-mode-map (kbd "RET") 'my-xxx)
(defvar dict-c5-font-lock-keywords
@@ -26,6 +26,10 @@
("\\[[^]\n]+]" . font-lock-type-face)
))
+(eval-when-compile
+ (defvar font-lock-beg)
+ (defvar font-lock-end))
+
(defun dict-c5-font-lock-extend-region ()
"Look for '_____' expression and extend `font-lock-beg' and `font-lock-end'."
;; (message "%d:%d, %d lines" font-lock-beg font-lock-end (count-lines font-lock-beg font-lock-end))
--- a/log4-hi-mode.el Fri Mar 13 14:20:23 2015 +0200
+++ b/log4-hi-mode.el Fri Mar 13 19:26:20 2015 +0200
@@ -1,3 +1,9 @@
+;;; log4-hi-mode.el --- Syntax highlighting logs keywords.
+
+;;; Commentary:
+;; Used for highlighting ERROR/WARN/INFO like keywords and dates in logs.
+
+;;; Code:
(defface log4-hi-error-face
'((t :inherit error))
@@ -51,3 +57,7 @@
(font-lock-fontify-buffer))
(provide 'log4-hi-mode)
+
+(provide 'log4-hi-mode)
+
+;;; log4-hi-mode.el ends here
--- a/maven-central.el Fri Mar 13 14:20:23 2015 +0200
+++ b/maven-central.el Fri Mar 13 19:26:20 2015 +0200
@@ -12,11 +12,6 @@
(defconst maven-central.search-url "http://search.maven.org/solrsearch/select?wt=json&rows=20")
-(defun maven-central.callback1 (status)
- (let ( (buffer (current-buffer)) )
- (switch-to-buffer maven-central.buffer-name)
- (url-insert buffer)))
-
(defun maven-central.versions-url (groupId artifactId)
(concat maven-central.search-url "&core=gav&q=g:" (url-hexify-string groupId) (url-hexify-string " AND ") "a:" (url-hexify-string artifactId)))
;; (maven-central.versions-url "junit" "junit")
@@ -25,7 +20,7 @@
(let ( (buffer (current-buffer)) json )
(with-temp-buffer
(url-insert buffer)
- (beginning-of-buffer)
+ (goto-char (point-min))
(setq json (json-read))
;; (switch-to-buffer maven-central.buffer-name)
;; (pp json)
@@ -44,7 +39,7 @@
(let ( (buffer (current-buffer)) json )
(with-temp-buffer
(url-insert buffer)
- (beginning-of-buffer)
+ (goto-char (point-min))
(setq json (json-read))
;; (switch-to-buffer maven-central.buffer-name)
;; (pp json)
@@ -103,10 +98,7 @@
(t
(list nil nil nil)))
)))
-
-(defun maven-central.parse-test (&optional point)
- (interactive)
- (pp (maven-central.parse-pom-dependency)) )
+;; (pp (maven-central.parse-pom-dependency))
;;;###autoload
(defun maven-central.last-version-from-pom ()
@@ -156,7 +148,7 @@
(format "%s help:effective-pom" maven.command)
(switch-to-buffer maven.help-buffer-name)) )
-(defun maven.effective-pom ()
+(defun maven.effective-settings ()
"Run help:effective-settings for plugin at point."
(interactive)
(shell-command
--- a/my-log-mode.el Fri Mar 13 14:20:23 2015 +0200
+++ b/my-log-mode.el Fri Mar 13 19:26:20 2015 +0200
@@ -17,7 +17,7 @@
;;; Code:
(defun my-log-goto (point)
- ""
+ "Visit file according to error specification at POINT."
(interactive "d")
(let ( start stop line fname fline (fregex "^\\([^:]+\\):\\([[:digit:]]+\\):") )
(save-excursion
@@ -25,28 +25,25 @@
(setq start (point))
(move-end-of-line 1)
(setq stop (point))
- (setq line (filter-buffer-substring start stop nil t))
+ (setq line (filter-buffer-substring start stop))
(string-match fregex line)
(setq fname (match-string 1 line))
(when fname
- (setq fline (string-to-int (match-string 2 line)))
- )
+ (setq fline (string-to-number (match-string 2 line))))
)
(cond
( (and fname (file-exists-p fname))
(find-file-other-window fname)
- (goto-line fline)
- )
+ (goto-char (point-min))
+ (forward-line (1- fline)) )
( t
(if fname
(message "File '%s' is not found (default directory is '%s')." fname default-directory)
- (message "No file under current line.")
- )
- )
+ (message "No file under current line.") ) )
)
))
-(setq my-log-mode-map (make-sparse-keymap))
+(defvar my-log-mode-map (make-sparse-keymap))
(define-key my-log-mode-map (kbd "RET") 'my-log-goto)
(require 'generic-x)
--- a/nsis-mode.el Fri Mar 13 14:20:23 2015 +0200
+++ b/nsis-mode.el Fri Mar 13 19:26:20 2015 +0200
@@ -79,7 +79,7 @@
'(nsis-mode-modify-syntax-entry nsis-mode-set-comment-style)
"Generic mode for nsis files.")
-(setq nsis-imenu-generic-expression
+(defvar nsis-imenu-generic-expression
'(
("Defines" "^!define[[:blank:]]+\\([[:word:]]+\\)" 1)
("Sections" "^Section[[:blank:]]+\"?\\(-?[[:word:] ]+\\)\"?" 1)
@@ -93,9 +93,11 @@
(add-hook 'nsis-mode-hook 'nsis-set-imenu-generic-expression)
+(eval-when-compile
+ (defvar which-func-modes))
+
(eval-after-load 'which-func
- '(add-to-list 'which-func-modes 'nsis-mode)
- )
+ '(add-to-list 'which-func-modes 'nsis-mode))
(provide 'nsis-mode)
--- a/pypi.el Fri Mar 13 14:20:23 2015 +0200
+++ b/pypi.el Fri Mar 13 19:26:20 2015 +0200
@@ -6,6 +6,9 @@
(require 'url-handlers)
(require 'thingatpt)
+(eval-when-compile
+ (defvar url-http-response-status))
+
;;; Code:
(defvar pypi.buffer-name "*Pip*")