[ale] Calling all emacs users

Michael B. Trausch mike at trausch.us
Wed Sep 12 14:03:10 EDT 2007


Trey Sizemore, on 09/08/2007 03:14 PM said:
> Hi all-
> 
> I'm just getting into emacs.  I like the idea of being able to have
> one tool where I can edit files, use irc, browse the web, use for a
> PIM, listen to media, view and send mail, etc.
> 
> I've got a long way to go with getting everything setup, but the
> first thing I'd like to do is get the fonts looking better.  They're
> terrible now on my SLED laptop.  How do I go about changing the font
> (to something like Bitstream Vera Sans or such)?
> 
> Also, any tips regarding setup, essential add-ons, sample .emacs or 
> .gnus.el files are greatly appreciated as well.
> 

Well, I am a bit late to the party on this one.  Hopefully, I won't be
late to any more parties... silly overzealous spam filter.

Anyway, Emacs customization is a wonderfully powerful thing.  However, I
don't know if the "new" fonts are available on it.  The default font is
horrid, and so I use fixed (the classic xterm font) which I find to be
very nice for everything that I do.

I have bound lots of functions to various keys and have a good deal of
customized packages installed.  Some pointers:

 * Install Emacs 22 if available for your distribution.  It's great.
   If you're running Ubuntu, it's backported to Feisty officially in
   the "emacs22" package.  If you use TeX/LaTeX, you'll also want to
   install auctex, a magnificent package for that.  You'll want to use
   "prevu"[0] so that you can pull auctex from Gutsy, which knows about
   emacs22.
 * If you edit (X)HTML with embedded PHP code, you might want to
   check out something called nxml/nxhtml/mumamo[1], which lets you have
   multiple major modes in a single buffer, and for far more than just
   (X)HTML/PHP.  It's worth a look-see.  It does have some quirks, but
   mmm-mode is actually a bit worse, IME.
 * There is an add-on called "linum" which prepends line numbers to
   whatever it is that you're viewing in the current buffer.  Useful,
   but not essential.
 * There are major modes for nearly any programming language you can
   imagine, including C#.  Google has the locations of most of those,
   of course.
 * The "gnu.emacs.help" group on USENET is a very valuable resource,
   even if all you do is lurk.  I would recommend that you subscribe
   to it with your favorite newsreader.

Also, there are a great many code snippets that you can add to your
~/.emacs file from all over the Internet.  Probably 90% of my Emacs
configuration file (that isn't written out by the customization modules)
is sourced from various places on the 'net.

Here are some helpful things that you might want to add to your ~/.emacs
file:

;;; Final version: while
(defun count-words-region (beginning end)
  "Print number of words in the region."
  (interactive "r")
  (message "Counting words in region ... ")

;;; 1. Set up appropriate conditions.
  (save-excursion
    (let ((count 0))
      (goto-char beginning)

;;; 2. Run the while loop.
      (while (and (< (point) end)
                  (re-search-forward "\\w+\\W*" end t))
        (setq count (1+ count)))

;;; 3. Send a message to the user.
      (cond ((zerop count)
             (message
              "The region does NOT have any words."))
            ((= 1 count)
             (message
              "The region has 1 word."))
            (t
             (message
              "The region has %d words." count))))))

;; Count the words in the entire document
(defun count-words-buffer ()
  "Count all the words in the buffer"
  (interactive)
  (count-words-region (point-min) (point-max) )
)

;; Global key mappings
(global-set-key "\C-c=" 'count-words-buffer)
(global-set-key "\C-cu" 'ucs-insert)
(global-set-key "\M-;" 'goto-line)
(global-set-key "\M-p" 'vc-update)
(global-set-key "\C-c;" 'comment-box)
(global-set-key "\C-ci" 'indent-region)
(global-set-key "\C-cp" 'print-buffer)
(global-set-key "\C-c\C-p" 'print-region)

(global-font-lock-mode t)
(setq inhibit-startup-message t)
(setq make-backup-files nil)

(setq locale-coding-system 'utf-8)

(set-terminal-coding-system 'utf-8)

(set-keyboard-coding-system 'utf-8)

(set-selection-coding-system 'utf-8)

(prefer-coding-system 'utf-8)


(line-number-mode t)
(column-number-mode t)
(display-time-mode (quote toggle))

(setq text-mode-hook 'turn-on-auto-fill)
(setq tex-mode-hook 'turn-on-auto-fill)

;; Fix tab behavior
(setq-default indent-tabs-mode 't)
(setq-default tab-width 2)
(setq default-tab-width 2)
(setq fill-column 78)

-- 
Michael B. Trausch               Internet Mail & Jabber: mike at trausch.us
Phone:  (404) 592-5746 x1                         http://www.trausch.us/
Mobile: (678) 522-7934             VoIP: 6453 at sip.trausch.us, 861384 at fwd
Pidgin 2.1.1 and plugins for Ubuntu Feisty! http://www.trausch.us/pidgin

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature




More information about the Ale mailing list