Fork me on GitHub
#spacemacs
<
2018-01-04
>
naomarik00:01:22

spacemacs tends to lockup daily for me, mostly when i’m connected to a repl

romain00:01:06

sometimes I get lost on what I've opened and what's currently running. So I just quit & restart ^^

jeff.terrell01:01:54

I keep mine going for a while because I've gotten used to layouts and can't reliably restore a layout across a restart. Specifically, I have an exocortex layer with all my org files as well as the *Org Agenda* buffer. But that buffer isn't tied to a file, so Spacemacs can't open it automatically upon start or upon layer load.

ag06:01:53

why don't you modify org layout, so the files you need will open automatically when you do spc l o o

jeff.terrell15:01:26

Hmm, I didn't know about SPC l o o…interesting. It took me a while to find any documentation for it. The manual says: > Custom perspective containing all the =org-agenda= buffers Do you know what "org-agenda buffers" are? Does it mean all of the files in the org-agenda-files variable? Because it only ever seems to open my file, whereas the variable also has my file in it.

ag18:01:49

yes, mine is set to (setq org-agenda-files "~/org/.agenda-files") it's a file where I list all my files that I want to contribute to the agenda, whenever I open agenda ALL those files get open automatically

ag18:01:46

yeah, custom layouts are dope, so for example, just a few days ago I realized that I keep creating a layout for the project I've been working on. So I did this:

(spacemacs|define-custom-layout "@finops-admin"
    :binding "f"
    :body (find-file "~/DevProjects/finops-admin/project.clj"))
now, every time I do spc l o f - it jumps to my project layout. niiiice

jeff.terrell20:01:00

I had org-agenda-files set properly, but with a list instead of a file. I changed it to be a file like yours, but the layout still doesn't open both of the files I have listed in the file. It opens the first file then stops. If I swap the first and second lines, the new first one is the one opened. In that layout, no other buffers are listed with SPC b b. Nothing is printed in *Messages*. Dunno what the problem is, but oh well… Might have to look into custom layouts. Maybe that would solve my problem here. Thanks!

ag20:01:29

it is strange that it wouldn't open files in agenda list

ag20:01:44

are they in a single dir or scattered?

ag20:01:55

what org-directory is set to?

jeff.terrell20:01:19

A single directory, and indeed, they're all in the same directory as what org-directory is set to.

ag20:01:05

maybe something wrong with the one of the files? try unleashing org-lint on them. yup, that is a thing

jeff.terrell21:01:23

Ooh, I'll try that!

jeff.terrell21:01:43

A couple of warnings about unknown fuzzy locations (probably because I archived some items that there were links targeting), but nothing major for either file. Good guess though!

jeff.terrell01:01:15

Current uptime: 7 days.

ag07:01:57

Does anyone know how to tweak auto-highlight-symbol.el so when I do * while cursor on foo, it would select everything "foo-related", :foo, ::foo/bar, foo/bar, zap/foo ?

pesterhazy09:01:13

@ag, oh yes, tweaking * is very high on my list of things I'm missing in spacemacs (or — more likely — haven't discovered the right option for yet)

ag18:01:04

interestingly I have discovered this yesterday. if you press * and it won't show any symbols (since it won't recognize :foo, foo/bar, etc.) but then, you press esc, and then n - it suddenly shows them (like if you do search with / vim command

ag18:01:08

¯\(ツ)

ag18:01:20

it's not ideal, but it kinda works

ag18:01:17

I would love though to find a more "natural" fix to this problem, then toggling SPC t h a - would work too

ag18:01:58

digging more into this problem I realized a few things: 1) CIDER guys have an open ticket https://github.com/clojure-emacs/cider/issues/1461 And it doesn't seem to be of high priority. Also I doubt that will work with Spacemacs out of the box. AFAIK none of the CIDER maintainers use Spacemacs 2) auto-highlight-symbol.el being published on MELPA is the fork of very old and kinda outdated package, and clojure is not in the list of "officially" supported modes. see ahs-modes var 3) Maybe one needs to tweak ahs-default-symbol-regexp. I tried to figure out correct regexp, but I have failed

pesterhazy09:01:45

it's infuriating close to being super useful, but the last missing 20% break it for me

pesterhazy09:01:04

essentially you want to tweak what * considers word boundaries, right?

vuuvi15:01:19

Re: the uptime discussion: it’s interesting that you guys update often. I usually don’t like restarting because of the overhead it requires to get my repl back to a productive state, meaning I have lots of let expressions I need to run as well as defs mocking config input

ag18:01:08

BTW, thank you guys for upvotting the small PR to improve g d for clojure modes. It's now merged on develop branch and it jumps to definition (even if you don't have CIDER running). But. CIDER guys just added C-C C-: for keywords. But that binding is soooo inconvenient. You have to: a) realize you want to search for keyword b) you have to hold Ctrl, then press C, then hold Ctrl with Shift and press ; - completely awful so I'm thinking this can be improved and baked into g d...

