about summary refs log tree commit diff stats
path: root/event.c
diff options
context:
space:
mode:
authorAnselm R. Garbe <arg@suckless.org>2007-01-16 11:41:56 +0100
committerAnselm R. Garbe <arg@suckless.org>2007-01-16 11:41:56 +0100
commit936e11fd5465819555604f924f8afaae702e426e (patch)
tree98cb3bf63fa8c44edd739b7cbd1dfc7c552b6302 /event.c
parent9715ba82aa4d256a43b3a166c88f3409b873eb32 (diff)
downloaddwm-936e11fd5465819555604f924f8afaae702e426e.tar.gz
Added tag 3.1 for changeset e1c8bef05e6e
Diffstat (limited to 'event.c')
0 files changed, 0 insertions, 0 deletions
padding-right: 5px; } td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } .highlight .hll { background-color: #ffffcc } .highlight .c { color: #888888 } /* Comment */ .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ .highlight .k { color: #008800; font-weight: bold } /* Keyword */ .highlight .ch { color: #888888 } /* Comment.Hashbang */ .highlight .cm { color: #888888 } /* Comment.Multiline */ .highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
---
layout: post
title: Using Emacs
date: 2023-07-18T09:27:00Z
tags: [webdev, ide, emacs, text editor, development]
---

This post is being written in [Emacs](https://www.gnu.org/software/emacs/) :)

### What?

Emacs is, according to its own website:

> "An extensible, customizable, free/libre text editor — and more."

Basically, it's one of the oldest text editors to exist, is (technically) entirely keyboard-based, and manages to combine simplicity with power. In short, it's great and I'm going to talk about it now.

### Why?

Why am I using Emacs? Well, there's a few reasons:

- I'd heard of it before and it sounded cool
- It's complex enough that it would present an interesting learning curve, but not so difficult as to discourage me
- It's useful for editing posts and HTML like this
- It ships with Tetris built in (need I say more?)

### How?

I went to the website and downloaded it.
My laptop currently uses Windows, and Emacs is made by GNU so as expected I was berated for my choice of OS:

> "To improve the use of proprietary systems is a misguided goal. Our aim, rather, is to eliminate them."

But I wasn't going to concern myself with GNU's plans for world domination; that's a problem for another day. The install was fairly simple, like any other application, and upon running the program I am greeted with a pleasant menu screen:

![The Emacs welcome page](https://cdn.discordapp.com/attachments/838048982873538572/1130779711820267570/image.png)

Now it was time for me to learn how to use Emacs.
Emacs is primarily keyboard-based, as it was developed at a time where not all computers had GUIs at all, let alone mice to interact with them. As such, and also due to its age, it has its own set of keybinding patterns which are overall very different to that of most applications. For example, saving a file in MS Word is `Ctrl-S`, while in Emacs it is `C-x C-s`, which means `Ctrl-x` followed by `Ctrl-S`. You'll notice that in this example, two keybindings need to be pressed to perform one action. This is very common in Emacs, as there are lots of commands and not many keys, and there are even some commands that don't have keybindings and must be invoked by pressing `M-x` (`M` meaning `Alt`) and then typing the command name out.

This was all a bit complex for me to understand at first, but I quickly got the hang of it (as I had done with the more standard keybinding patterns that existed elsewhere in the computing world).

### Customising Emacs

Now that I had gotten the grips of Emacs' basic usage, I needed to tailor it to my own needs.
My plan was to use Emacs for editing Markdown posts (such as this one) or HTML files, and my website is hosted on GitHub, so I needed something to cover both bases.

For the latter, there was already Emacs' `VersionControl`, but this was a generic version control tool and wasn't tailored to the specifics of Git. Therefore, I did some googling and came across [Magit](https://magit.vc). A few more googles educated me in how to add the package repository it was in and how to then install the package (`M-x package-install RET magit RET`), and I was quickly able to clone, commit, and push to the website repository. Perfect!

Now I needed to improve my Markdown editing experience. `.md` files are text, and so I could edit them as normal in Emacs, but then I wouldn't be able to enjoy things such as syntax highlighting and easy access to various formatting options without typing them out manually. Again, a quick google found [markdown-mode](https://github.com/jrblevin/markdown-mode), and within moments it was installed. The package adds a major mode to Emacs - Emacs is mode-based, meaning that there are modes of editing which result in different functionality of the editor for different purposes - in this case, the markdown mode (enabled with `M-x markdown-mode`) provides syntax highlighting and commands to automatically paste in the syntax for links, etc.

![Me editing this very post in Emacs with syntax highlighting](https://cdn.discordapp.com/attachments/838048982873538572/1130784754657153024/image.png)

And that was it! I had installed, learned to use, and configured Emacs and could now use it to edit blog posts for this very website (or Gopher phlog, if you're reading it on that mirror).
Next I shall get it set up for developing my Python/Java projects - I'll keep you posted!