logs archiveIRC Archive / Freenode / #emacs / 2009 / December / 30 / 1
fledermaus
there.
rudybot
Ooh, pong!
scb
Anyone knows how to force erc to reconnect after I get back on my network?
delYsid
/reconnect
fledermaus
train entering dead zone, bbl
scb
Sorry, I meant automatically.
delYsid
scb: It would need to retry periodically, I am not sure if there is an option for that.
jlf`
scb: erc-server-auto-reconnect and erc-autojoin-mode
delYsid
ah
         

scb
jlf`, let me check on that.
Uhm, I seem to have erc-server-auto-reconnect to non-nil and the erc-autojoin-mode already configured.
jlf`
is your erc reasonably modern?
defn
On the fact that his Physics grade hasn't been posted yet: "Maybe it takes longer to calculate a D."
scb
jlf`, 5.3
dim
[macosx] C-x 5 2 gives me another frame, can I switch back an forth from this new one to the other one with only the keyboard?
dmhouse
dim: C-x 5 o
dim
wow
cool, thx
M-` will be better at it :)
C-; maybe
C-|
my_haz
i am getting 'integer-or-marker-p, nil' as an error when trying to save an file.org.gpg file in emacs23. This did not happen in emacs 22.
'byte-code: Opening output file: integer-or-marker-p, nil'
dim
,,tdoe
fsbot
From memory, tdoe is [0] type M-x toggle-debug-on-error RET, reproduce the problem, then lisppaste the contents of the backtrace buffer.
[1] NOTE: you dont *have* to lisppaste, just contemplating the backtrace will often give you enlightenment
my_haz
dim: yeah, the backtrace isn't showing much
quotemstr
Mmm...
Now for coding part deux.
my_haz
hmm, i see that if i don't read my .emacs file it works ok
quotemstr
my_haz: Still might be a bug. Worth getting to the bottom of it..
my_haz
quotemstr: i found some debian bug tracker note of it
quotemstr: but there solution did not fix my problem.
bpalmer`
my_haz: are you using some gpg mode?
emacs23 includes a lot more random packages than did emacs22
my_haz
bpalmer`: yes
my .emacs is pretty big, but oddly none-of the gpg related lines seem to be causeing the problem
well actually, no there solution worked
i just had a local version of `epg-0.0.16` that was being added to the load path and emacs23 didn't like that
how can i add a conditional to my .emacs based on version? if (version < 23) { foo } ?
bpalmer`
,df emacs-version>=
fsbot
BEEEP: Symbol's function definition is void: emacs-version>=
bpalmer`
whoa, really? Alas, emacs.
see the variables emacs-major-version and emacs-minor-version
won't work in emacs < 19.23 or xemacs < 19.10, note.
but I imagine you may not worry about backwards compatibility quite so far back.
         

dim
(if (or (eq 0 (string-match "^23.1.50" emacs-version)) (eq 0 (string-match "^23.0.9[24]" emacs-version))) ...
hehe I still have (if (>= emacs-major-version 21) (tool-bar-mode 0))
bpalmer`
dim: come now, string-match is using regular expressions...
dim
bpalmer`: yes when using nightly builds it helps
bpalmer`
dim: so there's no reason to use that sort of conditional
dim
you mean the (or ?
bpalmer`
(if (string-match "^23.(1\\.50\\|0\\.9[24]") ...)
dim
I prefer when I can read my code :)
bpalmer`
also, you probably need to be escaping your dots.
dim
and it was temporary, just for when I was not sure about the next version
bpalmer`
(I foresee a certain someone chiming in with rx suggestions here, but beware of false prophets)
dim
I should rip it out now
you now the drift, it's experimental then it's historic
but I concur it's bad style and suboptimal
anyway, good night all!
mantis
Hi guys. How can I get emacs to immediately start a mode when I load a file with a certain extension ?
bpalmer`
mantis: major or minor mode?
dim: night.
mantis
minor modes.
I've just started learning actionscript, so I installed an actionscript mode. But I have to start it explicitely when I create or open an .as file.
bpalmer`
mantis: ah, that sounds like a major mode.
mantis
Ideally, I'd like the mode to kick in straight away.
Ah. ok.
bpalmer`
A major mode is something like C-mode that is the primary interface for the buffer; a minor mode is something like enabling on-the-fly spell checking.
,auto-mode-alist
fsbot
[->] I think automodealist is [0] at http://www.emacswiki.org/cgi-bin/wiki/AutoModeAlist
[1] (add-to-list 'auto-mode-alist '("\\.foo\\'" . foo-mode))
mantis
ok
thanks. I'll read that.
bpalmer`
you'll want to adapt [1] to be '("\\.as\\'" . actionscript-mode) or similar.
mantis
Awesome! Works!
Thank you :)
my_haz
yay! it works thanks bpalmer` quotemstr
quotemstr
Yep.
my_haz
i did like (if (< emacs-major-mode 23) (and (setq load-path (cons 'blah')) (requre 'epa-setup) (epa-file-enable)))
bpalmer`
looks good, although I don't like that style of and :)
my_haz
i don't know if (and) was the right function to use, but it worked
bpalmer`: what would b better than (and) ?
bpalmer`
(when (< emacs-major-mode 23) (setq ...) (require '...) (epa-file-enable))
mooglenorph
How do i retireve the documentation string for a variable, from within emacs?
bpalmer`
since cons should never in any reasonable thing return a nil value.
technomancy
my_haz: 'blah' doesn't mean what you think it means
you have to use double-quotes for strings
bpalmer`
(documentation-property 'emacs-major-version 'variable-documentation)
my_haz
technomancy: sorry, it is doubl quotes. Bad paste
bpalmer`
mooglenorph: or, interactively, C-h v
mooglenorph
bpalmer`: thanks
my_haz
(when (< emacs-major-version 23) (setq load-path (cons "/path/to/epg-0.0.16/" load-path)) (require 'epa-setup) (epa-file-enable))
both the (and) and (when) version work, but i could see how maybe the (when) version is easier to read.
fledermaus
use add-to-list on load path
my_haz
fledermaus: instead of cons?
fledermaus
instead of setq .... cons
,df add-to-list
fsbot
add-to-list is a compiled Lisp function in `subr.el'.
(add-to-list LIST-VAR ELEMENT &optional APPEND COMPARE-FN)
Add ELEMENT to the value of LIST-VAR if it isn't there yet.
The test for presence of ELEMENT is done with `equal',
or with COMPARE-FN if that's non-nil. ..[Type ,more]
mooglenorph
I am having trouble figuring out org-export-html-preamble, is there any way to use a file for this? Some mailing list post says it needs to be a string literal, but it is old, and the describe-variable command also does not specify what it wants.
fledermaus
(add-to-list 'load-path "...")
my_haz
fledermaus: that works
bpalmer`
I'm agnostic on a-t-l vs cons
a-t-l would be better suited to load-path manipulation if, rather than doing nothing if X was already present, it promoted it to the front.
my_haz
i try to avoid lisp whenever possible and use pymacs instead.
i really don't like lisp's syntax
quotemstr
my_haz: YOU MUST LIKE LISP.
my_haz
quotemstr: i knew i would catch hell for that, lol
technomancy
(Action) fires up the indoctrination nacelles
bpalmer`
http://xkcd.com/224/
my_haz
but python and haxe (though can't hack emacs with it) both have such nicer syntaxes
and i tend to code rather functionally in general
bpalmer`
I didn't realize pymacs was alive.
technomancy
functionally in python?
does not compute
bpalmer`
does too.
technomancy
functional programming in a language without lambda?
bpalmer`
python has a fine lambda.
my_haz
technomancy: lamda a plenty in python
bpalmer`
mint condition, never been used
ggole
Only little ones.
my_haz
technomancy: and you can generate functions (they are first class)
bpalmer`
anonymous functions are pretty anathema
give 'em a name, they'll thank you for it.
my_haz
they have nice decorators too
bpalmer`: hear hear!
def foo(x): def bar(y): return x + y + 10;; return bar
bpalmer`
decorators are reasonably neat, but I hate working in certain codebases with heavy decoration use.
my_haz
bpalmer`: handy for webdev
when you have to clean everything coming in and going out
bpalmer`
I'm not sure how that would affect things.
my_haz
bpalmer`: http://pylonshq.com/docs/en/0.9.7/modules/decorators/
bpalmer`
OK, I can see some of those use-cases.
fledermaus
ugh, pymacs. that flaky abomination
bpalmer`
if it works, it works.
and it's an end run around the lisp bottleneck.
fledermaus
meh.
it's a poorly conceive badly implementedd wreck.
implemented.
conceived.
anyway, sleep.
bpalmer`
never looked at its implementation.
mooglenorph
Is there any way to use a html file for my :preamble for an org-mode project?
Alternately, can I use en emacs lisp function to read in a file as a literal string?
ggole
,df insert-file
fsbot
insert-file is an interactive compiled Lisp function in `files.el'.
It is bound to C-x i, <menu-bar> <file> <insert-file>.
(insert-file FILENAME)
Insert contents of file FILENAME into buffer after point.
Set mark after the inserted text.
This function is meant for the user to run interactively. ..[Type ,more]
ggole
That might help
,m
fsbot
fsbot-more ..(symbol)
mooglenorph
Hm, I think I want to use this in my .emacs?
ggole
Remind me to bug fledermaus about that
You want to include an html file in your .emacs?
mooglenorph
Yes, as a string-literal
ggole
Why?
mooglenorph
For the HTML preamble on one of my org-mode projects.
Apparently that option only accepts a string-literal, not a filename
ggole
Including the file directly isn't really a nice way to handle that, though
mooglenorph
So it seems like a call to "read this html file into a string literal" would be better than actually typing the HTML into my .emacs
ggole: what would you recommend?
ggole
No need for literals, you could just open the file in a buffer and use buffer-substring
(with-temp-buffer (insert-file "foo.html") (buffer-string))
mooglenorph
And that'll hand off the string to my :preamble argument? Excellent.
ggole
I didn't test it, but yes
mooglenorph
Thanks very much, I don't know elisp at all.
ggole
Seems odd that org doesn't let you choose a file, though
mooglenorph
I know! That's what I thought.
Hmm, it is giving me a org-publish-org-to: Wrong type argument: char-or-string-p, (with-temp-buffer (insert-file "~/projects/inti-site-static/org/nav.html") (buffer-string))
ggole
One moment
Hmm, seems to work for me using another file
Try running that code using M-:. In particular, see if it returns nil.
mooglenorph
nope, it returns the contents of that file
With the quotes in it properly escaped.
ggole
No wait, no file would mean either an error or the empty string... hmm.
Maybe org isn't evaluating the form? That would be silly.
That must be it. It's a poorly designed macro.
Um, I don't know enough about org to know how to handle that
mooglenorph
Don't worry about it. I'll just paste HTML into the .emacs wily-nilly for now.
And pester the .org people
The file reading is useful anyway, as it escapes quotes for me... SO I can use emacs' HTML editing mode
ggole
OK
mooglenorph
thanks :-)
ggole
Any time
(Action) idly wonders what the org guys were thinking when they did things that way
mooglenorph
I was confused too. org-mode usually does exactly what I expect it to do
benny
carsten is good with fixing things that don't make sense
dmhouse
What's that minor mode which highlights the line with the point in?
benny
,hl-line-mode
fsbot
I think highlight is [0] for the current line, M-x hl-line-mode, for words and phrases, M-x hi-lock-mode
[1] at http://www.emacswiki.org/cgi-bin/wiki.pl?HighLight
dmhouse
Cheers, benny.
« prev 1 2 3 4 5 6 7 8 9 10 next »