• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 06:22
CET 12:22
KST 20:22
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
RSL Revival - 2025 Season Finals Preview8RSL Season 3 - Playoffs Preview0RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2TL.net Map Contest #21: Winners12
Community News
ComeBackTV's documentary on Byun's Career !8Weekly Cups (Dec 8-14): MaxPax, Clem, Cure win4Weekly Cups (Dec 1-7): Clem doubles, Solar gets over the hump1Weekly Cups (Nov 24-30): MaxPax, Clem, herO win2BGE Stara Zagora 2026 announced15
StarCraft 2
General
When will we find out if there are more tournament ComeBackTV's documentary on Byun's Career ! Weekly Cups (Dec 8-14): MaxPax, Clem, Cure win RSL Revival - 2025 Season Finals Preview Weekly Cups (Dec 1-7): Clem doubles, Solar gets over the hump
Tourneys
$5,000+ WardiTV 2025 Championship RSL Offline Finals Info - Dec 13 and 14! Master Swan Open (Global Bronze-Master 2) Winter Warp Gate Amateur Showdown #1: Sparkling Tuna Cup - Weekly Open Tournament
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 504 Retribution Mutation # 503 Fowl Play Mutation # 502 Negative Reinforcement Mutation # 501 Price of Progress
Brood War
General
FlaSh on: Biggest Problem With SnOw's Playstyle screp: Command line app to parse SC rep files How Rain Became ProGamer in Just 3 Months BGH Auto Balance -> http://bghmmr.eu/ [BSL21] RO8 Bracket & Prediction Contest
Tourneys
Small VOD Thread 2.0 [Megathread] Daily Proleagues [BSL21] WB SEMIFINALS - Saturday 21:00 CET [BSL21] RO8 - Day 2 - Sunday 21:00 CET
Strategy
Game Theory for Starcraft Current Meta Simple Questions, Simple Answers Fighting Spirit mining rates
Other Games
General Games
Stormgate/Frost Giant Megathread Path of Exile Nintendo Switch Thread General RTS Discussion Thread Dawn of War IV
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
Mafia Game Mode Feedback/Ideas Survivor II: The Amazon Sengoku Mafia TL Mafia Community Thread
Community
General
Russo-Ukrainian War Thread US Politics Mega-thread Things Aren’t Peaceful in Palestine The Games Industry And ATVI YouTube Thread
Fan Clubs
White-Ra Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece Movie Discussion!
Sports
2024 - 2026 Football Thread Formula 1 Discussion
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
TL+ Announced Where to ask questions and add stream?
Blogs
The (Hidden) Drug Problem in…
TrAiDoS
I decided to write a webnov…
DjKniteX
James Bond movies ranking - pa…
Topin
Thanks for the RSL
Hildegard
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1817 users

Alt+o on emacs

Blogs > araav
Post a Reply
araav
Profile Blog Joined September 2004
Armenia1590 Posts
March 13 2009 13:58 GMT
#1
yay, so happy..

recently i fully switched to emacs and i was missing the alt+o feature for visual assist (pressing alt+o switches between source and header files)

so, today i implemented this for me:

