This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-07-24
Channels
- # announcements (2)
- # aws (2)
- # babashka (1)
- # beginners (87)
- # boot (1)
- # calva (42)
- # clj-kondo (18)
- # cljdoc (5)
- # cljsjs (1)
- # cljsrn (1)
- # clojars (16)
- # clojure (222)
- # clojure-dev (30)
- # clojure-europe (17)
- # clojure-gamedev (2)
- # clojure-hungary (10)
- # clojure-italy (6)
- # clojure-nl (21)
- # clojure-spec (9)
- # clojure-uk (111)
- # clojuredesign-podcast (1)
- # clojurescript (99)
- # code-reviews (1)
- # conjure (18)
- # cursive (11)
- # datomic (22)
- # emacs (1)
- # events (3)
- # figwheel-main (3)
- # fulcro (14)
- # graalvm (41)
- # graphql (16)
- # helix (12)
- # juxt (1)
- # kaocha (56)
- # keechma (1)
- # meander (77)
- # observability (1)
- # off-topic (29)
- # pathom (3)
- # re-frame (4)
- # reagent (3)
- # reitit (1)
- # remote-jobs (3)
- # reveal (9)
- # shadow-cljs (45)
- # spacemacs (43)
- # sql (28)
- # tools-deps (14)
- # vim (1)
- # xtdb (26)
- # yada (1)
Hi, i need a suggestion, i am getting some events, i want to be able to search and visualize the events(aggregate query) should i store those events in db, or in file or somewhere different at all?
What's the preferred way to automate opening buffers, splitting frames, running commands, etc. in emacs like split-pane, select-pane, send-keys, etc. in tmux? I'm not looking to save some random state to go back to it later, nor are these things confined to a project.
Emacs has a programming language elisp that can do all these things. So you can write an elisp program that opens files, selects buffers, splits windows, etc and then just tell emacs to evaluate it
Thanks @U0NCTKEV8. There's a better description of what I'm after in this thread https://clojurians.slack.com/archives/C03RZGPG3/p1595604170447100
Thanks @U050SC7SV but I'm not looking to replace tmux. I want tmux like scripting capabilities in emacs. I want to automate the opening of emacs buffers, splitting frames, running emacs lisp commands, etc. but in emacs lisp
I don't know if I am missreading too, but in elisp you have functions like split-window-{vertically,horizontally}
, new-frame
, generate-new-buffer
and you can execute shell commands using several options like shell-command-to-string
I'm hoping I don't have to write much. I'm hoping there's a package out there that can do most of this already. For example, I want to split emacs into two halves C-x 3
, select the right most window, open a file over tramp, run cider-jack-in
, select the left most window, run an elisp function I wrote to expand the window width, then open a file, then run C-c k
to eval the buffer in the repl.
maybe this can help: https://github.com/bbatsov/crux
That looks like its mostly centered around editing. I'm looking for something higher-level. A generic way of saying "select this window and run these keystrokes." I'm not looking for a set of interactive commands, but rather something that takes some sequence of instructions that I have stored in a .el start-up script and runs them on command. I want to be able to type M-x start-clojure-devel
where I say, most likely in .dir-locals.el, start-clojure-devel
means run the sequence of commands listed above
Running keystrokes is not the way to think about it, keys are generally bound to run some elisp function, when you are automate things you don't send keystrokes (you can but typically don't) you just call the elisp functions directly
Not everything associated with a keystroke has a similar function that can be called programatically
https://gist.github.com/d4c507478430274ccf07de735632454a is a setup.el I have for a project that sets up the window like I want for that project and fiddles with opacity and font sizes
I thought everything in Emacs with a keystroke did have a function that can be called programmatically?
If I type C-h k <keystrokes>, for example C-h k C-x 3, I see a buffer appear that starts with the text "C-x 3 runs the command split-window-right ..."
And split-window-right is a function that can be called in Elisp code.
Here is a simple Elisp function I wrote that is loaded from my init.el, and I bind a function key that when pressed, executes that function: https://github.com/jafingerhut/dotfiles/blob/master/link/.emacs.d/lisp/fn-key-bindings.el#L18-L24
You're probably right @U0CMVHBL2. But how does that function know which window to split? Isn't that determined by which window was active when the keystrokes were entered?
The rest of the documentation that appears when I type C-h k C-x 3 includes this text:
Split the selected window into two side-by-side windows. The selected window is on the left. The newly split-off window is on the right and displays the same buffer. Return the new window.
I am pretty sure that "the selected window" is accessible via either an Elisp function, or perhaps some global Elisp variable, and it is updated by whatever operations cause the selected window to change.
I haven't used them before, but I believe there are Elisp functions to list all buffers, create new ones, delete buffers, etc., and all of those are what are used to implement the behaviors you get when you enter the appropriate key strokes that do those things.
That's good news, thanks. But this is sounding like a much bigger project than installing a package and setting a few things. 😞
Oh, I'm aware. I just don't consider myself one of them. hahaha 🙂 Besides maintaining my own setup for decades https://github.com/carrete/.emacs.d I still consider myself an emacs newbie