logs archiveIRC Archive / Freenode / #emacs / 2009 / December / 22 / 1
vinhdizzo
if i have to use screen in emacs, i use ansi-term
dim
alienbrain: don't think so, to get so much power, you get to setup things
ieure
dim, ssh-mode is like M-x shell, but for remote hosts. No interactive terminal apps work in it.
dim
bummer, I'll continue using M-x term then
I get to use things like psql, top, iostat, vmstat, vim, etc
vinhdizzo
i *wish* i can use screen using M-x shell
mns
what about using eterm ? or is that eshell ?
skorpan
just use urxvt already
dim
eshell is not an ansi terminal emulator
melmothX
which is difference between M-x term and M-x ansi-term ?
         

alienbrain
dim: it's really awesome, I love it, but many times I'm justing doing some quickies and I just get by by indenting with multiple space hits
ieure
dim, You should use sql-postgres instead of psql in a *term*.
dim
skorpan: I prefer having my terms in emacs rather than emacs in my terms
Nafai
I prefer to have my terms in a native terminal emulator
skorpan
*real* programmers don't need terminals anyways
Nafai
dang it
alienbrain
dim: this is where dumb indentation makes sense (i.e. not syntax driven)
Nafai
skorpan just called me a fake programmer
dim
ieure: not sure, didn't get to have this working easily, and I'm not always on the right network for it to have a chance working
ieure
The number of things I actually need a full terminal emulator for is close to zero.
dim
beside, psql is excellent
ieure
dim, sql-postgres runs psql as an inferior process. Its great.
Nafai
I still use a full terminal emulator out of habit I think
ieure
But you get a local mode for abbrevs, etc, you can edit big queries in a *SQL* buffer, etc.
dim
well how do you choose the major version?
I'm used to copy paste or remote editing a .sql file that I then \i in psql
I'll try again when back @ work ieure, then
ieure
dim, You can change sql-postgres-program. Or if your default-directory is a remote host, it will fire up the command remotely.
e.g. I can M-x ssh to a box, run sql-postgres, and psql runs on the remote box in a window on my local Emacs. I use sql-mysql, but its the same principle.
dim
that's better, so you ssh away with ssh.el then fire the sql mode and it starts psql over there?
ieure
Yes.
Nafai
ieure: fancy
dim
good, I need to try it
         

