Kuro5hin.org: technology and culture, from the trenches
create account | help/FAQ | contact | links | search | IRC | site news
[ Everything | Diaries | Technology | Science | Culture | Politics | Media | News | Internet | Op-Ed | Fiction | Meta | MLP ]
We need your support: buy an ad | premium membership

[P]
Making Emacs Stand Up To Visual Studio 7

By sludge in Op-Ed
Wed Apr 02, 2003 at 03:44:32 AM EST
Tags: Software (all tags)
Software

Emacs users have reason to be jealous. The Visual Studio 7 IDE offers features that are seemingly unavailable in Emacs, and are certainly not 'on' by default. Admit it, it doesn't feel good to consider switching from Emacs to Visual Studio, and it certainly doesn't work well to have them both open at the same time.

What's not hopeful is the amount of help out there for aspiring Emacs users who are less than excited about using the Visual Studio 7 IDE, or feel themselves shamefully being wooed away from The One True Editor by the admittedly slick functionality of Visual Studio 7. The goal of this document is to pave the way for Emacs users to integrate with Visual Studio 7, something that is not covered in any depth elsewhere. I focus on Visual C++ (unmanaged), as this is what I spend all my time working with, though a C# programmer would probably see the majority of these tips as a good start.

I attack each issue that I consider important point-by-point. Keep in mind that these are my solutions, which means they're all in use by me, and that you may have a better idea. I'd love to hear it. I hope you find them a good start. It should also be mentioned that I use GNU Emacs 21.1.1 under Windows 2000 with the cygwin tools installed.

Hopefully reading on will fix one or more of your pet peeves with the one true editor, and keep you plugging away on Free Software as much as possible.


Syntax Highlighting

Although I do enjoy Emacs' font-lock mode, it does leave something to be desired after seeing the very fine-grained syntax highlighting of Visual Studio 7. In graphics heavy code such as the code I write, a lot of array lookups are done in tight loops. Visual Studio highlights operators, such as the '[' and ']' operators, which makes array heavy code much more readable. Emacs does not, by default.

Solution: Write new font-lock rules for c++-mode. I haven't included all of the syntax here, but this is what works for me without looking too fruity:

(font-lock-add-keywords 'c++-mode '(
;; Currently support for []|&!.+=-/%*,()<>{}
("\\(\\[\\|\\]\\|[|!\\.\\+\\=\\&]\\|-\\|\\/\\|\\%\\|\\*\\|,\\|(\\|)\\|>\\ |<\\|{\\|}\\)" 1 font-lock-operator-face ) <BR> ; End of c++ statement ("\\(;\\)" 1 font-lock-end-statement ) ))

Apologies to regex pros. I get the job done, but I'm not great. You will also want to define font-lock-operator-face and font-lock-end-statement:

