logs archiveIRC Archive / Freenode / #emacs / 2010 / April / 19 / 1
The_Journey
how do I get emacs to automatically activate a function when I open a *.hpp or *.cpp file?
what is the hook
noisesmith
The_Journey: c-mode-common-hook
found in the documentation for c-mode
The_Journey
noisesmith: how do I get it to stop activating after it activated once?
noisesmith
hmm, maybe you want to define that via an autoload, if you want it to only evaluate on the first time
the function would run once when the mode is first autoloaded
also I don't have c++ mode loaded, there may be more in that package, come to think about it
so yeah, I would put an autoload on cpp that would run when the file for cpp mode is loaded I think
The_Journey
how do I make *Org Agenda* the only buffer visible on startup?
anyone? How do I make *Org Agenda* the only buffer visible on startup?
legumbre
(Action) thinks The_Journey launches emacs way too often ;)
noisesmith
yeah I mean why would you start up emacs more than once or twice a month?
The_Journey
not seriously, how do I make a buffer the only one visible
whenever I start Emacs it splits in half
noisesmith
add these lines to the end of your .emacs (one-window) (switch-to-buffer "*Org Agenda*")
         

skaby
Hi. Im running ubuntu 9.10. their emacs 23.1.1. The fonts are all very large, buffers, menu, elscreen. emacs22 does not do this. I have to use 23 because I am doing lots of auctex goodness. I have googled and googled all I can think of. browsed the wiki. I can easily change the size of one buffer, but that is cumbersome.
noisesmith
M-x customize-group basic faces
set the font size for default-face
pretty much everything else references that
yonkeltron
skaby: also, do you have anything funky in your startup file?
skaby
noisesmith, Ill try that thanks!
yonkeltron, my startups are a bit beyond funky. Ive been putting off using git for them because they are so scary.
yonkeltron
skaby: ah. well. um. did you try emacs with -Q? i think that ignored the startups
skaby
That did it thanks. I wasn't sure of what it was called.
Do most people here use some cvs for their startup?
ams
for their what?
ggole
I think he means "for their .emacs"
skaby
ams, .emacs init.el .site-lisp
ams
idon't touch my .emacs.
noisesmith
I don't, but I try to keep pretty basic for my .emacs - but I do use version control for any elisp libraries I write
ams
~ $ ls -l .emacs*|wc -l
3535
is my versioning.
:-)
bozhidar
I do - all my config is in github
ams
find that sh*t overkill...
bozhidar
[bozhidar@bozhidar-desktop ~]$ wc -l .emacs
1 .emacs
:-)
ams
(require 'universe)?
~ $ wc -l .emacs
89 .emacs
no loads or requires in that.
bozhidar
(load "~/emacs/dot-emacs.el")
I probably should switch to init.el
to remove this obsolete file
ams
and if i remove all double new lines, 45 lines.
bozhidar
my real .emacs is not that long either - just a bunch of load-paths and requires
skaby
617 .emacs.d/init.el, but it is full of loads and stuff. I love incrementing color themes and other useless stuff.
         

ams
bozhidar: yeah, but i don't have any load-paths, or requires...
bozhidar: nothing external ins pulled in :-)
bozhidar
ams: I try to pull little external stuff myself, but I doesn't happen all the time
too much great packages out there
ams
shurgh, i have better things to do... like hacking.
bozhidar
the part of the config written by my(or stolen from others) is about 1500 lines
ams
bozhidar: eech
i had such a beast...
now i just go for minimality
i need about two setq tomake emacs usable for me.
bozhidar
only my mew setup is about 250 lines - spent several days reading the manual, reading blog posts and testing the effects of different settings :-)
ams
disabled-command-hook to nil, and line-move-visual to nil
bozhidar
ams: I used to be like this, but I felt I wasn't using the full power of Emacs
if somebody wrote all that cool stuff - I should be using it...
ams
bozhidar: funny, i've been using emacs for 15+ years.... i know elisp inside and out
bozhidar
which is wasting a lot of time :-)
ams
i still have better things to do than looking for cool stuff
laurus
ams, bozhidar: Mine is only 97 lines it looks like, but it includes two other files too
skaby
ams, I think you can hack your init.el don't you?
ams
skaby: ?
laurus
And a lot of mine is comments saying where I got these things from
franl
wc -l ~/.emacs ~/.gnus.el ~/elisp/my*.el | grep total => 16899 total
skaby
ams, you said you have better things to do like hack, but I think you can do both.
bozhidar
ams: master :-) I've been using Emacs for about 5 years - it the beginning only for C/C++ development
ams
bozhidar: i do everything in emacs
bozhidar
I didn't do any lisp hacking then
ams
i feel lost when i look out the door actually
bozhidar
but as time passed by I started exploring more and more stuff
ams
like.. last day i was using something, and thinking... wtf ain't there any rectangles seletion in this pile of sh*t?
skaby
I love it when I am using something else, and hit C-p a bunch and it wants to print stuff.
ams
and where are my registers?!
bozhidar
I feel your pain...
btw is emms any good?
skaby
And talking my parents into not sending me html email.
ams
oh, emms .. one of those things i'd like tohave, but something simpler
laurus
Emacs should support HTML email!
ams
skaby: my mantra is that i do not want a .emacs, if i have something fun, i try to get it included into emacs.
bozhidar
skaby: w3m handles html pretty good
ams
gnus does so as well,but takes about 1000000 lines to configure
(i use rmail)
skaby
Yes, I use gnus, and It is something I don't touch unless I have to.
bozhidar
haven't used rmail, hate gnus
skaby
I think everyone hates gnus, it is just some of us also love it.
bozhidar
I'm happy with mew - multiple accounts handling could have been better
but other than that - it's perfect for my needs
skaby: it always seemed to me a little bit crazy to be using something as complex and hard to properly configure as gnus, for a task as simple as reading mail...
laurus
I really hate the mbox format
I don't understand why e-mail doesn't have something better
ams
bozhidar: amen to that.
laurus: what would that be?
laurus: a SQL data base?
laurus
ams, something with at least separate files
ams
laurus: which sucks, casue listing a directory with 1000000 files takes a sh*t load of time
laurus
So you can open individual messages easily
bozhidar
maildir is not that bad
ams
maildir blows
laurus
bozhidar, what's that?
ams
laurus: one message, one file.
bozhidar
http://en.wikipedia.org/wiki/Maildir
ams
thing is with a one message per fiel approach, you still need a central index..
yonkeltron
there are better databases than sql
ams
wanna sort it? then yousure as hell don't want to process 10k of mail
laurus
ams, yeah
ams
yonkeltron: it was a joke
yonkeltron
just checking.
bazz
if i have an ongoing compile running, can skip all current errors. make it like i had "C-x `"ed to all errors currently in the buffer, so i can "C-x `" to new ones
ams
yonkeltron: one such databse is called `file system' :-)
moljac024
so, considering that i switched from vim to emacs - am I now a ninja pirate, or a pirate ninja?
or a robot ninja pirate power ranger?
ams
mairix is nice for indexing stuff.
bozhidar
moljac024: it depends if you'll last :-)
moljac024
we'll see
i'm liking it so far
although i've grown too acustomed to searching with /
as many other apps behave that way - firefox, chrome, the man page reader (most, is it?)
bozhidar
chrome?
fsbot
From memory, chrome is http://www.catb.org/~esr/jargon/html/C/chrome.html
bozhidar
bad bod
bad bot*
moljac024
chromium
or google chrome
the web browser
bozhidar
I know what it is
I use it all the time
noisesmith
moljac024: there is always viper - or overriding / to do incremental-search if that is really the only key you miss
bozhidar
but I don't see a vim like search feature
only C-f by default
noisesmith
bozhidar: what is a vim-like search feature?
bozhidar
search with /
noisesmith
moljac024: you can override any key with a keybinding, not just control / alt key combos, so you can get any vim key you really want (and then enter the character in a file with C-q char for example)
moljac024
noisesmith: yes i know that
i just caught myself searching with / without thinking about it - which is natural
when u use something for a long(ish) time you get used to it
noisesmith
yeah, I used vi for a year or two myself
moljac024
while emacs doesn't have the speed vim has, I believe you don't have to think so much about every single key you type
in vim, one key can make a huge difference
damd
"while emacs doesn't have the speed vim has" stop right there
moljac024
because they operate in different ways
damd
so to take a classic example: saving a file
moljac024
vim's modal interface is just faster, because you don't have to bend fingers and type more to achieve the same thing
damd
C-x C-s, vs. ESC : w q i
sorry
moljac024
but i didn't come here for a holy war - is that thing still going on? :)
bozhidar
wq = x
damd
ESC : w RET i
moljac024: well, you *did* come in #emacs and say that vim was fundamentally "faster" :)
bozhidar
and you don't need to go esc actually, but I want say more :-)
moljac024
how about c-u 8 c-k vs 8dd?
shabble
(defun :wq() (interactive) (error "DOIN IT RONG"))
moljac024
but the m-x thing is something i really like about emacs
damd
moljac024: do you often know before-hand exactly how many lines to kill?
noisesmith
moljac024: C-8 C-k
moljac024
oh and the little things like the replace
noisesmith
moljac024: m-x is for when you don't remember the keybinding
moljac024
i find emacs replace infinitely better than vims
damd: ofc not
yes but its a nice interface
noisesmith
shabble: lol
damd
i'll have to say that
M-% and M-C-% are horrible to this day
whoever thought that that was a good idea should be taken out back
shabble
teh bindings?
damd
yeah, the bindings
noisesmith
C-8 C-k is only 2/3 as many keypresses as 8dd - while vi does have the advantage that you can run most vi commands if you are a pirate with a hook for a hand
moljac024
hjkl > C-p C-n C-f C-b
that one really amazes me
fledermaus
or you could use the arrow keys
moljac024
does anyone use those keys for moving in a documet?
most people I talked to just use arrows
shabble
sometimes
damd
moljac024: how do you like switching "mode" just to move the cursor?
noisesmith
moljac024: yeah, I do, they are mnemonic
moljac024
I use arrows too
fledermaus
I tend to use h, j, k and l for typing, well, h, j, k and l
radical, I know
shabble
fledermaus: crazy talk!
moljac024
fledermaus: you mean, you want typing j to insert j into the text?
i'm confused, why would you want that?
is there any place where i could pick up useful emacs tips?
noisesmith
moljac024: seriously - for any numeric argument, C-<num>, even for two digit args C-1 2 <fn> will do <fn> 12 times
moljac024: there are a bunch on the emacswiki iirc
damd
or M-1 M-2 or C-u 1 2
moljac024
noisesmith: i know about c-u <number(s)>, what was your point?
noisesmith
moljac024: you were comparing number of keypresses
moljac024
oh and, can you use something like M-12 command to do the command 12 times?
havent tried that
damd
not all commands of course, but most commands for which it would make sense
moljac024
or is M-n only valid for single digits
noisesmith
moljac024: C-n followed by another digit
becomes that two digit number
« prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 next »