Nafai
Sounds like ieure really could school me in Emacs
ieure
dim, Nafai: http://atomized.org/2008/10/enhancing-emacs%E2%80%99-sql-mode/
dim
you can type in the interactive psql if needed?
ieure
dim, Yeah, of course. Its just comint, though.
dim
no readline you mean?
ieure
Right.
Nafai
(Action) reads
ieure
I hacked that preset support together a while back. It just let-binds everything; if you set default-directory in your connection definition, you get a remote interactive SQL with a normal M-x command.
dim
and you can edit from a buffer then C-something and you see the result in the psql buffer
ieure
dim, Right.
dim
you can send a query in a any buffer to one of the psql comints you have?
ieure
dim, It has to be a sql-mode buffer. Im sure you could hack something together to make it work from any buffer.
dim
I edit a lot of .sql files that are checked in a local git or svn repo
so I'd like to be able to send the queries from there (create function, etc) then to have another more interactive buffer
ieure
Yeah, that should work fine.
dim
but copy/pasting from one to the other would be lame
then there's the BEGIN; create or replace function ....; select ...; ROLLBACK;
ieure
dim, C-c C-b sends the whole sql-mode buffer, C-c C-r sends the region.
dim
I guess that'll be well supported
begin and rollback are nothing special for emacs
ieure: is there sth to set the region to the sql-query-at-point? :)
mns
dim, ieure, I'm starting to work with SQL (oracle at the moment) and would like to do it from within emacs, but sometimes the output is just messed up. I tried it once with sql-mode or something. Is there something better ?
dim
oracle has a pretty awful interactive environment IIRC
ieure
dim, No, but it would be easy to hook in if you wrote one. ;)
dim
sqlplus is not usable, you need gqlplus or sth
ieure
mns, Not that I know of, but I dont use Oracle at all.
mns
sth ?
dim
ieure: mind you I'm still editing PostgreSQL .sql files with a MySQL oriented SQL mode
mns
ieure, the company I work for uses Oracle :(
dim
sth == something
mns: which part of the world are you in?
mns
US
dim
I know people to help you get out of there
ieure
dim, sql-mode supports gobs of different SQLs, just use sql-set-product.
dim
mns: zoom in? :)
ieure: I'll try (back from hollidays)
ieure: you ok for me bugging you again next week? :)
shabble
zoom, then enhance!
mns
lol dim, I'm bear Boston, MA.
dim
in exchange I could add support for ssh.el to cssh :)
ieure
dim, Sure, if Im around.
shabble
emacs needs a csi mode
mns
where are you dim ?
dim
Paris, France
mns: Baltimore is in MA too, right?
technomancy
what does ssh.el provide?
dim
I know people who could help you migrate from Oracle to PostgreSQL :)
mns
dim, no its in Marylyand.
ieure
technomancy, Just a simple shell-mode type dealy for remote boxes.
technomancy
(Action) uses eshell with ssh added to eshell-visual-commands
mns
lol dim its not my decision. If it was my decision, I'd have ordered that ages ago lol
dim
mns: oh sorry still mixing it all
mns: :)
ieure
Ive tried eshell a couple times. Have not found anything compelling enough to relearn my shell.
technomancy
ieure: being able to redirect output directly to a buffer is pretty badass
apart from that the way it translates calls to grep into M-x grep automatically is my favourite function
ieure
technomancy, Agreed, but with shell/ssh-mode I can do that in a few keystrokes anyway. (C-SPC C-c C-p C-w)
technomancy, Yeah, that is nice. I wrote shell scripts that invoke Emacs for man/grep/find, if available.
Doesnt work remotely, though.
jlf
anyone know how to htmlize/export an org-mode buffer that honors my hidestars setting? iow, i'd like to see /^ */ instead of /^****/ in the exported file.
mns
jlf, if you find out, let me know, I'd like that too
lacage
I am unclear about the semantic meaning of c-hanging-braces-alist
skorpan
,dv c-hanging-braces-alist
fsbot
*Controls the insertion of newlines before and after braces
when the auto-newline feature is active. This variable contains an
association list with elements of the following form:
(SYNTACTIC-SYMBOL . ACTION).
When a brace (either opening or closing) is inserted, the syntactic ..[Type ,more]
skorpan
,more
fsbot
context it defines is looked up in this list, and if found, the
associated ACTION is used to determine where newlines are inserted.
If the context is not found, the default is to insert a newline both
before and after the brace.
SYNTACTIC-SYMBOL can be statement-cont, brace-list-intro, ..[Type ,more]
skorpan
,more
fsbot
inexpr-class-open, inexpr-class-close, and any of the *-open and
*-close symbols. See `c-offsets-alist' for details, except for
inexpr-class-open and inexpr-class-close, which doesn't have any
corresponding symbols there. Those two symbols are used for the ..[Type ,more]
lacage
i.e., what is its relationship with indent-region ?
skorpan
is there any relation?
lacage
I thought that if I configure specially braces-alist, indent-region would potentially insert new newlines where needed
ieure
I dont believe indent-region ever adds newlines.
lacage
and is there a way to force emacs to do this for me ?
ieure
I dont know of one. It sounds like you want some sort of pretty-printer, not just indent-region.
lacage
yes, I am trying to abuse emacs
ieure
lacage, Right tool for the job. Sounds like Emacs is not the right tool in your case.
skorpan
lacage: are you trying to do what visual studio usually does?
automagically format the selection?
lacage
auto-newline does what I need
I am trying to automatically check for conformance for the coding style
skorpan
you want to insert a newline when you hit }?
lacage
I want to check for coding style conformance on commits
skorpan
heh, i'm sure your colleagues look up to you
lacage
the easiest way is to reformat the file and see if there is any difference between re-formatted and original
I do not want to make this mandatory
but I want to make it easy for those who care to do it automatically
before final commit
ieure
lacage, By definition, wouldnt those who care do it anyway?
skorpan
that's what i was thinking too
lacage
it's hard to get it always perfectly right
did I mention those using lesser editors such as vi ?
ieure
lacage, I find that indent-region is usually correct, but I change the alignment by hand in a few places where it makes sense. In cases like that, a tool like yours will just be generating noise. I think this is a problem best left unsolved.
skorpan
in visual studio you *can* choose to just automagically format the code according to the project settings
but yeah ieure is right
ieure
It also depends on the code. For Python, indent-region horribly mangles the code the point of unparseability.
skorpan
i never even tried it in haskell-mode
lacage
I do not wish to get dragged into a discussion about the merits of doing this: it's obvious others will disagree
I suspect that what I need is a combination of indent+emacs
technomancy
is there a trick to get flyspell to only check the text I type in ERC?
machatap
technomancy: there is, that's the way my flyspell works with erc. But I don't know how :)
ieure
technomancy, Are you using erc-spelling-mode?
technomancy
ieure: nope, just turning on flyspell in the hook
I'll try that; thanks
Mattias
skorpan: do you know how to make emacs + cedet as close to VS as possible? I mean, VS sure is good, but it doesn't work on linux
skorpan
Mattias: VS sucks, but no, i don't know to be honest
Mattias
skorpan: oh, why do you think it sucks?
skorpan
Mattias: bugs all over the place, sh*tty "interface", horrible emacs simulation
technomancy
(Action) is so glad he forgot everything he ever knew about VS
skorpan
lacking tons of features
what's *good* about visual studio is intellisense, but that's just about it.
Mattias
skorpan: oh, hm, yeah, intellisense is the thing I wanna get in emacs somehow, but I don't know how
cedet is the closest I can think of
but I suck on setting it up
I wanna setup emacs for C and C++
shabble
there's a thing on teh cedet sourceforge page.
,intellisense
fsbot
I think intellisense is [0] http://cedet.sourceforge.net/intellisense.shtml
[1] at http://charlespetzold.com/etc/DoesVisualStudioRotTheMind.html,
[2] see esense for Erlang
skorpan
i never learned any C lingo properly
well, C#, but i mean C/C++
Mattias
shabble: yeah, but either I can't setup it correctly, or it isn't as good as VS's intellisense
shabble
Mattias: I've tried and failed before, is there something specific that doens't work?
Mattias
skorpan: I also want to learn haskell or any other functional programming in the future, so I wanna setup emacs to support it with features for that too
shabble: well, I installed emacs + cedet on my main comp a few months ago, got it to work fairly well, I think a few problems was: it did color the functions but not the function calls I of my own functions, just the builtin functions
and intellisense I think worked somewhat too, can't remember exactly what I thought about it
there was something atleast :P
now I'm trying to setup emacs on my laptop
with c/c++ in mind
shabble
I'd had it partially working before, and found that partially is worse than none
I might give it another stab over christmas
skorpan
Mattias: the haskell-mode in emacs is pretty cool
Mattias
one thing I really wanted is to color the function calls, not only the builtin ones but the functions I've made
shabble
I think it might need to parse your headers for that to work
Mattias
cedet does parse the code
shabble
which might take some path/dir setup per-project
Mattias
it parses it for the "intellisense"
so why not make it color function calls too?
shabble
so it's suggesting them there, but not colouring them?
Mattias
yeah
I think it was something like that
if it can suggest, it should be possible to color function calls too
shabble
weird. Have you checked it's not using a different face to the built-ins?
C-u C-x = with the point on your function should tell you
Mattias
I can't try now, since it's not installed and setup yet on this laptop :)
this is just from the big comp of what I remember
Wish there could be a place to get example configs for each programming language ^.^
shabble
the emacswiki has a lot of good notes and code snippets
with all the possible options, it's quite hard to give a single 'standard' configuration for anything :p
Mattias
does emacswiki have for cedet too? :D
shabble
almost certainly
Mattias
if I remember correct, faces only works for the builtin standards in emacs
shabble
might not be much more than <h1>Oh god the pain and horror, Cthulhu, I beg you to eat me first!</h1>
Mattias
and it only colors function declarations, not function calls (except builtin ones)
I mean builtin standard functions calls for each language
ackthet
dood?
« prev 1 2 3 4 5 6 next »