-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdot.emacs.el.20110404
More file actions
2317 lines (2099 loc) · 106 KB
/
dot.emacs.el.20110404
File metadata and controls
2317 lines (2099 loc) · 106 KB
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
;;
;; My own setting
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;; 메인 설정 ;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; (setq font-lock-support-mode 'lazy-lock-mode)
(setq load-path (nconc '("~/.emacs") load-path)) ;; 개인 lisp 패키지가 위치 할 load-path 설정
(setq load-path (nconc '("~/.emacs.d") load-path)) ;; 개인 lisp 패키지가 위치 할 load-path 설정
;; ================================================================================
;; 기본 색 지정
;; ================================================================================
(set-foreground-color "wheat")
(set-background-color "DarkSlateGray")
;; ================================================================================
;; 영역 색 지정
;; ================================================================================
(set-face-foreground 'region "white")
(set-face-background 'region "cadetblue")
;; (setq bdf-directory-list
;; '("~/.emacs.d/fonts/english-sun"
;; "~/.emacs.d/fonts/korean-sun"))
;; (create-fontset-from-fontset-spec
;; "-*-gothic-normal-r-*-*-12-*-*-*-c-*-fontset-most,
;; latin-iso8859-2:-*-gothic-normal-r-*-*-12-*-*-*-c-*-iso8859-2,
;; latin-iso8859-3:-*-gothic-normal-r-*-*-12-*-*-*-c-*-iso8859-3,
;; latin-iso8859-4:-*-gothic-normal-r-*-*-12-*-*-*-c-*-iso8859-4,
;; cyrillic-iso8859-5:-*-gothic-normal-r-*-*-12-*-*-*-c-*-iso8859-5,
;; greek-iso8859-7:-*-gothic-normal-r-*-*-12-*-*-*-c-*-iso8859-7,
;; latin-iso8859-9:-*-gothicng-normal-r-*-*-12-*-*-*-c-*-iso8859-9,
;; japanese-jisx0208:-*-MS Gothic-normal-r-*-*-12-*-*-*-c-*-jisx0208-sjis,
;; katakana-jisx0201:-*-MS Gothic-normal-r-*-*-12-*-*-*-c-*-jisx0208-sjis,
;; latin-jisx0201:-*-MS Gothic-normal-r-*-*-12-*-*-*-c-*-jisx0208-sjis,
;; japanese-jisx0208-1978:-*-MS Gothic-normal-r-*-*-12-*-*-*-c-*-jisx0208-sjis,
;; korean-ksc5601:-*-roundgothic-normal-r-*-*-12-*-*-*-c-*-ksc5601.1987-*,
;; chinese-gb2312:-*-MS Song-normal-r-*-*-12-*-*-*-c-*-gb2312-*,
;; chinese-big5-1:-*-MingLiU-normal-r-*-*-12-*-*-*-c-*-big5-*,
;; chinese-big5-2:-*-MingLiU-normal-r-*-*-12-*-*-*-c-*-big5-*" t)
;; (require 'cvs-mode)
(require 'sudo-save)
(defun sudo-before-save-hook ()
(set (make-local-variable 'sudo:file) (buffer-file-name))
(when sudo:file
(unless(file-writable-p sudo:file)
(set (make-local-variable 'sudo:old-owner-uid) (nth 2 (file-attributes sudo:file)))
(when (numberp sudo:old-owner-uid)
(unless (= (user-uid) sudo:old-owner-uid)
(when (y-or-n-p
(format "File %s is owned by %s, save it with sudo? "
(file-name-nondirectory sudo:file)
(user-login-name sudo:old-owner-uid)))
(sudo-chown-file (int-to-string (user-uid)) (sudo-quoting sudo:file))
(add-hook 'after-save-hook
(lambda ()
(sudo-chown-file (int-to-string sudo:old-owner-uid)
(sudo-quoting sudo:file))
(if sudo-clear-password-always
(sudo-kill-password-timeout)))
nil ;; not append
t ;; buffer local hook
)))))))
(add-hook 'before-save-hook 'sudo-before-save-hook)
(require 'ipython)
(setq py-python-command-args '( "--colors" "Linux"))
(require 'python-mode)
(require 'pymacs)
(pymacs-load "ropemacs" "rope-")
;; (defadvice py-execute-buffer (around python-keep-focus activate)
;; "Thie advice to make focus python source code after execute command `py-execute-buffer'."
;; (let ((remember-window (selected-window))
;; (remember-point (point)))
;; ad-do-it
;; (select-window remember-window)
;; (goto-char remember-point)))
;; (defun rgr/python-execute()
;; (interactive)
;; (if mark-active
;; (py-execute-string (buffer-substring-no-properties (region-beginning) (region-end)))
;; (py-execute-buffer)))
;; (global-set-key (kbd "C-c C-e") 'rgr/python-execute)
(add-hook 'python-mode-hook
'(lambda () (eldoc-mode 1)) t)
(provide 'python-programming)
(require 'cmake-mode)
(setq auto-mode-alist
(append '(("CMakeLists\\.txt\\'" . cmake-mode)
("\\.cmake\\'" . cmake-mode))
auto-mode-alist))
(require 'xcscope)
(setq cscope-do-not-update-database t)
(require 'hangul)
(set-input-method "korean-hangul3f") ;; if you want 3 beolsik final...
;; cc-mode
(require 'cc-mode)
;; automatic indent on return in cc-mode
; (define-key c-mode-base-map [RET] 'newline-and-indent)
;; syntax-highlighting for Qt
;; (based on work by Arndt Gulbrandsen, Troll Tech)
(defun jk/c-mode-common-hook ()
"Set up c-mode and related modes.
Includes support for Qt code (signal, slots and alikes)."
;; base-style
(c-set-style "stroustrup")
;; set auto cr mode
(c-toggle-auto-hungry-state 1)
;; qt keywords and stuff ...
;; set up indenting correctly for new qt kewords
(setq c-protection-key (concat "\\<\\(public\\|public slot\\|protected"
"\\|protected slot\\|private\\|private slot"
"\\)\\>")
c-C++-access-key (concat "\\<\\(signals\\|public\\|protected\\|private"
"\\|public slots\\|protected slots\\|private slots"
"\\)\\>[ \t]*:"))
(progn
;; modify the colour of slots to match public, private, etc ...
(font-lock-add-keywords 'c++-mode
'(("\\<\\(slots\\|signals\\)\\>" . font-lock-type-face)))
;; make new font for rest of qt keywords
(make-face 'qt-keywords-face)
(set-face-foreground 'qt-keywords-face "Yellow")
;; qt keywords
(font-lock-add-keywords 'c++-mode
'(("\\<Q_OBJECT\\>" . 'qt-keywords-face)))
(font-lock-add-keywords 'c++-mode
'(("\\<SIGNAL\\|SLOT\\>" . 'qt-keywords-face)))
(font-lock-add-keywords 'c++-mode
'(("\\<Q[A-Z][A-Za-z]*" . 'qt-keywords-face)))
))
(add-hook 'c-mode-common-hook 'jk/c-mode-common-hook)
;; Other things I like are, for example,
;; cc-mode
(require 'cc-mode)
;; automatic indent on return in cc-mode
(define-key c-mode-base-map "\r" 'newline-and-indent)
;; Do not check for old-style (K&R) function declarations;
;; this speeds up indenting a lot.
; (setq c-recognize-knr-p nil)
;; Switch fromm *.<impl> to *.<head> and vice versa
(defun switch-cc-to-h ()
(interactive)
(when (string-match "^\\(.*\\)\\.\\([^.]*\\)$" buffer-file-name)
(let ((name (match-string 1 buffer-file-name))
(suffix (match-string 2 buffer-file-name)))
(cond ((string-match suffix "c\\|cc\\|C\\|cpp")
(cond ((file-exists-p (concat name ".h"))
(find-file (concat name ".h"))
)
((file-exists-p (concat name ".hh"))
(find-file (concat name ".hh"))
)
))
((string-match suffix "h\\|hh")
(cond ((file-exists-p (concat name ".cc"))
(find-file (concat name ".cc"))
)
((file-exists-p (concat name ".C"))
(find-file (concat name ".C"))
)
((file-exists-p (concat name ".cpp"))
(find-file (concat name ".cpp"))
)
((file-exists-p (concat name ".c"))
(find-file (concat name ".c"))
)))))))
; (require 'etheme) ;; Emacs Theme
(require 'php-mode) ;; php-mode 패키지를 인스톨 했을 경우 필요
(require 'generic-x)
(require 'font-lock)
(require 'psvn)
(require 'sql)
(defalias 'sql-get-login 'ignore)
;; ; RubyOnRails
;; (require 'ruby-mode)
;; ; (require 'rubydb3x)
;; (require 'inf-ruby)
;; ; (require 'ruby-electric)
;; ; (setq autu-mode-alist (cons '("\.rb$" . ruby-mode) auto-mode-alist))
;; (require 'mmm-mode) ;; mmm-mode 패키지를 인스톨 했을 경우 필요
;; (require 'mmm-auto)
;; (setq mmm-global-mode 'maybe)
;; (setq mmm-submode-decoration-level 2)
;; (set-face-background 'mmm-output-submode-face "LightGrey")
;; (set-face-background 'mmm-code-submode-face "MediumSlateBlue")
;; (set-face-background 'mmm-comment-submode-face "DarkOliveGreen")
;; (mmm-add-classes
;; '((erb-code
;; :submode ruby-mode
;; :match-face (("<%#" . mmm-comment-submode-face)
;; ("<%=" . mmm-output-submode-face)
;; ("<%" . mmm-code-submode-face))
;; :front "<%[#=]?"
;; :back "-?%>"
;; :insert ((?% erb-code nil @ "<%" @ " " _ " " @ "%>" @)
;; (?# erb-comment nil @ "<%#" @ " " _ " " @ "%>" @)
;; (?= erb-expression nil @ "<%=" @ " " _ " " @ "%>" @))
;; )))
; html mode
(add-hook 'html-mode-hook
(lambda ()
(setq mmm-classes '(erb-code))
(setq indent-line-function 'indent-relative)
(mmm-mode-on)))
(add-to-list 'auto-mode-alist '("\\.rhtml$" . html-mode))
; It is said that this sometimes makes it so that the syntax highlighting doesn?t update enough, so for this you might want to bind so:
(global-set-key [f8] 'mmm-parse-buffer)
; #2
;(require 'find-recursive)
;(defun try-complete-abbrev (old)
; (if (expand-abbrev) t nil))
;
;(setq hippie-expand-try-functions-list
; '(try-complete-abbrev
; try-complete-file-name
; try-expand-dabbrev))
;; ; -----------------------
;; (require 'rails)
;; (setq x-select-enable-clipboard t)
;; (setq interprogram-paste-function 'x-cut-buffer-or-selection-value)
;; (add-to-list 'load-path
;; "/opt/emacs")
;;
;; (require 'cedet)
;;
;; ;; Enabling various SEMANTIC minor modes. See semantic/INSTALL for more ideas.
;; ;; Select one of the following
;; (semantic-load-enable-code-helpers)
;; ;; (semantic-load-enable-guady-code-helpers)
;; ;; (semantic-load-enable-excessive-code-helpers)
;;
;; ;; Enable this if you develop in semantic, or develop grammars
;; ;; (semantic-load-enable-semantic-debugging-helpers)
;;
;; (require 'ecb-autoloads)
;;
;; (autoload 'ruby-mode "ruby-mode" "Ruby editing mode." t)
;; (setq auto-mode-alist (cons '("\\.rb$" . ruby-mode) auto-mode-alist))
;; (setq auto-mode-alist (cons '("\\.rhtml$" . html-mode) auto-mode-alist))
;;
;; ; (modify-coding-system-alist 'file "\\.rb$" 'utf-8)
;; ; (modify-coding-system-alist 'file "\\.rhtml$" 'utf-8)
;;
;; (require 'snippet)
;; (require 'rails)
;;
;; (defun try-complete-abbrev (old)
;; (if (expand-abbrev) t nil))
;;
;; (setq hippie-expand-try-functions-list
;; '(try-complete-abbrev
;; try-complete-file-name
;; try-expand-dabbrev))
;;
;; (add-hook 'ruby-mode-hook
;; (lambda()
;; (add-hook 'local-write-file-hooks
;; '(lambda()
;; (save-excursion
;; (untabify (point-min) (point-max))
;; (delete-trailing-whitespace)
;; )))
;; (set (make-local-variable 'indent-tabs-mode) 'nil)
;; (set (make-local-variable 'tab-width) 2)
;; (imenu-add-to-menubar "IMENU")
;; (require 'ruby-electric)
;; (ruby-electric-mode t)
;; ))
;; ; -----------------------
; RubyOnRails
(load-library "hideshow")
(autoload 'awk-mode "cc-mode" nil t)
;; Doxygen mode
(add-hook 'c-mode-common-hook 'doxymacs-mode)
(defun my-doxymacs-font-lock-hook ()
(if (or (eq major-mode 'c-mode) (eq major-mode 'c++-mode))
(doxymacs-font-lock)))
(add-hook 'font-lock-mode-hook 'my-doxymacs-font-lock-hook)
(require 'doxymacs)
;; vim 의 "%"키 처럼
(define-key global-map (kbd "%") 'match-paren)
(defun match-paren ()
"% command of vi"
(interactive)
(let ((char (char-after (point))))
(cond ((memq char '(?\( ?\{ ?\[))
(forward-sexp 1)
(backward-char 1))
((memq char '(?\) ?\} ?\]))
(forward-char 1)
(backward-sexp 1))
(t (call-interactively 'self-insert-command)))))
;(add-to-list 'vc-handled-backends 'SVN)
;(require 'gnuserv)
;(gnuserv-start)
;; mailcryt 패키지 인스톨했을 경우 필요.
;; mailcrypt 패키지 최초 설정에서 전체 사용자에게 mailcrypt 패키지를 적용시키지 않았을 경우 필요
;; dpkg-reconfigure 로 재설정 가능하다.
;;(require 'mailcrypt-init)
;; ================================================================================
;; person info
;; ================================================================================
(setq user-full-name "Doo-Hyun Jang")
(setq user-mail-address "[email protected]")
;; ================================================================================
;; 폰트 설정
;; ================================================================================
; (set-default-font "-*-*-medium-r-normal-*-14-*-*-*-*-*-fontset-sun") ;; 이맥스21에서 디폴트 폰트셋 설정 방법
; (setq load-path (nconc '("~/emacs/python-mode-1.0alpha") load-path)) ;; load-path 설정
; (setq load-path (cons "/home/dhjang/emacs" load-path))
;; ================================================================================
;; ;;indent with just spaces 들여쓰기 설정
;; ================================================================================
;;(setq-default indent-tabs-mode nil) ;; nil 이 아니면 들여쓰기 명령이 탭문자를 입력한다.(버퍼지역변수)
(setq-default indent-tabs-mode t) ;; nil 이 아니면 들여쓰기 명령이 탭문자를 입력한다.(버퍼지역변수)
(setq tab-stop-list '(4 8 12 16 20 24 28 32 26 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120))
(setq default-tab-width 4) ;; 탭간 간격(버퍼지역변수)
;; automatically indenting yanked text if in programming-modes
;; 붙여넣기 하면서 자동 들여쓰기 함수
(defadvice yank (after indent-region activate)
(if (member major-mode '(emacs-lisp-mode
c-mode c++-mode
tcl-mode sql-mode
perl-mode cperl-mode
java-mode jde-mode
LaTeX-mode TeX-mode))
(let ((transient-mark-mode nil))
(indent-region (region-beginning) (region-end) nil))))
;; ================================================================================
;; font lock 및 컬러링 설정
;; ================================================================================
(global-font-lock-mode 1) ;; 신택스 하이라이트 기능
(setq font-lock-maximum-decoration t) ;; 하이라이트 장식을 최대한으로 틀리게 함
;; (setq font-lock-support-mode 'lazy-lock-mode)
(setq lisp-font-lock-keywords 'lisp-font-lock-keywords-2)
;; (setq font-lock-face-attributes
;; ;; FACE FG BG bold italic underline
;; '((font-lock-string-face "green3")
;; ;(font-lock-emphasized-face "black" nil t nil nil)
;; ;(font-lock-other-emphasized-face "red" nil nil nil nil)
;; ;(font-lock-other-type-face "darkgreen" nil nil nil nil)
;; ;(font-lock-keyword-face "yellow3")
;; ;(font-lock-function-name-face "blue4")
;; ;(font-lock-variable-name-face "red")
;; (font-lock-type-face "violet")
;; (font-lock-constant-face "CadetBlue")))
;; ================================================================================
;; 하이라이트
;; ================================================================================
;; 하이라이트-01
;; 커서가 있는 라인을 하이라이팅 / X 윈도가 아닐 경우에는 더 불편하다.
; NNNNNN (highlight-current-line-on t)
; (highlight-current-line-set-bg-color "SlateGrey")
; (highlight-current-line-set-fg-color "none")
; (highlight-current-line-set-bg-color "#254437")
; (highlight-current-line-set-fg-color "none")
;;
;; emacs wiki
;; transient-mark-mode, delete-selection-mode, pc-selection-mode
(setq transient-mark-mode t) ; 범위 지정시 이 범위가 다른 지역과 구분되게 하기 위해
;; Delete-selection-mode, pc-selection-mode / 별 필요성을 느끼지 못하겠다.
;; Delete-Selection-Mode and Transient-Mark-Mode are also enabled.
;; Transient-Mark-mode is enabled in Delete-Selection-mode. Also, Pc-Selection-Mode includes Delete-Selection-mode.
;;(pc-selection-mode) ; 일반 PC 컴타의 키바인딩을 인식시켜줌
; This allows you to use the `S-<left>' and `S-<right>' to extend or shrink the region.
; Ditto for `C-S-<left>' and `C-S-<right>' as well as lots of other combinations well known
; from the Windows 3.11 world. My favorite is `S-<insert>', `C-<insert>', and `S-<delete>'
; to paste, copy, and cut the region.
;;(delete-selection-mode 1) ; Delete Selection mode lets you treat an Emacs region like a Windows selection:
; You can replace the region just by typing text, and delete it just by typing the Backspace key (DEL).
;;
;; highlight-completion / 미니 버퍼에서 사용되는 자동 완성 기능에 대한 하이라이팅
;; 'Highlight completion' is a variant on completion in Emacs.
;; Normally if you're typing a file name into the minibuffer in Emacs, when you hit the TAB key,
;; Emacs completes what you already have as far as possible.
;; This package augments this by displaying the text that Emacs would add if you hit the TAB key, highlighted.
;; (The idea is that, if you're not looking at the screen, you won't know that anything different is happening,
;; but if you are looking, you get extra information.)
;;
;; http://www.math.washington.edu/~palmieri/Emacs/hlc.html 참조
;;--------------------------------------------------------------------------------
;; This package modified how Emacs performs completions.
;; Ordinarily, if you are typing a file name into the minibuffer (after hitting C-x C-f, say),
;; if you type a few letters and hit the TAB key, then Emacs completes as far as possible.
;; For example, suppose a directory contains only these files:
;;
;; filbert filibuster frank grunge.tex
;;
;; If you type g followed by TAB, then runge.tex is inserted. If you hit fi then TAB, an l is inserted.
;; If you hit f then TAB, there is no unique continuation of the file name,
;; so Emacs opens up a new window displaying the list of possible completions.
;;
;; That's the old system. This package provides a variant: if you type g, then runge.tex is automatically inserted as highlighted text,
;; to indicate that it's only provisional. The point remains immediately after the g. If you hit TAB, the point jumps to the end,
;; and the added text is no longer highlighted.
;; (So if you weren't looking at the screen, you wouldn't know that anything different had happened.) If after hitting g, you typed a
;; (because you wanted to find a new file gaptooth.el) the highlighted text would disappear. The effects of various keys:
;;
;; TAB: jump forward to the end of the highlighted text. If no text is highlighted, open up a window showing possible completions.
;; SPC: jump forward a word (so g followed by SPC would yield grunge.tex, with the point after the ., and with tex highlighted).
;; If no text is highlighted, open up a window showing possible completions.
;; ?: open up a window showing possible completions.
;; RET: open the named file (so g followed by RET would open grunge.tex).
;; C-g: stop this modified completion process and exit the minibuffer.
;; C-c: delete the highlighted text and stop this modified completion process.
;; character: if consistent with completion, unhighlight it and move the point forward. if inconsistent,
;; insert the character and delete the highlighted text, stopping this completion process.
;; --------------------------------------------------------------------------------
;; How to use:
;; 1. Put the file highlight-completion.el in your load-path.
;; 2. Put (require 'highlight-completion) in your .emacs file (or your .xemacs/init.el file).
;; 3. Turn on highlight completion by either
;;
;; M-x highlight-completion-mode
;;
;; or customizing variables:
;;
;; M-x customize-group highlight-completion
;;
;; Then turn on "Highlight completion mode". You may want to modify some of the entries in "Highlight completion list".
;; 4. You can also run the functions
;;
;; hc-completing-insert-file-name to complete file names
;; hc-completing-insert-lisp-function lisp functions
;; hc-completing-insert-lisp-variable lisp variables
;; hc-completing-insert-kill contents of kill ring
;; hc-completing-insert-buffer contents buffer contents
;; hc-ispell-complete-word words from a dictionary, using ispell
;;
;; These functions can be used anywhere, not just in the minibuffer.
; (highlight-completion-mode 1)
;;
;; 컬러 설정(범위지정시 범위가 다른 지역과 구분되게 설정 하였을 경우) / highlight-completion 도 적용받음
(set-face-foreground 'region "white")
;;(set-face-background 'region "#254437")
(set-face-background 'region "cadetblue")
;;
;; emacs wiki
;; emacs 종료시 변경된 버퍼 하이라이트
(highlight-changes-mode 1)
;; ================================================================================
;; mode line hacking. 모드라인 컬러링및 기타 display 설정
;; ================================================================================
(setq-default mode-line-format
'(""
(current-input-method ;; input-method표시 선택이 않됐을 경우에는 현재 위치를 퍼센트로 표시
(3 . current-input-method-title)
(-3 . "%p"))
"%Z" ;; 키보드 코딩 시스템 표시
mode-line-modified
mode-line-buffer-identification
" %[(" mode-name mode-line-process minor-mode-alist "%n" ")%]" ;; 주모드및 보조 모드 리커시브 편집표시
(which-func-mode ("" which-func-format))
(" " "L" "%l" "." "C" "%c") ;; 라인 및 컬럼 표시
global-mode-string ;; display-time 표시
" "
default-directory))
(setq-default mode-line-modified '("%1*%1+"))
(setq-default mode-line-frame-identification '("%F"))
;; 밑에 3개 중에서 사용자 취향대로 선택해서 사용하기 바란다. 단 3개를 동시에 사용하면 안된다.
(setq-default mode-line-buffer-identification '("%b:<%p>")) ;파일을 열었을 경우 뒤에 현 파일의 위치를 퍼센트로 표시
;;(setq-default mode-line-buffer-identification '("%b:%l.%c<%p>")) ;라인과 컬럼을 같이 표시
;;(setq-default mode-line-buffer-identification '("%b")) ;파일 이름만을 표시
;display-time에 대한 표시설정. 주석처리되 부분은 메일이 왔을 경우 메일 왔음을 알린다(하지만 귀찮기만 하다)
(setq display-time-string-forms
'(" ["24-hours ":" minutes am-pm" " monthname" " day "]"))
;; (if mail " <You got mail!!>" " " ) ;메일이 왔을 경우 모드라인에 표시되는 방법 설정
;; (if mail "" year) (if mail "" "/") (if mail "" month) (if mail "" "/") (if mail "" day)))
;;모드라인에 현재 커서의 줄과 칼럼위치 시간 표시('mode line hacking'때문에 필요 없음)
(setq column-number-mode t) ;;컬럼수를 모드라인에 표시할 경우 에디팅 속도가 느려진다
;;(setq line-number-mode t)
;;(setq display-time-day-and-date t)
(display-time)
;; mode-line color
(when enable-multibyte-characters
(set-face-foreground 'modeline "blue")
(set-face-background 'modeline "khaki"))
(unless enable-multibyte-characters
(set-face-foreground 'modeline "Red")
(set-face-background 'modeline "Yellow"))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;; 패키지/모드에 관한 설정 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;이맥스를 처음 실행시켰을때 디폴트로 text모드로 작동하게 함
;(setq default-major-mode 'text-mode)
;(setq initial-major-mode 'text-mode)
;;text-mode
(add-hook 'text-mode-hook
'(lambda ()
(turn-on-font-lock)
(modify-syntax-entry ?\" "\"")
(modify-syntax-entry ?< "(>")
(modify-syntax-entry ?> ")<")))
;; ================================================================================
;; speedbar 패키지메뉴로 등록
;; ================================================================================
(define-key-after (lookup-key global-map [menu-bar tools])
[speedbar] '("Speedbar" . speedbar-frame-mode) [calendar])
;; ================================================================================
;; dired-mode
;; ================================================================================
;;중요 파일들은 표시가 안됨
;;초보일 경우 이 주석들을 제거하고 dired 모드를 사용하는것이 좋다.
;;어느정도 리눅스에 익숙한 사용자라면 아래 내용을 주석 처리하고 그냥 사용할것.
(add-hook 'dired-load-hook
'(lambda ()
(load-library "dired-x")
(setq dired-omit-files-p t) ; Enable toggling of uninteresting files.
(setq dired-omit-files
"^RCS$\\|^CVS$\\|,v$\\|^\\.?#\\|^\\.$\\|^\\.\\.$")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(fset 'yes-or-no-p 'y-or-n-p) ;; disable some novice confirmation features.
(setq dired-recursive-deletes 'top) ;; dired 모드에서 디렉토리를 지울때 행동을 규정
(setq dired-backup-overwrite 'always)
(setq dired-listing-switches "-alh") ;; dired-mode에서 전달되는 인수
;; always : 비어있지 않은 디렉토리를 지울때 물어보지 않고 바로 실행
;; top : 비어있지 않은 디렉토리를 지울때 최상위 디렉토리에 대해서만 물어봄, 서브 디렉토리에 대해서는 물어보지 않음
(setq dired-no-confirm
'(byte-compile chgrp chmod chown compress copy delete hardlink load
move print shell symlink uncompress))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(push ".cma" dired-omit-extensions)
(push ".cmi" dired-omit-extensions)
(push ".cmo" dired-omit-extensions)
(push ".cmx" dired-omit-extensions)))
;; dired 모드에서 한글을 제대로 보기위해
;;(defun dired-load-hook-fn ()
;; (setq dired-move-to-filename-regexp
;; (concat "\\("
;; dired-move-to-filename-regexp
;; ;;"\\|"
;;
;; ;;"[12][90][0-9][0-9]년[ ][1 ][0-9]월[ ][ 1-3][0-9]일[ ]"
;;
;; "\\|"
;;
;; "1?[0-9]월[ ]+[1-3]?[0-9]일?[ ]+[0-9:]+[ ]"
;; "\\)")))
;; ================================================================================
;; thumb모드. 이미지를 Thumbnail로 보여준다. 시스템 로드 엄청 잡아먹는다.(다운받은 Lisp)
;; ================================================================================
;;(autoload 'thumbs "thumbs" "Preview images in a directory." t)
;; ================================================================================
;; ange-ftp
;; ================================================================================
;; 자주 방문하는 사이트는 아래처럼 주소, 아이디, 패스를 등록하여 로그인 과정을 생략할 수 있다
;; (ange-ftpet-passwd "<host>" "<id>" "<pass>")
;; (ange-ftpet-passwd "<host>" "<id>" "<pass>")
(setq ange-ftp-generate-anonymous-password "[email protected]")
;; ange-ftp에서 패시브 모드 사용을 위해서
(add-hook 'ange-ftp-process-startup-hook 'ange-ftp-passive-mode)
(defun ange-ftp-passive-mode ()
(send-string proc "passive\n"))
;; ================================================================================
;; tramp 패키지 설정
;; ================================================================================
(require 'tramp)
(setq tramp-chunksize 500)
(setq tramp-default-method "sm")
(setq find-file-visit-truename nil)
(setq password-cache-expiry nil)
;; (setq tramp-default-method "scp") ; external methods ssh with scp
(setq tramp-default-method "ssh")
(setq find-file-visit-truename nil)
;; It makes Emacs beep after reading from or writing to the remote host.
(defadvice tramp-handle-write-region
(after tramp-write-beep-advice activate)
" make tramp beep after writing a file."
(interactive)
(beep))
(defadvice tramp-handle-do-copy-or-rename-file
(after tramp-copy-beep-advice activate)
" make tramp beep after copying a file."
(interactive)
(beep))
(defadvice tramp-handle-insert-file-contents
(after tramp-copy-beep-advice activate)
" make tramp beep after copying a file."
(interactive)
(beep))
;; ================================================================================
;; mailcrypt 패키지 설정
;; ================================================================================
; (mc-setversion "gpg") ;;pgp대신 gpg사용을 위해 디폴트는 pgp
; (autoload 'mc-install-write-mode "mailcrypt" nil t)
; (autoload 'mc-install-read-mode "mailcrypt" nil t)
; (add-hook 'mail-mode-hook 'mc-install-write-mode)
; ;;(add-hook 'gnus-summary-mode-hook 'mc-install-read-mode)
; ;;(add-hook 'message-mode-hook 'mc-install-write-mode)
; ;;(add-hook 'news-reply-mode-hook 'mc-install-write-mode)
; ;; 모든 메세지에 자동으로 sign을 보내기 위해 사인한 메세지를 보낼지 물어봄
; (setq mc-gpg-user-id "pcharley") ;; 계정 id와 gpg 서명 id가 다를 경우에 사용할 서명 id를 적어줍니다.
; (setq mc-gpg-comment
; (format "Mailcrypt %s and GnuPG" mc-version))
; (add-hook 'message-send-hook 'my-sign-message)
; (defun my-sign-message ()
; (load-library "mc-toplev")
; (interactive)
; (if (yes-or-no-p "Sign message? ")
; (my-sign-message)))
; ;; 서명된 메세지의 확인은 `mc-verify' (C-c / v)로 합니다
;; ================================================================================
;; mail &message setting
;; ================================================================================
(setq rmail-mail-new-frame t) ;메일 메시지를 발송하기 위한 새로운 프레임을 생성
;;(setq user-mail-address "[email protected]") ;이메일 주소
(setq mail-archive-file-name "~/Mail/outgoing") ;발송메일을 저장하는파일명
(setq mail-yank-prefix ">") ;메일 답장할때 원본내용 앞에 삽입할 문자
(setq message-user-organization "Unix Network World")
(setq message-default-headers
(concat "Mime-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n" ;
"Content-Transfer-Encoding: 8bit\n"
"Reply-to: [email protected]\n"
"Gcc: nnfolder+archive:mail."
(format-time-string "%Y-%m") "\n"
))
;; ================================================================================
;; bm.el 설정
;; ================================================================================
;; (require 'bm)
;; or
(autoload 'bm-toggle "bm" "Toggle bookmark in current buffer." t)
(autoload 'bm-next "bm" "Goto bookmark." t)
(autoload 'bm-previous "bm" "Goto previous bookmark." t)
;;; Configuration:
;;
;; To make it easier to use, assign the commands to some keys.
;;
;; M$ Visual Studio key setup.
(global-set-key (kbd "<C-f2>") 'bm-toggle)
(global-set-key (kbd "<f2>") 'bm-next)
(global-set-key (kbd "<S-f2>") 'bm-previous)
;; ================================================================================
;; naver 영한사전 by 정재윤
;; ================================================================================
(require 'cl)
(defun ndic (word)
"simple naver dictionary browser"
(interactive
(list (let ((wd (current-word)))
(read-string (format "dict naver (default '%s'): " wd)))))
(let ((url
(format "http://endic.naver.com/search.naver?where=dic&query=%s"
(qs-url-encode word))))
(with-output-to-temp-buffer "*ndic*"
(set-buffer "*ndic*")
(setq buffer-read-only nil)
(erase-buffer)
(call-process "wget" nil (current-buffer) nil "-q" "-O-" url)
(setf (point) (point-min))
(when (looking-at "<META HTTP-EQUIV=")
(progn (re-search-forward "url=")
(delete-region (point-min) (point))
(re-search-forward "\"")
(setq url (format "http://endic.naver.com%s"
(buffer-substring (point-min) (1- (point)))))
(erase-buffer)
(call-process "wget" nil (current-buffer) nil "-q" "-O-" url)
(setf (point) (point-min))))
(when (search-forward "<!-- end :" nil t)
(beginning-of-line 2)
(delete-region (point-min) (point)))
(when (search-forward "<!-- start :" nil t)
(beginning-of-line 0)
(delete-region (point) (point-max)))
(setf (point) (point-min))
(while (re-search-forward "<[^>]+>" nil t) (replace-match ""))
(setf (point) (point-min))
(while (re-search-forward "&[^;]+;" nil t) (replace-match ""))
(setf (point) (point-min))
(when (re-search-forward (format "^%s" word) nil t)
(beginning-of-line 0)
(delete-region (point-min) (point)))
(setf (point) (point-min))
(insert (format "definition of %s: %s\n" word url))
(pop-to-buffer "*ndic*"))))
(defun qs-url-encode (str &optional coding)
"urlencode the string"
(loop for c across (encode-coding-string str (or coding 'utf-8))
concat (cond ((eq c ?\n) "%0D%0A")
((string-match "[-a-zA-Z0-9_:/.]" (char-to-string c))
(char-to-string c))
((char-equal c ?\x20) "+")
(t (format "%%%02x" c)))))
;; ================================================================================
;; MSIE에서 web accessories를 깔고 난 후에 주소창에서 쓰던 기능을 emacs에서 구현
;; by 정재윤
;; ================================================================================
(require 'ffap)
(defconst qs-keywords
'(
a "http://www.google.com/answers/search?qtype=answered&q=%s"
av "http://www.altavista.com/cgi-bin/query?text=yes&q=%s"
bible "http://bible.gospelcom.net/cgi-bin/bible?passage=%s"
dict "http://www.dictionary.com/cgi-bin/dict.pl?term=%s"
dmoz "http://search.dmoz.org/cgi-bin/search?search=%s"
e "http://www.thefreedictionary.com/%s"
f "http://wombat.doc.ic.ac.uk/foldoc/foldoc.cgi?query=%s&action=Search"
fm "http://freshmeat.net/search/?q=%s"
g "http://www.google.com/search?q=%s"
gg "http://www.google.com/search?btnI=1&q=%s"
gk "http://labs.google.com/cgi-bin/keys?q=%s"
gl "http://labs.google.com/glossary?q=%s"
gm "http://www.google.com/microsoft?hq=microsoft&q=%s"
gn "http://groups.google.com/groups?q=%s"
imdb "http://www.imdb.com/Tsearch?%s"
isbn "http://isbn.nu/%s/price"
m "http://planetmath.org/?op=search&term=%s"
mskb "http://cryo.gen.nz/projects/mskb/?q=%s"
mw "http://www.m-w.com/cgi-bin/dictionary?book=Dictionary&va=%s"
n "http://search.naver.com/search.naver?where=nexearch&query=%s"
nb "http://100.naver.com/search.naver?query=%s"
nd "http://dic.naver.com/endic?where=dic&query=%s"
ni "http://kinsearch.naver.com/search.naver?where=allqna&query=%s"
r "http://ragingsearch.altavista.com/cgi-bin/query?q=%s"
rc5 "http://stats.distributed.net/rc5-64/psearch.php3?st=%s"
rfc "http://www.faqs.org/rfcs/rfc%s.html"
rhyme "http://rhyme.lycos.com/r/rhyme.cgi?Word=%s"
s "http://citeseer.ist.psu.edu/cis?q=%s&submit=Search+Documents&cs=1"
t "http://s.teoma.com/search?q=%s&qcat=1&qsrc=0"
thes "http://www.thesaurus.com/cgi-bin/search?config=roget&words=%s"
w "http://www.wikipedia.org/w/wiki.phtml?search=%s"
whats "http://www.netcraft.com/whats/?host=%s"
whois "http://www.domainwatch.com/getwho.cgi?dom=%s"
wp "http://www.whitepages.co.nz/cgi-bin/search?loc=AK&key=%s"
yd "http://kr.engdic.yahoo.com/search/engdic?p=%s"
yp "http://www.yellowpages.co.nz/quick/search?lkey=Auckland&key=%s"
;; these are later add on -- not from registry
fi "http://www.fact-index.com/search/search.html?search=%s"
wi "http://en.wikipedia.org/wiki/%s"
))
(defun qs-search (url-string)
"immitage the search url facility in MSIE w/ web accessories"
(interactive "sURL ('?' for help): ")
(when (or (null url-string)
(string= url-string ""))
(setq url-string (ignore-errors (ffap-prompter))))
(flet ((browse (url) (browse-url url (or current-prefix-arg t))))
(let* ((pos (position ? url-string))
(key (intern (substring url-string 0 pos)))
(idx (position key qs-keywords)))
(if (and pos idx)
(let ((buzzword (substring url-string (1+ pos))))
(browse (format (nth (1+ idx) qs-keywords)
(qs-url-encode buzzword))))
(if (string= url-string "?")
(with-output-to-temp-buffer "*Help*"
(princ "Simply type any url ('https?://' is optional) or")
(terpri) (terpri)
(loop for key in qs-keywords by #'cddr
for url in (cdr qs-keywords) by #'cddr
do (princ (format " %-10s%s" key url))
do (terpri)))
(or (string-match "^https?://" url-string)
(setq url-string (concat "http://" url-string)))
(browse url-string))))))
(define-key mode-specific-map "d" 'qs-search)
;; C-c d를 누르고 "w Poincare Conjecture"를 치시면 포앙카레 컨젝쳐가 뭔지 바로 알 수 있다.
;; 위에 올린 (require 'cl)하고 qs-url-encode 도 있어야 합니다.
;; by 정재윤
;; ================================================================================
;; 단순 shell 모드에 대한 환경 지정. eshell 모드 사용을 강력 권장
;; by 정재윤
;; ================================================================================
(add-hook 'shell-mode-hook 'shell-integration-hook)
(defun shell-integration-hook ()
(make-local-variable 'comint-input-sender)
(setq comint-input-sender 'shell-integration-sender))
(defun shell-integration-sender (process command)
(setq command command)
(let* ((program (comint-arguments command 0 0))
(func (intern (format "shell/%s" program))))
(if (not (fboundp func))
(comint-simple-send process command)
(comint-simple-send process (format "# %s" command))
(funcall func process command))))
;; shell 모드에서 "vi filename" 하면 filename이 emacs에서 열리고, make를 치면 알아서 compile버퍼로 넘어가서 실행.
;; by 정재윤
(defun shell/vi (process command)
(find-file (comint-arguments command 1 1) nil))
(defun shell/make (process command)
(compile command))
;; 해당하는 명령이 M-p, M-n.
;; by 정재윤
(add-hook 'shell-mode-hook 'shell-custom-bindings)
(defun shell-custom-bindings ()
(define-key shell-mode-map (kbd "<up>") (kbd "M-p"))
(define-key shell-mode-map (kbd "<down>") (kbd "M-n"))
(define-key shell-mode-map (kbd "C-p") (kbd "M-p"))
(define-key shell-mode-map (kbd "C-n") (kbd "M-n")))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; calender & diary 설정
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ================================================================================
;; diary & calendar
;; ================================================================================
;; calendar 위도, 경도, 위치
(setq calendar-latitude [37 34 north])
(setq calendar-longitude [126 34 east])
(setq calendar-location-name "Seoul")
;; ================================================================================
;; calender에서 음력표시(emacs메일리스트에서 참조)
;; ================================================================================
;; p o calendar-print-other-dates
;; p m calendar-print-mayan-date
;; p f calendar-print-french-date
;; p i calendar-print-islamic-date
;; p h calendar-print-hebrew-date
;; p a calendar-print-astro-day-number
;; p j calendar-print-julian-date
;; p c calendar-print-iso-date (includes number of the week!)
;; p p calendar-print-persian-date
;; p e calendar-print-ethiopic-date
;; p k calendar-print-coptic-date
;; p C calendar-print-chinese-date
;; p d calendar-print-day-of-year
(require 'cal-china)
(defun from-chinese-to-gregorian (date-list)
"date-list is '(m d) or '(m d y) in chinese date"
(let* ((date (if (= (length date-list) 2)
(append '(12 31)
(cdr (cdr (calendar-current-date))))
(append '(12 31) (cdr (cdr date-list)))))
(c-date (calendar-chinese-from-absolute
(calendar-absolute-from-gregorian date)))
(cycle (car c-date))
(year (car (cdr c-date)))
(month (car date-list))
(day (car (cdr date-list))))
(calendar-gregorian-from-absolute (calendar-absolute-from-chinese
(list cycle year month day)))))
;;특정 음력일을 변수에 할당하여 선언
(setq korean-new-year-day (from-chinese-to-gregorian '(1 1)))
(setq buddha-day (from-chinese-to-gregorian '(4 8)))
(setq korean-thanksgiving-day (from-chinese-to-gregorian '(8 15)))
(setq other-holidays
'((holiday-fixed 1 1 "New Year's Day") ;; 1月1日(신정)
(holiday-fixed 1 14 "Diary Day") ;; 1月14日
(holiday-fixed (extract-calendar-month korean-new-year-day) ;; 구정
(extract-calendar-day korean-new-year-day)
"Lunar New Year's Day")
(holiday-fixed 2 14 "Valentine's Day") ;; 2月14日
(holiday-fixed 3 1 "Anniversary of the Samil Independence Movement") ;; 삼일절
(holiday-fixed 3 14 "White Day") ;; 3月14日
(holiday-fixed 4 5 "Arbor Day") ;; 식목일
(holiday-fixed 4 14 "Black Day") ;; 5月14日
(holiday-fixed 5 5 "Children's Day") ;; 어린이날
(holiday-fixed 5 14 "Yellow & Rose Day") ;; 5月14日
(holiday-fixed (extract-calendar-month buddha-day) ;; 부처님 오신날
(extract-calendar-day buddha-day)
"Buddha's Day")
(holiday-fixed 6 6 "Memorial Day") ;; 현충일
(holiday-fixed 6 14 "Kiss Day") ;; 6月14日
(holiday-fixed 7 17 "Constitution Day") ;; 제헌절
(holiday-fixed 7 14 "Siver Day") ;; 7月14日
(holiday-fixed 8 14 "Green Day") ;; 8月14日
(holiday-fixed 8 15 "Independence Day of Korea") ;; 광복절
(holiday-fixed 9 14 "Music Day & Photo Day") ;; 9月14日
(holiday-fixed (extract-calendar-month korean-thanksgiving-day) ;; 추석
(extract-calendar-day korean-thanksgiving-day)
"Korean Thanksgiving Day(Harvest Moon Day)")
(holiday-fixed 10 14 "Red Day(Wine Day)") ;; 10月14日
(holiday-fixed 10 3 "Anniversary of Dangun's Accession") ;; 개천절
(holiday-fixed 11 14 "Orange Day & Movie Day") ;; 11月14日
(holiday-fixed 12 14 "Hug Day & Money Day") ;; 12月14日
(holiday-fixed 12 25 "Christmas Day"))) ;; 크리스 마스
(setq local-holidays '((holiday-fixed 4 13 "Assemblyman Election Day"))) ;; 임시정부수립기념일
(setq calendar-holidays (append other-holidays local-holidays))
;; 1월14일 : 다이어리 데이(일년동안 쓸 다이어리를 연인에게 선물하는 날)
;; 2월14일 : 발렌타인 데이
;; 3월14일 : 화이트 데이(남자가 좋아하는 여자에게 사탕을 선물하며 자신의 마음을 전하는 날. 서양에는 없고 동양에만 있다.
;; 발렌타인데이에 사랑을 고백한 여자의 마음을 남자가 받아들일 경우라면 사탕을 선물한다. 연인들에게는 남자가 밸런타인데이에 받은 선물을 답례하는
;; 날로서 의미를 가진다)
;; 4월14일 : 블랙 데이(밸런타인데이에 초콜릿을 받지 못한 남자와 화이트데이에 사탕을 받지 못한 여자가 만나 서로 외로움을 달래주는 날. 이날은
;; 옷을 비롯해 구두, 양말, 액세서리까지 검정색으로 입어야 하고 먹는 것도 자장면을 먹고 카페에 가도 블랙커피를 마신다)
;; 5월14일 : 옐로우 & 로즈데이(블랙데이까지 연인을 사귀지 못한 사람이 노란옷을 입고 카레를 먹어야 독신을 면한다는 날
;; 반면 연인이 된 사람들에게는 장미가 만발한 가운데 아름다운 데이트를 하는날)
;; 6월14일 : 키스데이(로즈데이를 무난히 치러낸 연인들이라면 키스할 만큼 분위기가 무르익었을까..?)
;; 7월14일 : 실버데이(학교-직장의 선배 또는 어른들께 데이트 비용을 부담하게 하면서 자신의 애인을 선보이는날)
;; 8월14일 : 그린데이(연인과 함께 무더운 날씨를 피해 산속을 손잡고 걸으며 삼림욕 하는 날. 애인이 없는 사람들은 순한 소주를 마시며 외로움을 달래는 날)
;; 9월14일 : 뮤직 & 포토데이(나이트클럽등 음악이 있는 곳에서 친구들을 모아놓고 연인을 소개하면서 둘 사이를 공식화하는 날이다. 청명한 가을 하늘 아래서
;; 연인과 사진을 찍는 날이기도 하다)
;; 10월14일 : 레드데이(와인데이)(깊어가는 가을 연인과 함께 분위기 있게 와인을 마시는 날)
;; 11월14일 : 오렌지 & 무비데이(오렌지쥬스를 마시며 사랑의 상큼함을 느끼는 날. 연인끼리 영화를 보는 날이기도 하다)
;; 12월14일 : 허그 & 머니데이(연인끼리 껴안는것이 허락되고, 남자는 여자에게 돈을 팍팍쓰며 봉사하는 날이다)
;; ================================================================================
;; Here is some code to make your calendar and diary display fancier:
;; ================================================================================
;; diary & calendar 외관 설정
(setq view-diary-entries-initially t ;; calendar가 시작할때 diary의 요약 내용을 보여줌
mark-diary-entries-in-calendar t ;; calendar에 diary에 내용이 있는 날짜를 mark 함
number-of-diary-entries 7) ;; diary의 내용을 7일까지 보여줌
(add-hook 'diary-display-hook 'fancy-diary-display)
(add-hook 'today-visible-calendar-hook 'calendar-mark-today)
;; ================================================================================
;; emacs wiki
;; diary 내용 요약 페이지에 ==== 를 없애는 설정 / 헷갈린다.