.emacs-obsolete
author Oleksandr Gavenko <gavenkoa@gmail.com>
Fri, 01 Apr 2016 17:55:30 +0300
changeset 1375 5959fa99a6f7
parent 1313 ec0316f8e223
child 1376 52d43b70cc7c
permissions -rw-r--r--
Unconditionally enable Org mode.

;; -*- 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..."))