From 6c4d68c8106fc91a30e01dde1c5661b09e51363d Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Sat, 17 Aug 2013 02:32:38 +0200 Subject: Fix some warnings, eshell++ --- .emacs.d/init.el | 57 ++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 37 insertions(+), 20 deletions(-) (limited to '.emacs.d/init.el') diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 03f5d3e..5944db2 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -28,6 +28,10 @@ (autoload 'w3m-goto-url "w3m" nil t) (autoload 'xmodmap-mode "xmodmap-mode" nil t) +(defvar elnode-do-init) +(defvar whitespace-style) +(defvar eshell-prompt-regexp) + (defadvice org-agenda-redo (after ext:org-agenda-redo-add-appts) "Pressing `r' on the agenda will also add appointments." (progn @@ -47,10 +51,24 @@ (declare (indent 0)) `(add-hook 'emacs-startup-hook #'(lambda () ,@body))) +(defun init-eshell-C-d () + "Either call `delete-char' interactively or quit." + (interactive) + (condition-case err + (call-interactively #'delete-char) + (error (if (and (eq (car err) 'end-of-buffer) + (looking-back eshell-prompt-regexp)) + (kill-buffer) + (signal (car err) (cdr err)))))) + (defun init-make-readable () - "Make non-programming buffers a little more readable." + "Make non-programming buffers a little more readable." (setq line-spacing .2)) +(defun init-set-keys-for-eshell () + "Set some keybindings for `eshell'." + (local-set-key (kbd "C-d") #'init-eshell-C-d)) + (defun init-set-keys-for-tagedit () "Set some keybindings for `tagedit-mode'." (local-set-key (kbd "M-k") #'tagedit-kill-attribute)) @@ -114,14 +132,14 @@ FEATURE may be an unquoted feature symbol or a file name, see (let ((lsts (mapcar (lambda (l) (if (listp l) l (list l))) lst))) (apply #'append lsts)))) -(defun loadpath-add-and-autoload (path) - "Add PATH to `load-path' and load a `loaddefs.el' if it exists." - (add-to-list 'load-path path) - (let ((loaddefs (concat path "/loaddefs.el"))) - (when (file-exists-p loaddefs) - (load loaddefs)))) - (eval-and-compile + (defun loadpath-add-and-autoload (path) + "Add PATH to `load-path' and load a `loaddefs.el' if it exists." + (add-to-list 'load-path path) + (let ((loaddefs (concat path "/loaddefs.el"))) + (when (file-exists-p loaddefs) + (load loaddefs)))) + (defun make-mode-hook-name (mode) "Get the hook name for MODE." (intern (concat (symbol-name mode) "-mode-hook")))) @@ -220,11 +238,12 @@ Also change directories to current working directory." (turn-off '(menu-bar-mode scroll-bar-mode tool-bar-mode blink-cursor-mode column-number-mode line-number-mode tooltip-mode)) -(mapc #'loadpath-add-and-autoload - '("~/.emacs.d/site-lisp" "~/projects/emacs/pony-mode/src" - "~/projects/emacs/php-mode" "~/.emacs.d/vendor-lisp/org/lisp" - "~/.emacs.d/vendor-lisp/org/contrib/lisp" - "~/.emacs.d/vendor-lisp/eap")) +(eval-and-compile + (mapc #'loadpath-add-and-autoload + '("~/.emacs.d/site-lisp" "~/projects/emacs/pony-mode/src" + "~/.emacs.d/vendor-lisp/org/lisp" + "~/.emacs.d/vendor-lisp/org/contrib/lisp" + "~/.emacs.d/vendor-lisp/eap" "/usr/share/emacs/site-lisp"))) (stante-after appt (setq appt-disp-window-function #'oni:appt-display-window-and-jabber) @@ -443,15 +462,13 @@ Also change directories to current working directory." (stante-after package (setq package-archives '(("melpa" . "http://melpa.milkbox.net/packages/") - ("marmalade" . "http://marmalade-repo.org/packages/") - ("gnu" . "http://elpa.gnu.org/packages/"))) - (setq package-load-list '((htmlize "1.39") - (lua-mode "20111107") - (dispass "1.1.2.1") + ("marmalade" . "http://marmalade-repo.org/packages/") + ("gnu" . "http://elpa.gnu.org/packages/"))) + (setq package-load-list '((dispass "1.1.2.1") (desktop-registry "1.1.0") all))) -(stante-after "paragraph" +(stante-after "paragraphs" (setq sentence-end-double-space nil)) (stante-after php-mode @@ -531,6 +548,7 @@ Also change directories to current working directory." ((emacs-lisp ielm) eldoc-mode) ((emacs-lisp ielm) set-emacs-lisp-keys) ((eshell) buffer-disable-undo) + ((eshell) init-set-keys-for-eshell) ((git-commit text) auto-fill-mode) ((git-commit text) flyspell-mode) ((html org prog) yas-minor-mode) @@ -572,7 +590,6 @@ Also change directories to current working directory." (tool-bar-lines . nil) (font . "Liberation Mono:pixelsize=16"))) (setq frame-title-format '(:eval (concat "emacs: " (buffer-name)))) -(setq inhibit-local-menu-bar-menus t) (setq message-log-max 1000) (setq redisplay-dont-pause t) (setq use-dialog-box nil) -- cgit v1.2.3-54-g00ecf