Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Seashell Salesman
Aug 4, 2005

Holy wow! That "Literally A Person" sure is a cool and good poster. He's smart and witty and he smells like a pure mountain stream. I posted in his thread and I got a FANCY NEW AVATAR!!!!
Only myself and one other co-worker at my lab actually like emacs and everyone else constantly complains about it because Proofgeneral only works properly in emacs/xemacs so they are all forced to use it. Glad to have a place where I can come and talk about emacs and feel safe. Those vi users are mean :smith:

Adbot
ADBOT LOVES YOU

Beef
Jul 26, 2004
'RIP




Lacking a Lisp thread, I think this is appropriate here.

pgroce
Oct 24, 2002

Beef posted:

'RIP




Lacking a Lisp thread, I think this is appropriate here.

Great programmers never die, they just go out of scope.

orphean
Apr 27, 2007

beep boop bitches
my monads are fully functional
RIPL> ( )

Beef
Jul 26, 2004

quote:

Here lies a Lisper / Uninterned from this mortal package / Yet not gc'd / While we retain pointers to his memory

chunkles
Aug 14, 2005

i am completely immersed in darkness
as i turn my body away from the sun

orphean posted:

stuff
What sort of font settings are you using? Your setup looks a lot crisper than mine.

orphean
Apr 27, 2007

beep boop bitches
my monads are fully functional
code:
;; Set default font.
(set-default-font "DejaVu Sans Mono-10")
(add-to-list 'default-frame-alist '(font . "DejaVu Sans Mono-10"))
Literally my only font settings. What version of Emacs are you running? Pre Emacs 23 it didn't do any kind of antialiasing when rendering fonts or use whatever subpixel font rendering the host was using (ie, ClearType, whatever) so it looked sort of looked like jaggy rear end.

chunkles
Aug 14, 2005

i am completely immersed in darkness
as i turn my body away from the sun

orphean posted:

code:
;; Set default font.
(set-default-font "DejaVu Sans Mono-10")
(add-to-list 'default-frame-alist '(font . "DejaVu Sans Mono-10"))
Literally my only font settings. What version of Emacs are you running? Pre Emacs 23 it didn't do any kind of antialiasing when rendering fonts or use whatever subpixel font rendering the host was using (ie, ClearType, whatever) so it looked sort of looked like jaggy rear end.

I'm using emacs 23. I've been using bitmap fonts forever since emacs couldn't render fonts properly and every time I've switched to a real font it seemed kind of "off" to me. I guess I just need to adjust.

orphean
Apr 27, 2007

beep boop bitches
my monads are fully functional
Yeah if you use a truetype/opentype font you can leverage Emacs' new font rendering. A bitmap is a bitmap, that's always going to look the way it does. I find that DejaVu font to be the One True Font (crossplatform, huge amount of unicode codepoints included, etc) but try out a few!

Can't hurt.

Beef
Jul 26, 2004
I'm starting to hate aquamacs more and more. Last few versions were unstable as gently caress.

Now that it finally works in Lion it just freezes if I try to even change the font.

Time to configure the regular emacs?

Catalyst-proof
May 11, 2011

better waste some time with you

Beef posted:

I'm starting to hate aquamacs more and more. Last few versions were unstable as gently caress.

Now that it finally works in Lion it just freezes if I try to even change the font.

Time to configure the regular emacs?

Just install homebrew, and `brew install emacs --cocoa --use-git-head --srgb`. The purest, most OS-friendly Emacs build for Mac, period.

If you're feeling sassy you can even get integrated Lion fullscreen by adding this to the emacs formula:

code:

--- a/emacs.rb	2011-10-28 10:34:58.000000000 -0400
+++ b/emacs.rb	2011-10-28 10:36:26.000000000 -0400
@@ -40,6 +40,10 @@
       p << "https://raw.github.com/gist/1212776"
     end
 
+    if ARGV.build_head?
+      p << "https://raw.github.com/gist/1219862"
+    end
+
     if ARGV.include? "--cocoa"
       # Fullscreen patch, works against 23.3 and HEAD.
       p << "https://raw.github.com/gist/1012927"

It works like a dream, except I've found I've had to quickly enable and disable menu-bar-mode in order to hide a stubborn toolbar rectangle in the fullscreen mode.

orphean
Apr 27, 2007

beep boop bitches
my monads are fully functional

Fren posted:

emacs.rb

:aaa: A dark day indeed.

