logs archiveIRC Archive / Freenode / #emacs / 2010 / May / 24 / 1
JordiGH
Oops, I lie. Looks like I don't avoid it.
Piratero: Found it, I think
inhibit-startup-buffer-menu
haha: http://bitbucket.org/jordigh/dotemacs/changeset/b8eeda0a7bad
marioxcc
hi, ┬┐what's the command for switch style in CC?
fledermaus
M-x c-set-style RET
marioxcc
ty
Eraldo
Eraldo 22:19
empathy (messaging client) has a spell checker where I can tell it to check for 'German and English' the result is that only words which are neither English nor German get marked as potentially wrong.
how can I get the same behaviour in emacs?
fsmunoz
Eraldo: writing in only one of them ;)
Eraldo: more seriaously
I remember something called "ispell-multi.el"
You could give it a search, maybe it does something to that effect.
Eraldo
fsmunoz: sounds interesting... just had a quick look at it
fsmunoz: thanks for the pointer
fsmunoz
Eraldo: yw... it could be a dead-end though, no guarantees ;)
Eraldo
fsmunoz: no warries :) I'll check it out beforehand
         

paulv_
is there some way to debug "Lisp nesting exceeds `max-lisp-eval-depth'" in a running emacs? I think ido is causing problems, but I can't figure out why. Now when I try to open files, I get that error.
Eraldo
I need to somehow parse a file and change all dates like '2010/3/9' to this format '2010-03-09' any idea how I should do that?
for me changing the single digit ones to have a zero added is the problem... otherwise I could have done it with my basic regexp "knowledge"
fsmunoz
Eraldo: replace-regexp?
Eraldo
fsmunoz: how would I solve the leading zero... don't I need some kind of if decision?
fsmunoz
(while (re-search-forward regexp nil t)
(replace-match to-string nil nil))
(this was actuallt in the replace-regexp documentation, that said that it was likely the wrong thing to use in a program ;) )
Ahh, sorry
Missed that part
titanofold
Is the regexp Perl compatible?
Eraldo
I could use multiple search replace calls one for each possible: yyyy-mm-dd ...then yyyy-m-dd ... yyyy-mm-d and yyyy-m-d
ngz
Eraldo: for the middle part, what about replace regex from /\([1-9]\)/ to -0\1- to have 2 digits ?
fsmunoz
Eraldo: you could also take a look at the Time Conversion section in the Elisp manual
Maybe there is something in there that would make it easier
i.e. you would still have to find the date (which isn't hard), but would not have to worry with the details
Eraldo
ngz: wouldn't that make 2010/11/23 > 2010-011-23 ?
the reason I need this is to convert a diary style date in an org-mode time stamp
ngz
Eraldo: No, there is only one [1-9] in my regexp.
Eraldo
ngz: but that would not do anything to 2010-11-23 ...right?
ngz
Eraldo: no
Eraldo
?
ngz
Eraldo: I would do it in 3 steps : 1) xxxx/x/xx -> xxx/xx/xx 2) xxxx/xx/x -> xxxx/xx/xx 3) xxxx/xx/xx -> xxxx-xx-xx.
Eraldo
4) xxxx-x-x
ngz
No that case is already covered by the 2 firsts steps
Eraldo
*4) xxxx/x/x
oh I see
ngz
After step 1) xxxx/x/x has become xxxx/xx/x anyway
Eraldo
genius :) *like*
is this the syntax I need to use:
(while (re-search-forward regexp nil t)
(replace-match to-string nil nil))
(Action) does not know elisp yet
         

