4 ms·
I would, as well. Very neat idea and I'm in a Discord server where I'd get some utility from this sort of thing.
by scruple 3y ago
I would, as well. Very neat idea and I'm in a Discord server where I'd get some utility from this sort of thing.
- julianeon 3y agoHere's the meat of it. First, you have an API or something which is piping text into your terminal - in this case, into eshell. Like for example let's say it's churning out lines like this: "big vote in berlin" https://cnn.com/vote-in-berlin https://cnn.com/vote-in-berlin I move my cursor over the text - remember, this is in emacs in eshell, I can modify the text there - and change the line to read: "big vote in berlin" (opyn https://cnn.com/vote-in-berlin https://cnn.com/vote-in-berlin) I move my cursor after the parenthesis and type C-x C-e. In my .emacs file I've defined this function: (defun opyn (arg) "Open local file in Firefox" (interactive) (let ((filearg (concat "file:///home/julian/Lang/Python/Something/" arg ".html"))) (shell-command (concat "chromium " filearg))) (message "opened file") ) Now it opens that file. But probably what you want to do is process the data in the text. So here's my emacs function for this (not the code for the data processing itself which was done in Python, separately - but see how you can go combine those together). (defun refresh (arg) "Rerun local file creation & open in Firefox" (interactive) (let ((filearg (concat "ruby project_refresh_emacs.rb " arg))) (shell-command filearg)) (message "refreshed file for you") ) That's pretty much it. Hope that helps.