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
pgroce
Oct 24, 2002
If they don't want you using Emacs, do you want them?

Legit question. You want to know how you'll be expected to work, and if it's not something you can live with, you want to know. You're interviewing them, too. If they say no and it's a deal breaker, better to know now.

Extrapolate this advice to all aspects of the interview process, BTW. And don't rely on the kindness of IT departments, either.

Adbot
ADBOT LOVES YOU

shrughes
Oct 11, 2008

(call/cc call/cc)

xf86enodev posted:

Hej guys, just wanted to throw this out there (nice thread title btw),
but how have your (future) employer's reactions to using emacs have been?

I imagine strange looks at the least, or maybe a "what's emacs?"

Why I care is, I'm looking for a new job and all appropriate offerings list some of "eclipse knowledge", "vs knowledge"...

How do I explain to employers I do emacs and emacs does all I need?

I've been using emacs everywhere I worked at so far, but it also never came up in interviews so far... So my choice of action would be to dodge the question and just let the IT guys know later, since that's what I've done so far. (IT's been always sort of "understanding" in letting me do whatever)

But what if? How'd you go about telling mgmt you'd rather use emacs than vs?

????

At my current employer his reaction was "oh good, you're not one of those vi users" (who were in the majority).

At my previous employer most of us used VS for most work (it was C#) but my boss used Emacs.

What do IT guys have to do with anything?

Johnny Cache Hit
Oct 17, 2011

xf86enodev posted:

Hej guys, just wanted to throw this out there (nice thread title btw),
but how have your (future) employer's reactions to using emacs have been?

I imagine strange looks at the least, or maybe a "what's emacs?"

Why I care is, I'm looking for a new job and all appropriate offerings list some of "eclipse knowledge", "vs knowledge"...

How do I explain to employers I do emacs and emacs does all I need?

I've been using emacs everywhere I worked at so far, but it also never came up in interviews so far... So my choice of action would be to dodge the question and just let the IT guys know later, since that's what I've done so far. (IT's been always sort of "understanding" in letting me do whatever)

But what if? How'd you go about telling mgmt you'd rather use emacs than vs?

"Vim or emacs" was an interview question at my latest job. The team lead said he didn't really care which one I answered, just that I didn't say nano :downs:

I guess it really depends on what kind of job you are interviewing for. Everyone's been cool with emacs at all of my jobs, but I've also lived in a comfortable bubble of Python and Ruby. I could see why management would expect you to know Visual Studio if you were applying for a C# job.

But more importantly, all the places I've worked so far understand that good developers spend time learning & customizing their tools -- their editor, their OS, whatever -- and they wouldn't dare forbid people from using what they know & are good at.

Ask in your interview what their policies look like. If they're going to be issuing edicts on what editor programers can use, their culture is pretty screwed up, and you should look elsewhere.

Zombywuf
Mar 29, 2008

Last place I worked I did check that they didn't do any weird "you must use this editor" poo poo during the interview. I then spent several years learning how to write documents in Word and diagrams in Visio without slitting my wrists. I think it took a year for people to stop blaming my use of emacs for every svn corruption (which were caused by something else entirely).

baby puzzle
Jun 3, 2011

I'll Sequence your Storm.
How do I paste arbitrary text into org mode without it freaking out?

I.E. text that may have lines beginning with #, *, or |.

I figure I want some kind of "unformatted" block, but that isn't getting me anywhere.

pgroce
Oct 24, 2002

baby puzzle posted:

How do I paste arbitrary text into org mode without it freaking out?

I.E. text that may have lines beginning with #, *, or |.

I figure I want some kind of "unformatted" block, but that isn't getting me anywhere.

I trolled the documentation looking for this and came up empty, too.

If you're pasting source code in, you can use src blocks (see (info "(org) Working with source code")). That's not really arbitrary, though.

When I want to reference some arbitrary data from an org file without it receiving any markup, I usually put it in its own file and link to it, e.g.:

code:
* Installation info in [[file:README.md][the README file]]

or

code:
* Installation info in [[file:README.md]]
Hope that helps.

Catalyst-proof
May 11, 2011

