Port to Emacs 22.
--- a/.emacs-my Thu Oct 06 21:04:15 2016 +0300
+++ b/.emacs-my Fri Oct 07 02:16:30 2016 +0300
@@ -415,8 +415,9 @@
(cond
((eq window-system 'x)
- (when (find-font (font-spec :name "DejaVu Sans Mono-11:weight=normal"))
- (set-frame-font "DejaVu Sans Mono-11")))
+ (if (and (fboundp 'find-font) (find-font (font-spec :name "DejaVu Sans Mono-11:weight=normal")))
+ (set-frame-font "DejaVu Sans Mono-11")
+ (set-frame-font "7x14")))
((eq window-system 'w32)
(set-frame-font "Courier New-10:antialias=none") ))
@@ -446,10 +447,11 @@
;; For (display-time-world).
(setq display-time-world-time-format "%A %d %B %R %z %Z")
-(mapc (lambda (el) (add-to-list 'display-time-world-list el))
- '(("EET" "UTC+2, Eastern European Time")
- ("EST" "UTC-5, Eastern Standard Time, New York")
- ("EDT" "UTC-4, Eastern Daylight Time, New York")))
+(when (boundp 'display-time-world-list) ; Absent in Emacs 22.
+ (mapc (lambda (el) (add-to-list 'display-time-world-list el))
+ '(("EET" "UTC+2, Eastern European Time")
+ ("EST" "UTC-5, Eastern Standard Time, New York")
+ ("EDT" "UTC-4, Eastern Daylight Time, New York"))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(message "shell, bash, Cygwin, MSYS")
@@ -881,10 +883,11 @@
;; I found this more quick method to allow `forward-word' across pronunciation
;; as a whole word.
(defconst my/ipa-chars (list ?ˈ ?ˌ ?ː ?ǁ ?ʲ ?θ ?ð ?ŋ ?ɡ ?ʒ ?ʃ ?ʧ ?ə ?ɜ ?ɛ ?ʌ ?ɒ ?ɔ ?ɑ ?æ ?ʊ ?ɪ))
-(mapc (lambda (ch)
- (aset char-script-table ch 'latin)
- (modify-syntax-entry ch "w"))
- my/ipa-chars)
+(when (boundp 'char-script-table) ; Absent in Emacs 22.
+ (mapc (lambda (ch)
+ (aset char-script-table ch 'latin)
+ (modify-syntax-entry ch "w"))
+ my/ipa-chars))
;; Another option is to invent new category:
;;
;; (defconst my/ipa-chars (list ?ˈ ?ˌ ?ː ?ǁ ?ʲ ?θ ?ð ?ŋ ?ɡ ?ʒ ?ʃ ?ʧ ?ə ?ɜ ?ɛ ?ʌ ?ɒ ?ɔ ?ɑ ?æ ?ʊ ?ɪ))
@@ -1077,6 +1080,9 @@
(icomplete-mode 1)
(setq icomplete-with-completion-tables t)
+;; Another alternative to `icomplete' is `smex' https://github.com/nonsequitur/smex/
+;; which is based on `ido'.
+
(defun my--large-file-p ()
"If buffer too large and my cause performance issue."
(< large-file-warning-threshold (buffer-size)))
@@ -1417,7 +1423,9 @@
;; Maintaining the table of contents up-to-date.
(add-hook 'rst-adjust-hook 'rst-toc-update)
-(modify-coding-system-alist 'file "\\.rst\\'" 'prefer-utf-8-unix)
+(if (coding-system-p 'prefer-utf-8-unix)
+ (modify-coding-system-alist 'file "\\.rst\\'" 'prefer-utf-8-unix)
+ (modify-coding-system-alist 'file "\\.rst\\'" 'utf-8-unix))
(unless window-system
(my--eval-after-load rst
@@ -1756,7 +1764,7 @@
(setq mail-personal-alias-file "~/.mailrc")
;; Initialize from your mail aliases file...
(setq mail-aliases t)
-(require 'ecomplete)
+(require 'ecomplete nil t) ; Absent in Emacs 22.
(setq message-mail-alias-type '(abbrev ecomplete))
(my--eval-after-load message
--- a/init.el Thu Oct 06 21:04:15 2016 +0300
+++ b/init.el Fri Oct 07 02:16:30 2016 +0300
@@ -13,5 +13,7 @@
(my-load.add-my-loadpaths)
(mapc
- (lambda (fname) (load fname t))
+ (lambda (fname) (if (>= emacs-major-version 23)
+ (load fname t)
+ (load fname t nil t)))
(list custom-file my-lisp-autogen my-lisp-auth my-lisp-pre my-lisp-autoload my-lisp-dotemacs my-lisp-post))