At CIM Software Testing we have
for along time pondered moving to Visual Studio 2012, but now 2013
came out so that is the next target.
With a new Visual Studio comes a new hunt for a way to make it usable
for people like me who are emacs-impaired and cant help hitting
Ctrl+N and Ctrl+P all the time, which normally means that new
documents are created and printed on end.
Visual Studio 2005 contained some emacs keybindings which were ok for
moving about a document, but the copy/paste (kill/yank in emacs lingo)
was HORRIBLE!?!?!? it tried to implement a kill-ring but that did not
work at all, and usually i ended up opening the document in emacs and
doing the actual copy/pasting - but i lived with that setup for many
With Visual Studio 2008 and 2010 the emacs bindings got split into a
separate package, and with 2012 they disappeared completely - and
apparently never to return.
So i need some way to use emacs keybindings with visual studio, at
first i pondered writing a Visual Studio extension which would connect
to a socket emacs listened on, and emacs would then talk to VS to get
information about the open documents, and get intellisense
But writing VS "packages" are really hard i found out, i thought it
would be easy now that Microsoft has adopted .net for almost
everything but there is still a LOT of COM monsters lurking in there.
And i though writing the emacs elisp part of the equation would be hard.
So my current solution is to use the standard VS commands and map them
to the relevant Emacs keys.
So far it feels very basic and i haven't used it that long yet (we
haven't made the switch to VS 2013 completely yet), but i think i can
live with it. At least as long as i can jump into Emacs when the need
arises using Alt+E.
The most prominently missing thing is selection support, i haven't
found a way to make the VS editor do selection marking the same way
that emacs does it (using Ctrl+Space to mark the start of the
selection) - i maybe end up having to write a bit of VS package
after all to get that working.
So we have to use "hold-down-shift" selecting - and you just cannot do
that while you are using emacs keybindings to move the cursor.
The keys i currently have mapped are:
I had to remove the following keybindings to get it to work:
Some of commands do not map correctly from emacs, e.g. TAB has been
mapped to FormatDocument, it was the best match as i hit TAB all the
time when i write code in emacs to indent the line i am on without
moving the cursor position. It works, but VS cant indent unless the
entire document is "correct" according to the coding rules for the
document (e.g. C#), emacs is better here in my oppinion since you can
use TAB to find out where you are missing a end } character in your
code - VS just looks a you with a blank face, waiting for you to fix
Emcas is the name i have given to this journey to make me spend even
more time inside Visual Studio. When i started using emacs i often
started it directly from the commandline and my fingers would
sometimes hit emcas instead if i went too fast.
My G502 finally gave up so i had to find a new phone (apparently life without a phone is impossible). I went with Sony Ericsson for the second time, a Mini Pro with Android 2.3.
The best thing is definitely the keyboard, i never got the hang of T9, now i can type at a pretty good speed and i do not dread writing text messages, i have tried both the Android virtual keyboard and the iPhone keyboard on friend's phones and i hate both. I am actually writing this on the phone right now.
I use Emacs! I want tactile feedback!
The phone is a bit big and heavy, and the battery drains too fast. But that seems to be a problem with all modern phones, they all suffer from iPhone envy.
The worst thing is all the crap-ware that Ericsson puts on the phone. Mcafee virus scanner, UEFA.com PopCon games to name just a few. All in trial versions of course.
If you could just remove this stuff i could accept it, but much of it is "burned in" and not removeable without root'ing your device. Actually the PopCon games thingy has a service running in the background on the phone at all times - no way to know what it is doing and what kind of data is is stealing.
I think this is a scary scenario, if our phones will now be as bloated as a windows pc when we buy them. And since there is no explanation about what the different programs do, it is impossible to know what they do unless you accept their license agreement thingy, and sometimes it is not even apparent after that. I am a fairly technical guy who should be capable of coping, but i can not imagine how "normal people" will feel when there are all sorts of crap-ware installed on the phone.
I would also like to see some ball-part-figure about how much money the companies are paying Sony Ericsson to put it on the phones, they have to decide whether to provide an inferior user experience and risk loosing future customers, or if they want to line their pockets right now.
Hi again, after over half a year of silence i think i am finally ready to write something again. The thing is: i have been writing a lot of C# lately as part of my job.
When you work some years with a language you start to envision certain improvements to the langauge which would make your life much easier. I plan to write these findings here as i find the time to do so.
The first thing i wish to tackle is the "lack of" a nameof operator, this is actually something which is lacking in Java and C++ too, but i find that it is more needed in C# because you deal with a lot of strings there, not to say that it would not be a huge boon in any language.
What this new operator tries to tackle is a problem most C# developers have faced: you have a class with a number of properties, these properties can be updated which, in turn, makes the object instance emit a PropertyChanged event for that particular property.
The problem comes when you want to write code which reacts to this property change for a particular property:
This works ok at the beginning, but you are actually introducing dynamic/runtime programming into your statically compiled program. What happens if NumberOfSamples changes name to NumberOfActualSamples ? Your code will be broken but you will not see it on compile time, only on runtime.
Sometimes people, including myself, handle this by introducing an inner public class called Properties which contain several public const strings with the property names:
public class MyClass
public class Properties
public const string NumberOfSamples = "NumberOfActualSamples";
private int m_numberOfSamples;
public int NumberOfSamples
if ( m_numberOfSamples != value )
m_numberOfSamples = value;
This is actually quite a nice way to write code, you even get the added benefit of being able to search your code for places where a particular property is used from inside visual studio by using the built-in "Find all references" command.
But please notice that this is a violation of the DRY (Don't Repeayt Yourself) principle, that all hackers hold so dear.
A further complication is that this does not work for interfaces where inner classes are not allowed.
So what to do?
My proposal is to add a "nameof" operator, which takes the name of an identifier and returns it's name as a string. The "OnPropertyChanged" part of the code above would then look like:
For a long time my primary animosity against windows has been the lack of a standard packaging system like on Linux, where keeping your system up to date is a simple process that does not require you to run 10 different programs with 10 different interfaces and rebooting 10 times.
In the past this has made my blood boil several times, two years ago it even got so bad i had to blog about it
Several months ago i created a program that will hopefully make this less painful in the future, and now i think it is time to tell the world.
You might have noticed the Vaca link on the top of this page which has been here for some months now too, it will lead you to my "repository" of Vaca sources.
Ok, let's back down a bit, what exactly is Vaca?
Well it is a simple "download and install program" which uses rss feeds to query when programs come in new versions. It simply downloads the newest version of a program's installer and executes it with the proper parameters to install without bothering you with the "next,next,next,next,finish" nonsense.
The reason for using Vaca is "obviously" to make it even easier for projects and bloggers to publish new versions of their software, they simple slap a vaca tag in their rss feed and Vaca will eat it all up.
Now, back to the Vaca link at the top of this page. It will lead you to a repository i keep of Vaca rss feeds (called sources). This is more a proof of concept than anything else, if Vaca takes off i know that i wont be happy with maintaining a list of thousands of software up-to-date. I don't scale well :)
I think that is enough talk, give it a whirl and tell me what you think. And if you start publishing any Vaca sources, incorporate Vaca in your product (please do!) or some other cool thing, please let me know!
If this gets enough leverage i will have to set up a bigger Vaca source site somewhere where admins will be able to edit the site without me having to be the weak link.