• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 13:26
CEST 19:26
KST 02:26
  • 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
Power Rank - Esports World Cup 202560RSL Season 1 - Final Week9[ASL19] Finals Recap: Standing Tall15HomeStory Cup 27 - Info & Preview18Classic wins Code S Season 2 (2025)16
Community News
BSL Team Wars - Bonyth, Dewalt, Hawk & Sziky teams10Weekly Cups (July 14-20): Final Check-up0Esports World Cup 2025 - Brackets Revealed19Weekly Cups (July 7-13): Classic continues to roll8Team TLMC #5 - Submission re-extension4
StarCraft 2
General
The GOAT ranking of GOAT rankings Power Rank - Esports World Cup 2025 What tournaments are world championships? RSL Revival patreon money discussion thread Jim claims he and Firefly were involved in match-fixing
Tourneys
Esports World Cup 2025 Sparkling Tuna Cup - Weekly Open Tournament FEL Cracov 2025 (July 27) - $8000 live event Master Swan Open (Global Bronze-Master 2) Sea Duckling Open (Global, Bronze-Diamond)
Strategy
How did i lose this ZvP, whats the proper response
Custom Maps
External Content
Mutation #239 Bad Weather Mutation # 483 Kill Bot Wars Mutation # 482 Wheel of Misfortune Mutation # 481 Fear and Lava
Brood War
General
BW General Discussion Dewalt's Show Matches in China [Update] ShieldBattery: 2025 Redesign Ginuda's JaeDong Interview Series BSL Team Wars - Bonyth, Dewalt, Hawk & Sziky teams
Tourneys
[Megathread] Daily Proleagues CSL Xiamen International Invitational [CSLPRO] It's CSLAN Season! - Last Chance [BSL 2v2] ProLeague Season 3 - Friday 21:00 CET
Strategy
Does 1 second matter in StarCraft? [G] Mineral Boosting Simple Questions, Simple Answers
Other Games
General Games
Stormgate/Frost Giant Megathread Nintendo Switch Thread [MMORPG] Tree of Savior (Successor of Ragnarok) Path of Exile CCLP - Command & Conquer League Project
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
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
Russo-Ukrainian War Thread US Politics Mega-thread Things Aren’t Peaceful in Palestine Post Pic of your Favorite Food! The Games Industry And ATVI
Fan Clubs
SKT1 Classic Fan Club!
Media & Entertainment
[\m/] Heavy Metal Thread Anime Discussion Thread Movie Discussion! [Manga] One Piece Korean Music Discussion
Sports
Formula 1 Discussion 2024 - 2025 Football Thread TeamLiquid Health and Fitness Initiative For 2023 NBA General Discussion
World Cup 2022
Tech Support
Installation of Windows 10 suck at "just a moment" Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List
Blogs
Ping To Win? Pings And Their…
TrAiDoS
momentary artworks from des…
tankgirl
from making sc maps to makin…
Husyelt
StarCraft improvement
iopq
Socialism Anyone?
GreenHorizons
Eight Anniversary as a TL…
Mizenhauer
Customize Sidebar...

Website Feedback

Closed Threads



Active: 885 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
OSC
14:00
King of the Hill #219
davetesta20
Liquipedia
Esports World Cup
11:00
2025 - Final Day
Serral vs ClassicLIVE!
EWC_Arena28495
ComeBackTV 5480
TaKeTV 1152
JimRising 887
Hui .791
3DClanTV 567
Fuzer 396
EnkiAlexander 327
Rex261
CranKy Ducklings151
Reynor148
SpeCial87
BRAT_OK 39
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
EWC_Arena28495
JimRising 887
Hui .791
Fuzer 396
Rex 261
UpATreeSC 154
Reynor 148
SpeCial 87
BRAT_OK 39
StarCraft: Brood War
Bisu 3883
Shuttle 2198
Larva 806
Mini 751
actioN 371
EffOrt 303
Soma 244
ggaemo 224
Rush 113
TY 102
[ Show more ]
Snow 90
Shine 65
JYJ63
Hyun 53
sorry 34
sas.Sziky 29
Aegong 27
zelot 19
yabsab 18
JulyZerg 14
Terrorterran 9
NaDa 9
Sacsri 9
soO 8
Dota 2
syndereN705
420jenkins650
League of Legends
Trikslyr17
Counter-Strike
fl0m3406
sgares399
oskar193
Other Games
gofns10204
FrodaN2347
Beastyqt756
KnowMe228
ArmadaUGS117
Organizations
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 16 non-featured ]
StarCraft 2
• Kozan
• sooper7s
• Migwel
• AfreecaTV YouTube
• LaughNgamezSOOP
• intothetv
• IndyKCrew
StarCraft: Brood War
• FirePhoenix4
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• WagamamaTV822
League of Legends
• Nemesis3941
• TFBlade364
Other Games
• Shiphtur363
• imaqtpie286
Upcoming Events
CranKy Ducklings
16h 34m
BSL20 Non-Korean Champi…
20h 34m
CSO Cup
22h 34m
BSL20 Non-Korean Champi…
1d
Bonyth vs Sziky
Dewalt vs Hawk
Hawk vs QiaoGege
Sziky vs Dewalt
Mihu vs Bonyth
Zhanhun vs QiaoGege
QiaoGege vs Fengzi
FEL
1d 15h
BSL20 Non-Korean Champi…
1d 20h
BSL20 Non-Korean Champi…
2 days
Bonyth vs Zhanhun
Dewalt vs Mihu
Hawk vs Sziky
Sziky vs QiaoGege
Mihu vs Hawk
Zhanhun vs Dewalt
Fengzi vs Bonyth
Sparkling Tuna Cup
3 days
Online Event
4 days
uThermal 2v2 Circuit
4 days
[ Show More ]
The PondCast
5 days
Replay Cast
6 days
Liquipedia Results

Completed

CSL Xiamen Invitational
Championship of Russia 2025
Murky Cup #2

Ongoing

Copa Latinoamericana 4
Jiahua Invitational
BSL20 Non-Korean Championship
Esports World Cup 2025
CC Div. A S7
Underdog Cup #2
IEM Cologne 2025
FISSURE Playground #1
BLAST.tv Austin Major 2025
ESL Impact League Season 7
IEM Dallas 2025
PGL Astana 2025
Asian Champions League '25

Upcoming

CSLPRO Last Chance 2025
ASL Season 20: Qualifier #1
ASL Season 20: Qualifier #2
ASL Season 20
CSLPRO Chat StarLAN 3
BSL Season 21
RSL Revival: Season 2
Maestros of the Game
SEL Season 2 Championship
uThermal 2v2 Main Event
FEL Cracov 2025
HCC Europe
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall 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.