From: Ian Kelling Date: Wed, 26 Jun 2019 00:47:53 +0000 (-0400) Subject: various improvements X-Git-Url: https://iankelling.org/git/?a=commitdiff_plain;h=3f21bda3e1eb4c85c20f8b8996765372a30800f6;p=dot-emacs various improvements --- diff --git a/init.el b/init.el index 5ba8428..d2411eb 100644 --- a/init.el +++ b/init.el @@ -39,8 +39,8 @@ ;; emacs -f benchmark-init/show-durations-tree ;; to catch things post-init ;; emacs -f benchmark-init/deactivate - ;;(require 'benchmark-init) - ;;(add-hook 'after-init-hook 'benchmark-init/deactivate) + (require 'benchmark-init) + (add-hook 'after-init-hook 'benchmark-init/deactivate) ;; ;; these need to be done before the hook in order to satisfy the byte compiler or batch mode @@ -481,7 +481,7 @@ Fourth argument TYPE is the custom option type." ;; mu4e has a bug right now, undo breaks when saving drafts (not (string= (buffer-file-name) "*draft*")) (buffer-modified-p) - (not (org-src-edit-buffer-p))) + (not (and (boundp 'org-src-edit-buffer-p) (org-src-edit-buffer-p)))) ;; serial is incremented on each save, so let's do a bit less of them (not (derived-mode-p 'dns-mode)) (setq my-auto-save-last last) @@ -1433,7 +1433,7 @@ https://fsf.org | https://gnu.org (defun gtags-update-hook() "Update GTAGS file incrementally upon saving a file" - (when (and ggtags-mode ggtags-project-root) + (when (and (boundp 'ggtags-mode) ggtags-mode ggtags-project-root) (gtags-update-current-file))) (add-hook 'after-save-hook 'gtags-update-hook) @@ -1506,7 +1506,7 @@ https://fsf.org | https://gnu.org ;; show the name of the current function definition in the modeline - (require 'which-func) + ;;(require 'which-func) (setq which-func-modes t) (which-function-mode 1) @@ -1560,19 +1560,7 @@ https://fsf.org | https://gnu.org (define-key Info-mode-map [mouse-4] nil) (define-key Info-mode-map [mouse-5] nil)) - (eval-after-load "info" '(my-info-init)) - - (require 'smooth-scroll) - ;; long gnus summary buffers lags too much with this, - ;; but I like it enough to leave it enabled by default - ;; and crank up the step size to be faster - ;; and it doesn't have a way to enable it only for certain modes etc. - ;; todo sometime, make it work for certain modes only - (smooth-scroll-mode t) - ;; its too slow with the default of 2 - (setq smooth-scroll/vscroll-step-size 7) - ;; sublimity doesn't work as good going fast by default - ;; smooth-scrolling.el, does not do smooth scrolling. its about cursor location + (add-hook 'info-mode-hook 'my-info-init) (setq sh-here-document-word "'EOF'") @@ -1671,6 +1659,18 @@ https://fsf.org | https://gnu.org imenu-auto-rescan t indicate-empty-lines t) ; mark end of buffer + (require 'smooth-scroll) + ;; long gnus summary buffers lags too much with this, + ;; but I like it enough to leave it enabled by default + ;; and crank up the step size to be faster + ;; and it doesn't have a way to enable it only for certain modes etc. + ;; todo sometime, make it work for certain modes only + (smooth-scroll-mode t) + ;; its too slow with the default of 2 + (setq smooth-scroll/vscroll-step-size 7) + ;; sublimity doesn't work as good going fast by default + ;; smooth-scrolling.el, does not do smooth scrolling. its about cursor location + (blink-cursor-mode '(-4)) (menu-bar-mode -1) @@ -2224,7 +2224,9 @@ indent yanked text (with prefix arg don't indent)." ;; todo, testout these mode specific settings from graphene. ;; Ruby-specific pairs and handlers - (require 'smartparens-ruby) + + (eval-after-load "ruby" + '(require 'smartparens-ruby)) ;; Markdown (sp-local-pair '(markdown-mode gfm-mode) "*" "*" @@ -2235,13 +2237,8 @@ indent yanked text (with prefix arg don't indent)." (sp-local-pair 'html-mode "\"" nil :unless '(:rem sp-point-after-word-p)) -;;; smex - ;; todo; check out smex-show-unbound-commands shows frequently used commands that have no key bindings. - ; these must be before smex-initialize - (setq - smex-save-file "~/.emacs.d/.smex-items") - (smex-initialize) + ;;; spell correction (setq ispell-program-name "hunspell" @@ -2990,9 +2987,16 @@ modes like org-mode which have their own yank function." (global-set-key (kbd "C-s") 'kill-region) -;;;;; M-x - smex +;;;;; M-x - counsel-m-x + + + ;; todo; check out smex-show-unbound-commands shows frequently used commands that have no key bindings. + ;; this must be before smex-initialize + (setq + smex-save-file "~/.emacs.d/.smex-items") - (global-set-key (kbd "M-x") 'smex) + ;; this uses smex + (global-set-key (kbd "M-x") 'counsel-M-x) ;;;;; C-M-x - cut-to-register @@ -3233,9 +3237,10 @@ modes like org-mode which have their own yank function." (org-show-context 'mark-goto))) (global-set-key (kbd "C-j") 'my-pop-to-mark-command) - (define-key ido-common-completion-map (kbd "C-j") 'ido-select-text) (add-hook 'ido-setup-hook - (lambda () (define-key ido-common-completion-map (kbd "C-j") 'ido-select-text))) + (lambda () + (define-key ido-common-completion-map (kbd "C-j") 'ido-select-text) + )) (add-hook 'lisp-interaction-mode-hook (lambda () (define-key lisp-interaction-mode-map (kbd "C-j") nil))) @@ -3426,6 +3431,7 @@ modes like org-mode which have their own yank function." ;;;;; C-S-down-arrow - m-x for major mode +;; todo, update this for ivy (global-set-key (kbd "") 'smex-major-mode-commands) ;;;;; C-lbracket - ----