better waste some time with you
I just published my article on synchronizing Org-mode and iCloud's Reminders. It requires the use of Clozure Common Lisp to generate a foreign function interface to Apple's Foundation Framework, which has an API for accessing and manipulating calendar data. I'd love to hear people's feedback, comments, and criticisms. Oh, and the entire page, and everything I wrote for it, was written and tested primarily in Org-mode :-)

Beef
Jul 26, 2004
Eat your own dogfood ey? Awesome

Catalyst-proof
May 11, 2011

better waste some time with you
Yah. Also I'm currently using Org-mode's plumbing to publish my blog, but I'm getting sick of digging into that code and I'm working on writing my own. I don't know if anyone else is as crazy as me, but I wrote the incredibly simple makehtml.el to help write HTML trees. Check it.

code:
(defun makehtml-css (href)
  `(:link/ ((rel . stylesheet) (type . text/css) (href . ,href))))

(defun makehtml-rss (title href)
  `(:link/ ((rel . alternate) (type . application/rss+xml)
            (title . ,title) (href . ,href))))

(makehtml (:!DOCTYPE (html))
          (:html ((lang . en))
                 (:head nil
                  (:title nil "Wooh title")
                  (:meta/ ((charset . utf-8)))
                  (makehtml-css "/css/site.css")
                  (makehtml-rss "Wooh RSS" "http://example.com/rss.xml"))))
And that generates this:

code:
<!DOCTYPE html>
<html lang='en'><head><title>Wooh title</title>
<meta charset='utf-8' />
<link rel='stylesheet' type='text/css' href='/css/site.css' />
<link rel='alternate' type='application/rss+xml' title='Wooh RSS' href='http://example.com/rss.xml' /></head></html>
So you can write your own little defuns for shortcuts to commonly used HTML, or to abstract things out, and you can iterate over poo poo in it:

code:
(makehtml (:ul nil
                 (mapcar (lambda (item)
                           `(:li nil (:a ((href . ,(car item))) ,(cadr item))))
                         '(("http://www.example.com" "example.com")
                           ("http://www.example.net" "example.net")))))
code:
<ul><li><a href='http://www.example.com'>example.com</a></li>
<li><a href='http://www.example.net'>example.net</a></li></ul>
Right now, all the Org-mode HTML publishing functions just have huge hunks of HTML in their poo poo. And it's so stupid.

pgroce
Oct 24, 2002

Fren posted:

I just published my article on synchronizing Org-mode and iCloud's Reminders. It requires the use of Clozure Common Lisp to generate a foreign function interface to Apple's Foundation Framework, which has an API for accessing and manipulating calendar data. I'd love to hear people's feedback, comments, and criticisms. Oh, and the entire page, and everything I wrote for it, was written and tested primarily in Org-mode :-)

Here are some comments from a developer and elisper without any CL experience....

Overall, this was a lot of fun to read. Being able to talk to Apple Foundation stuff adds a lot of power to Emacs, and I'm interested in seeing how it develops.

The article is simultaneously an installation document and a technical commentary. Both are necessary, but I think they should be two documents. I think that would also give you room to elaborate more on your choice of design, implementation challenges, etc., all of which would be interesting to see.

Regarding the installation: Installing SLIME, Clozure and ffigen is quite a lot of work to sync your calendar. If you're interested in this as an application (and not just a technical POC), I think you can make things easier on users if you can get rid of some of the moving parts. Some weakly informed suggestions:

Instead of using SLIME, perhaps you could communicate with the CL process using sockets and a homegrown protocol. Since they're both lisps, this could be sexpr-based, which would simplify the communication code.

You could simplify it further by compiling the CL part into a binary and running it in Emacs as an inferior process. Take that one step farther and build the binaries yourself, and you relieve the user of installing CL/ffigen. (My brief Googling leads me to believe you wouldn't need to provide a CL runtime for this to work, but you probably know better than I. It seems like it would remove the ffigen step, at least.)

Anyway, very cool stuff. Thanks for doing the work, and sharing with us. Personally, I think the iTunes-control use case you put out is the most interesting—controlling iTunes via Emacs sounds like a killer app for the twenty or so people like us using Emacs on OS X. :)

ynohtna
Feb 16, 2007

backwoods compatible
Illegal Hen
I haven't yet consumed Fren's article to properly understand the situation - sorry! - but I have had success controlling iTunes from Emacs on OSX in the past (I no longer use iTunes) with osx-itunes.el and osx-osascript.el from http://www.mahalito.net/~harley/elisp/

They don't require any further installation other than the usual placement within load-path and something along the lines of:
code:
(if (eq window-system 'mac)
    (require 'osx-itunes))

xf86enodev
Mar 27, 2010

dis catte!
Sorry for the late response but I just wanted to say thanks to all who replied.

pgroce posted:

If they don't want you using Emacs, do you want them?

shrughes posted:

At my current employer his reaction was "oh good, you're not one of those vi users" (who were in the majority).

Kim Jong III posted:

but I've also lived in a comfortable bubble of Python and Ruby.

All of this sounds really amazing, your advice is spot-on and just reaffirming my opinion when it comes to choosing the right job.


Zombywuf posted:

Last place I worked I did check that they didn't do any weird "you must use this editor" poo poo during the interview. I then spent several years learning how to write documents in Word and diagrams in Visio without slitting my wrists. I think it took a year for people to stop blaming my use of emacs for every svn corruption (which were caused by something else entirely).

This on the other hand reminds me of my old job.

shrughes posted:

What do IT guys have to do with anything?

At my old job: "Hey guys, you know how I'm using XP on my workstation and it's not the best environment to work in? I mean you use Linux yourself, you know about all the handy tools. So how about I get a Linux workstation?" - "gently caress off (We might give you one eventually, but we have so much other stuff to do and why do you care anyway? You're just a coder. Leave the administrators alone!)"
I ended up running a Linux desktop in a VM on XP. It was ok.


Kim Jong III posted:

but I've also lived in a comfortable bubble of Python and Ruby.
Also this again. You just don't know how good you have it.


Some one chime in and tell me they get to write Lisp for a living.

Beef
Jul 26, 2004
I do, but it's academic research :v:

Catalyst-proof
May 11, 2011

better waste some time with you
You know, I don't really think Org-mode has a place in my life. It's too picky to be a universal markup language. Filtering out noise with agenda filters is too complicated to be practical. Literate programming is too primitive to handle complex development. TODO items are a pain in the rear end to be kept in sync with outside systems. Publishing a blog with it requires violent wrenching about in the innards of the module, and the default export systems are always just 90% there but for some glaring oversight in formatting. I like the default behavior for outlining, say, 50% of the time, and the other 50% are wrapped up in countless bizarre edge case options to understand and set.

It's really sad. There's a lot of potential there, but it seems bloated and too generalized to be really good at any one thing. I still use it deft-mode, but it's habit more than for any real benefit.

Is there anything like it? Some kind of promising alternative?

EDIT: I also like that I can take notes on a project with rudimentary outlining, and then just as easily write out tasks for me to complete for the project. But after that it just falls apart. If you export the TODOs then you lose the context, and if the TODOs are just stuck in the Org file, it's a pain in the rear end to share that with other services and keep them updated.

Catalyst-proof fucked around with this message at 04:21 on May 24, 2012

mustermark
Apr 26, 2009

"Mind" is a tool invented by the universe to see itself; but it can never see all of itself, for much the same reason that you can't see your own back (without mirrors).
I thought the same thing about org-mode until I took a course on number theory this semester. I get all the boons of LaTeX with a better syntax and easier workflow.

Zombywuf
Mar 29, 2008

Fren posted:

You know, I don't really think Org-mode has a place in my life. It's too picky to be a universal markup language. Filtering out noise with agenda filters is too complicated to be practical. Literate programming is too primitive to handle complex development. TODO items are a pain in the rear end to be kept in sync with outside systems. Publishing a blog with it requires violent wrenching about in the innards of the module, and the default export systems are always just 90% there but for some glaring oversight in formatting. I like the default behavior for outlining, say, 50% of the time, and the other 50% are wrapped up in countless bizarre edge case options to understand and set.

I kind of agree with you. org-mode is still awesome for short term things like "I need to take notes in this meeting" but really starts to fall apart after 3 months of note taking all you have is a big pile of notes. The real thing that would make it shine would be a thing that lives outside of Emacs and syncs up all your note/tracking/issue data. But that's just one of my dreams of a brighter tomorrow.

I still use it as an ide for sql, it beats just about everything hands down there. In fact as a general "I need to do some coding for this one of task with a few scraps of shell, awk, python, sql, etc..." babel is pretty sweet. And when you realise you need to do it again a month later you have all your notes and code.

Catalyst-proof
May 11, 2011

better waste some time with you
I don't think I'll be migrating away from it any time soon:

code:
msnyder@Diogenes ~/Documents/Org % wc -l **/*.org | tail -n 1
   14730 total
msnyder@Diogenes ~/Projects/msnyder.info (git)-[master] % wc -l **/*.org | tail -n 1
    3960 total
But I find myself using less and less of its features. I think I'm going to write an alternative pipeline for blogging, use it to track notes and project research, but scrap using it for keeping track of TODOs and events. It's just too much hassle.

pgroce
Oct 24, 2002

Fren posted:

I think I'm going to write an alternative pipeline for blogging, use it to track notes and project research, but scrap using it for keeping track of TODOs and events. It's just too much hassle.

That's about where I am with it. The outlines are pretty and the formatting is nice for keeping personal structured notes. That's about it.

For a long time, I thought it would be nice to use org-mode files as input to a time tracking app—there would just need to be a more generic API for treating an org-mode document as a tree. I was even writing that up in this post, when I realized that if I want to go down that road in Emacs, I already have a far superior format: s-expressions.

What I'm trying to say is that my afternoon will probably be spent rewriting my time tracking app, and it's your fault. :)

Catalyst-proof
May 11, 2011

better waste some time with you
Org-mode does time tracking, I'm not sure how good it is since I've never used it, but this one guy had a fairly sophisticated setup: http://doc.norang.ca/org-mode.html#Clocking

EDIT: I really need to change the name of this thread to "Mostly bitching about Org-mode"

Catalyst-proof fucked around with this message at 19:33 on May 24, 2012

pgroce
Oct 24, 2002

Fren posted:

Org-mode does time tracking, I'm not sure how good it is since I've never used it, but this one guy had a fairly sophisticated setup: http://doc.norang.ca/org-mode.html#Clocking

Yeah, that scares me. :)

I already have a Python app where I track things on a weekly basis. The input is something along the lines of:

code:
WEEK: 2012/05/07

JOB: Big Project X
5d
CUSTOMER_X/.8,CUSTOMER_Y/.2
Then the script figures out that 4 days of that week (1 day == 8 hours) should be billed to X and 1 day should be billed to Y.

The insight I had while writing my previous post was that I could write something like:

Lisp code:
;; UNTESTED
(week "2012/05/07" '((job "Big Project X" (5days) '((bill-to 'X .8) (bill-to 'Y .2)))))
and capture just as much information, plus be able to read it in and eval it if I want to print out a roll-up for subsequent reporting. (Once I've defined functions for week and job and whatnot.)

This solves two problems: it will almost certainly be cleaner parsing/printing code than what I have now, and I no longer have an input format that looks like the north end of a southbound mule. :)

orphean
Apr 27, 2007

beep boop bitches
my monads are fully functional
Storing data as lisp instead of text is very nearly always the correct decision.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

orphean posted:

Storing data as lisp instead of text is very nearly always the correct decision.

This is why I hate unix pipelines and bash so much.

fishbacon
Nov 4, 2009
wonderful yet strange smell
Hey thread, don't die!

Emacs 24.1 is out!

http://www.gnu.org/software/emacs/NEWS.24.1

pgroce
Oct 24, 2002

Mr. Fish posted:

Hey thread, don't die!

Emacs 24.1 is out!

http://www.gnu.org/software/emacs/NEWS.24.1

I've been using the 24 nightlies for a while. The coolest feature to elisp programmers has to be the introduction of lexical scope.

ELPA is an exciting development, too, but there's some tension between building a good packaging system and the (basically unlimited) level of control users now have over their configuration. (See customize.) It'll be interesting to see how things move forward.

Sacha Chua did her .emacs up as an org-babel file. This is bizarrely appealing to me.

fishbacon
Nov 4, 2009
wonderful yet strange smell

Am I missing something or is there a reason to "require" stuff every time you need something from it? I thought the initialization slowed for every require.

I have a heavily commented .emacs file so I might have some benefit from just switching to using org-babel.

Zombywuf
Mar 29, 2008

org-babel would be awesome for SQL if org-mode weren't so drat slow at displaying tables. Just having a table in your buffer slows it down horribly.

orphean
Apr 27, 2007

beep boop bitches
my monads are fully functional

Mr. Fish posted:

Am I missing something or is there a reason to "require" stuff every time you need something from it? I thought the initialization slowed for every require.

The main idea is that it makes your init files easier to maintain if you break them up into logical pieces and then require them.

For example here is the entirety of my '.emacs':
code:
            1 ;;; Package Load Paths ;;;----------------------------
            2 ; 3rd Party Packages
            3 (add-to-list 'load-path (expand-file-name "~/.emacs.d/vendor"))
            4 (progn (cd (expand-file-name "~/.emacs.d/vendor"))
            5        (normal-top-level-add-subdirs-to-load-path)
            6        (cd (expand-file-name "~/")))
            7
            8 ; Local Configuration
            9 (add-to-list 'load-path (expand-file-name "~/.emacs.d/config"))
           10
           11 ;;; Load Configuration ;;;---------------------------
           12 (require 'my-function-config)
           13 (require 'my-general-config)
           14 (require 'my-package-config)
           15 (require 'my-hooks-config)
           16
           17 ;;; Emacs Server ;;;-----------------------------------
           18 (unless (fboundp 'server-running-p) (load "server"))
           19 (unless (server-running-p) (server-start))
Do the requires slow down initialization? Sure probably a little bit. But I'd argue that if this is an issue for someone they are using emacs incorrectly (ie, like vim, opening and closing it all the time rather than just leaving it open).

Extra bonus tip:
Emacs looks inside .emacs.d on startup for a file called init.el if it can't find .emacs. This is handy if you want to consolidate all your emacs configuration into one folder (ie, to push all of it to a git repo or what have you)

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
Whoever said to use marmalade, well, uh...

A large amount of the packages don't have correct autoloads, which means that you still need to manually (require 'foo) them in your .emacs file. They don't provide a contact mechanism to give bug reports back to the author.

So I wanted to upload a package, so I looked through the documentation for it, and, um... Welp. Seriously. Click on "Docs" at the bottom, and then click on any of the documentation. Great.

So I decided to check out some of the other packages, and when trying to browse, um, the pagination is broken. Clicking on Next from the index package takes me to this page.

Look at the source for the package list page:

code:
<a href="function (n) {
              var u = url.parse(req.url, true);
              u.query = u.query || {};
              u.query.page = String(n);
              u.search = '?' + querystring.stringify(u.query);
              return url.format(u);
          }" class="next">Next</a>
url.parse? That's the node.js server code in there. How do you gently caress that up?

Johnny Cache Hit
Oct 17, 2011
Is there a way to make emacs automagically strip out extra whitespace at the end of lines, or to convert any whitespace-only lines to a single \n?

My team lead is yelling at me to strip trailing whitespace because it makes diffs noisy. After going around and around with him, it appears that he has his vim set to s/\w*$// on save or something -- so my changes don't make diffs noisy, but as soon as he opens something I wrote and saves it the world catches on fire.

I'm trying to say "diff -w is your friend" but I'm not sure this is a battle I'm going to win :psypop:

Police Academy III
Nov 4, 2011

Kim Jong III posted:

Is there a way to make emacs automagically strip out extra whitespace at the end of lines, or to convert any whitespace-only lines to a single \n?

My team lead is yelling at me to strip trailing whitespace because it makes diffs noisy. After going around and around with him, it appears that he has his vim set to s/\w*$// on save or something -- so my changes don't make diffs noisy, but as soon as he opens something I wrote and saves it the world catches on fire.

I'm trying to say "diff -w is your friend" but I'm not sure this is a battle I'm going to win :psypop:

code:
(push 'delete-trailing-whitespace before-save-hook)

Police Academy III fucked around with this message at 23:46 on Jul 9, 2012

Johnny Cache Hit
Oct 17, 2011

Police Academy III posted:

code:

(push 'delete-trailing-whitespace before-save-hook)

:respek:

I knew there was a way... thanks, this will save me from pain and suffering tomorrow.

shrughes
Oct 11, 2008

(call/cc call/cc)

Kim Jong III posted:

:respek:

I knew there was a way... thanks, this will save me from pain and suffering tomorrow.

I'm more a fan of (setq-default show-trailing-whitespace t), but that's because my coworkers are the ones adding it from time to time and I don't want to muck up the codebase with merge conflicts.

Zombywuf
Mar 29, 2008

shrughes posted:

I'm more a fan of (setq-default show-trailing-whitespace t), but that's because my coworkers are the ones adding it from time to time and I don't want to muck up the codebase with merge conflicts.

Merge early, merge often.

pgroce
Oct 24, 2002
Glad this thread's still in action.

Inspired by Sacha Chua, I redid my .emacs as an org-mode file. I figured I'd like it for the ability to better describe what's going on, but the real win is applying an outline structure to my code and navigating everywhere quickly. I kind of wish I could do all my coding this way, just for that.

baby puzzle
Jun 3, 2011

I'll Sequence your Storm.
How do I prevent ctrl-backspace from clobbering the clipboard? Every time I correct a typo I lose my clipboard.

Zombywuf
Mar 29, 2008

baby puzzle posted:

How do I prevent ctrl-backspace from clobbering the clipboard? Every time I correct a typo I lose my clipboard.

Well if you're talking about within emacs you have access to your clipboard history, C-y will paste the clipboard contents, M-y will replace that with the previous contents. Repeated M-y will cycle through the history.

pgroce
Oct 24, 2002

Zombywuf posted:

Well if you're talking about within emacs you have access to your clipboard history, C-y will paste the clipboard contents, M-y will replace that with the previous contents. Repeated M-y will cycle through the history.

You can also type C-u and a number n followed by C-y to paste the nth most recent thing you cut/copied. If you're using the menu, one of the options in the Edit menu (can't remember which and I'm on my phone) will let you paste anything from the last several things you copied.

pgroce
Oct 24, 2002
Double posting because I Did A Thing:

I often find myself wanting to run a quick shell command in the directory where (or close to where) my buffer lives. dired and compile-mode take care of most of these use cases, but not all. So I wrote a little function to rapidly deploy and destroy shells:

Lisp code:
(defun pg/make-or-destroy-temporary-shell ()
  (interactive)
  (if (string-match-p "^temp-shell" (buffer-name))
      (let ((kill-buffer-query-functions '()))
        (kill-buffer))      
    (shell (concat "temp-shell (" (buffer-name) ")"))))

(global-set-key (kbd "s-s") 'pg/make-or-destroy-temporary-shell)
It's nothing earth-shattering, but I've already used it four or five times in the last half-hour. It's awesome how little tweaks like this can make your life better.

e: Removed redundant repetitiveness.

pgroce fucked around with this message at 19:41 on Jul 20, 2012

Catalyst-proof
May 11, 2011

better waste some time with you
So I've slunk back to Gnus for most of my email needs, because it's regex-based splitting is loving amazing. I've also torn out offlineimap+dovecot because I'm sick of having to deal with the complexity. Is there a way to keep Gnus up-to-date without locking up all of Emacs with a configuration like this?

Adbot
ADBOT LOVES YOU

pgroce
Oct 24, 2002

WHOIS John Galt posted:

So I've slunk back to Gnus for most of my email needs, because it's regex-based splitting is loving amazing. I've also torn out offlineimap+dovecot because I'm sick of having to deal with the complexity. Is there a way to keep Gnus up-to-date without locking up all of Emacs with a configuration like this?

No one else has chimed in with an answer, to my disappointment. I can't fix this, but I work around it with a mail notifier (MacBiff) and just hit 'g' when I care to see the contents of the mail. Other people I know run a separate copy of Emacs just for Gnus so gnus-agent doesn't block their system. Personally, I can't give up a shared kill ring, so MacBiff it is.

  • Locked thread