(make-face 'font-lock-operator-face)
(make-face 'font-lock-end-statement)
(setq font-lock-operator-face 'font-lock-operator-face)
(setq font-lock-end-statement 'font-lock-end-statement)

There are multiple ways to assign a face. You will want to do it in a way that is similar to anything you already have customized.

Status compared to Visual Studio: Emacs is a perfectly acceptable alternative. If you turn off precaching of syntax highlighting, it's a bit slower to load a file. Jumping around a 60,000 line c++ source tree on my 1.2ghz Athlon is still easily within acceptable ranges.

"Go To Definition"

Visual Studio 7 lets you right click on a component of a statement (usually a function, variable or typedef) and go to it's definition. This handy feature lets you jump around a source tree in a snappy fashion. Emacs has a similar feature out of the box. You need to build a tags table, which is essentially a precached list of all of the definitions. Go to the root of your source tree, and type:

etags `find -iname "*.cpp"` `find -iname "*.h"`

This produces a file called 'TAGS' in the current working directory. Next, in Emacs, type M-x visit-tags-table and select the TAGS file.

In true Emacs fashion, the best way of navigating the tags is through the bindings. M-. will find a tag. M-* brings your cursor back to the place it was at before the most recent tag find. (Yes, this works recursively!) C-TAB completes the current keyword from the tags table database.

Status compared to Visual Studio: Not quite as smart or accurate as the Visual C++ tag finder. I find myself having to revert to M-x grep from time to time, or M-x occur (try it). On the bright side, there is no latency: the precaching in Emacs makes for one of those rare situations where Emacs is actually faster than Visual Studio in it's default state. I'm also a huge fan of the ability to push and pop my navigation points through the source tree. Mixed bag. I'd choose Emacs over Visual Studio if I had to take one implementation over the other, overall.

Compilation

Getting Visual Studio 7 projects to compile through Emacs is one of the thorniest issues addressed here. If you used Visual C++ 6.0, you know that used to be able to export Makefiles. Well, in its infinite wisdom, Microsoft has removed this ability from Visual Studio 7. Instead, you must invoke the IDE from the command line and get it to build from the .sln file.

If you were to bring up a shell (with devenv.exe and .com in your $PATH), you could type "devenv.com foo.sln /build Debug /out output.log" and have it compile your project from the command line. Caveat - if you don't specify devenv.com, you get devenv.exe, which, for seemingly no good reason, sends it's output somewhere else than stdout, which ensures that you won't see it unless you're running cmd.exe. Always specify devenv.com when building from the command line.

In the simplest case of directory structures, all you need to do to compile a Visual Studio 7 project in Emacs is to set the default compile command:

(setq compile-command "devenv.com foo.sln /build Debug")

The usual C-` to step through the compiler errors works just fine with the compile buffer's output.

Honestly, I maintain a multi-directory project with some complications, so I call a perl script which actually goes ahead and calls devenv with the proper build configuration. I don't mind keeping that logic out of Emacs.

Compiling a Single File

One thing I hate about Visual Studio is what happens when I make a small change in a file, and the entire project's dependancies are checked before a single file is compiled. If you're like me, and you have a ton of dependancies in a big project, it can take upwards of around a minute to compile your single line change. Unfortunately, this minute can become two or three minutes if you muck your changes up and need to recompile. I'd rather compile the file by itself to make sure all of the changes are done and final before calling in the dependancy checker and the linker with the above step. In Visual Studio, I could hit ctrl-F7, but that's the grace an IDE gives you.

We can shell out and run Visual Studio's cl.exe (assuming it's in your path). But, with what arguments and environment? Good question.

You need to set the INCLUDE environment variable for the single file compilation environment. When loading my project, I run the following command:

(setenv "INCLUDE" "C:\\Program Files\\Microsoft Visual Studio .NET\\Vc7\\include;C:\\Program Files\\Microsoft Visual Studio .NET\\Vc7\\atlmfc\\include;C:\\Program Files\\Microsoft Visual Studio .NET\\Vc7\\PlatformSDK\\include\\prerelease;C:\\Program Files\\Microsoft Visual Studio .NET\\Vc7\\PlatformSDK\\include;C:\\Program Files\\Microsoft Visual Studio .NET\\FrameworkSDK\\include;")

Your mileage will vary. Don't copy this directly, but instead follow the directions above for aquiring your own INCLUDE environment variable set. Compile your project in Visual Studio, and check out the generated buildlog.htm. It will list off the environment the program was compiled in. Grab the contents of the INCLUDE line, and use it in Emacs, remembering to escape the slashes.

Next, we need to address the cl.exe syntax. We want to build the source file similar to the already-built obj files so it will drop in nicely when it's linked. Open the buildlog.htm back up. Near the bottom, there will be talk of options put into a temp file and then passed to cl.exe. We want these in emacs. Therefore, set this variable, which we'll use in a second. Mine looks similar to this:

(setq c++-compile-current-file "cl.exe /Od /D \"WIN32\" /D \"_DEBUG\" /D \"_WINDOWS\" /D \"_WIN32\" /D \"QUAKE3\" /FD /EHsc /MDd /YX\"stdafx.h\" /Fp\".\\Debug/foo.pch\" /Fo\".\\Debug/\" /Fd\".\\Debug/\" /FR\".\\Debug/\" /W3 /c /ZI ")

Given that we have defined c++-compile-current-file, the following LISP function compiles against it:

(defun c++-compile-current ()
(interactive)
(let ((compile-command
(concat c++-compile-current-file (buffer-file-name))))
(save-buffer)
(recompile)
))

It'd be cool if I had a Perl script to generate the required LISP based on the contents of a buildlog.htm. I haven't done that yet, though.

Status compared to Visual Studio: A bit of a bitch to get working, but once it works, you're there. Compiling a single file isn't recommended for small projects, as it's a bit of an effort to get working, but you wouldn't need the speed gains on a small project anyway. Considering Visual Studio does this out of the box, there is no contest as to which I'd prefer. But, let's face it, you're taking a chunk of logic usually reserved for IDEs, and making it execute through Emacs. Not bad, considering.

Starting the Debug Executable

After you build a binary, you're going to want to run it, right? I simply execute a shell script which sets up the current working directory properly, and runs the debug executable. Consider the following:

(defun shell-run-debug ()
(interactive)
(shell-command "sh rundebug.sh"))

You may also need to set the environment properly here.

Status compared to Visual Studio: Visual Studio 7 rearranges your windows, sometimes needlessly, when you enter debug mode. In this case, you are waiting for a crash before you are taken into the Visual Studio debugger. In practice, the executable starts up slightly faster. I am annoyed less, but ymmv. Both get the job done.

Class Browser

Visual Studio has the class/file/definition browser. Emacs has the speedbar. It's installed by default. Fire up a file in your project once you have your tags loaded (see above for tags tips), and type M-x speedbar.

I haven't had much experience with the speedbar, but it seems pretty usable so far. But then, I don't care for Visual Studio's class browser 90% of the time. I have it off.

Status compared to Visual Studio: The Visual Studio browser seems to be a bit more snappy. I don't appreciate having to double click a file to open it, or the flickery nature of the highlight in speedbar. This may be fixable - like I said, I'm not a big speedbar user in the first place. Speedbar gets points for it's use in all different languages. I still prefer Visual Studio's functionality here. Best interface in town.

Indentation and Code Style Compatibility

There is a small army of coders who dislike some aspect of then default indentation style in Emacs' C/C++ modes. I myself, have been hassled by respectable programmers for using it.

Braces cause a double indentation:~the braces are indented once, and then whatever is past the braces is indented again. This is not a bug, or an oversight - it is the GNU coding style at work. In addition, Visual Studio displays the tabs generated by Emacs by default incorrectly. If you are working with people who have not discovered The One True Editor, you will want to convert your tabs to spaces. In addition, I will throw in a line that shows how to reduce the number of spaces per tab stop in case your code project requires it, and a line that automatically places your cursor at the required indent level instead of the far left of your buffer where you will be needing to press TAB anyhow.

(setq-default tab-width 2) ; Tab width set to 2 spaces
(setq-default indent-tabs-mode nil) ; Indentation cannot insert tabs
(add-hook 'c++-mode-hook '(lambda () (local-set-key "\C-m" 'c-context-line-break)))
(add-hook 'c++-mode-hook '(lambda () (c-set-offset 'substatement-open '0)))

Status compared to Visual Studio: Emacs does precisely what I want here. I didn't even mention anything about electric braces or anything of that nature, since the object of this document is to help with the jealousy Emacs users feel against Visual Studio 7. Taking Emacs beyond Visual Studio 7's featureset is an exercise left to the reader.

Project-Centric Functionality

The concept of projects and solutions in Visual Studio is central to it's operation. Emacs is not an IDE, but it does play one on TV. I can make Emacs do enough to satisfy my requirements. There is a session management tool for Emacs out there, but I don't really need that. I take a more simple route, of setting a few states within Emacs whenever I approach working on a project. Observe the following code which opens a source file in one of the projects, fires up the speedbar, starts a tags table definition and sets up the environment for compiling a single file in the project:

(defun project-foo ()
(interactive)
(save-excursion
(find-file "c:\\foo\\bar.cpp")
(find-file "c:\\foo\\bar.h")
(visit-tags-table "c:\\foo\\TAGS")
(setq compile-command "perl compile.pl")
(setq c++-compile-current-file "cl.exe /Od ")
(setenv "INCLUDE" "c:\\foo\\bar\\include;")
(speedbar)
)

)

Status compared to Visual Studio: Emacs does what I want it to. Visual Studio wins because it's an IDE that works for a single compiler, and there is a ton of raw functionality behind the idea of projects and solutions.

Scrolling

By default in Emacs, when you scroll, you are given what amounts to half a page down when your cursor reaches the end of the screen. If you prefer the smooth scrolling of Visual Studio, you can get it:

(setq scroll-step 1)
(setq scroll-conservatively 50)

Sadly, in Emacs, your cursor always has to be in the screen, to my knowledge. In Visual Studio, you can mouse wheel scroll away from the current editing position, and when you get back to it, your cursor will be where you left it. Emacs waits until your cursor is at the edge of the screen, then it reluctantly drags it along. You are given a choice, however. The following line will make the cursor start scrolling right away:

(setq scroll-preserve-screen-position nil)

Status compared to Visual Studio: Overall, I like the scrolling features in Emacs more, despite the gripe I have above. I like the idea of scroll-margin which allows me to "look before I leap".

What I Haven't Touched On

Visual Studio 7 still excels over Emacs in a number of ways I haven't touched on here. One of the biggest issues in the list is debugging. The idea of stepping through the code, making changes and linking into the running code (a feature that has been there since Visual Studio 6) is something that is best done from the IDE.

Visual Studio also has the Intellisense feature. I am told that this feature can be compared to the functionality of the speedbar, coupled with Emacs packages EIEIO and the Semantic Bovinator. I am okay with the way things are currently, but will definitely be checking these packages out once I become familiar with my current working environment. You can click here to jump ahead of me and learn how this works for yourself, already.

MSDN help. The ability to jump around the MSDN help is better in Visual Studio. I don't use MSDN help in my day to day life. I would be interested to hear what others are doing.

"Reverse" integration, because it's not out there (yet?). There is a plugin for Visual Studio that lets you use Emacs in lieu of the in-IDE editor. You click on a file in the IDE, and Emacs pops up instead of the Visual Studio 6 editor. Here is a link to VisEmacs. It's got nothing to do with Visual Studio 7. The last release was in 2000. And yes, I have tried to see if I could get it to work, and I fell short of success.

Visual Source Safe. I use CVS.

Additional reading based on editorial comments posted to this article:

Sponsors

Voxel dot net
o Managed Hosting
o VoxCAST Content Delivery
o Raw Infrastructure

Login

Related Links
o out there
o here
o Here
o EBrowse
o Alternativ e method of completing variables
o Also by sludge


Display: Sort:
Making Emacs Stand Up To Visual Studio 7 | 115 comments (98 topical, 17 editorial, 0 hidden)
Great article (1.00 / 1) (#3)
by A Proud American on Tue Apr 01, 2003 at 09:34:03 PM EST

Would it possibly be even simpler to just customize Visual Studio .NET to support whatever keystrokes you use in Emacs?

____________________________
The weak are killed and eaten...


two comments (4.66 / 3) (#11)
by Delirium on Tue Apr 01, 2003 at 10:11:59 PM EST

  1. If all you dislike about the GNU coding style is the halfway-indented braces, then your solution fixes that just fine. However, you can also just switch to one of the many other built in C/C++ indentation styles. M-x c-set-style (you can set it to default to one in your .emacs if you'd like as well). The available ones by default are bsd, ellemtel, gnu, java, k&r, linux, python, stroustrup, and whitesmith.
  2. Other than the lack of a class browser (which you've addressed here), the other thing I miss about Visual Studio when using Emacs is semantic-sensitive prompting and autocompletion. In Visual Studio, if you type sqrt( a popup comes up listing the parameters it takes (if the function's overloaded, up/down arrow scrolls through them). Avoids having to lookup library functions in manpages or the order of arguments in member functions. In addition, it autocompletes class members; if you type blah-> and blah is of type SomeClass*, it'll show you the members of SomeClass, and if you type the first few chars (enough to disambiguate) you can then autocomplete with spacebar. Emacs has neither of these features, and as far as I know, there is no way for the end user to easily emulate them, as it'd require Emacs to parse C grammar enough to know the members of all classes (in real-time, no less -- when you add a new member, it shows up in the autocomplete list instantly) and furthermore the types of all identifiers.
In any case, I mainly use emacs, but feature #2 would really be nice.

Elisp -- The biggest problem with emacs (4.85 / 7) (#12)
by GGardner on Tue Apr 01, 2003 at 10:20:52 PM EST

The biggest problem with emacs today is elisp. No, not because it is a lisp variant, but because elisp isn't a good enough lisp. The primary problem with Elisp is that it is dynamically-scoped. Although there are ways to get around this, substantially all the emacs-lisp code uses dynamically scoped variables.

Why is dynamic scope bad? It is bad not just because it is slow in the current emacs interpreter implementation, it also means that JIT compiling elisp down to native code (as many other lisp implementations do) can't buy you a big speedup. This is because most variable references can't be easily assigned to machine registers, like a lexically scoped language, but you need to call out to a function every time you want to look up a variable.

A lexically scoped elisp with a decent JIT compiler would supercharge emacs. For example, emacs calc program is just about the best online calculator on the planet. Unfortantely, because it is executed on slow elisp, it falls down for big calculations. A jit-compiled calc.el would win huge.

A jit-compiled elisp would speed up all kinds of day-to-day activities and enable developer tools to be built which blow away Visual Studio.

Unfortaneatly, due to the huge amount of legacy .el code which depends on elisp, this sort of change will probably never happen. And that's a huge pity -- if emacs had a fast extension language, netscape could have been written in emacs, and that would have been an amazing program.

Other option (none / 0) (#18)
by Anonymous 242 on Tue Apr 01, 2003 at 11:06:22 PM EST

Use Sun's Workshop Pro. It has XEmacs embedded into the product.

I abstain because (2.50 / 6) (#19)
by exile1974 on Tue Apr 01, 2003 at 11:10:54 PM EST

I hate emacintoss and visual stupid. I am a vi kinda guy. Somebody else kill this puppy as I am biased.

exile1974
"A sucking chest wound is Nature's way of telling you to stay out of a firefight." --Mary Gentle

+1: Funny (4.50 / 2) (#22)
by jabber on Tue Apr 01, 2003 at 11:39:57 PM EST

but this is what works for me without looking too fruity:

(font-lock-add-keywords 'c++-mode '(
;; Currently support for []|&!.+-%,()<>{}
("\(\[\|\]\|[|!\.\+\
\&]\|-\|\\|\%\|\\|,\|(\|)\|>\ |<\|{\|}\)" 1 font-lock-operator-face )
; End of c++ statement ("\(;\)" 1 font-lock-end-statement ) ))

That statement alone brought appropriate closure to my otherwise unremarkable 4/1. Vote to section.

[TINK5C] |"Is K5 my kapusta intellectual teddy bear?"| "Yes"

Notepad.EXE (3.50 / 10) (#23)
by Armada on Tue Apr 01, 2003 at 11:42:09 PM EST

I found this nifty little utility the other day. It's like a GUI interface to EDIT.COM. For those of us that have been big fans of EDIT, I'd have to say that this is a pretty big step up. I've been impressed so far and would recommend it to anyone that has to do any serious coding.

I am happy with Emacs as it is (2.80 / 5) (#24)
by tftp on Tue Apr 01, 2003 at 11:43:45 PM EST

Emacs works fine for me, and I need no changes whatsoever, besides my personal .emacs file with some fonts, colors and couple of hot key assignments.

The editor's importance is probably 0.032%, and the code itself - structure, classes, algorithms, semaphores etc. - is the remaining 99.968% ...

Also, I do not use VC++ IDE even when I have to compile stuff on Windows. It generates a whole lot of gibberish files (including the makefile, in MSVC6) which is also mostly junk.) I use qmake (and Qt). Highly recommend. Emacs and make/qmake are the only tools I need. Qmake is free, IIRC - use it.

Related Emacs tips (4.66 / 3) (#30)
by cooldev on Wed Apr 02, 2003 at 12:43:27 AM EST

0) I sent this guy (VisEmacs) the source for a *very ugly* hack that allows you to run emacs as an editor in VS.NET in a ToolWindow. It wasn't pretty, but it worked and even had minimal integration with class browser, etc. (also a hack). You can't use it as the debugger. If you want this I can be persuaded to dig it up; he doesn't seem to be doing anything with it. (It would need some work if you wanted to really use it.)

1) Instead of jumping through hoops with devenv, projects, cl.exe, and perl, just compile through makefiles. It's not that hard to build them yourself. If you have a project that spans multiple directories, setup a proper hierarchical makefile system and try something like this to compile from just the current or selected directory:

(defun nmake (BUILDDIR)
  (interactive "Dnmake from Directory: ")
  (cd BUILDDIR)
  (compile "nmake")
  (if (buffer-file-name)
      (cd (file-name-directory (buffer-file-name)))))

2) For the kind of searching I do in code I've been happier with NT's findstr than grep:

(setq grep-program "findstr")
(setq grep-find-command "/N /I /S ")

3) Short fragment that I use for project managment. Allows me to list a set of dirs I work in frequently so I can find and open those files easily:

(setq proj-dirs '("."
    "c:\myproj"
    "c:\myproj\dir2"))

(defun proj-flatten-list (lst nxt)
  (let (a d l)
    (setq l lst)
    (while lst
      (setq a (car lst) d (cdr lst))
      (cond ((consp a)
             (proj-flatten-list a (or d nxt))
             (setcar lst (car a))
             (setcdr lst (cdr a)))
            ((null d)
             (setcdr lst nxt)))
      (setq lst d))
    l))

(defun proj-directory-files (dir)
  (directory-files dir nil "[^.].*"))

(defun proj-build-file-list ()
  (mapcar 'list (proj-flatten-list (mapcar 'proj-directory-files proj-dirs) nil)))

(defun proj-open (filename)
  (if filename
      (let ((dirs proj-dirs))
        (while dirs
          (if (file-exists-p (concat (car dirs) "/" filename))
              (progn
             &n bsp;  (find-file (concat (car dirs) "/" filename))
             &n bsp;  (setq dirs nil)))
          (setq dirs (cdr dirs))))))

(defun proj-find-file ()
  "Kind of like find-file but completes all filenames in proj-dirs"
  (interactive)
  (proj-open (completing-read "Project find file: " (proj-build-file-list))))

I think I could go on and on.. That's all for now.

Disclaimers: No GPL code was knowingly viewed or harmed in the making of all of my hacks. Also, don't laugh at my elisp. I usually just bang it out until it works and then append it to my massive .emacs file never to be seen or refined again. ;-)



One other suggestion (4.50 / 2) (#36)
by cooldev on Wed Apr 02, 2003 at 01:53:20 AM EST

Sort of off topic, but if you're using emacs on Windows and you have an emacs or unix background you've gotta try eshell.



Delphi (5.00 / 1) (#39)
by alfadir on Wed Apr 02, 2003 at 03:04:38 AM EST

Emacs is not an IDE, but it does play one on TV.

I agree with the quirks that Emacs have, but I have not used it under Windows, and therefor not made any GUI programs, with it. Emacs is good for normal linux projects. The big problem is that you have to become a .emacs programmer before you can start coding. dotfiles.org might help.

It has been a while, but I have used Delphi, C++ Builder and VC++. Delphi and C++ Builder was much better IDEs than VC++.

They have the debug, compile environment that VC++ has since they are built as IDEs, not just got shoehorned into a IDE on TV.

You could select between several syntax highlighting schemes or define your own. Very easy. I used Twilight IIRC.

What I liked about Delphi back then was the autofilling of arguments to routines you were calling. Object.method(argument1, argument2) each part with a kind of tabcompleation. Often you know what you want to do, but you don't want to start the help to get the exact definition, order of arguments etc.

The latest Delhpi I used was version 3 so the IDE may have improved or gotten worse since then. It blew VC++ (version 6 IIRC) out of the water back then though. It would be interesting to see a Delphi/VStudio comparison by someone who uses the IDEs actively.

I have but one comment (3.83 / 6) (#41)
by fink on Wed Apr 02, 2003 at 03:12:27 AM EST

and I say this in fear of invoking the wrath of Stick or Joh3n:
vim.
Thankyou for your attention. I'll now climb back into my crater where I belong, and wait for the modding to begin...

----

Eclipse (5.00 / 2) (#44)
by ComradeFork on Wed Apr 02, 2003 at 04:29:11 AM EST

I'd just like to add that Eclipse is also a wonderful IDE for programming in Java. People who haven't used Java and Eclipse often will pick on it, but its really quite good.

Lets hope someone writes a good IDE for Python, Lua, or Scheme...

ECB might be an option (5.00 / 3) (#46)
by jschwarz on Wed Apr 02, 2003 at 04:56:18 AM EST

Anyone using Emacs for development should checkout ECB (http://ecb.sourceforge.net/). It makes for a nice IDE-like environment.

Why not gvim? (4.50 / 2) (#49)
by stormysky on Wed Apr 02, 2003 at 07:17:13 AM EST

Personally, I love using gvim with this little patch so that I can have my cutsey background while I code. Typically, I have about 20 gvim windows, most with multiple files open in them, and an old copy of win32.hlp, when I do windows brewing. Erm, coding, sorry, the mead article's on my mind. Anyway, I believe it's relatively easy to substitute gvim as the default editor in VC, (at least, version 6) and it supports all the features you'd expect in a modern editor, like syntax highlighting, without the extreme memory footprint emacs boasts; gvim's at least half the bloat... editors shouldn't have to go on diets --- but some of us who use 'em probably do. :)
We can face anything, except for bunnies.
Slashes vs Backslashes (5.00 / 1) (#50)
by Hightc on Wed Apr 02, 2003 at 07:23:56 AM EST

Forward slashes work in path names fine in windoze, always have and always will.  Much easier than escaping backslashes all the time.


Why? (4.00 / 3) (#54)
by lazyll on Wed Apr 02, 2003 at 08:33:02 AM EST

I don't understand why you would want to use emacs over VS? I use emacs, but that's because I run linux on my desktop and I code for a linux platform. I mean, he's working on a windows box, and he compiling VS projects, why does he insist on use emacs?? The whole point of this article is to describle all the crap you have to go through to make emacs almost as good as VS. I don't understand.



I stopped reading about here... (4.14 / 7) (#56)
by Silent Chris on Wed Apr 02, 2003 at 08:41:55 AM EST

"Hopefully reading on will fix one or more of your pet peeves with the one true editor, and keep you plugging away on Free Software as much as possible."

You make two incorrect assumptions (actually, one's a mistake).  

  1. VS .NET (7) is not an editor.  If I want an editor, I use emacs, vi, or even notepad -- which I do.  VS is a tool to pull together code, structure and ideas in a nice GUI package.  It's worthless for multiplatform development, it's semi-ok for web development, but there's nothing better for Windows development.
  2. For some reason, some Free Software people think once you've started using commercial tools, you're forever indebted to the dark side.  Not at all.  I work on a number of FS projects using Visual Studio (mostly when there's a port to be done to Windows).  There's nothing in Visual Studio forcing you to use proprietary libraries (in fact, Visual Studio .NET starts you off with a completely blank slate with absolutely no references).  All it takes is referencing the FS code of your choice (which you would have to do anyway in emacs or another editor).
I understand there's aversions to VS.  That's understandable (it ain't perfect).  But I don't understand, when you're given the right tool to do the job, you don't use.  (By the way, if you balk at the cost, try picking up the Academic edition.  I got what's essentially the professional toolkit for under $150).

Making Visual Studio even better (5.00 / 1) (#61)
by sien on Wed Apr 02, 2003 at 09:24:38 AM EST

I have to add a plug for the best plug in I have ever seen - Visual Assist . It has variable name completion which is really impressive. It also extends variable information and other features of Visual Studio.

You can download a free 30 day trial version, it's well worth the time.

Bah! (3.62 / 8) (#64)
by Rocky on Wed Apr 02, 2003 at 09:58:49 AM EST

All the editors shall bow before the One True Editor - ed!

ed will crush it's enemies, and hear the lamentations of their women!

If we knew what it was we were doing, it would not be called research, would it?
- Albert Einstein (1879 - 1955)

c-set-style and the auto reform (3.00 / 1) (#79)
by bored on Wed Apr 02, 2003 at 01:33:56 PM EST

When it comes for formatting the default emacs mode (gnu) does suck. But there is a quick solution. M-x c-set-style. Then pick your coding style. Personally I use 'ellmental' with some minor tweaks for switch statements and class methods.

So, stick the following line in your c-mode-common-hook. (c-set-style "ellemental") and everything will be fine.

Personally, I don't like emacs and when I use windows I use the M$ VS IDE, but on linux/solaris/aix etc.. I end up running emacs because the company I work for doesn't buy everyone copies of Visual SlickEdit to run on their platform of choice. Instead I waste probably 10x the price of Visual SlickEdit in hours hosing with my enviroment so that I can press 'F7' and get emacs to compile.

Tip: :> Here is a cool little feature that VS doesn't seem to support (I don't know what the key sequence is). Emacs has a built in reformatter. Simply select your code block and press ESQ, C-\. Wham!



WHAT YOU SAY???? (2.90 / 11) (#91)
by Bob Abooey on Wed Apr 02, 2003 at 04:18:08 PM EST

Based upon your informative article I ran out to the local MicroCentreTM and bought this fine VisualStudio program but for some reason I can't get it to install on Linux 8.0. Is there a bug fix or a patch I can download for free that will fix this?

Thanks for your quick reply.


-------
Americans will tolerate just about anything as long as you don't stop traffic - Dan Rather

Try SciTe Instead (none / 0) (#92)
by n8f8 on Wed Apr 02, 2003 at 04:25:02 PM EST

Type Scite. It uses the same Text control as Komodo:

http://www.scintilla.org/SciTE.html

Some Features:

Syntax highlighting for every language imaginable
Cross Platform
Optional Tabbed Interface
Open Source

 

Sig: (This will get posted after your comments)

you people never will really get it, will you (2.38 / 13) (#93)
by turmeric on Wed Apr 02, 2003 at 05:55:19 PM EST

dependencies have to be checked. otherwise what you are doing is not compiling, its guessing at what might be compiled.

now the sane solution to this problem is to analyze the way make works, and optimize the speed of this program so that dependcy checking takes somewhere close to it's theoretical limit, which is like, 1 second or something.

instead you dumbfucks sit around using the same goddamn broken ass shitty crapholian 'make' program for 20 years, researching double blitted hyperspatial transofrmations so you can more fully animate japanese anime porn, and yet you dont give a rats fuck about improving makefiles.... other than buying yourself a new computer with the fat check the man is giving you.

screw the poor! screw those with shit hardware! screw anyone who actually cares about what tools they are using!

computer science is filled to overflowing with absolute moronic stupids who would gladly use a dinner knife as a saw and tell you you were an idiot for criticizing them for it. rather they wold tell you to attach a 300 dollar 5 hp electric motor to the saw, shrug and say 'works for me i dont know what you are bitching about you stupid clueless fuck'.

god i hate computer scine.ce

As much fun as it is to build a hot-rod out of (5.00 / 1) (#95)
by porkchop_d_clown on Wed Apr 02, 2003 at 06:44:52 PM EST

a Model A Ford, there comes a point when it's time to buy a new Mustang, instead....

EMACS was state-of-the-art a quarter of a century ago, the fact that it's lasted as long as it has is a testament to its excellent design. But, for God's sake, stop trying to teach the pig new songs and just buy a new pig!


--
Note that the depiction of the president as a deranged or Nazi paranoid is coming mostly from people who constantly tell us how passionately they

Emacs (none / 0) (#113)
by Dickie Crickets on Fri Apr 04, 2003 at 10:56:10 AM EST

Emacs, Emacs,
With macros writ in lisp.
Baby highlights syntax,
Highlightin' all day loooooooong.


--
King of Megaphone Crooners
xemacs is only good for sokoban (none / 0) (#114)
by biggs on Fri Apr 04, 2003 at 02:54:18 PM EST

i write java, and i wanted to like xemacs for writin java code, but it just sux compared to a netbeans + ant solution.

--
"Rockin my 'hell I made it' wetsuit stitch so I can swim in elevators crazy wet through piss" -Cannibal Ox
vim! [nt] (none / 0) (#115)
by 5pectre on Sat Apr 05, 2003 at 11:57:11 AM EST



"Let us kill the English, their concept of individual rights might undermine the power of our beloved tyrants!!" - Lisa Simpson [ -1.50 / -7.74]

Making Emacs Stand Up To Visual Studio 7 | 115 comments (98 topical, 17 editorial, 0 hidden)
Display: Sort:

kuro5hin.org

[XML]
All trademarks and copyrights on this page are owned by their respective companies. The Rest © 2000 - Present Kuro5hin.org Inc.
See our legalese page for copyright policies. Please also read our Privacy Policy.
Kuro5hin.org is powered by Free Software, including Apache, Perl, and Linux, The Scoop Engine that runs this site is freely available, under the terms of the GPL.
Need some help? Email help@kuro5hin.org.
My heart's the long stairs.

Powered by Scoop create account | help/FAQ | mission | links | search | IRC | YOU choose the stories!