ngz
Do you need to repeat it often, or just once ?
parolang
(setq easy 'elisp)
Eraldo
ngz: I have a diary file with multiple lines that start like this: '&2010/3/9 13:00-14:30 some text'
ngz
I mean, when this file will be fixed, will you have any use for this transform ?
Eraldo
and I want to make org-mode style headlines out of it: '* <2010-03-09 13:00-14:30> some text'
ngz: I need to do this once a week
on a weekly basis I get the updated events in .ics (icalendar) format
there is a function that parses that ics info and converts it into a diary file... however I don't use the diary
that is why I want to further convert it to org-mode format
ngz: so the answer is yes... I will still have use for it
in the long run I want to expand the icalendar-import function to have that as an option
or make another standalone function ics2org
ngz
Ok, so you need a function.
(and the syntax you provided it the one to use)
is*
Eraldo
ngz: how would I combine the resulting 3 while loops?
ngz
Eraldo: well I would put them one after the other, and would add (beginning-of-buffer) between them.
You can add a save-excursion form around all of it, too
Eraldo
when I execute the following code it returns nil and that's it.. it does not change anything:
(while (re-search-forward "/\([1-9]\)/" nil t)
(replace-match "-0\1-" nil nil)
)
ngz
Eraldo: let me try&
Eraldo
:) thank you
ngz
Ok I have it
Eraldo
nice!
ngz
http://paste.lisp.org/+25F0
Eraldo
I will write a short post about it to the org-mode mailng list... shall I use your nick "ngz" as author?
I just tested it and it works great
ngz
Well you can, but honestly, it is *very* ugly.
Eraldo
you saved me a lot of time... thank you for that!
I did it by hand the last 2 weeks :)
JordiGH
I think I already have ngz immortalised in my dotemacs repo.
damd
what is the most appropriate way to remake emacs when all i have changed is e.g. rcirc.el?
JordiGH
Huh, I guess I don't.
ngz
JordiGH: maybe one day then ! ;)
JordiGH
ngz: Patches welcome! http://bitbucket.org/jordigh/dotemacs/src/tip/dotemacs.el
ngz
JordiGH: (setq transient-mark-mode nil) : you are way too hardcore for me !
damd
yeah, i lold
JordiGH
Yeah, I was annoyed when they turned that on by default.
damd
only when they turned it on by default i learned the true power of non-transient-mode
JordiGH
I'm proud of line 153 too, but that's pretty common.
There's something that transient-mark-mode actually does. It changes some keybinding...
I forget what it was.
damd
well, lots of commands act differently depending on the mark being active or not
JordiGH
There was something that was actually useful.. but it depended on transient-mark-mode.
srbaker
technomancy: what WM are you using ?
awesome_guest
hey if anyone here was/is involved in the nXhtml project, you rock
I just installed it
JordiGH
Really?
It's always sucked for me.
awesome_guest
in what way?
like.. php-mode wasn't doing it for me
JordiGH
I think it still freaks out on heavily-mixed code.
awesome_guest
you byte compiled it and everything?
damd
i agree with JordiGH
awesome_guest
if so, what file size and what languages were involved?
JordiGH
ALL LANGUAGES
awesome_guest
I may start to hate it eventually
JordiGH
And huge filesizes.
awesome_guest
like... 500 kb? 100 kb?
JordiGH
Billions and billions of blue blustering bytes.
No, I don't know, I just remember it sucked and could only handle simple mixing.
But hey, if it works, power to you.
pizzledizzle
why do all auto-mode-alist entries end with \\' ? like "\\.C\\'"
i get the first \\. to escape the . for regexp
pd
pizzledizzle: it's basically $ in that context, but for reasons i don't know it's preferred
apparently matches the empty string at the end of a string
http://www.gnu.org/software/emacs/manual/html_node/emacs/Regexp-Backslash.html#Regexp-Backslash
damd
that's right
filenames *can* have newlines in them, so the most correct way to do it is to use \\'
and \\` means beginning of string as opposed to ^ which means beginning of line
parolang
Is there any reason for allowing newlines in filenames though? (not with respect to emacs, but with respect to OS's in general)
damd
parolang: not that i know of... i guess there is no reason to allow tabs either, but as far as i know, they're allowed
Riviera
everything except \0s and /s are allowed
s/are/is/
parolang
Sounds like overengineering :)
damd
it would be overengineering not to allow them i guess
parolang
I wonder if all the graphical file managers have considered possible display problems when displaying filenames with newlines in them.
damd
i know for sure that windows hasn't
parolang
Heh, didn't know that Windows allowed it.
damd
i can't recall the details but with some hacking, modifying the same file system from both windows and linux, my friends and i managed to break explorer completely
if i remember correctly, there was a file with no filename (in windows) which we could not do anything with
we could not move it, delete it, etc.
parolang
heh
I guess that could happen of your file operations aren't consistent on what is allowed/not allowed.
*of --> if
damd
Windows kernel forbids the use of characters in range 1-31 (i.e., 0x01-0x1F) and characters " * : < > ? \ / |.
apparently POSIX systems only allow A-Za-z0-9._-
and a hyphen must not be the first character of the file name
pjb
damd: no. POSIX allows much more.
damd: it's the intersection of all the file system that restricts it to A-Z0-9_ and with 8.3
damd
apparently what i was looking at was "fully portable filenames"
leo2007
rms yes ffi
damd
what?
parolang
He's chatting to rms in his sleep.
leo2007
rms has agreed to add ffi to emacs.
k-man
what is ffi?
fsbot
FFI is short for "foreign function interface", a mechanism for talking to libraries written in other languages. Most commonly, a Lisp system (e.g. SBCL) is using a C FFI to talk to a C library (e.g. libncurses). Other host and foreign languages are possible. .. + other entries
leo2007
which will be an important feature
damd
so *that's* what his mail was about
several others and i had no idea what it meant
leo2007
which email?
k-man
why is ffi important to emacs?
damd
leo2007: to emacs-devel
leo2007
yeah
pizzledizzle
thanks
leo2007
it is promising emacs 24 will have both lexical and ffi
pjb
k-man: without FFI, you cannot do a pure emacs over linux kernel system, you need to add mount.
k-man
pjb: what do you mean? as in emacs runs directly from the kernel - no other programs running??
fsbot
Highly likely.
pjb
See: http://www.informatimago.com/linux/emacs-on-user-mode-linux.html
leo2007
I think once ffi is in we can make xemacs an emacs 3rd party package.
pjb
So with FFI, you can add syscalls to emacs, and then implement the few unix tools missing to make emacs a full shell and system.
With only the linux kernel and drivers as a hardware abstraction layer.
Instant Lisp Machine! :-)
k-man
pjb: crazy stuff!
pjb
k-man: you can even do bitmap graphics in Lisp. Once upon a time, bitmap graphics only existed on Lisp Machines!
leo2007
pjb: I was about to write pdf
k-man
pjb: meaning? you can edit images in emac?
emacs
pjb
k-man: you can implement X windows in lisp. The first X servers ever implemented were written in Lisp. Why do you think you have 29-bit atoms in X?
k-man
pjb: freaky
i never knew that
pjb
So of course, you cuold then edit images in emacs.
damd
no, images are too CPU demanding
pjb
have a look at: http://video.google.com/videoplay?docid=8612534856516244040# and remember it was a computer 10,000 less powerful than what you have on your desktop. and 1,000 times less powerful than what you have in your pocket.
woodworks
one app to rule them all? (think frodo et al)
damd
if only emacs had a javascript engine
pjb
damd
fu*k you, emacs.
pjb
You cannot win, it has everything.
All the others are always doing, is to try to catch up with lisp.
damd
if only emacs had lexical binding
hah!
pjb
Well, ejacs has it, same as emacs-cl.
damd
ejacs fakes it i presume?
k-man
what is lexical binding?
damd
k-man: http://en.wikipedia.org/wiki/Lexical_scope#Lexical_scoping
pjb
damd: 'faking' in computer doesn't mean anything.
fsmunoz
k-man: I've read a lot about it, but the only thing I really got was that in Emacs if you pass a value to a function (say, foo=1), that value is available to all the function that you call inside, even if not explicitly passed
damd
pjb: you *know* what i mean :)
fsmunoz
(I'm actually depending on this on a small program I have, which is not clever)
pjb
damd: and this is not sure, because it might be a compiler to byte code.
parolang
pjb
damd: emacs byte code might allow to implement lexical binding. Most probably.
k-man
fsmunoz: so whats the big deal about it?
fsmunoz
k-man: well, that behaviour is seen as a Bad Thing
« prev 1 2 3 4 5 6 7 8 next »