Emacs: using lua-mode-hook with prog-mode-hook

master
Pierre Neidhardt 2014-03-09 12:24:26 +01:00
parent 34d951ef83
commit dad9ab299b
4 changed files with 8 additions and 12 deletions

View File

@ -211,7 +211,7 @@ fallback to the mode provided in symbol DEFAULT."
(symbol-name ',feature) (symbol-name ',default))))))))))
;; TODO: use defadvice instead of duplicate code.
(defun mark-word (&optional arg allow-extend)
(defun mark-word-alt (&optional arg allow-extend)
"Set mark ARG words away from point.
The place mark goes is the same place \\[forward-word] would move
to with the same argument. Interactively, if this command is

View File

@ -116,6 +116,7 @@ Example: to assign some-function to C-i, use
(autoload 'guess-style-guess-variable "guess-style")
(autoload 'guess-style-guess-all "guess-style" nil t)
(setq guess-style-info-mode 1)
(add-hook 'prog-mode-hook 'guess-style-guess-all)
(autoload 'pdf-view "tool-pdf" nil t)
(autoload 'pdf-compress "tool-pdf" nil t)

View File

@ -103,16 +103,11 @@
;; programming languages only, so that it does not affect buffer like calendar
;; and so on. There is no prog-mode-hook on Emacs<24.
(require 'functions) ; for page-number-mode
(mapcar
(lambda (mode-hook)
(add-hook
mode-hook
(lambda ()
(page-number-mode t)
(when (fboundp 'guess-style-guess-all)
(guess-style-guess-all))
(whitespace-mode))))
'(prog-mode-hook lua-mode-hook))
(add-hook
'prog-mode-hook
(lambda ()
(page-number-mode t)
(whitespace-mode)))
;; WARNING: this can break some configuration files needing whitespaces at the
;; end.

View File

@ -163,7 +163,7 @@
'(("\\<\\(FIXME\\):" 1 font-lock-warning-face prepend)
("\\<\\(TODO\\):" 1 font-lock-warning-face prepend)
("\\<\\(WARNING\\):" 1 font-lock-warning-face prepend))))))
'(lua-mode-hook prog-mode-hook tex-mode-hook texinfo-mode-hook))
'(prog-mode-hook tex-mode-hook texinfo-mode-hook))
;; Digits regex are not perfect, and may make emacs slow. Sure?
;; ("[^[:digit:][:space:]][[:space:]]*\\(-\\)[[:digit:]]+" 1 font-lock-constant-face)
;; ("\\(0x[[:digit:]a-fA-F]+\\)[^[:alnum:]_]" 1 font-lock-constant-face)