Entries in Life

Previous 5

Aug. 12th, 2009

geek-boy

Quick Emacs Tip: Scale fonts in a buffer

Emacs23 includes default keybindings for scaling fonts up or down:
C-x C-+ — scale the current buffer's face/font up

C-x C-+ — scale the current buffer's face/font down

This is good as far as it goes, but I'd really like something a little easier. So I've added the following to my .emacs file:
(global-set-key [(control mouse-4)] (lambda () (interactive)
                                      (text-scale-increase 1)))
(global-set-key [(control mouse-5)] (lambda () (interactive)
                                      (text-scale-decrease 1)))

Now, if I hold down the control key and scroll the mouse wheel, the font will get larger or smaller. Some other applications (e.g. Firefox) use "Control +" and "Control -" to do something similar along with "Control 0" to return to the default size. You could set these keybindings in Emacs without losing too much (unless you're used to C-- and C-0 as prefixes, in which case, you still have C-M-- and C-M-0):
(global-set-key [(control ?+)] (lambda () (interactive)
                                      (text-scale-increase 1)))
(global-set-key [(control ?-)] (lambda () (interactive)
                                      (text-scale-decrease 1)))
(global-set-key [(control ?0)] (lambda () (interactive)
                                      (text-scale-increase 0)))


None of this will permanently affect the size of the font, so for the next buffer you open or the next time you start Emacs, you'll have the same size font you started with. If you want to change the default font size, use M-x customize-face RET default RET instead.
Tags:

Jul. 20th, 2009

consultant

Emacs Hack: mediawiki.el

I've gotten some feedback on the mediawiki mode I've been working on.  So I'm releasing a new version.  Some highlights:
  • Now works with HTTP Auth (I'll write a seperate post on how Emacs handles credentials for HTTP Authentication).
  • Introduced tab-completion of sites.  If you have multiple MW sites set up that you work on, this makes switching between sites super-easy.
  • Started working on making it more XEmacs compatible.  As far as I can tell, XEmacs lacks the Unicode support that GNU Emacs has.  The released version of XEmacs also lacks the POSIX character classes for regular expressions and ships with a very out-dated version of url.el.  All these combine to make it very difficult.  But do-able.  I'm surprised there are still XEmacs users, but if it doesn't cause me too much pain, I'll help them out.
  • Misc other clean up (including making the url.el wrappers much better).
Tags:

Jan. 5th, 2009

consultant

notify.el -- pop-up notifications from emacs using dbus

Since emacs on Linux can use DBus calls now, I wrote a short notify.el as a demonstration to myself and to save myself from forking notify-send (because, uh, forking is bad) whenever someone mentions my nick in IRC.

There is a delay built into it so that your "friends" on IRC can't DDOS you with notifications.

Oh, the really nifty thing about this is the function keywords-to-properties. elisp keywords (:example) allow you to fake named parameters in function calls. This is done a couple of different places in Emacs, the most visible being defcustom. But there isn't any universal way that I could find to parse the keyword-value pairs into something usable. So I cribbed from defcustom and wrote something that I hope will be useful to others.
Tags:
geek-boy

mediawiki.el - Emacs mode for editting MediaWiki pages

I seem to be spending an inordinate amount of time editting MediaWiki wikis, so I've had some time to put together a better MediaWiki mode for emacs. In the process, I wrote some code that many people (myself included) seem to think Emacs needs.

HTTP POSTing in native elisp is too hard right now, so a http-post-simple.el was written. The original mediawiki.el required this library, but it wasn't included. I refactored the dependency away and now I have some form parsing functions in elisp that I can contribute back to the Emacs core.

Anyway, if you use Emacs and edit MediaWiki pages, check out mediawiki.el and let me know what you think. I'm especially interested in bug reports from anyone.
Tags:

Jul. 25th, 2008

consultant

Women and Computing

One of the never-ending subjects of Free Software is "Where are the Women?"

While I see it as mostly a non-problem -- that is, there are some obvious problems that need to be fixed with time, but no one is going to rectify them right now -- I'm doing what I can to encourage my daughters and son in the field.

In the meantime, The Decline of Women in Computer Science from 1940-1982 has some fascinating anecdotes:
Computing was unique, however, in the sense that the fledgling profession was still in its infancy and had no strong pre-war gender socialization.  This fact must have helped the women in that the returning men lacked programming expertise, and clearly had no expectation of “returning” to a programming job.  The lack of structure in the industry was also a boon to women programmers who wanted to continue working even after they became pregnant and had children.  Most notably, “Computations, Inc., of Harvard, Massachusetts (outside Route 128), formed in 1958 by Elsie Shutt and several other programmer-mothers who worked part-time and largely at home on problems contracted out to them by their former employers, such as Minneapolis-Honeywell and Raytheon”.  These women, widely known as the “Pregnant Programmers” were mentioned by speaker Richard H. Bolt at the M.I.T Symposium on American Women in Science and Engineering in 1964.  Bolt, who was a lecturer in Political Science at M.I.T and also a former Associate Director of the National Science Foundation (NSF) from 1960-1963, also mentioned the following:

 “I asked one of the unmarried women, a computer programmer in industry, if she thought a woman’s activities as a mother and homemaker would interfere with her opportunities in a career.  ‘One good thing about programming,’ she said, ‘is that you can work part time.’”

Previous 5