.emacs-my
changeset 1439 6fc6ce787711
parent 1438 57d7478f265d
child 1440 0653019d58f1
equal deleted inserted replaced
1438:57d7478f265d 1439:6fc6ce787711
   413 ;; See what I am typing immediately (for keystroke in minibuffer).
   413 ;; See what I am typing immediately (for keystroke in minibuffer).
   414 (setq echo-keystrokes 0.2)
   414 (setq echo-keystrokes 0.2)
   415 
   415 
   416 (cond
   416 (cond
   417  ((eq window-system 'x)
   417  ((eq window-system 'x)
   418   (when (find-font (font-spec :name "DejaVu Sans Mono-11:weight=normal"))
   418   (if (and (fboundp 'find-font) (find-font (font-spec :name "DejaVu Sans Mono-11:weight=normal")))
   419     (set-frame-font "DejaVu Sans Mono-11")))
   419       (set-frame-font "DejaVu Sans Mono-11")
       
   420     (set-frame-font "7x14")))
   420  ((eq window-system 'w32)
   421  ((eq window-system 'w32)
   421   (set-frame-font "Courier New-10:antialias=none") ))
   422   (set-frame-font "Courier New-10:antialias=none") ))
   422 
   423 
   423 (fset 'yes-or-no-p 'y-or-n-p)
   424 (fset 'yes-or-no-p 'y-or-n-p)
   424 
   425 
   444 (setq display-time-default-load-average nil)
   445 (setq display-time-default-load-average nil)
   445 (display-time)                          ; display-time-mode
   446 (display-time)                          ; display-time-mode
   446 
   447 
   447 ;; For (display-time-world).
   448 ;; For (display-time-world).
   448 (setq display-time-world-time-format "%A %d %B %R %z %Z")
   449 (setq display-time-world-time-format "%A %d %B %R %z %Z")
   449 (mapc (lambda (el) (add-to-list 'display-time-world-list el))
   450 (when (boundp 'display-time-world-list) ; Absent in Emacs 22.
   450       '(("EET" "UTC+2, Eastern European Time")
   451   (mapc (lambda (el) (add-to-list 'display-time-world-list el))
   451         ("EST" "UTC-5, Eastern Standard Time, New York")
   452         '(("EET" "UTC+2, Eastern European Time")
   452         ("EDT" "UTC-4, Eastern Daylight Time, New York")))
   453           ("EST" "UTC-5, Eastern Standard Time, New York")
       
   454           ("EDT" "UTC-4, Eastern Daylight Time, New York"))))
   453 
   455 
   454 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   456 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   455 (message "shell, bash, Cygwin, MSYS")
   457 (message "shell, bash, Cygwin, MSYS")
   456 
   458 
   457 (eval-when 'compile (require 'shell))
   459 (eval-when 'compile (require 'shell))
   879 (global-set-key (kbd "C-\\") 'my-toggle-input-method)
   881 (global-set-key (kbd "C-\\") 'my-toggle-input-method)
   880 
   882 
   881 ;; I found this more quick method to allow `forward-word' across pronunciation
   883 ;; I found this more quick method to allow `forward-word' across pronunciation
   882 ;; as a whole word.
   884 ;; as a whole word.
   883 (defconst my/ipa-chars (list ?ˈ ?ˌ ?ː ?ǁ ?ʲ ?θ ?ð ?ŋ ?ɡ ?ʒ ?ʃ ?ʧ ?ə ?ɜ ?ɛ ?ʌ ?ɒ ?ɔ ?ɑ ?æ ?ʊ ?ɪ))
   885 (defconst my/ipa-chars (list ?ˈ ?ˌ ?ː ?ǁ ?ʲ ?θ ?ð ?ŋ ?ɡ ?ʒ ?ʃ ?ʧ ?ə ?ɜ ?ɛ ?ʌ ?ɒ ?ɔ ?ɑ ?æ ?ʊ ?ɪ))
   884 (mapc (lambda (ch)
   886 (when (boundp 'char-script-table)       ; Absent in Emacs 22.
   885         (aset char-script-table ch 'latin)
   887   (mapc (lambda (ch)
   886         (modify-syntax-entry ch "w"))
   888           (aset char-script-table ch 'latin)
   887       my/ipa-chars)
   889           (modify-syntax-entry ch "w"))
       
   890         my/ipa-chars))
   888 ;; Another option is to invent new category:
   891 ;; Another option is to invent new category:
   889 ;;
   892 ;;
   890 ;; (defconst my/ipa-chars (list ?ˈ ?ˌ ?ː ?ǁ ?ʲ ?θ ?ð ?ŋ ?ɡ ?ʒ ?ʃ ?ʧ ?ə ?ɜ ?ɛ ?ʌ ?ɒ ?ɔ ?ɑ ?æ ?ʊ ?ɪ))
   893 ;; (defconst my/ipa-chars (list ?ˈ ?ˌ ?ː ?ǁ ?ʲ ?θ ?ð ?ŋ ?ɡ ?ʒ ?ʃ ?ʧ ?ə ?ɜ ?ɛ ?ʌ ?ɒ ?ɔ ?ɑ ?æ ?ʊ ?ɪ))
   891 ;; (define-category ?p "Phonetic")
   894 ;; (define-category ?p "Phonetic")
   892 ;; (mapc (lambda (ch)
   895 ;; (mapc (lambda (ch)
  1075 (require 'icomplete)
  1078 (require 'icomplete)
  1076 
  1079 
  1077 (icomplete-mode 1)
  1080 (icomplete-mode 1)
  1078 (setq icomplete-with-completion-tables t)
  1081 (setq icomplete-with-completion-tables t)
  1079 
  1082 
       
  1083 ;; Another alternative to `icomplete' is `smex' https://github.com/nonsequitur/smex/
       
  1084 ;; which is based on `ido'.
       
  1085 
  1080 (defun my--large-file-p ()
  1086 (defun my--large-file-p ()
  1081   "If buffer too large and my cause performance issue."
  1087   "If buffer too large and my cause performance issue."
  1082   (< large-file-warning-threshold (buffer-size)))
  1088   (< large-file-warning-threshold (buffer-size)))
  1083 
  1089 
  1084 (define-derived-mode my-large-file-mode fundamental-mode "LargeFile"
  1090 (define-derived-mode my-large-file-mode fundamental-mode "LargeFile"
  1415 (message "rst, reStructuredText")
  1421 (message "rst, reStructuredText")
  1416 
  1422 
  1417 ;; Maintaining the table of contents up-to-date.
  1423 ;; Maintaining the table of contents up-to-date.
  1418 (add-hook 'rst-adjust-hook 'rst-toc-update)
  1424 (add-hook 'rst-adjust-hook 'rst-toc-update)
  1419 
  1425 
  1420 (modify-coding-system-alist 'file "\\.rst\\'" 'prefer-utf-8-unix)
  1426 (if (coding-system-p 'prefer-utf-8-unix)
       
  1427     (modify-coding-system-alist 'file "\\.rst\\'" 'prefer-utf-8-unix)
       
  1428   (modify-coding-system-alist 'file "\\.rst\\'" 'utf-8-unix))
  1421 
  1429 
  1422 (unless window-system
  1430 (unless window-system
  1423   (my--eval-after-load rst
  1431   (my--eval-after-load rst
  1424     (custom-set-faces
  1432     (custom-set-faces
  1425      '(rst-level-1-face ((t (:background "yellow"))) t)
  1433      '(rst-level-1-face ((t (:background "yellow"))) t)
  1754 ;; (setq mail-from-style 'angles)
  1762 ;; (setq mail-from-style 'angles)
  1755 
  1763 
  1756 (setq mail-personal-alias-file "~/.mailrc")
  1764 (setq mail-personal-alias-file "~/.mailrc")
  1757 ;; Initialize from your mail aliases file...
  1765 ;; Initialize from your mail aliases file...
  1758 (setq mail-aliases t)
  1766 (setq mail-aliases t)
  1759 (require 'ecomplete)
  1767 (require 'ecomplete nil t)              ; Absent in Emacs 22.
  1760 (setq message-mail-alias-type '(abbrev ecomplete))
  1768 (setq message-mail-alias-type '(abbrev ecomplete))
  1761 
  1769 
  1762 (my--eval-after-load message
  1770 (my--eval-after-load message
  1763   (require 'mailabbrev)
  1771   (require 'mailabbrev)
  1764   (define-key message-mode-map "\e\t" 'mail-abbrev-complete-alias))
  1772   (define-key message-mode-map "\e\t" 'mail-abbrev-complete-alias))