.emacs-my
changeset 983 0e7cc21acc47
parent 977 f1c1a26ad0b9
child 984 3dea749e5fe2
equal deleted inserted replaced
982:b1446aa2c03e 983:0e7cc21acc47
   777 (message "yasnippet")
   777 (message "yasnippet")
   778 
   778 
   779 (setq my-yas-root-directory "~/.emacs.d/my-yas")
   779 (setq my-yas-root-directory "~/.emacs.d/my-yas")
   780 (setq yas/ignore-filenames-as-triggers t)
   780 (setq yas/ignore-filenames-as-triggers t)
   781 
   781 
   782 (eval-after-load 'yasnippet
   782 ;; (eval-after-load 'yasnippet
   783   '(progn
   783 ;;   '(progn
   784      (cond
   784 ;;      (cond
   785       ((listp yas/root-directory) (add-to-list 'yas/root-directory my-yas-root-directory))
   785 ;;       ((listp yas/root-directory) (add-to-list 'yas/root-directory my-yas-root-directory))
   786       ((stringp yas/root-directory) (setq yas/root-directory (list my-yas-root-directory yas/root-directory)))
   786 ;;       ((stringp yas/root-directory) (setq yas/root-directory (list my-yas-root-directory yas/root-directory)))
   787       (t (error "I expect that yas/root-directory is a list of string")) )
   787 ;;       (t (error "I expect that yas/root-directory is a list of string")) )
   788      (mapc 'yas/load-directory yas/root-directory)))
   788 ;;      (mapc 'yas/load-directory yas/root-directory)))
   789 
   789 
   790 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   790 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
   791 (message "open file, ffap, dired")
   791 (message "open file, ffap, dired")
   792 
   792 
   793 (setq-default save-place t)
   793 (setq-default save-place t)
  1135   ;; Redefine path-separator to UNIX to update Info-directory-list.
  1135   ;; Redefine path-separator to UNIX to update Info-directory-list.
  1136   (let ( (path-separator ":") )
  1136   (let ( (path-separator ":") )
  1137     (require 'info)
  1137     (require 'info)
  1138     (info-initialize)
  1138     (info-initialize)
  1139     ))
  1139     ))
       
  1140 
       
  1141 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
       
  1142 (message "info-lookup")
       
  1143 
       
  1144 ;; Info index nodes for automake under Debian.
       
  1145 (setq my-fix-for-automake-info-lookup
       
  1146       '(("(automake-1.11)Macro Index" nil
       
  1147          "^`" "['(]")
       
  1148         ("(automake-1.11)Variable Index" nil
       
  1149          "^`" "['(]")
       
  1150         ("(automake-1.11)General Index" nil
       
  1151          "^`" "['(]")))
       
  1152 
       
  1153 ;; Add `my-fix-for-automake-info-lookup' entries to the end of doc-spec for
       
  1154 ;; some modes.
       
  1155 (eval-after-load 'info-look
       
  1156   '(progn
       
  1157      (mapc
       
  1158       (lambda (mode)
       
  1159         (let ( (doc-spec (info-lookup->doc-spec 'symbol mode)) )
       
  1160           (mapc
       
  1161            (lambda (doc-spec-item)
       
  1162              (setcdr (last doc-spec) (list doc-spec-item)))
       
  1163            my-fix-for-automake-info-lookup)))
       
  1164       '(makefile-mode autoconf-mode))
       
  1165      (info-lookup-maybe-add-help
       
  1166       :mode 'makefile-gmake-mode
       
  1167       :other-modes '(makefile-mode))
       
  1168      ))
  1140 
  1169 
  1141 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1170 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1142 (message "man, woman")
  1171 (message "man, woman")
  1143 
  1172 
  1144 ;; Assume that cygwin-mount already activated.
  1173 ;; Assume that cygwin-mount already activated.
  1421  nnml-directory "~/.gnus/nnml-mail"
  1450  nnml-directory "~/.gnus/nnml-mail"
  1422  spam-directory "~/.gnus/spam/"
  1451  spam-directory "~/.gnus/spam/"
  1423  smime-certificate-directory "~/.gnus/certs/"
  1452  smime-certificate-directory "~/.gnus/certs/"
  1424  nnfolder-directory "~/.gnus/archive"
  1453  nnfolder-directory "~/.gnus/archive"
  1425  nnfolder-active-file "~/.gnus/archive/active"
  1454  nnfolder-active-file "~/.gnus/archive/active"
  1426 )
  1455  )
  1427 
  1456 
  1428 ;; Remove gnus-ignored-newsgroups to show all GMail folders.
  1457 ;; Remove gnus-ignored-newsgroups to show all GMail folders.
  1429 (setq gnus-ignored-newsgroups "some-non-existing")
  1458 (setq gnus-ignored-newsgroups "some-non-existing")
  1430 
  1459 
  1431 ;; (require 'spam)
  1460 ;; (require 'spam)
  1805 ;; (setq erc-kill-queries-on-quit t)
  1834 ;; (setq erc-kill-queries-on-quit t)
  1806 ;; Kill buffers for server messages after quitting the server
  1835 ;; Kill buffers for server messages after quitting the server
  1807 ;; (setq erc-kill-server-buffer-on-quit t)
  1836 ;; (setq erc-kill-server-buffer-on-quit t)
  1808 
  1837 
  1809 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1838 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
       
  1839 (message "devel, programming")
       
  1840 
       
  1841 (which-func-mode 1)
       
  1842 
       
  1843 (add-to-list 'auto-mode-alist '("\\.cu$" . c-mode))
       
  1844 
       
  1845 (defun my-c++-header-file-p ()
       
  1846   "Return non-nil, if in a C++ header."
       
  1847   (and (string-match "\\.h$"
       
  1848                      (or (buffer-file-name)
       
  1849                          (buffer-name)))
       
  1850        (save-excursion
       
  1851          (re-search-forward "\\_<class\\_>" nil t))))
       
  1852 
       
  1853 (when (>= emacs-major-version 22)
       
  1854   (add-to-list 'magic-mode-alist '(my-c++-header-file-p . c++-mode))
       
  1855   )
       
  1856 
       
  1857 (setq-default comment-style (quote indent))
       
  1858 (setq-default comment-column 44)
       
  1859 (setq-default comment-fill-column my-fill-column)
       
  1860 
       
  1861 (mapc (lambda (hook) (add-hook hook (lambda () (setq fill-column my-fill-column)) ))
       
  1862       (append my-devel-mode-hook-list my-text-mode-hook-list))
       
  1863 
       
  1864 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
       
  1865 (message "diff, patch, ediff, emerge")
       
  1866 
       
  1867 (setq diff-switches "-u")
       
  1868 
       
  1869 (setq ediff-diff-options "")
       
  1870 (setq ediff-custom-diff-options "-u")
       
  1871 (setq ediff-window-setup-function 'ediff-setup-windows-plain)
       
  1872 (setq ediff-split-window-function 'split-window-vertically)
       
  1873 
       
  1874 (defun my-diff-auto-refine-mode-on () (diff-auto-refine-mode 1))
       
  1875 (add-hook 'diff-mode-hook 'my-diff-auto-refine-mode-on)
       
  1876 
       
  1877 (when window-system
       
  1878   (eval-after-load 'diff-mode
       
  1879     '(progn
       
  1880        (set-face-foreground 'diff-added-face "DarkGreen")
       
  1881        (set-face-foreground 'diff-removed-face "DarkRed")
       
  1882        (set-face-background 'diff-refine-change "LightBlue1")
       
  1883        )))
       
  1884 
       
  1885 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1810 (message "vc-mode, VCS, version control, cvs, svn, mercurial, hg, bazaar, bzr, git, fossil")
  1886 (message "vc-mode, VCS, version control, cvs, svn, mercurial, hg, bazaar, bzr, git, fossil")
  1811 
  1887 
  1812 ;; `-b' switch to ignore changes in whitespaces.
  1888 ;; `-b' switch to ignore changes in whitespaces.
  1813 ;; (setq vc-git-diff-switches "-b")
  1889 ;; (setq vc-git-diff-switches "-b")
  1814 ;; (setq vc-diff-switches "-b")
  1890 ;; (setq vc-diff-switches "-b")
  1860 (message "DVC")
  1936 (message "DVC")
  1861 
  1937 
  1862 (when (featurep 'dvc-emacs)
  1938 (when (featurep 'dvc-emacs)
  1863   (setq dvc-tips-enabled nil)
  1939   (setq dvc-tips-enabled nil)
  1864   )
  1940   )
  1865 
       
  1866 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
       
  1867 (message "devel, programming")
       
  1868 
       
  1869 (which-func-mode 1)
       
  1870 
       
  1871 (add-to-list 'auto-mode-alist '("\\.cu$" . c-mode))
       
  1872 
       
  1873 (defun my-c++-header-file-p ()
       
  1874   "Return non-nil, if in a C++ header."
       
  1875   (and (string-match "\\.h$"
       
  1876                      (or (buffer-file-name)
       
  1877                          (buffer-name)))
       
  1878        (save-excursion
       
  1879          (re-search-forward "\\_<class\\_>" nil t))))
       
  1880 
       
  1881 (when (>= emacs-major-version 22)
       
  1882   (add-to-list 'magic-mode-alist '(my-c++-header-file-p . c++-mode))
       
  1883   )
       
  1884 
       
  1885 (setq-default comment-style (quote indent))
       
  1886 (setq-default comment-column 44)
       
  1887 (setq-default comment-fill-column my-fill-column)
       
  1888 
       
  1889 (mapc (lambda (hook) (add-hook hook (lambda () (setq fill-column my-fill-column)) ))
       
  1890       (append my-devel-mode-hook-list my-text-mode-hook-list))
       
  1891 
       
  1892 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
       
  1893 (message "diff, patch, ediff, emerge")
       
  1894 
       
  1895 (setq diff-switches "-u")
       
  1896 
       
  1897 (setq ediff-diff-options "")
       
  1898 (setq ediff-custom-diff-options "-u")
       
  1899 (setq ediff-window-setup-function 'ediff-setup-windows-plain)
       
  1900 (setq ediff-split-window-function 'split-window-vertically)
       
  1901 
       
  1902 (when window-system
       
  1903   (eval-after-load 'diff-mode
       
  1904     '(progn
       
  1905        (set-face-foreground 'diff-added-face "DarkGreen")
       
  1906        (set-face-foreground 'diff-removed-face "DarkRed")
       
  1907   )))
       
  1908 
  1941 
  1909 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1942 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1910 (message "indenting")
  1943 (message "indenting")
  1911 
  1944 
  1912 (setq standard-indent 4)
  1945 (setq standard-indent 4)
  2362 (defun html-charref-to-string (html)
  2395 (defun html-charref-to-string (html)
  2363   (let ((res "") (pos 0))
  2396   (let ((res "") (pos 0))
  2364     (while (string-match "&#\\([[:digit:]]+\\);" html pos)
  2397     (while (string-match "&#\\([[:digit:]]+\\);" html pos)
  2365       (setq res (concat res (string (string-to-int (substring html (match-beginning 1) (match-end 1)) 10))))
  2398       (setq res (concat res (string (string-to-int (substring html (match-beginning 1) (match-end 1)) 10))))
  2366       (setq pos (match-end 0))
  2399       (setq pos (match-end 0))
  2367      )
  2400       )
  2368     res
  2401     res
  2369     ) )
  2402     ) )
  2370 
  2403 
  2371 (defun html-charref-unescape-region (begin end &optional prefix)
  2404 (defun html-charref-unescape-region (begin end &optional prefix)
  2372   (interactive "r\nP")
  2405   (interactive "r\nP")
  2416               (my-filter
  2449               (my-filter
  2417                (lambda (item) (not (equal (car item) "html")))
  2450                (lambda (item) (not (equal (car item) "html")))
  2418                html-tag-alist)))
  2451                html-tag-alist)))
  2419        (add-to-list 'html-tag-alist '("script" (\n) ("type" "text/javascript") ))
  2452        (add-to-list 'html-tag-alist '("script" (\n) ("type" "text/javascript") ))
  2420        (add-to-list 'html-tag-alist '("style" (\n) ("type" "text/css") ))
  2453        (add-to-list 'html-tag-alist '("style" (\n) ("type" "text/css") ))
  2421      )))
  2454        )))
  2422 
  2455 
  2423 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2456 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2424 (message "sh, bash")
  2457 (message "sh, bash")
  2425 
  2458 
  2426 (add-to-list 'auto-mode-alist '("\\.cygport\\'" . shell-script-mode))
  2459 (add-to-list 'auto-mode-alist '("\\.cygport\\'" . shell-script-mode))