logs archiveIRC Archive / Freenode / #emacs / 2010 / April / 2 / 1
ams
you should advice compile.
phobbs
could I advise it?
ams
not talking to you
phobbs
wgreenhouse: could I advise it?
ams: me neither
ams
good!
phobbs
=]
wgreenhouse
phobbs: hmm, idk. I was just looking at the `buffer-name' function
you may be able to do something useful with either buffer-name or buffer-live-p
ams
so tired
90 percent of Windows 7 flaws fixed by removing admin rights (arstechnica.com)
i have a better solution.. that fixes windows to 100%: install a free operating system.
FunctorSalad
hmm I can't quite figure out how to byte-compile a file conditionally if a certain package exists... what I have so far is "(eval-when-compile (unless (require 'the-pack nil t) (... abort? ...)))"
maybe there's a slightly nicer way, lol
err or "feature" would be the right term, not "package", AIUI
         

ams
you don't need the require.
erm, unless...
i mean
FunctorSalad
I use that require just for its return value
ams
oh,right, you pass no-error
missed that.
i did say i was tired
i'd write it as:
(eval-when-compile (require 'foo))
ologNation
Here's a really rough draft of something that I worked out over the last week:
http://pastebin.com/rqTPqNuX
ams
not sure why you are convulting it
ologNation
To make it work, you have to edit the line to (setq Prefix ...) to point to some directory on your filesystem
And create a file "./list" in a directory with this elisp script
which has a list of filenames in that directory.
The code that I wrote is just a system for paging through a list of files.
It's pretty fun.
Load-next works really well. load-next-two I'm still testing.
ams
ologNation: what does it do?
FunctorSalad
ams: then the compilation will fail if it doesn't exist, no?
ams
FunctorSalad: yes, which it should.
FunctorSalad
I wanted it to succeed and compile an empty file
wgreenhouse
ologNation: this is part of your incremental file browsing thingy?
ams
FunctorSalad: why?
FunctorSalad
I guess I could wrap the whole file into "eval-after-load 'foo (.... file ...)"
ams
what are you trying to do?
FunctorSalad
ams: uh, it consists of my customizations to some package I don't have installed anymore
ams
FunctorSalad: how about this...
(eval-when-compile (require 'foo nil t))
and in the bits that use foo
(when (featurep 'foo) ...)
ologNation
wgreenhouse, Yeah kind of
amacleod, Try it!
FunctorSalad
I'd guess that the compiler will leave alone anything in the eval-after-load too
ams
ologNation: was that directed to me?
FunctorSalad
and it'd even have the advantage of being on-demand-only even when I reinstall the original package...
         

ologNation
ams, I made it because I was writing a story with the different parts in separate files and I couldn't keep remembering which one was next in the story.
sorry.
yes.
ams, try it!
ams
i odn't know what it does.
FunctorSalad
ams: "featurep" is the direct way to do what I did at first?
ams
FunctorSalad: no clue what you want to do, you never said.
amacleod
(Action) now wonders what he should try. :)
ologNation
Maybe it would be better if I tarred something up so you could run it out of the box.
FunctorSalad
*reads manual* nvm
my see-if-feature-is-in-loadpath abuse of `require'
ams
ologNation: shouldn't you use a toc if you have a story?
ologNation: seems like a problem that doesn't need to exist...
ologNation
ams, I guess you have to work with what you got.
ams
or refactor things
ologNation
I didn't know how to use a toc, so I wrote a script that wrapped the list up the list of separate files into one latex document.
amacleod
Is there a command for switching the buffer of the other pane?
FunctorSalad
ok, just wrapped the whole file in eval-after-load, at least it compiles now ;)
should work too, actually
wgreenhouse
ologNation: have you ever checked out howm-mode? it has a search output mode called `riffle' that sort of does what you want. it scans files via string or regex and generates a temporary buffer, and allows you to move quickly through results
amacleod
C-x o; C-x b; <choose buffer>; C-x o
ams
ologNation: sounds like your story needs a proper format.
or just shove it into a singl efile.... and use page breaks
FunctorSalad
btw is there some good reason while auto-mode-alist isn't customizable?
ologNation
wgreenhouse, sounds cool.
wgreenhouse
,howm-mode
fsbot`
HowmMode is [0] at http://www.emacswiki.org/cgi-bin/wiki.pl?HowmMode
[1] see: http://howm.sourceforge.jp/README.html,
[2] http://dto.freeshell.org/HowmTutorial.howm.html
FunctorSalad
(otherwise I'd just defcustom it)
ams
FunctorSalad: hm? you can setq it...
wgreenhouse
ologNation: it'll be handy if you tend to sprawl across many little files while writing.
ams
it isn't defconst...
wgreenhouse
it can also display a concatenated view
FunctorSalad
ams: yeah, I meant "customizable" in the sense of the customization-buffer machinery
(so you can find it with customize-variable etc)
ams
no clue
i never used that
FunctorSalad
that or even better customize-apropos is quite convenient on a hotkey :)
(don't have to look up the setq)
ams
i don't custoimise my emacs, i useit.
lisppaste
dsetchell pasted "macro formating" at http://paste.lisp.org/display/97218
dsetchell
Hi All, I'm using some cpp macros in Cmode that insert actual code bits, they are really messing up my formatting
paste is above
my c-style is k&r
anyone know how to change this behavior ... I'll add the macro defs to that pastebin
basix
hey everybody. I have a file with a bunch of apache rewrite rules. I have extracted some lines, which need to be modified, in a separate text file. Is it possible for me to
merge them back in the original file?
lisppaste
dsetchell annotated #97218 "untitled" at http://paste.lisp.org/display/97218#1
ams
night
dsetchell: add a ; after the macro calls.
FunctorSalad
uh I admit that I may have passed over the lifetime-amortization point with customizing the emacs o_O
ams
dsetchell: and frankly, that is horribly code.
dsetchell
ams: that certainly worked, thanks, i feel a bit silly for not trying that myself!
ams
if you need to do this...
how about
dsetchell
ams: I'm following Advanced Unix Programming ... it's one of the first examples of, use goto for this
quotemstr
Let's boil the ocean.
ams
dsetchell: eech
quotemstr
Used responsible goto is perfectly fine.
Anyone who tells you different probably wears a leather collar on Friday nights.
ams
goto is fine...
i never understood why people eskew goto, or start quoting dijkstra at me when i use it...
dsetchell
this is how AUP does their error reporting, so I've gotta use it to continue with the examples i'm actually interested in
quotemstr
ams: Because blanket prohibitions are easy, and using judgement is hard.
kodein
slashroulette creeps me out
ams
(dijkstra DID NOT hate goto, the title of the paper, "Goto considered Harmful" is a title he didn;t even give, but the reviewer or something for a journal, dijkstra hate the title)
quotemstr
kodein: I stopped reading Slashdot last month.
kodein: A rant by the _owner_ of the site full of right-wing hysteria was just too much to take.
ams
dsetchell: using these macros? christ
quotemstr
kodein: All the liberal replies to that story somehow ended up being moderated -1 too.
kodein
"a case against the GOTO statement" was the original title
quotemstr
kodein: I'm done with people who think ObamaCare is slavery. If they think that, what else are they getting wrong?
kodein: Reddit is much saner place all-around.
kodein
quotemstr: well, irregardless. the slashroulette april fools thing is what I was talking about.
dsetchell
ams: yep! I thought the same, but the book is very good.
kodein
no need to rant about it
quotemstr
kodein: Right.
ams
dsetchell: with examples like these, no it isn't.
quotemstr
(Action) switches rant targets.
ams
dsetchell: nobody in the `unix' world programs like that
quotemstr
dsetchell: ams is right. (Gasp!) Idiomatic unix code looks nothing like that.
dsetchell
quotemstr
dsetchell: If you want exceptions, just use C++. Or better yet, Python.
ams: In its defense, apr-based programs that use memory pools often look somewhat like that.
ams
apr?
quotemstr
ams: And obstacks also follow the do-crap-then-clean-up mold.
,apr
fsbot`
try: Apropos apropos+.el apropos-fn+var.el AproposMode BrowseAproposURL CategoriaProgramacion DebianMMAPRanOutOfRoom drew-emacs-help-apropos IciclesHighlightInputFailureApropos InfoApropos shapr SystemApropos useapropos
quotemstr
,apr is the Apache Portable Runtime, used by Apache httpd, subversions, and other projects.
fsbot`
created.
ams
never used it.
quotemstr
,forget apr
fsbot`
Forgot "apr" which had exactly one entry.
quotemstr
,apr is the Apache Portable Runtime, used by Apache httpd, subversion, and other projects.
fsbot`
created.
ams
closest i can think of is lock code
and even then there are cleaner ways of doing it
quotemstr
ams: It's even free software.
ams
dsetchell: ok...
quotemstr
Yes.
Like using a language that isn't C.
(Unless you absolutely must.)
dsetchell
I don't *need* exceptions i need scalable multithreaded I/O network socket access
ams
why would you want to do that?
quotemstr
dsetchell: Consider using Boost's ASIO.
dsetchell: It's *solved these problems already*.
dsetchell: Or Twisted Python, which has also *already solved* these problems.
ams
consider something not-C.
like lisp.
quotemstr
SBCL is quite good.
dsetchell
agree with all on this, but I'm stuck in C for this one, as it's for a pseudo network interface driver ( vpn like )
quotemstr
dsetchell: kernel-mode code?
dsetchell
plugs into linux
it's ugly, and both -- there is module code that plugs into kernel
quotemstr
Then you might as well just use the kernel coding style.
ams
you an plug in sbcl cruft into tht kernel...
dsetchell
and gives me an interface
quotemstr
Rolling your own will preclude any possible inclusion into the tree.
ams: That's the stupidest thing I've heard all day.
dsetchell
this is not part of the kernel module, this is the part that writes to the interface
ams
quotemstr: your world order is back to normal then.
dsetchell
so i could use c++ i think
quotemstr
dsetchell: There's something to be said for using a consistent coding style throughout a project, however.
ams
or sbcl
people bi**h to much about coding styles... i just use indent.
or whatever is default...
or whatever the project i'm hacking on is using
quotemstr
Yes
.
Choice is hard.
Let's use the defaults.
dsetchell
quotemstr: hehe
ams
dunno if it is hard, but i'm lazy.
quotemstr
Choice *is* hard.
I hate choice.
The most stressful part of coding is coming to a decision that will have far-reaching implications and not having any good reason to choose one approach over another.
ams
quotemstr: dunno, i know what i like, and when i don't like something.... in general, i don't care.
cvandusen
quotemstr: I second that emotion
ams
isn't that kinda like looking into the future?
you can't know where something is headed unless you have a strict plan that you follow blindly...
if yo udon't, no matter what you decide can have far reaching implications
and if it does, refactor...
quotemstr
Sure, but refactoring is a pain.
ams
refactoring is fun!
i'm crazy, i dislike adding new features :)
dsetchell
refactoring in some languages is fun. Refactoring in C especially on a multi person project where original writers are no longer there, is a royal pain
quotemstr
Not when you grumble to yourself, "fu*k, I should have known all along that using a reader-writer lock for this data structure would cause starvation. Fuck. Now I have to spend days rewriting all the access points."
ams
dsetchell: oh bollocks
« prev 1 2 3 4 5 6 7 8 9 next »