What's the difference between emacs with GTK support and xemacs? I understand they are both branches from the ol' console text editor. Which one would have better support for programming in C++, for example? (i.e. syntax color highlighting, auto indent)

Dani AI

Generated

and rightly raised the GUI/theme side of the question; that is mostly cosmetic. For C++ work the practical choice comes down to mode support and available extensions rather than window decorations.

Key capabilities to look for: reliable C/C++ major mode (cc-mode), syntax highlighting (font-lock), consistent auto-indentation (c-basic-offset / c-offsets-alist), tag/definition navigation (etags, gtags or xref), on-the-fly syntax checking (flymake or flycheck), autocompletion (company or auto-complete), and good build/debug integration (M-x compile, gud/gdb). Ease of installing and updating those packages (package manager availability) and native integration on the target platform matter more than which Emacs binary is used.

Minimal practical setup (example):

;; enable common C++ conveniences
(global-font-lock-mode 1)
(add-hook 'c++-mode-hook
          (lambda ()
            (c-set-style "linux")    ;; or "stroustrup", "gnu", etc.
            (setq c-basic-offset 4)
            (electric-indent-mode 1)
            (electric-pair-mode 1)))

Troubleshooting tips: if indentation behaves oddly, inspect c-basic-offset and c-offsets-alist for the current buffer. If highlighting is missing, confirm global-font-lock-mode or font-lock-mode is enabled. For navigation and cross-references, regenerate tags after renames. When picking a build for a specific OS, prefer the binary that gives easiest access to the packages and features above; the GUI look is secondary.

This frames the decision around editing features and ecosystem rather than window decorations, making it easier to pick the build that will require the least extra configuration for productive C++ work.

Recommended Answers

All 5 Replies

The difference is mainly that emacs with GTK support is basically the console version that runs with the same GTK theme as your system is using.
xemacs is emacs that runs in xwindows, but isn't gtk aware.

They should both have the same support.
I don't use emacs myself, as I found the keyboard commands confusing, so as far as how to get that support set up, I'm not sure.

Hey there knute. Thanks for the info. This question actually conerns the mac OSX port of emacs-gtk/xemacs through fink. Therefore, I would assume that the gtk version uses the aqua interface while the xemacs version doesn't? Or am I totally offbase?

Sorry, I'm not familiar with macs. or fink either for that matter, so I don't know.

Though, it would seem to me that if you had gtk set up to use a theme called aqua, the gtk version would use the same window decorations as the rest of the theme, whereas the xemacs would use the default xwindow setup.

Ahh, that makes sense ;)

Fink/Fink Commander mac's response to apt-get and serves as a port of unix-based apps to the mac. Aqua is the name given to the mac GUI.

I'll take a stab at this, but I could be completely wrong.

Knute's onto something, I think, with xemacs using the X Windows default window decorations. Last time I used the X11 server under OS X, all of the X Windows had the Aqua theme. I'd be willing to bet that what Knute said would apply-- if you used emacs-gtk, it would have Gtk window decorations, and if you used Xemacs, it would have the default X Windows window decorations, ala Aqua's buttons.

So, I'd imagine it's the opposite of what you said in your second post.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.