Anyone running emacs-head know if its possible to make a color theme buffer local using the new theming stuff? I want a different color theme for my terminal buffers but don't want to change the theme globally.

\/\/\/ :allears:

orphean fucked around with this message at 17:38 on Oct 29, 2011

trex eaterofcadrs
Jun 17, 2005
My lack of understanding is only exceeded by my lack of concern.

orphean posted:

:aaa: A dark day indeed.


Brew uses ruby as it's configuration language, that's all that is.

orphean
Apr 27, 2007

beep boop bitches
my monads are fully functional
The second Emacs 24 pretest was released today. If you're still on 23.x or the earlier pretest (and you don't track HEAD) now's a good time to check it out. From my experience, its stable for day to day use in both linux and win environments.

The best new feature is obviously animated gif support. Gonna bling my buffers like geocities, yo. :slick:

Edit: haha it's terrible glorious...

orphean fucked around with this message at 06:34 on Oct 31, 2011

Beef
Jul 26, 2004
Any changes that will make me more productive? I've got a deadline on Thursday and I need to soothe my conscience that it will be worth the switch :)

Catalyst-proof
May 11, 2011

better waste some time with you

Beef posted:

Any changes that will make me more productive? I've got a deadline on Thursday and I need to soothe my conscience that it will be worth the switch :)

If you're not using Emacs already and you have a deadline, I would not recommend switching editors. Worst case scenario you won't understand what you're doing in time to get back all the momentum you lost (muscle memory, features, etc), then you're hosed and you'll blame Emacs. Practice Emacs in your free time before you bust it out in a Real Life setting.

Johnny Cache Hit
Oct 17, 2011
e: f, b.

Beef posted:

Any changes that will make me more productive? I've got a deadline on Thursday and I need to soothe my conscience that it will be worth the switch :)

Don't gently caress with switching editors three days before a deadline. That's daft.

Load it up on Friday and C-h t

Zombywuf
Mar 29, 2008

Beef posted:

Any changes that will make me more productive? I've got a deadline on Thursday and I need to soothe my conscience that it will be worth the switch :)

This is called Yak Shaving. Don't do it.

orphean
Apr 27, 2007

beep boop bitches
my monads are fully functional

Beef posted:

I've got a deadline on Thursday and I need to soothe my conscience that it will be worth the switch

:raise:

Anyway, for a more serious post for once one of the best new features in Emacs 24 is that Elisp now supports lexical binding. This is a massive improvement and fast-forwards Elisp a couple decades in terms of lisp development. Closures, in my Emacs?

For now dynamic binding is still the default (since packages will need to be rewritten) but Emacs 24 provides the buffer-local lexical-binding variable which lets you turn it on for your own stuff.

Here's a couple of IELM sessions showing it off:

Dynamic Binding
code:
*** Welcome to IELM ***  Type (describe-mode) for help.
ELISP> (defun create-an-adder (x)
         #'(lambda (y) (+ x y)))
create-an-adder
ELISP> (setf adder3 (create-an-adder 3))
(lambda
  (y)
  (+ x y))

ELISP> (funcall adder3 9)
*** Eval error ***  Symbol's value as variable is void: x
ELISP>
Lexical Binding
code:
*** Welcome to IELM ***  Type (describe-mode) for help.
ELISP> (setq lexical-binding t)
t
ELISP> (defun create-an-adder (x)
         #'(lambda (y) (+ x y)))
create-an-adder
ELISP> (setf adder3 (create-an-adder 3))
(closure
 ((x . 3)
  t)
 (y)
 (+ x y))

ELISP> (funcall adder3 9)
12
ELISP> (funcall adder3 2)
5
ELISP>
This has been in HEAD since April so its not brand new or anything but if you're an elisp programmer and you aren't using Emacs 24 you're missing out!

Catalyst-proof
May 11, 2011

better waste some time with you
Holy poo poo.


...


Emacs has a REPL for Elisp? How the gently caress did I not know that?!

Also, the lexical binding stuff is pretty fantastic. I understand that this may be the beginning of writing code that doesn't block (i.e., waiting for the interface to respond after checking Gnus IMAP), though I'll admit I don't understand fully how the two concepts are related. Could you shed some light on that?

Zombywuf
Mar 29, 2008

Fren posted:

Also, the lexical binding stuff is pretty fantastic. I understand that this may be the beginning of writing code that doesn't block (i.e., waiting for the interface to respond after checking Gnus IMAP), though I'll admit I don't understand fully how the two concepts are related. Could you shed some light on that?

Asynchronous callbacks? Please say it's asynchronous callbacks. Then I can do flymake in tramp.

orphean
Apr 27, 2007

beep boop bitches
my monads are fully functional

Fren posted:

Holy poo poo ... How the gently caress did I not know that?!

emacs.txt

(IELM rocks!)

Fren posted:

Could you shed some light on that?

The basic idea is pretty simple. Right now every variable in Emacs is basically a Global variable. This is why you see everything named like <package-name>-<foo>-<bar> because if they didn't include the package name there's a good chance whatever the variable/function/whatever is is going to clobber another one.

Now imagine multiple threads all accessing the same globals variables at once. It is non-trivial to make a threaded system in such a way that no thread will try to access the same variable at once, or get into cycles where one thread is waiting for another thread which is in turn waiting back on the first thread and they're just deadlocked forever (Incidentally this is what happened to the Mars rovers, a race condition got left in. Its a very hard problem to solve! They could debug it because they had a REPL since they were using lisp~)

So what lexical binding does is make it so functions can "close over" their own private variables so that nothing else can access them AND so they retain their state. Its much easier to do concurrency when you don't have a huge bramble of global variables getting in the way.

Edit: Felt like I needed an example.

In the lexical binding thing I posted earlier there was this snippet:
code:
ELISP> (setf adder3 (create-an-adder 3))
(closure
 ((x . 3)
  t)
 (y)
 (+ x y))
You can see that create-an-adder returned something sort of like a lambda but we have this (x . 3) put in. That's Elisp "closing over" the x variable for the lambda code's x. It makes that x a private variable for the lambda that's always going to be set to 3.

Now we can create multiple adders. We could have an adder6, an adder12, whatever and it'll just work. With only dynamic binding (what Emacs has had until now) to do something like this you'd need to store the value of x somewhere since we saw that in dynamic binding x=3 isn't saved and its nil when we try to call our adder. Since everything is global that means only one x at a time and we're back to the problems with that.

Zombywuf posted:

Asynchronous callbacks? Please say it's asynchronous callbacks. Then I can do flymake in tramp.

Not yet, but it's an important step on the way to asynchronous callbacks.

orphean fucked around with this message at 19:43 on Oct 31, 2011

Cubiks
Aug 31, 2005
I wish I had something witty to put here...
As someone who doesn't really use emacs much, and has never played around in Elisp, I'm really confused. I'd consider closures and the like a huge aspect of a lisp-like language. Did Elisp really not have anything similar until now?

orphean
Apr 27, 2007

beep boop bitches
my monads are fully functional
With Elisp you got to remember that it predates Common Lisp and is a derivative of MACLisp. Its a really old fashioned lisp that's being dragged kicking and screaming into something more modern.

Heck there's still really powerful lisp features that Elisp still doesn't do. Things like reader macros and even packages.

Personally I'd like ELisp to be Common Lisp, but RMS hates common lisp so that's never going to happen. :)

\/\/\/ Climacs is a horrible tease.

orphean fucked around with this message at 21:12 on Oct 31, 2011

Catalyst-proof
May 11, 2011

better waste some time with you
There's always Climacs...

Catalyst-proof
May 11, 2011

better waste some time with you
I wonder how much work it would require to write a solid Emacs in Common Lisp, from scratch. Climacs looks like it sits directly on top of CLIM, which looks like a bunch of useless bullshit specifications that no one cares about. Make some easy decisions first: target one implementation (SBCL) and one windowing API (Cocoa :3:). Get a window, implement buffers and frames, and anything in Emacs's C foundation that's not already taken care of in CL. I smell a goon project.

orphean
Apr 27, 2007

beep boop bitches
my monads are fully functional
The problem isn't necessarily writing emacs in common lisp. Not that that's easy but it's not the main chunk.

The main chunk is getting all the elisp rewritten in CL which is a monumental undertaking.

Beef
Jul 26, 2004
With 'change' I meant 'change from emacs23 to emacs24'.

I just switched to the Solarized color theme: http://ethanschoonover.com/solarized
Dear god that's an improvement on the eyes to my green-on-black theme.

Catalyst-proof
May 11, 2011

better waste some time with you
So with the new Google Reader experience I've imported my RSS feeds into Gnus. Suprisingly simple and effective, aside from some formatting issues in feed items. I love being able to use the same interface for mail as I do for feeds, and after I discovered group topics, everything's all neat and organized. Of course, now I need to write an nnatom backend because those imports didn't make it in :(

Catalyst-proof
May 11, 2011

better waste some time with you
Has anyone figured out a way to run an Emacs server on one computer, and connect the *actual* Emacsclient executable on another computer to it? I don't mean SSHing in and running a terminal emacsclient, nor do I mean SSH with X forwarding and running the graphical emacsclient. Native client, remote server is what I'm after.

pgroce
Oct 24, 2002

Fren posted:

Has anyone figured out a way to run an Emacs server on one computer, and connect the *actual* Emacsclient executable on another computer to it? I don't mean SSHing in and running a terminal emacsclient, nor do I mean SSH with X forwarding and running the graphical emacsclient. Native client, remote server is what I'm after.

I haven't played with this, so sorry if you've already seen it. This is suggestive:

Emacs info posted:

Even if local sockets are available, you can tell Emacs to use TCP by setting the variable server-use-tcp to t. One advantage of TCP is that the server can accept connections from remote machines. For this to work, you must (i) set the variable server-host to the hostname or IP address of the machine on which the Emacs server runs, and (ii) provide emacsclient with the server file. (One convenient way to do the latter is to put the server file on a networked file system such as NFS.)

It looks like the tricky bit is that the server file needs to be shared out-of-band. The source code for server-start also mentions a server-port variable, which might be useful if you need to punch through a (hopefully internal) firewall.

There is zero encryption going on here and minimal authentication, I would only make this accessible via an SSH tunnel or point-to-point VPN if possible. (As a bonus, you can use scp to grab the server file, so it doesn't have to live in a shared filesystem.)

Please report back if you get it working, I'll be interested to see how it goes.

Zombywuf
Mar 29, 2008

pgroce posted:

It looks like the tricky bit is that the server file needs to be shared out-of-band. The source code for server-start also mentions a server-port variable, which might be useful if you need to punch through a (hopefully internal) firewall.

Sounds like this might be a job for sshfs.

Catalyst-proof
May 11, 2011

better waste some time with you
Update on this.

Server:
code:
(setq server-use-tcp t)
(setq server-host "Server.local")
(setq server-auth-dir "~/Dropbox/Sync/emacs")
(server-start)
Client:
code:
$ emacsclient -f ~/Dropbox/Sync/emacs/server -c
Result? A new frame is opened on the server. :ughh:

orphean
Apr 27, 2007

beep boop bitches
my monads are fully functional
What happens if you pass -d <DISPLAY> to emacsclient? It sounds like the basic mechanism is working and you just need to tell emacs which xserver gets the frame.

Catalyst-proof
May 11, 2011

better waste some time with you
Still no luck

orphean
Apr 27, 2007

beep boop bitches
my monads are fully functional
So emacs is running on the server, emacsclient can connect to it. Since passing in the display didn't work I'm thinking that the server emacs doesn't see your local display.

There needs to be a connection between your server's Xserver and your local workstations Xserver. What does (x-display-list) return on the server emacs? If your local workstation's display isn't in there then its not going to work I don't think.

Zombywuf
Mar 29, 2008

I wonder if emacsserver is a server in the same way that Xserver is a server. i.e. the server is supposed to be run wherever the user is sitting.

Catalyst-proof
May 11, 2011

better waste some time with you
The first Emacs mode I've written has been released. It's a gopher client for Emacs, and it's called gopher.el.

fishbacon
Nov 4, 2009
wonderful yet strange smell
A thread about emacs!

Can we talk about favourite modes and how they make us feel inside?

I have been using org-mode for about a year now and I am very impressed with the power of it; I only really use it for notes and todo lists. Most of the time my group mates (university project group) hate that I write notes from meetings in org-mode because they find that it is hard to read, I found a solution: Publishing to html and having a stylesheet which makes everything all pretty.

Currently my biggest problem with emacs is that color-theme-mode can't customize the area below numbers in linum-mode, at least not in any place I have been able to locate, it creates a weird gap between numbers when you have multiple "lines" on one line (that is the arrow thing in the fringe).

Adbot
ADBOT LOVES YOU

pgroce
Oct 24, 2002
The coolest thing about org-mode is tables. <3 org-mode tables.

What's the font-face for clickable hyperlnks? I just moved over to Solarized, but I still have obnoxious neon-teal hyperlinks. I want a pretty Emacs.

e: It looks like it's just happening in jabber.el -- Solarized has faces for link and link-visited. Time to poke at jabber.el, I guess.

pgroce fucked around with this message at 17:39 on Nov 8, 2011

  • Locked thread