Emacs: a lot of bugfixes for the new config organization

master
Pierre Neidhardt 2014-02-13 16:30:05 +01:00
parent 9f76a23790
commit 32719436c2
9 changed files with 58 additions and 43 deletions

View File

@ -45,10 +45,8 @@ Example: to assign some-function to C-i, use
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Modes config
;; (load "mode-cc")
(add-hook 'c-mode-hook (lambda () (require 'mode-cc)))
(add-hook 'c++-mode-hook (lambda () (require 'mode-cc)))
(add-hook 'dot-mode-hook (lambda () (require 'mode-dot)))
(add-hook 'perl-mode-hook (lambda () (require 'mode-perl)))
(add-hook 'python-mode-hook (lambda () (require 'mode-python)))
(add-hook 'shell-mode-hook (lambda () (require 'mode-shell)))
@ -66,15 +64,16 @@ Example: to assign some-function to C-i, use
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Extra modes
(require 'go-mode-load nil t)
(when (require 'go-mode nil t)
(add-to-list 'auto-mode-alist '("\\.go\\'" . go-mode)))
;; Lua
(when (require 'lua-mode nil t)
(add-to-list 'auto-mode-alist '("\\.lua\\'" . lua-mode)))
(when (require 'markdown-mode nil t)
(add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode))
(add-to-list 'auto-mode-alist '("\\.markdown\\'" . markdown-mode))
;; If we need more option, add it to dedicated file.
(set (make-local-variable 'paragraph-start) "
"))
@ -84,18 +83,25 @@ Example: to assign some-function to C-i, use
(when (require 'po-find-file-coding-system nil t)
(modify-coding-system-alist 'file "\\.po\\'\\|\\.po\\." 'po-find-file-coding-system))
;; Bison/flex
(when (require 'bison-mode nil t)
(add-to-list 'auto-mode-alist '("\\.yy?\\'" . bison-mode)))
(when (require 'flex-mode nil t)
(add-to-list 'auto-mode-alist '("\\.l\\'" . flex-mode)))
;; GLSL
(when (require 'glsl-mode nil t)
(add-to-list 'auto-mode-alist '("\\.vert\\'" . glsl-mode))
(add-to-list 'auto-mode-alist '("\\.frag\\'" . glsl-mode))
(add-to-list 'auto-mode-alist '("\\.glsl\\'" . glsl-mode)))
;; This mode has no 'provide'.
(when (autoload 'graphviz-dot-mode "graphviz-dot-mode" "Dot mode." t)
(add-to-list 'auto-mode-alist '("\\.dot\\'" . graphviz-dot-mode))
(add-hook 'dot-mode-hook (lambda () (require 'mode-dot))))
(when (require 'mediawiki nil t)
(add-to-list 'auto-mode-alist '("\\.wiki\\'" . mediawiki-mode))
(add-hook 'mediawiki-mode-hook (lambda () (require 'mode-mediawiki))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; We need to put it at the end to make sure it doesn't get overriden by other
;; minor modes.

View File

@ -59,7 +59,8 @@ restored."
mode-hook
(lambda ()
;; Identation style
(setq c-default-style "linux" c-basic-offset 4)
(c-set-style "linux")
(setq c-basic-offset 4)
(cc-set-compiler)
(local-set-key (kbd "<f9>") 'cc-clean)

View File

@ -68,6 +68,6 @@
(local-set-key (kbd "<right>") 'dired-find-file)
(local-set-key (kbd "SPC") 'dired-mark)
(local-set-key (kbd "<backspace>") 'dired-up-directory)
(local-set-key (kbd "b") 'dired-up-directory)))
(local-set-key (kbd "b") 'dired-up-directory)
(provide 'mode-dired)

View File

@ -2,10 +2,6 @@
;; Graphviz' dot mode
;;==============================================================================
(autoload 'graphviz-dot-mode "graphviz-dot-mode.el" "Graphviz dot mode." t)
(add-to-list 'auto-mode-alist '("\\.dot\\'" . graphviz-dot-mode))
(setq graphviz-dot-preview-extension "pdf")
(defcustom graphviz-dot-view-extension "pdf"
"Graphviz format for external view."

View File

@ -3,7 +3,7 @@
;; Ediff split horizontally by default.
;; TODO: ediff split does not seem to work.
(lambda ()
(setq ediff-merge-split-window-function 'split-window-horizontally))
;; (setq ediff-merge-split-window-function 'split-window-horizontally)
(setq ediff-merge-split-window-function 'split-window-vertically)
(provide 'mode-ediff)

View File

@ -2,31 +2,31 @@
;; MediaWiki
;;==============================================================================
(when (require 'mediawiki nil t)
(setq mediawiki-site-alist
'(
("Wikipedia" "http://en.wikipedia.org/w/" "Ambrevar" "" "Main Page")
("Wikibooks" "http://en.wikibooks.org/w/" "Ambrevar" "" "LaTeX")
("ArchLinux" "https://wiki.archlinux.org/" "Ambrevar" "" "Mutt")
("WikEmacs" "https://wikemacs.org/wiki/" "Ambrevar" "" "Main Page")
))
(setq mediawiki-site-alist
'(
("Wikipedia" "http://en.wikipedia.org/w/" "Ambrevar" "" "Main Page")
("Wikibooks" "http://en.wikibooks.org/w/" "Ambrevar" "" "LaTeX")
("ArchLinux" "https://wiki.archlinux.org/" "Ambrevar" "" "Mutt")
("WikEmacs" "https://wikemacs.org/wiki/" "Ambrevar" "" "Main Page")
))
;; The url-cookie timer is set to a high value because it seems that once the
;; cookie has been saved, MediaWiki fails to upload files correctly. Is
;; 'url-do-setup' needed to make sure the url-cookie-save-interval variable is
;; taken into account?
;; TODO: url-cookie timer does not work.
(setq url-cookie-save-interval 86400)
;; The url-cookie timer is set to a high value because it seems that once the
;; cookie has been saved, MediaWiki fails to upload files correctly. Is
;; 'url-do-setup' needed to make sure the url-cookie-save-interval variable is
;; taken into account?
;; TODO: url-cookie timer does not work.
(setq url-cookie-save-interval 86400)
(setq mediawiki-mode-hook
(lambda ()
(visual-line-mode 1)
(turn-off-auto-fill)
(define-key mediawiki-mode-map (kbd "C-c RET") 'mediawiki-open-page-at-point)
(define-key mediawiki-mode-map (kbd "C-c o") 'mediawiki-browse)
(local-unset-key (kbd "M-g"))
(local-set-key (kbd "C-c C-d") 'duplicate-line)
(local-set-key (kbd "C-c C-s") 'mediawiki-save)
(local-set-key (kbd "C-x C-s") 'save-buffer)
)) )
(setq
mediawiki-mode-hook
(lambda ()
(visual-line-mode 1)
(turn-off-auto-fill)
(define-key mediawiki-mode-map (kbd "C-c RET") 'mediawiki-open-page-at-point)
(define-key mediawiki-mode-map (kbd "C-c o") 'mediawiki-browse)
(local-unset-key (kbd "M-g"))
(local-set-key (kbd "C-c C-d") 'duplicate-line)
(local-set-key (kbd "C-c C-s") 'mediawiki-save)
(local-set-key (kbd "C-x C-s") 'save-buffer)
)) )

View File

@ -1,4 +1,8 @@
;; Set comments to be '%' to be matlab-compatible.
(set (make-local-variable 'comment-start) "% ")
(add-hook
'octave-mode-hook
(lambda ()
(set (make-local-variable 'comment-start) "% ")
))
(provide 'mode-octave)

View File

@ -5,7 +5,6 @@
(setq org-M-RET-may-split-line '((default)))
(setq org-agenda-files '("~/todo.org"))
(auto-fill-mode -1)
(setq org-enforce-todo-dependencies t)))
;; Set PDF association in Org-mode (was Evince by default).
(eval-after-load "org"
@ -13,4 +12,10 @@
;; Change .pdf association directly within the alist
(setcdr (assoc "\\.pdf\\'" org-file-apps) "zathura --fork %s")))
(add-hook
'org-mode-hook
(lambda ()
(auto-fill-mode -1)
))
(provide 'mode-org)

View File

@ -8,7 +8,10 @@
(set (make-local-variable 'compile-command)
(concat "perl " buffer-file-name)))
(set (make-local-variable 'compilation-scroll-output) t)
(perl-set-interpreter)
(add-hook
'python-mode-hook
(lambda ()
(set (make-local-variable 'compilation-scroll-output) t)
(perl-set-interpreter)))
(provide 'mode-perl)