Permalink
Browse files

More speedups and fixes; down to about 3/4s

  • Loading branch information...
1 parent f2f0685 commit 322b935ed075ea9251f4c7575e47e7aebc8dce60 @jwiegley committed Jun 15, 2012
Showing with 72 additions and 34 deletions.
  1. +62 −31 emacs.el
  2. +2 −0 lisp/persistent-scratch.el
  3. +2 −2 settings.el
  4. +6 −1 site-lisp/archive-region.el
View
@@ -11,8 +11,6 @@
(eval-when-compile
(require 'cl))
-(autoload 'diminish "diminish")
-
(defvar use-package-verbose nil)
(defmacro hook-into-modes (func modes)
@@ -636,15 +634,9 @@
(helm-other-buffer 'helm-c-source-occur "*Helm Occur*"))
(define-key global-map [(meta ?s) ?b] 'my-helm-occur)
-(define-key global-map [(meta ?s) ?c] 'highlight-changes-mode)
(define-key global-map [(meta ?s) ?F] 'helm-for-files)
-(define-key global-map [(meta ?s) ?h] 'crosshairs-mode)
-(define-key global-map [(meta ?s) ?l] 'hl-line-mode)
(define-key global-map [(meta ?s) ?n] 'find-name-dired)
(define-key global-map [(meta ?s) ?o] 'occur)
-(define-key global-map [(meta ?s) ?r] 'highlight-regexp)
-(define-key global-map [(meta ?s) ?R] 'highlight-lines-matching-regexp)
-(define-key global-map [(meta ?s) ?w] 'highlight-phrase)
(define-key global-map [remap eval-expression] 'pp-eval-expression)
@@ -765,7 +757,11 @@
(use-package tex-site
:defines (latex-help-cmd-alist
latex-help-file)
+ :commands latex-mode
:init
+ (add-to-list 'auto-mode-alist '("\\.tex$" . latex-mode))
+
+ :config
(progn
(defun latex-help-get-cmd-alist () ;corrected version:
"Scoop up the commands in the index of the latex info manual.
@@ -1118,28 +1114,37 @@
(add-to-list 'auto-mode-alist '("CMakeLists\\.txt\\'" . cmake-mode))
(add-to-list 'auto-mode-alist '("\\.cmake\\'" . cmake-mode))))
+;;;_ , crosshairs
+
+(use-package crosshairs
+ :commands crosshairs-mode
+ :init
+ (define-key global-map [(meta ?o) ?c] 'crosshairs-mode))
+
;;;_ , css-mode
(use-package css-mode
:commands css-mode
:init
(add-to-list 'auto-mode-alist '("\\.css$" . css-mode)))
-;;;_ , diff-mode-
+;;;_ , diff-mode
-(use-package diff-mode-)
+(use-package diff-mode
+ :commands diff-mode
+ :config
+ (use-package diff-mode-))
;;;_ , diminish
(use-package diminish
- :init
- (progn
- (ignore-errors (diminish 'auto-fill-function))))
+ :commands diminish)
;;;_ , dired
(use-package dired
- :init
+ :defer t
+ :config
(progn
(defun dired-package-initialize ()
(unless (featurep 'dired-async)
@@ -1621,10 +1626,32 @@
helm-c-source-info-cl
helm-c-source-emacs-source-defun)))))))
+;;;_ , hi-lock
+
+(use-package hi-lock
+ :commands (highlight-regexp
+ highlight-phrase
+ highlight-lines-matching-regexp)
+ :init
+ (progn
+ (define-key global-map [(meta ?o) ?l] 'highlight-lines-matching-regexp)
+ (define-key global-map [(meta ?o) ?r] 'highlight-regexp)
+ (define-key global-map [(meta ?o) ?w] 'highlight-phrase)))
+
+;;;_ , hilit-chg
+
+(use-package hilit-chg
+ :commands highlight-changes-mode
+ :init
+ (define-key global-map [(meta ?o) ?C] 'highlight-changes-mode))
+
;;;_ , hl-line
(use-package hl-line
- :defer t
+ :commands hl-line-mode
+ :init
+ (define-key global-map [(meta ?o) ?h] 'hl-line-mode)
+
:config
(use-package hl-line+))
@@ -2158,7 +2185,8 @@ end tell" account account start duration commodity (if cleared "true" "false")
;;;_ , nroff-mode
(use-package nroff-mode
- :init
+ :commands nroff-mode
+ :config
(progn
(defun update-nroff-timestamp ()
(save-excursion
@@ -2447,7 +2475,11 @@ end tell" account account start duration commodity (if cleared "true" "false")
(use-package texinfo
:defines texinfo-section-list
+ :commands texinfo-mode
:init
+ (add-to-list 'auto-mode-alist '("\\.texi$" . texinfo-mode))
+
+ :config
(progn
(defun my-texinfo-mode-hook ()
(dolist (mapping '((?b . "emph")
@@ -2460,22 +2492,21 @@ end tell" account account start duration commodity (if cleared "true" "false")
`(lambda () (interactive)
(TeX-insert-macro ,(cdr mapping))))))
- (add-hook 'texinfo-mode-hook 'my-texinfo-mode-hook))
+ (add-hook 'texinfo-mode-hook 'my-texinfo-mode-hook)
- :config
- (defun texinfo-outline-level ()
- ;; Calculate level of current texinfo outline heading.
- (require 'texinfo)
- (save-excursion
- (if (bobp)
- 0
- (forward-char 1)
- (let* ((word (buffer-substring-no-properties
- (point) (progn (forward-word 1) (point))))
- (entry (assoc word texinfo-section-list)))
- (if entry
- (nth 1 entry)
- 5))))))
+ (defun texinfo-outline-level ()
+ ;; Calculate level of current texinfo outline heading.
+ (require 'texinfo)
+ (save-excursion
+ (if (bobp)
+ 0
+ (forward-char 1)
+ (let* ((word (buffer-substring-no-properties
+ (point) (progn (forward-word 1) (point))))
+ (entry (assoc word texinfo-section-list)))
+ (if entry
+ (nth 1 entry)
+ 5)))))))
;;;_ , vkill
@@ -50,6 +50,8 @@
(push #'load-persistent-scratch after-init-hook)
(push #'save-persistent-scratch kill-emacs-hook)
+(run-with-idle-timer 300 t 'save-persistent-scratch)
+
(provide 'persistent-scratch)
;;; persistent-scratch.el ends here
View
@@ -85,7 +85,7 @@
'(ediff-show-clashes-only t)
'(ediff-window-setup-function (quote ediff-setup-windows-plain))
'(edit-server-new-frame nil)
- '(emacs-lisp-mode-hook (quote (turn-on-auto-fill eldoc-mode (lambda nil (local-set-key [(meta 46)] (quote find-function)) (local-set-key [(control 109)] (quote newline-and-indent))))))
+ '(emacs-lisp-mode-hook (quote (turn-on-auto-fill (lambda nil (ignore-errors (diminish 'auto-fill-function))) eldoc-mode (lambda nil (local-set-key [(meta 46)] (quote find-function)) (local-set-key [(control 109)] (quote newline-and-indent))))))
'(enable-recursive-minibuffers t)
'(erc-auto-query (quote window-noselect))
'(erc-autoaway-message "I'm away (after %i seconds of idle-time)")
@@ -238,7 +238,7 @@
'(tail-max-size 25)
'(tail-volatile nil)
'(temp-buffer-resize-mode t nil (help))
- '(text-mode-hook (quote (turn-on-auto-fill)))
+ '(text-mode-hook (quote (turn-on-auto-fill (lambda nil (ignore-errors (diminish 'auto-fill-function))))))
'(tool-bar-mode nil)
'(tramp-auto-save-directory "~/.emacs.d/backups")
'(tramp-default-method "rsyncc")
@@ -180,7 +180,12 @@ C-u C-u C-w: `archive-region-open-archive-file-other-window' (open archive file)
(interactive "p\nr")
(case arg
(4 (kill-region s e))
- (1 (kill-new (buffer-substring s e)) (archive-region s e))
+ (1 (condition-case nil
+ (progn
+ (kill-new (buffer-substring s e))
+ (archive-region s e))
+ (error
+ (kill-region s e))))
(16 (archive-region-open-archive-file-other-window))))
(substitute-key-definition 'kill-region 'kill-region-or-archive-region global-map)

0 comments on commit 322b935

Please sign in to comment.