• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 05:46
CET 10:46
KST 18:46
  • 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
Intel X Team Liquid Seoul event: Showmatches and Meet the Pros9[ASL20] Finals Preview: Arrival13TL.net Map Contest #21: Voting10[ASL20] Ro4 Preview: Descent11Team TLMC #5: Winners Announced!3
Community News
Weekly Cups (Oct 20-26): MaxPax, Clem, Creator win52025 RSL Offline Finals Dates + Ticket Sales!10BSL21 Open Qualifiers Week & CONFIRM PARTICIPATION1Crank Gathers Season 2: SC II Pro Teams10Merivale 8 Open - LAN - Stellar Fest4
StarCraft 2
General
RotterdaM "Serral is the GOAT, and it's not close" Intel X Team Liquid Seoul event: Showmatches and Meet the Pros Weekly Cups (Oct 20-26): MaxPax, Clem, Creator win Weekly Cups (Oct 13-19): Clem Goes for Four DreamHack Open 2013 revealed
Tourneys
Kirktown Chat Brawl #9 $50 8:30PM EST 2025 RSL Offline Finals Dates + Ticket Sales! SC4ALL $6,000 Open LAN in Philadelphia Merivale 8 Open - LAN - Stellar Fest Crank Gathers Season 2: SC II Pro Teams
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 497 Battle Haredened Mutation # 496 Endless Infection Mutation # 495 Rest In Peace Mutation # 494 Unstable Environment
Brood War
General
Map pack for 3v3/4v4/FFA games BW General Discussion Ladder Map Matchup Stats SnOw's ASL S20 Finals Review [ASL20] Ask the mapmakers — Drop your questions
Tourneys
[ASL20] Grand Finals Small VOD Thread 2.0 The Casual Games of the Week Thread BSL21 Open Qualifiers Week & CONFIRM PARTICIPATION
Strategy
PvZ map balance Current Meta How to stay on top of macro? Soma's 9 hatch build from ASL Game 2
Other Games
General Games
Path of Exile Dawn of War IV Beyond All Reason Stormgate/Frost Giant Megathread General RTS Discussion Thread
Dota 2
Official 'what is Dota anymore' discussion LiquidDota to reintegrate into TL.net
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
TL Mafia Community Thread SPIRED by.ASL Mafia {211640}
Community
General
US Politics Mega-thread Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread The Big Programming Thread YouTube Thread
Fan Clubs
White-Ra Fan Club The herO Fan Club!
Media & Entertainment
Anime Discussion Thread Movie Discussion! [Manga] One Piece Korean Music Discussion Series you have seen recently...
Sports
TeamLiquid Health and Fitness Initiative For 2023 Formula 1 Discussion MLB/Baseball 2023 2024 - 2026 Football Thread NBA General Discussion
World Cup 2022
Tech Support
SC2 Client Relocalization [Change SC2 Language] Linksys AE2500 USB WIFI keeps disconnecting Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List Recent Gifted Posts
Blogs
Career Paths and Skills for …
TrAiDoS
KPDH "Golden" as Squid Game…
Peanutsc
Reality "theory" prov…
perfectspheres
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1225 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
Next event in 2h 15m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
BRAT_OK 54
StarCraft: Brood War
Stork 363
NotJumperer 17
Terrorterran 2
Dota 2
ODPixel249
XcaliburYe173
canceldota33
League of Legends
JimRising 665
Counter-Strike
Stewie2K1935
PGG 198
Other Games
Hui .151
hungrybox54
Dewaltoss26
Organizations
Counter-Strike
PGL9890
Other Games
gamesdonequick761
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 12 non-featured ]
StarCraft 2
• LUISG 24
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Jankos2173
Upcoming Events
Epic.LAN
2h 15m
BSL Team A[vengers]
4h 15m
Dewalt vs ZeLoT
UltrA vs ZeLoT
SC4ALL
4h 15m
SC4ALL
4h 15m
BSL 21
9h 15m
BSL Team A[vengers]
1d 4h
Cross vs Sobenz
Sziky vs IcaruS
SC4ALL
1d 5h
SC4ALL
1d 5h
BSL 21
1d 9h
Replay Cast
1d 23h
[ Show More ]
Wardi Open
2 days
Monday Night Weeklies
2 days
Replay Cast
2 days
Sparkling Tuna Cup
3 days
WardiTV Korean Royale
3 days
Replay Cast
3 days
WardiTV Korean Royale
4 days
The PondCast
5 days
Korean StarCraft League
6 days
Liquipedia Results

Completed

CSL 2025 AUTUMN (S18)
CranK Gathers Season 2: SC II Pro Teams
Eternal Conflict S1

Ongoing

BSL 21 Points
BSL 21 Team A
C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
SOOP Univ League 2025
SC4ALL: Brood War
SC4ALL: StarCraft II
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
Esports World Cup 2025

Upcoming

YSL S2
BSL Season 21
SLON Tour Season 2
BSL 21 Non-Korean Championship
RSL Offline Finals
WardiTV 2025
RSL Revival: Season 3
Stellar Fest
META Madness #9
BLAST Bounty Winter 2026: Closed Qualifier
eXTREMESLAND 2025
ESL Impact League Season 8
SL Budapest Major 2025
BLAST Rivals Fall 2025
IEM Chengdu 2025
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.