ag18:01:07

Although the binding is inconvenient (I'm glad at least we have that now) - unlike Cursive users

ag19:01:36

Damn it, I don't understand why this:

M-x clj-find-usages

To perform this op the project needs to be evaluated.
  Analyzing a large project might take a while: hit C-g to abort.
  (Set cljr-warn-on-eval to nil to analyze the project without warning)
  Do you want to proceed? (y or n) y
error in process filter: cljr--maybe-rethrow-error: Only .clj files are supported!
Only .clj files are supported! But why? What's the semantic difference between .cljs, .clj and .cljc in this case? sigh... I guess I will never be able to tell my Cursive using colleague that CIDER is better

eggsyntax19:01:20

IIRC (questionable in this case), there's an open issue or comment thread somewhere talking about what it would take to do the generalization to cljc + cljs, and it didn't look all that huge for most of it. Probably just a matter of someone committing some time to it.

eggsyntax19:01:14

#72 looks probably outdated.

eggsyntax19:01:43

I got a glance at some of that when I worked on https://github.com/clojure-emacs/clj-refactor.el/issues/394 , but it was pretty tangential.

ag19:01:55

> Probably just a matter of someone committing some time to it sigh... if only I wasn't so lazy and stupid. Alas I'm all of those things

eggsyntax19:01:44

Right there with you 😄

eggsyntax19:01:06

Or: busy and imperfect, on my good days 😉

gzmask19:01:41

any good workflow for 1.9 cli in spacemacs? I can't even get it running inside eshell

gzmask19:01:46

also, what is the quickest way to change [...] to {...} ? such as paren-surround shotcuts?

chris19:01:16

c-hange s-urrounding [-square brace }-to curly brace

chris19:01:50

note that the direction of the second brace actually matters, the opening brace/paren version (so [{() leaves a space

chris19:01:04

the closing brace/paren does not leave a space

chris19:01:34

the plugin is called evil-surround and is based on tpope's vim-surround if you need googleable things

gzmask19:01:54

perfect, works

vuuvi19:01:05

do you guys have any thoughts on literate programming? I’m currently exploring the idea of writing code in org mode files, as a way to organize my thoughts or provide a way to keep notes and thoughts organized as I move through code writing

ag19:01:54

I personally think literate programming generally is a bad idea. Unless you have a personality disorder and your second personality calls himself Professor Donald Knuth and wants to write series of books about programming

ag19:01:18

However... there are cases where org-mode's babel is sooooo dope. I love it

vuuvi19:01:28

what makes you say that ag?

vuuvi19:01:42

and what use cases do you have where babel is so dope?

ag19:01:00

I use it to manage my dotfiles...

ag19:01:40

managing configuration of ALL the stuff on my machine is in a single file now, and it's documented and it can even encrypt things

ag19:01:58

like putting sensitive stuff in ~/.authinfo.gpg. And you can use the same mechanism of restoring config from a backup on all the systems (in my case linux and osx)

ag19:01:55

Also org-mode is perfect way to use for showcasing/testing/documenting an API

ag19:01:26

using restclient you can on the fly poke remote endpoints

vuuvi19:01:44

wow those are both really cool ideas

vuuvi20:01:14

I have seen demos of people using org mode for their .spacemacs

ag20:01:49

yeah, I've seen people having their entire emacs configs in a single .org file

ag20:01:33

using org-mode for my dotfiles finally made me stop worrying about things scattered across my machines. Nothing else I tried before made it so simple yet very flexible. One day my work laptop has died. I've given a new machine. It took me like ten minutes to get everything restored back as I had on my previous.

chris20:01:29

so do you have babel tangle to a bunch of different files then?

ag20:01:14

and you can "stich" files together with multiple things. For example you can have section * public git where you tangle into /.gitconfig and then section * private where you still tangle into /.gitconfig, but this time more sensitive stuff

ag20:01:42

you can do it for different machines like this:

#+begin_src gitconfig :tangle (when (eq system-type 'darwin) "~/.gitconfig")
    [gpg]
      program = /usr/local/MacGPG2/bin/gpg2
  #+end_src
  #+begin_src gitconfig :tangle (when (eq system-type 'gnu/linux) "~/.gitconfig")
    [gpg]
      program = /usr/bin/gpg2
  #+end_src

ag20:01:40

if you need to create nested directories and then a file, you can use :mkdirp yes

#+begin_src  sh :tangle (when (eq system-type 'darwin) "~/.gnupg/gpg-agent.conf")  :mkdirp yes
    pinentry-program /usr/local/MacGPG2/libexec/pinentry-mac.app/Contents/MacOS/pinentry-mac
  #+end_src

ag20:01:01

you can encrypt things:

#+begin_src emacs-lisp :tangle ~/.authinfo.gpg
# -*- epa-file-encrypt-to: ("") -*-

machine  login agzam^magithub password MYPASS
machine  login ilemming force yes password MYPASS

#+end_src

chris20:01:33

I hadn't thought about putting everything in one file. I've seen other people rewriting their .spacemacs file into org and I didn't really understand the point, but the idea of having one master file to handle all of my dotfiles is incredibly appealing

ag20:01:14

you can always split things into multiple files. Org can "include" other files

ag20:01:42

and it will still have a single "entrypoint" from where you run babel-tangle

chris20:01:06

I just have a ton of configs everywhere and I recently got a new machine and realized that my dotfiles were not up to par

chris20:01:14

I still don't have the new machine setup correctly

ag20:01:26

Oh, my dotfile is like 3000 lines or something. And I always know where things are

vuuvi20:01:41

phew that’s intense hahah

ag20:01:58

too bad I can't share it - it has way too much to reveal

vuuvi20:01:02

how did you learn about using babel ag?

vuuvi20:01:10

and maybe you can try to anonymize it? that would be super helpful

ag20:01:40

> how did you learn about using babel ag? there's not much to learn. Just create an .org file, add some source blocks something like I showed above, run M-x org-babel-tangle and voila

ag20:01:36

the only thing I couldn't figure out is how to set the correct permissions after the files get created. I kinda did it with a hacky workaround - an elisp function and post-babel-tangle hook

ag20:01:58

I wish there was a simpler way though

jeff.terrell20:01:57

Here's an example of using org-mode for emacs config. https://github.com/cndreisbach/emacs.d

jeff.terrell20:01:09

Haven't gone down that path myself.

ag20:01:58

and guys, totally check this thing out... it's amaaazing... https://github.com/zweifisch/ob-http

ag20:01:30

and guess what? the only thing you need to do is to add restclient layer

vuuvi20:01:31

what did do you to the configs of all of the apps? Was that annoying to change so that the dotfiles was all this one file?

ag20:01:19

au contraire, having it in a single file is absolutely cool sorry, got the question wrong: no, it wasn't very difficult to gather things. You can do it piecemeal way - just every single time you want to change config of anything on the machine, instead of doing it directly in a related file, do it in your http://dotfile.org

ag20:01:43

it's easier to find things, easier to manage the changes - "diffing"

ag20:01:55

easier to update things

ag20:01:43

it's kinda close to Clojure's core philosophy - your entire machine's configuration is immutable

ag20:01:05

every time you do org-babel-tangle, you unroll new configuration

vuuvi21:01:58

that makes a lot of sense

vuuvi21:01:08

do you use your org mode file to create all the configs?

jeff.terrell20:01:40

:thinking_face:

ag20:01:23

I hope you see how awesome babel is. Now to the sad part. Unfortunately, it's kind of PITA to make it work with Clojure. And even more so with Clojurescript. I've been thinking about finding a way to make it work with Lumo and create something like ob-lumo.el or whatever

ag20:01:55

but again. I'm not just stupid or lazy. I'm both of those things ;(

vuuvi20:01:51

that’s super cool, thanks for showing us babel. I’m glad this whole conversation kicked off!

vuuvi20:01:37

also you never explained your distaste for literate programming, it seems like it makes sense!

ag21:01:13

well, literate programming I think is not suitable to solve business problems.

vuuvi21:01:41

that makes sense. I’m really more interested in it for myself though. There’s always a big difference between OSS / personal programming and professional code writing

ag21:01:15

I mean it's probably possible to use org-babel in a small team where everyone agree's to use it. And manage documentation/tests in that format

ag21:01:12

but that's very unusual and it makes hard to replace team members if they decide to leave.

ag21:01:53

but one may argue - same is true for Clojure, or any piece of tech

ag22:01:36

Org is truly amazing, but I wish it was ported outside of Emacs. Vim has flaky version of it, but that's not enough. It would've been awesome to see people using Org-mode in Atom, VSCode, Intellij

vuuvi22:01:06

haha We are currently having that problem with our team. If you have any clojure experience, that’s a HUGE plus

vuuvi22:01:45

Yeah Org mode really should become more of a thing in other places. However, it’s also nice that it’s a secret? of emacs users? like it’s the kind of thing that helps keep me in the emacs system and loving it

ag22:01:50

Not really. Because majority of people have no idea about existence of org, or cannot use it without learning Emacs they have to invent all sorts of markdown flavors, tools for note keeping, todo lists, blogging engines, publishing tools, etc, etc.

vuuvi22:01:06

yeah that’s a great point. FWIW the last markdowny notes taking thing I saw on HN all of the comments were about org mode