Definite's Extractor

My findings on Life, Linux, Open Source, and so on.

Monthly Archives: May 2008

“No profile for user … found” in .xsession-errors

Simply put, it is a warning message from sabayon. See
Creating desktop profiles with Sabayon for detail.

Oh, you don’t have Desktop -> System Settings -> More System Settings -> Desktop User Profiles ?
Just run sayabon as root.

Advertisements

.rpmmacros in RHEL5

I used to pack rpm in RHEL5 with rpm-build, but the names of generated rpms are very weird: package-version-0el5.rpm, where the normal name should be package-version-0.el5.rpm

I kept trying various version of rpm-build, but none prevail. Finally, I learnt one of the rpmbuild options --showrc, which really helps.
On my F-9 machine, rpmbuild --showrc | grep fc9 shows:

-14: dist	.fc9
-14: fc9	1

while my RHEL5 shows:

-14: dist	el5
-14: el5	1

Immediately I realized I should add the following line to ~/.rpmmacros:

%dist .el5

This ended the weird thing, ha ha ha.

[Fix] Nasty behaviour of Vim

Well, it is not a fix for that behaviour per se, just a workaround.

It’s very simple, just add an extra character before entering the normal mode.
For example, I insert “#” before entering normal mode:

imap  #:call SmartPasteSelection(1)

Just remember to delete that character (#) before the end of the function.

Nasty behavior of Vim

As Vim FAQ Section 10.2 shows, whenever <Esc> is pressed, the Vim cursor will moves one character to the left, and there is no way to change the behaviour.

The FAQ suggests that we can use Ctrl-O to enter the command mode temporally, after command entered, the cursor will back to it should be. However, it doesn’t help me.

I’d written a smart paste script for Vim
(see http://vim.wikia.com/wiki/Smart_selection_mode_paste for details).
It works well except one bug: when pasting between col 1 and col 2 in insert mode, the pasteded text will appear in the beginning of line, what the..

The cause is simple: col 1 and col 2 are both mapped to col 1 after leaving insert mode. They are undistinguishable in normal, unfortunately, function cannot be called in inserted mode. Ctrl-O cannot help us because it will do the same when the function is performed.

Still ponding about solution.