From d1dca70c439ef014635dc13bb126d8b9515a41e1 Mon Sep 17 00:00:00 2001 From: Avram Colak Date: Sun, 4 Oct 2015 16:52:17 +1300 Subject: [PATCH] Shuffle ui-rc, moving some "confusing commands" and (also adding) some keybindings. --- lisp/edit-rc.el | 5 --- lisp/org-rc.el | 7 +++- lisp/os-rc.el | 3 -- lisp/ui-rc.el | 117 +++++++++++++++++++++++++++++++++----------------------- 4 files changed, 76 insertions(+), 56 deletions(-) diff --git a/lisp/edit-rc.el b/lisp/edit-rc.el index a36c673..24db5ff 100644 --- a/lisp/edit-rc.el +++ b/lisp/edit-rc.el @@ -5,11 +5,6 @@ indent-tabs-mode nil) (setq tab-stop-list (number-sequence 4 120 4)) -;;; Turn on some "confusing" commands. -(put `upcase-region `disabled nil) -(put `downcase-region `disabled nil) -(put 'dired-find-alternate-file 'disabled nil) - ;;; "stroustrup" and "k&r" in lieu of "gnu". (setq-default c-default-style '((java-mode . "java") (awk-mode . "awk") diff --git a/lisp/org-rc.el b/lisp/org-rc.el index 010b6d9..224edab 100644 --- a/lisp/org-rc.el +++ b/lisp/org-rc.el @@ -35,4 +35,9 @@ (add-hook 'org-shiftdown-final-hook 'windmove-down) (add-hook 'org-shiftright-final-hook 'windmove-right) - (setq org-completion-use-ido t)) + (setq org-completion-use-ido t) + + (when (package-installed-p 'org-plus-contrib) ; Provides org. + (add-to-list 'load-path + (file-name-directory (locate-library "org-contribdir"))) + (require 'org-drill nil nil))) diff --git a/lisp/os-rc.el b/lisp/os-rc.el index f672cf9..ce2057e 100644 --- a/lisp/os-rc.el +++ b/lisp/os-rc.el @@ -44,6 +44,3 @@ ;;; Oddly, the environment PATH and exec-path may differ after loading ;;; e.g. on Mac OS X. (setq exec-path (delete-dups (append (yard-get-environment-path) exec-path))) - -(global-set-key (kbd "C-c r") 'yard-root-find-file) -(global-set-key (kbd "C-c c") 'save-buffers-kill-emacs) diff --git a/lisp/ui-rc.el b/lisp/ui-rc.el index 1c3b6b1..98a6428 100644 --- a/lisp/ui-rc.el +++ b/lisp/ui-rc.el @@ -10,69 +10,56 @@ (setq inhibit-startup-screen t) -;;; By default Emacs rings the bell on end of buffer, and other -;;; unecessary times. -(setq ring-bell-function 'ignore) +;;; Empirically, Emacs on Windows and OS X has a very nice default +;;; font. On the other hand, the systems which feature a GTK Emacs are +;;; unlikely to have a very servicable default. GNU's FreeMono is a +;;; nice Courier clone with good unicode coverage, and is usually +;;; installed. +(when (featurep 'gtk) + (set-face-attribute 'default nil + :family "FreeMono" + :height 120 + :weight 'normal)) ;;; If nil, input (keyboard or mouse) interrupts redisplay. (setq redisplay-dont-pause t) -;;; By default, only the row number is shown in the modeline. -(column-number-mode) - -;;; The Commander Pike school of thought on syntax highlighting. +;;; Font lock is Emacs for "syntax highlighting". (global-font-lock-mode -1) -;;; Quick keystroke prompt. -(setq echo-keystrokes 0.0166) - -;;; Aristotelean scrolling maps better to the hardware I use. -(setq mouse-wheel-progressive-speed nil) +;;; By default, only the row number is shown in the modeline. +(column-number-mode) ;;; Highlight matching parenthesis at point. (show-paren-mode) -;;; Use S- to change windows. -(windmove-default-keybindings) - -;;; Minibuffer tab completion. -(icomplete-mode) - -(setq focus-follows-mouse t) -(setq mouse-autoselect-window t) +(setq-default doc-view-resolution 300) -(global-set-key (kbd "C-c p") 'proced) -(global-set-key (kbd "C-c b") 'bury-buffer) -(global-set-key (kbd "C-c d") 'yard-toggle-window-dedication) -(global-set-key (kbd "C-c q") 'yard-quit-other-window) -(define-key emacs-lisp-mode-map (kbd "M-.") 'find-function-at-point) +;;; eldoc-mode employs the minibuffer to prompt parameter lists and +;;; docstrings for Emacs Lisp objects, and also generally +;;; (e.g. Clojure's nrepl uses eldoc). +(add-hook 'emacs-lisp-mode-hook 'turn-on-eldoc-mode) +(add-hook 'lisp-interaction-mode-hook 'turn-on-eldoc-mode) +(add-hook 'ielm-mode-hook 'turn-on-eldoc-mode) -;;; Empirically, Emacs on Windows and OS X has a very nice default -;;; font. On the other hand, the systems which feature a GTK Emacs are -;;; unlikely to have a very servicable default. GNU's FreeMono is a -;;; nice Courier clone with good unicode coverage, and is usually -;;; installed. -(when (featurep 'gtk) - (set-face-attribute 'default nil - :family "FreeMono" - :height 120 - :weight 'normal)) +;;; Prompt keystrokes quickly. +(setq echo-keystrokes 0.0166) -;;; Make sure, no matter what, ediff uses one frame. -(setq ediff-window-setup-function 'ediff-setup-windows-plain) +;;; By default, Emacs rings the bell on end of buffer, and other +;;; unecessary times. +(setq ring-bell-function 'ignore) (defalias 'yes-or-no-p 'y-or-n-p) -;;; Going over this threshold results in an annoying warning, so make -;;; it high. +;;; The default assumes far less capable hardware than I usually +;;; operate. (setq large-file-warning-threshold 100000000) -;;; ElDoc uses the minibuffer to prompt parameter lists and docstrings -;;; for Emacs Lisp objects, and also generally (e.g. Clojure's nrepl -;;; uses ElDoc). -(add-hook 'emacs-lisp-mode-hook 'turn-on-eldoc-mode) -(add-hook 'lisp-interaction-mode-hook 'turn-on-eldoc-mode) -(add-hook 'ielm-mode-hook 'turn-on-eldoc-mode) +;;; Make sure, no matter what, ediff uses one frame. +(setq ediff-window-setup-function 'ediff-setup-windows-plain) + +;;; Minibuffer tab completion. +(icomplete-mode) ;;; Follow compile errors with tab. (add-hook 'compilation-mode-hook 'next-error-follow-minor-mode) @@ -81,8 +68,44 @@ ;;; does not jump to next page. (setq doc-view-continuous t) -(setq-default doc-view-resolution 300) - ;;; Enable some "confusing" commands. (put 'set-goal-column 'disabled nil) (put 'erase-buffer 'disabled nil) +(put `upcase-region `disabled nil) +(put `downcase-region `disabled nil) +(put 'dired-find-alternate-file 'disabled nil) + +;;; The defaults in this case are S-. +(windmove-default-keybindings) + +(global-set-key (kbd "C-c p") 'proced) +(global-set-key (kbd "C-c b") 'bury-buffer) +(global-set-key (kbd "C-c d") 'yard-toggle-window-dedication) +(global-set-key (kbd "C-c q") 'yard-quit-other-window) +(global-set-key (kbd "C-c r") 'yard-root-find-file) +(global-set-key (kbd "C-c c") 'save-buffers-kill-emacs) + +(define-key emacs-lisp-mode-map (kbd "M-.") + 'yard-find-function-at-point) + +(define-key emacs-lisp-mode-map (kbd "M-*") + 'yard-pop-find-symbol-stack) + +;;; Aristotelean scrolling maps better to the hardware I use. +(setq mouse-wheel-progressive-speed nil) + +(setq focus-follows-mouse t) +(setq mouse-autoselect-window t) + +(define-key emacs-lisp-mode-map (kbd "") + (lambda (event prefix-arg) + (interactive "@e +P") + (mouse-set-point event) + (yard-find-function-at-point prefix-arg))) + +(define-key emacs-lisp-mode-map (kbd "") + 'yard-pop-find-symbol-stack) + +(define-key help-mode-map (kbd "") 'help-go-forward) +(define-key help-mode-map (kbd "") 'help-go-back) -- 2.11.4.GIT