.emacs-obsolete
author Oleksandr Gavenko <gavenkoa@gmail.com>
Fri, 01 Apr 2016 18:26:08 +0300
changeset 1380 1affd280b1e6
parent 1379 d9e284adf519
child 1383 f2b6754654a4
permissions -rw-r--r--
I have no needs to use my jdone mode anymore.

;; -*- mode: emacs-lisp; coding: utf-8; fill-column: 78 -*-

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(iswitchb-mode 1)

(setq iswitchb-regexp t)
(setq iswitchb-use-virtual-buffers t)
(setq iswitchb-buffer-ignore
      '("^ "
        "^\\*Buffer"
        "^\\*Completions\\*"
        "^\\*tramp"
        "^\\*Dired log\\*"
        "^\\*Quail Completions\\*"
        "^\\*Disabled Command\\*"
        "^TAGS"
        ))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(require 'ffap)
(ffap-bindings)

;; I usually mistype "C-x C-f" to "C-x d" or "C-x C-d", so always use find-file,
;; because when file if directory find-file load dired, if regular file open it.
(global-set-key (kbd "C-x C-f") 'find-file-at-point)
(global-set-key (kbd "C-x C-d") 'find-file-at-point)
(global-set-key (kbd "C-x d") 'find-file-at-point)

;; Stop 'ffap' in Dired as its suggestion is inconvenient.
(define-key dired-mode-map (kbd "C-x C-f") 'find-file)
(define-key dired-mode-map (kbd "C-x C-d") 'find-file)
(define-key dired-mode-map (kbd "C-x d") 'find-file)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(mapc (lambda (ext) (add-to-list 'completion-ignored-extensions ext))
      '(
        ".class" "~" ".aux"
        ".o" ".obj" ".map" ".lib" ".lo" ".la" ".a" ".bin" ".exe"
        ;; Place dir at end to appear at the start of completion-ignored-extensions.
        "CVS/" ".hg/" ".svn/" ".git/" ".bzr/"
        ) )

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defun my-find-subdirs (dir)
  (if (file-directory-p dir)
      (cons dir (apply 'append (mapcar 'my-find-subdirs (directory-files dir t "^[^.]")) ) )
    ))
(defun my-add-subdirs-to-load-path (dir)
  (mapc
   (lambda (d)
     (add-to-list 'load-path d t)
     (message "Load-path updated with: %s" d)
     )
   (my-find-subdirs dir)) )

(my-add-subdirs-to-load-path my-usr-lisp-dir)
(my-add-subdirs-to-load-path my-lisp-dir)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(add-hook 'comint-output-filter-functions 'comint-strip-ctrl-m)
(add-hook 'comint-mode-hook 'ansi-color-for-comint-mode-on)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; For Cygwin.

(add-hook 'comint-output-filter-functions 'comint-strip-ctrl-m)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(message "TODO, XXX, FIXME highlight")

(defface my-contrasty-face
  '((t :background "pink" :foreground "red" :weight bold))
  "Font for showing conflicts."
  :group 'basic-faces)

(dolist (mode (append my-devel-mode-list my-text-mode-list))
  (font-lock-add-keywords
   mode
   `(
     ;; 64 times, for highlight C-u C-u C-u <key>
     ("\\([^[:space:]]\\)\\1\\{63\\}" 0 'my-contrasty-face t) )) )

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Make mouse clicks work in xterm (and iTerm).

(when (not (window-system))
  (xterm-mouse-mode +1))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(message "org-mode, GTD, PIM, organize, todo")

(when (>= emacs-major-version 22)
  (require 'org))

(when (or (featurep 'org) (featurep 'org-install))
  (message "Many lines here..."))

(cond
 ((featurep 'org-capture)
  (setq org-default-notes-file my-org-agenda-todo-file)
  (setq org-capture-templates
        '(("t" "Todo" entry (file my-org-agenda-todo-file) "* %?\n  SCHEDULED: %T")))
  (define-key global-map "\C-vr"
    (lambda () (interactive) (org-capture nil "t")))
  )
 ((or (featurep 'remember) (fboundp 'remember))
  (setq remember-annotation-functions '(org-remember-annotation))
  (setq remember-handler-functions '(org-remember-handler))
  (add-hook 'remember-mode-hook 'org-remember-apply-template)
  (define-key global-map "\C-vr" 'org-remember)
  (setq org-remember-templates
        ;; With one item org-mode do not prompt choose template.
        `(
          ("todo" ?t "* TODO %?" ,my-org-agenda-todo-file)
          ;; ("note" ?n "* %?\n" ,my-org-agenda-note-file)
          ))
  (setq org-remember-store-without-prompt t)
  (org-remember-insinuate)
  ))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(message "highlight selected text")

(cond
 ((= emacs-major-version 21) (pc-selection-mode))
 ((>= emacs-major-version 22) (pc-selection-mode 1)) )

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(message "keyboard, mouse")

(setq my-russian-input-method 'russian-computer)
(setq my-ukranian-input-method 'ukrainian-computer)
(setq my-ipa-input-method 'ipa-x-sampa)
(when (<= emacs-major-version 21)
  (setq my-russian-input-method 'cyrillic-jcuken)
  (setq my-ukranian-input-method 'cyrillic-jcuken))
(setq default-input-method my-russian-input-method)

(defun my-toggle-input-method (&optional arg)
  (interactive "P")
  (if (numberp arg)
      (cond
       ((eq arg 1)
        (activate-input-method nil))
       ((eq arg 2)
        (activate-input-method 'my-russian-input-method))
       ((eq arg 3)
        (activate-input-method 'my-ukranian-input-method))
       ((eq arg 4)
        (activate-input-method 'greek))
       ((eq arg 5)
        (activate-input-method 'my-ipa-input-method))
       ((eq arg 6)
        (activate-input-method 'TeX)) )
    (toggle-input-method arg)) )

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(message "dired")

(when (>= emacs-major-version 22)
  ;; Enable 'a' command.
  (put 'dired-find-alternate-file 'disabled nil)
  )

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(message "devel, programming")

(when (>= emacs-major-version 22)
  (add-to-list 'magic-mode-alist '(my--c++-header-file-p . c++-mode))
  )

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(message "desktop")

(when (>= emacs-major-version 22)
  (require 'desktop)
  (add-to-list 'desktop-path desktop-dirname)
  (setq desktop-restore-frames nil)
  (desktop-save-mode 1)
  (setq
   desktop-globals-to-save
   (append
    '((file-name-history . 100)
      (compile-history . 100)
      (command-history . 100)
      (extended-command-history . 100)
      (shell-command-history . 100)
      (search-ring . 20)
      (query-replace-history . 100)
      (regexp-history . 100)
      (grep-history . 100)
      (minibuffer-history . 100)
      tags-file-name
      register-alist)
    desktop-globals-to-save))
  )

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(message "coding system, charset, locale, lang")

;; Emacs 23.1 no longer need codepage-setup.
(when (<= emacs-major-version 22)
  (codepage-setup 866)
  (codepage-setup 1251)
  )

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(message "jdone")

(ignore-errors
  (require 'jdone)
  (jdone-setup-key-binding)
  (jdone-integrate-hook)
  )