Comments (14)
@petrosb your feature is ready as a configuration!
Get the latest from master
curl -fsSL https://raw.github.com/zachcurry/emacs-anywhere/master/install | bash
Add the second line below the comment in ~/.emacs_anywhere/config
# Your configs go here
export EA_SHOULD_COPY=true
Cheers!
from emacs-anywhere.
Great script, btw. Very useful!
from emacs-anywhere.
Hi, @petrosb 👋 !
I like it! I need to separate the Elisp from the Applescript and put it all together in a build step. Then, we can put things like this into their respective script files where one can uncomment some lines to enable certain functionality.
I'll work on cleaning this thing up as I've described. Then, it should be easier to add to via pull requests. Stay tuned...
from emacs-anywhere.
A quick follow-up:
Is there a way to paste the copied text into new *Emacs Anywhere*
buffer automatically?
from emacs-anywhere.
@feigaoxyz no. It seems like a nice compliment to this feature though! Do you think we should add it?
from emacs-anywhere.
I do think so. And that's actually PO proposed.
I mean, the whole purpose to select some text and copy to clipboard before invoking this tool is to have it shown in the buffer, right?
from emacs-anywhere.
p.s.
I think the names EA_SHOULD_COPY
and EA_SHOULD_PASTE
need some work, as they are not so self-explain and README does not make them clear.
from emacs-anywhere.
I think you mean OP and I agree after rereading his/her post that he/she intended for the text to appear in the buffer. I must have glanced at the title when I added this late last night. Also, the README and the names of these options are probably less than ideal like you say.
from emacs-anywhere.
Haven't had a chance to try the latest version, but to clarify the OP's comment (:-P), the script I provided above copies the selected text from the app upon activation using
keystroke "c" using command down -- copy before launching emacs; the yank later pastes it in emacs
and then when the emacs anywhere buffer is activated is using
(yank)
to copy the text from the clipboard into the buffer. Thus, when the script is run, the Emacs window will contain the selected text, ready to be edited.
In hindsight, something I did not consider is what happens if no text is selected, so the Command-C does nothing, and there is old text in the Clipboard. In a quick test I just performed, the old text appears in the window, which might not be desired behavior. If I haven't selected something, I would expect the Emacs Anywhere buffer to be empty (not sure how to fix that easily). For me, it's an acceptable trade-off for now, but you might feel otherwise.
PS. Apologies for nod properly making the code in the original ticket look like code... Don't use github tickets/comments very often, so I completely missed this.
from emacs-anywhere.
Thanks @petrosb ! I messed up and I didn't see the part where you call (yank)
. No apologies necessary. I'll see if I can think of a good way of handling the implementation concerns you've brought up because they are totally valid.
from emacs-anywhere.
@petrosb I think Emacs Anywhere will let you do this now. In fact, I think you can do anything with it now 😎
Have a look at the README. A lot of things have changed lately.
Let me know if you have any questions 😄
from emacs-anywhere.
Looks like the original complaint still doesn't work:
Would be nice if I select something in the text box before opening emacs to have it appear in the emacs buffer so I can edit it before pasting again.
from emacs-anywhere.
@m-cat I have something close to this in my config, this may be of interest: https://tecosaur.github.io/emacs-config/config.html#emacs-anywhere-configuration it pastes the last/active selection (it's hard to tell if which), and deletes the buffer content if the first keystroke is backspace.
from emacs-anywhere.
I have a working version of this functionality for linux, see https://github.com/DanielRichtmann/emacs-anywhere
from emacs-anywhere.
Related Issues (20)
- Do not hardcore installation directory HOT 3
- Does not work with the freecodecamp editor HOT 2
- Does this work on mojave? HOT 4
- Question: How to launch under cursor? HOT 6
- Populate the buffer with the current contents of the textarea HOT 6
- More robust pasting HOT 1
- How to define my keyborad shortcut HOT 1
- README should be more clear about where to put configuration
- Paste not working when there is a physical key pressed HOT 1
- Mac
- Macos HOT 1
- Would you recommend an especific keybinding (shortcut) on macOS?
- Is emacs-anywhere compatible with tiling window managers?
- Is it really necessary to use `C-x 5 0`? Why can't I use classic `C-x C-x` to quit? HOT 2
- Please, package this for NixOS
- Is it possible to configure emacs-anywhere with Karabiner-elements instead of setting a hotkey via the GUI SystemPreferences/keyboard/shortcuts/services/general?
- Feature request: save content of frame on kill ring before it is deletion
- Feature request: bring content already written on the text box to the frame created by Emacs Anywhere
- Thank you
- trouble on ubuntu 22.04
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from emacs-anywhere.