2008-08-19 Emacs on Windows

Here are some more snippets from my .emacs file. This time from my Windows machine.

I really like Eshell. In fact, I want C-z to switch to it; and since I like toggles, hitting C-z again will bury eshell. Nice.

Eshell

I also want to use the powers of Emacs when inside eshell, which is why I override some of the default keybindings. I use M-p and N-n to navigate the history. The alternative would be to use C-p and C-n to move up and down in the buffer. I dislike that.

Asking me whether to save the history is a usability problem. Don’t ask, just do the right thing.

The last things are just neat stuff to do. No longer will you be confused if your fingers type emacs, man, or dired into the buffer – Emacs will know what to do.

;;; eshell
(global-set-key (kbd "C-z") 'eshell)
(setq eshell-save-history-on-exit t)
(add-hook 'eshell-mode-hook
	  (lambda ()
	    (local-set-key (kbd "C-z") 'bury-buffer)
	    (local-set-key (kbd "C-a") 'eshell-bol)
	    (local-set-key (kbd "<up>") 'previous-line)
	    (local-set-key (kbd "<down>") 'next-line)))
(defalias 'eshell/emacs 'find-file)
(defun eshell/dired () (dired (eshell/pwd)))

That brings me to another problem. Man pages! I found that woman does everything that man does, but slower. Except that running M-x man on my system causes an error and I’ve been too lazy to track it down.

;;; man using Cygwin seems to fail because no fgets is available.
;;; Use woman instead.

(defalias 'man 'woman)
(defalias 'eshell/man 'woman)
(setq woman-manpath '("c:/cygwin/usr/man"
		      "c:/cygwin/usr/share/man"
		      "c:/cygwin/usr/local/man"))

​#Emacs

Comments

(Please contact me if you want to remove your comment.)

I found that woman does everything that man does, but slower.

That’s dangerous talk there, Alex 😄

– GreyWulf 2008-08-19 12:22 UTC

GreyWulf

---

Yeah, the authors of that package basically asked for cheesy jokes. 😄

– Alex Schroeder 2008-08-19 13:00 UTC

Alex Schroeder

---

I should put that on EmacsChannelQuotes. Come to the channel and say that kensanata, so that I may satisfy the rules.

EmacsChannelQuotes

– AlokSingh 2008-08-28 20:01 UTC

AlokSingh

---

Hahahaha.

– Alex Schroeder 2008-08-28 20:36 UTC

Alex Schroeder