.emacs
---------------------------------------
....
(defun corresp_h (fln h) (let ((x (concat fln (string ?.) h))) (if (file-exists-p x) x nil)))
(defun corresp_hh (fl lst) (if (not (null lst)) (or (corresp_h fl (car lst)) (corresp_hh fl (cdr lst)))))
(defun corresponding (fln)
(let ((ext (file-name-extension fln)) (prefix (file-name-sans-extension fln)))
(cond
((string= ext "cpp") (corresp_hh prefix '("hpp" "h" "c")))
((string= ext "hpp") (corresp_hh prefix '("cpp" "c" "h")))
((string= ext "c") (corresp_hh prefix '("h" "hpp" "cpp")))
((string= ext "h") (corresp_hh prefix '("c" "cpp" "hpp")))
(t nil)
)
)
)

(defun switch-to-corresponding-hh (fln) (let* ( (fln2 (corresponding fln)) (buff (if (null fln2) nil (get-file-buffer fln2))))
(if (null buff) (if (not (null fln2)) (find-file fln2)) (switch-to-buffer buff))))

(defun switch-to-corresponding-h ()
"Swtich to the corresponding header/source file."
(interactive)
(switch-to-corresponding-hh buffer-file-name))

(global-set-key [?\A-\o] 'switch-to-corresponding-h)
---------------------------------------

i'm still a elisp newb, but fuck, this is awesome!
still yearn for ctrl+shift+v and context-sensitive auto-complete/goto definition features though

The flower that blooms in adversity is the most rare and beautiful of all.
hni
Profile Joined February 2009
Canada8 Posts
March 13 2009 14:06 GMT
#2
that's pretty awesome, although a more intuitive solution is to use a real editor. we're not in the 80s anymore. if you want a real job, you'll probably have to learn how to use visual studio, so why waste time on this emacs garbage?
araav
Profile Blog Joined September 2004
Armenia1590 Posts
March 13 2009 14:25 GMT
#3
haha real job? i have it 12 years already

vassist is just a plugin for visual studio. i use vstudio with eyes closed for 10+ years already.

i use emacs for Linux and it really rocks
The flower that blooms in adversity is the most rare and beautiful of all.
Sirakor
Profile Joined April 2003
Great Britain455 Posts
March 13 2009 14:27 GMT
#4
On March 13 2009 23:06 hni wrote:
that's pretty awesome, although a more intuitive solution is to use a real editor.


Up to here I thought you were going to bash emacs and show him the light to the one and only true editor - Vim. >

On March 13 2009 23:06 hni wrote:
we're not in the 80s anymore. if you want a real job, you'll probably have to learn how to use visual studio, so why waste time on this emacs garbage?


Both emacs and vim are much, much more powerful than you may realize, although they do have a steeper learning curve compared to the usual IDEs (visual studio, eclipse, etc). Also I don't think it makes a lot of sense to force your programmers to use a specific editor, so unless you work for M$ or are stuck in .NET so deeply that you don't see the rest of the world anymore, I really don't see that being an issue.

And for what it's worth... nah I will resist to rank the programmers I work with by their skill and try to correlate that to the editor they use ;-)
TheYango
Profile Joined September 2008
United States47024 Posts
Last Edited: 2009-03-13 15:59:06
March 13 2009 15:55 GMT
#5
On March 13 2009 23:06 hni wrote:
that's pretty awesome, although a more intuitive solution is to use a real editor. we're not in the 80s anymore. if you want a real job, you'll probably have to learn how to use visual studio, so why waste time on this emacs garbage?

Because it works? Depending on project size, simple editors can be far better for a project than an IDE. Most of the features present in IDEs either are implemented in Vim or Emacs, or can be added through various extensions, and both editors have plenty of things that modern IDEs haven't implemented.

Generally, it works out something like this:
Small Projects - You don't need powerful features, so a lightweight editor will be better for the job than an IDE
Medium-sized Projects - Code can get a little messy, so its good to have an IDE that can help you sort your work into a manageable way for you better than a text editor
Large Projects - There's simply so much code that you can't sort it in a useful fashion, and doing so starts to work against the IDE. A text editor becomes useful here again

Also, as far as I know, jobs don't "force" you to use one editor or another (its a really stupid thing to manage). Whatever gets your code written in the way they want should work.
Moderator
Insane
Profile Blog Joined November 2003
United States4991 Posts
March 13 2009 19:03 GMT
#6
On March 14 2009 00:55 TheYango wrote:
Show nested quote +
On March 13 2009 23:06 hni wrote:
that's pretty awesome, although a more intuitive solution is to use a real editor. we're not in the 80s anymore. if you want a real job, you'll probably have to learn how to use visual studio, so why waste time on this emacs garbage?

Because it works? Depending on project size, simple editors can be far better for a project than an IDE. Most of the features present in IDEs either are implemented in Vim or Emacs, or can be added through various extensions, and both editors have plenty of things that modern IDEs haven't implemented.

Generally, it works out something like this:
Small Projects - You don't need powerful features, so a lightweight editor will be better for the job than an IDE
Medium-sized Projects - Code can get a little messy, so its good to have an IDE that can help you sort your work into a manageable way for you better than a text editor
Large Projects - There's simply so much code that you can't sort it in a useful fashion, and doing so starts to work against the IDE. A text editor becomes useful here again

Also, as far as I know, jobs don't "force" you to use one editor or another (its a really stupid thing to manage). Whatever gets your code written in the way they want should work.

You may be 'forced' to use specific IDEs if test suites in the codebase are written for a specific IDE to run. I suppose you don't 'have' to use the IDE, but it makes the job significantly easier if you're a tester than trying to use some other text editor to write the code, and then run it in the IDE...
JeeJee
Profile Blog Joined July 2003
Canada5652 Posts
Last Edited: 2009-03-13 19:13:42
March 13 2009 19:11 GMT
#7
hahaha nice
i never cared for emacs, i'm a vim guy :-)
a friend of mine uses exclusively visual studio though. he writes good code, too. he usually spends a bit more time, but i'm not going to say that has anything to do with the choice of editor, that's just silly

use whatever you're comfortable with, and yes sometimes it was more comfortable for me to switch to an IDE, although it wasn't so much for the purposes of coding..

and of course the obligatory xkcd follows..
[image loading]
(\o/)  If you want it, you find a way. Otherwise you find excuses. No exceptions.
 /_\   aka Shinbi (requesting a name change since 27/05/09 ☺)
araav
Profile Blog Joined September 2004
Armenia1590 Posts
March 13 2009 19:32 GMT
#8
haha, yeah, good ol' xkcd
The flower that blooms in adversity is the most rare and beautiful of all.
miseiler
Profile Blog Joined October 2008
United States1389 Posts
Last Edited: 2009-03-13 19:45:05
March 13 2009 19:42 GMT
#9
On March 13 2009 23:06 hni wrote:
that's pretty awesome, although a more intuitive solution is to use a real editor. we're not in the 80s anymore. if you want a real job, you'll probably have to learn how to use visual studio, so why waste time on this emacs garbage?


What a useless comment.

It certainly depends on the field, doesn't it? In computational biology, Windows (and therefore Visual Studio) is a complete waste of time. You will probably have to learn a real language, too, which (except for C) Visual Studio doesn't even support.

Personally, I prefer vim, but I was an emacs guy before I started my phd.
"Jinro soo manly wearing only a T-Shirt while the Koreans freeze in their jackets" -- Double_O
"He's from Sweden, man. We have to fight polar bears on our way to school." -- Yusername
TheYango
Profile Joined September 2008
United States47024 Posts
March 13 2009 20:27 GMT
#10
[B]On March 14 2009 04:03 HnR)Insane wrote:[/B
You may be 'forced' to use specific IDEs if test suites in the codebase are written for a specific IDE to run. I suppose you don't 'have' to use the IDE, but it makes the job significantly easier if you're a tester than trying to use some other text editor to write the code, and then run it in the IDE...

*shrug* The basic point is the same. Which editor is better depends both on personal preference and the codebase you're working with. Ideally, having experience in multiple environments is useful, just like having experience with multiple programming languages is useful. To dismiss either text editors or IDEs is closed-minded.
Moderator
Please log in or register to reply.
Live Events Refresh
WardiTV 2025
11:00
Playoffs
ByuN vs CreatorLIVE!
Clem vs Rogue
Scarlett vs Spirit
ShoWTimE vs Cure
WardiTV384
ComeBackTV 290
TaKeTV 141
Rex70
IndyStarCraft 48
IntoTheiNu 22
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
SortOf 157
Rex 70
IndyStarCraft 48
BRAT_OK 38
StarCraft: Brood War
Britney 17214
Calm 4233
GuemChi 3083
Rain 1753
Bisu 784
Horang2 744
actioN 633
Stork 339
Mini 338
Shuttle 298
[ Show more ]
Soma 200
Larva 119
sorry 112
JYJ 99
Rush 96
firebathero 92
Dewaltoss 73
Killer 63
ggaemo 63
ZerO 56
Bale 49
Mind 49
hero 47
ToSsGirL 38
Barracks 37
Mong 34
Sacsri 33
soO 25
Sea.KH 22
zelot 15
910 14
Shinee 14
Terrorterran 13
ajuk12(nOOB) 13
Shine 11
SilentControl 9
Noble 9
Icarus 2
Dota 2
singsing1709
Gorgc1354
XcaliburYe156
League of Legends
C9.Mang0392
JimRising 366
Counter-Strike
olofmeister1403
shoxiejesuss882
allub116
Other Games
crisheroes350
Fuzer 182
XaKoH 161
Trikslyr19
ZerO(Twitch)5
Organizations
StarCraft: Brood War
lovetv 12
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 12 non-featured ]
StarCraft 2
• Light_VIP 46
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• iopq 2
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Upcoming Events
OSC
2h 39m
Big Brain Bouts
5h 39m
YoungYakov vs Jumy
TriGGeR vs Spirit
The PiG Daily
9h 39m
SHIN vs ByuN
Reynor vs Classic
TBD vs herO
Maru vs SHIN
TBD vs Classic
CranKy Ducklings
22h 39m
WardiTV 2025
23h 39m
Reynor vs MaxPax
SHIN vs TBD
Solar vs herO
Classic vs TBD
SC Evo League
1d 1h
Ladder Legends
1d 7h
BSL 21
1d 8h
Sziky vs Dewalt
eOnzErG vs Cross
Sparkling Tuna Cup
1d 22h
Ladder Legends
2 days
[ Show More ]
BSL 21
2 days
StRyKeR vs TBD
Bonyth vs TBD
Replay Cast
2 days
Wardi Open
3 days
Monday Night Weeklies
3 days
WardiTV Invitational
5 days
Replay Cast
5 days
WardiTV Invitational
6 days
ByuN vs Solar
Clem vs Classic
Cure vs herO
Reynor vs MaxPax
Liquipedia Results

Completed

Acropolis #4 - TS3
RSL Offline Finals
Kuram Kup

Ongoing

C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
YSL S2
BSL Season 21
Slon Tour Season 2
CSL Season 19: Qualifier 1
WardiTV 2025
META Madness #9
eXTREMESLAND 2025
SL Budapest Major 2025
ESL Impact League Season 8
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22

Upcoming

CSL Season 19: Qualifier 2
CSL 2025 WINTER (S19)
BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
Bellum Gens Elite Stara Zagora 2026
HSC XXVIII
Big Gabe Cup #3
OSC Championship Season 13
ESL Pro League Season 23
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2025 TLnet. All Rights Reserved.