Milan Zamazal's Weblog RSS feed

Entries tagged "emacs".

Tramping in Emacs
3rd January 2006

Why to use separate terminal applications for remote connections when one can use Emacs? Why to run remote Emacs of different version, in different configuration, with echo delays, without your customizations, etc.? Why to pollute your desktop with another window and why to switch between it and Emacs all the time? Why to run multiple editors?

The only reason I didn't simply use Tramp for remote connections was lack of command line completion. But that can be done with Tramp too, one just must configure it. rlogin.el doesn't seem to be directly useful for that purpose, but it's useful for getting a clue. So I wrote a little hack:

(defun my-shell-directory-tracker (command)
  (when (string-match "^ssh " command)
    (make-local-variable 'comint-file-name-prefix)
    (let ((host (comint-substitute-in-file-name
                 (comint-arguments command nil nil))))
      (set (make-local-variable 'comint-file-name-prefix) (format "/%s:" host))
      (set (make-local-variable 'comint-process-echoes) t)
      (cd-absolute (format "%s~" comint-file-name-prefix))
      (rename-buffer (format "*shell:%s*" host)))))
(add-hook 'comint-input-filter-functions 'my-shell-directory-tracker)

Now I can enjoy remote editing (both editing files and editing command lines) quite comfortably and without echo delays.

This hack is not perfect, but it has good usefulness/effort ratio. If you can improve it or know about a better solution, please tell me.

Tags: computers, emacs.
Fonts in Emacs 23.2
11th September 2010

When my Emacs was upgraded from 23.1 to 23.2, I got negatively surprised: It changed font rendering, making fonts significantly less readable. I quickly identified the corresponding NEWS entry:

*** On X11, Emacs reacts to Xft changes made by configuration tools,
via the XSETTINGS mechanism.  This includes antialias, hinting,
hintstyle, RGBA, DPI and lcdfilter changes.

But I didn't know anything about Xft and XSETTINGS. I started to look for a quick solution and tried to install and use common desktop configuration tools such as gnome-control-center, systemsettings and xfce4-settings. I've found that font adjustments apply in Emacs only when using the GNOME tools. So running gnome-settings-daemon was necessary and it was very annoying: It changes keyboard layout on startup and after switching back to X from console, breaks multimedia keys, pops up annoying dialogs on various occasions, etc. and I couldn't find a way to prevent all the odd behavior.

Now I've finally got rid of it. I discovered Xft font properties can be set simply via X resources. After some testing and elaboration I ended up with the following new lines in my ~/.Xresources:

Xft.antialias: 1
Xft.hinting:   1
Xft.hintstyle: hintslight
Xft.lcdfilter: lcdnone
Xft.rgba:      none

Now fonts in Emacs look fine again and gnome-settings-daemon is no longer present on my computer.

Tags: computers, emacs.
Getting organized
18th February 2011

I've never been successful in keeping really useful and up-to-date diaries and todo lists. Well, one can think: "If it's really important I won't forget about it and the other things don't matter much." But if nothing else then family life can cause semi-chaos making really difficult to get anything done. Nevertheless an important change has happened to me last year.

I used to use KDE PIM suite as my software organizer (indeed, there are some important things one can forget of). Last summer I had to upgrade my desktop and got exposed to the infamous KDE 4. I hadn't been very comfortable with KDE PIM before the upgrade and it got only worse afterwards. I think I needn't explain much, KDE PIM simply wasn't among the few excellent and already completely working KDE 4 applications (believe or not there are some).

By chance I met Emacs Org-mode at that time. This wasn't for the first time I've seen it. But previously either Org-mode wasn't mature or I didn't really understand its concepts (perhaps both). This time I found a mature product with interesting concepts and features. After some exploration I decided to move from KDE PIM to Org-mode.

What's so good about Org-mode? The basic idea of simplicity and flexibility. You can just write down anything that comes to your mind and put it into plain text files using simple markup. And then you can use available tools to manage all the information. Easy, isn't it? Actually it may not be that easy, it requires some mental change when abandoning GUI tools designed to drive you and moving to a plain text organizer designed to be driven by you. But once you get it you'll start to like it a lot.

You can simply start writing anything you want in your editor without having to use menu commands and to navigate through fields and buttons of predefined dialogs – you define how information is organized. You can keep related information in a single place – no need to split a journal entry containing a calendar item, a short todo list, a contact and some note into five different locations in five different applications. You can structure and organize your information as you like, it can be anything from a single big file to a directory tree containing many different files. In any case you can use the presentation tools to retrieve and combine required information. And you can customize it as you like, it's Emacs after all.

In the result KDE PIM wasn't the only set of applications I abandoned in favor of Org-mode. Think, you can put a lot of things into plain text files: notes, tasks, events, anniversaries, journal, bookmarks, passwords, contacts, vocabularies, clocking, documents, source code, commands, ideas, this blog entry, etc. There are many contributions to Org-mode, putting some kinds of specialized applications into obsolescense due to their limitations, low flexibility and lack of integration.

A very important part of Org-mode is its excellent documentation. When you've got a flexible software, good documentation is essential because the software is much about general concepts and personal preferences. It's interesting to see that e.g. KDE PIM pages present just feature lists and completely omit the important areas. Org-mode is equipped with a complete user manual, tutorials, presentations, FAQ and other documentation that help you learn how to manage things. It's software with intelligent community around it.

I can confirm the Org-mode way works. I was able to reasonably organize my things soon after I had begun to start using Org-mode and this is for the first time I'm able to keep my agenda in order. Org-mode has impressed me a lot. Not because it's perfect (it's not) or because of its feature set (it offers much more than I need while some things are missing), but because of its excellent concepts that solve the right problem, in a right way and for a useful purpose.

Well, this is not an introduction to Org-mode nor a feature overview. If you'd like to know what Org-mode actually is, look at Org-mode home page where you can find explanation of its concepts and everything else about it.

Tags: emacs, freesoft, software.

Entries tagged "emacs": RSS Feed

Created by Chronicle v4.6