(setq compilation-scroll-output t) (setq gdb-many-windows t) (global-cwarn-mode 1) (windmove-default-keybindings) (defun select-gud-interaction-window () (interactive) (if (and (boundp 'gud-comint-buffer) gud-comint-buffer (window-live-p (get-buffer-window gud-comint-buffer))) (select-window (get-buffer-window gud-comint-buffer)) (message "GUD interaction window is inactive"))) (define-key global-map [(f3)] 'select-gud-interaction-window) (defun turn-on-flyspell () "Force flyspell-mode on using a positive arg. For use in hooks." (interactive) (flyspell-mode 1)) (setq flyspell-use-meta-tab nil) (add-hook 'text-mode-hook 'turn-on-flyspell) (add-hook 'c-mode-common-hook 'flyspell-prog-mode) (add-hook 'tcl-mode-hook 'flyspell-prog-mode) (add-hook 'emacs-lisp-mode-hook 'flyspell-prog-mode) (add-hook 'lisp-mode-hook 'flyspell-prog-mode) (add-hook 'cperl-mode-hook 'flyspell-prog-mode) (defun wl-pp-macroexpand-at-point () (interactive) (pp-eval-expression '(macroexpand (read (thing-at-point 'sexp))))) (defun wl-pp-evaluate-at-point () (interactive) (pp-eval-expression (macroexpand (read (thing-at-point 'sexp))))) (define-key emacs-lisp-mode-map (kbd "C-c C-c") 'wl-pp-macroexpand-at-point) (define-key emacs-lisp-mode-map (kbd "C-c C-e") 'wl-pp-evaluate-at-point) (require 'find-func) (find-function-setup-keys) (require-maybe 'xcscope) ;;; snippets for gcc development (eval-after-load 'yasnippet '(progn (yas/define-snippets 'c-mode '(("bb" "basic_block ${1:bb}; FOR_EACH_BB (${1:bb}) { $0 }" "FOR_EACH_BB (...) { ... }") ("bsi" "for (${1:si} = bsi_start (${2:bb}); !bsi_end_p (${1:si}); bsi_next (&${1:si})) { $0 }" "bsi_start (...) { ... }") ("bbb" "basic_block ${1:bb}; FOR_BB_BETWEEN (${1:bb}, ${2:ENTRY_BLOCK_PTR}, ${3:EXIT_BLOCK_PTR}, ${4:next_bb}) { $0 }" "FOR_BB_BETWEEN (...) { ... }") ("ee" "edge ${1:e}; edge_iterator ${2:ei}; FOR_EACH_EDGE (${1:e}, ${2:ei}, ${3:bb->succs}) { $0 }" "FOR_EACH_EDGE (...) { ... }"))))) (add-to-list 'load-path "~/elisp/3rd-party-lib/go-mode") (require-maybe 'go-mode-load) (add-to-list 'load-path "~/src/llvm/trunk/utils/emacs") (require-maybe 'tablegen-mode) (defvar wl-llvm-root-dir "~/src/llvm/trunk") (defvar wl-llvm-grep-command (concat wl-llvm-root-dir "/utils/llvmgrep")) ;;; To make this command work, add `llvm-config' to PATH (defun wl-llvmgrep () (interactive) (let ((regexp (grep-read-regexp)) (default-directory wl-llvm-root-dir)) (compilation-start (concat wl-llvm-grep-command " -topdir " wl-llvm-root-dir " " (shell-quote-argument regexp)) 'grep-mode))) (provide 'wl-programming)