-
Notifications
You must be signed in to change notification settings - Fork 5
/
my-debug.el
107 lines (106 loc) · 4.37 KB
/
my-debug.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
(setq frame-title-format "Emacs :: Debug mode")
(setq debug-on-error t)
(setq make-backup-files nil)
(set-language-environment "Japanese")
(set-default-coding-systems 'utf-8-unix)
(set-keyboard-coding-system 'utf-8)
(set-clipboard-coding-system 'utf-8)
(set-terminal-coding-system 'utf-8)
(setq buffer-file-coding-system 'utf-8)
(setq save-buffer-coding-system 'utf-8-unix)
(set-buffer-file-coding-system 'utf-8)
(prefer-coding-system 'utf-8-unix)
(set-locale-environment "en_US.UTF-8") ; "ja_JP.UTF-8"
(when (eq window-system 'ns)
;; Paste command by Command+v
(global-set-key (kbd "M-v") 'yank)
(setq ns-command-modifier (quote meta))
(set ns-alternate-modifier (quote super))
;; Drag and Drop config. for Emacs 23 (2010-07-20)
(global-set-key [ns-drag-file] 'ns-find-file))
(setq next-line-add-newlines nil)
(setq require-final-newline t)
(setq truncate-lines nil)
(setq truncate-partial-width-windows nil)
(setq scroll-conservatively 1000)
(setq scroll-step 1)
(setq scroll-margin 0) ; default=0
(setq next-screen-context-lines 1)
(require 'time-stamp nil t)
(add-hook 'before-save-hook 'time-stamp)
(eval-after-load "time-stamp"
'(progn
(setq time-stamp-active t)
(setq time-stamp-start "Last Update: ")
(setq time-stamp-format "%04y-%02m-%02d@%02H:%02M")
(setq time-stamp-end "$")
(setq time-stamp-line-limit 10)))
(autoload 'word-count-mode "word-count" "Minor mode to count words." t)
(add-hook 'change-log-mode-hook
'(lambda() (setq tab-width 4) (setq left-margin 4)))
(cua-mode t)
(setq cua-enable-cua-keys nil)
(setq visible-bell t)
(defcustom echo-area-bell-string " BEEP ";
"Message displayed in mode-line by `echo-area-bell' function."
:group 'user)
(defcustom echo-area-bell-delay 0.1
"Number of seconds `echo-area-bell' displays its message."
:group 'user)
;; internal variables
(defvar echo-area-bell-cached-string nil)
(defvar echo-area-bell-propertized-string nil)
(defun echo-area-bell ()
"Briefly display a highlighted message in the echo-area.
The string displayed is the value of `echo-area-bell-string',
with a red background; the background highlighting extends to the
right margin. The string is displayed for `echo-area-bell-delay'
seconds.
This function is intended to be used as a value of `ring-bell-function'."
(unless (equal echo-area-bell-string echo-area-bell-cached-string)
(setq echo-area-bell-propertized-string
(propertize
(concat
(propertize
"x"
'display
`(space :align-to (- right ,(+ 2 (length echo-area-bell-string)))))
echo-area-bell-string)
;; 'face '(:background "red")
;; 'face '(:foreground "#FFFFFF" :background "#FF4040")
;; 'face '(:foreground "#FFFFFF" :background "#C1252D")
;; 'face '(:foreground "#FFFFFF" :background "#FD8A4B")
'face '(:foreground "#FFFFFF" :background "#FF7D7D")))
(setq echo-area-bell-cached-string echo-area-bell-string))
(message echo-area-bell-propertized-string)
(sit-for echo-area-bell-delay)
(message ""))
(setq ring-bell-function 'echo-area-bell)
(line-number-mode t)
(set-frame-width (selected-frame) 81)
(set-frame-width (selected-frame) 80)
(global-set-key [delete] 'delete-char)
(global-set-key [kp-delete] 'delete-char)
(global-set-key (kbd "C-;") 'comment-dwim) ;; M-; is the defualt
(global-set-key (kbd "C-M-t") 'beginning-of-buffer)
(global-set-key (kbd "C-M-b") 'end-of-buffer)
(global-set-key (kbd "M-p") 'scroll-down)
(global-set-key (kbd "M-n") 'scroll-up)
(global-set-key (kbd "C-c g") 'goto-line)
(global-set-key (kbd "C-M-p") '(lambda () (interactive) (other-window -1)))
(global-set-key (kbd "C-M-n") '(lambda () (interactive) (other-window 1)))
(global-set-key (kbd "M-]") 'cycle-buffer)
(global-set-key (kbd "M-[") 'cycle-buffer-backward)
(global-set-key (kbd "M-+") 'word-count-mode)
(add-hook 'after-init-hook
(lambda ()
(message
"Emacs booting time: %.0f [msec]"
(* 1000 (float-time
(time-subtract after-init-time before-init-time))))))
;;(load-path-setter '("~/Dropbox/emacs.d") 'load-path)
;;(load-path-setter '("~/Dropbox/emacs.d/config") 'load-path)
;;(load-path-setter '("~/.emacs.d/.cask/package") 'load-path)
;;(load-path-setter '("~/devel/git/org-8.2/lisp") 'load-path)
;;(load-path-setter '("~/devel/git/org-8.2/contrib/lisp") 'load-path)
(provide 'my-debug)