Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Great idea! #3

Closed
carcot opened this issue Nov 26, 2021 · 9 comments
Closed

Great idea! #3

carcot opened this issue Nov 26, 2021 · 9 comments
Labels
question Further information is requested

Comments

@carcot
Copy link

carcot commented Nov 26, 2021

Hi, this is a great idea and something I've kicked around myself but didn't know how/have the time to start approaching it. I have made many extensions for myself of Lispy and have given this a lot of thought and time coding. How much do you think of combobulate as a generalization of Lispy? One thing in particular that I've thought about is how one might implement a Lispy-like 'special mode' for non-Lisp-like languages so that one doesn't have to explicitly invoke a structural editing mode and can save keystrokes. For Python, for example, something similar to Lispy is possible because of the explicit indentation. Anyway, I haven't tried combobulate out (I will soon) or looked at the code yet, but I am interested in contributing ideas and code if they would be compatible with your conception of the project.

@mickeynp
Copy link
Owner

I'll talk about general philosophy of combobulate soon on my blog as it warrants a deep dive. There's a million ways to approach this, I think, and your point about not wanting a "specialised editing mode" for doing changes is valid, I think, because I although that should probably exist, I want the natural flow of Emacs keybindings around movement and editing to keep working.

There's also a lot to be said about how strict or loose the commands should be in terms of preventing you from doing things. Currently few such checks are in place as there are no such checks in paredit either; if you want to do silly things you can --- and you can always undo.

I recommend you try it out in Python and navigate with C-M-u/d, C-M-p/n, M-h (to mark), and M-k (to kill) to get a feel for the basics.

@mickeynp mickeynp added the question Further information is requested label Nov 26, 2021
@carcot
Copy link
Author

carcot commented Nov 28, 2021

Thanks for your response. I agree with everything you wrote. There is a related question to the strictness/looseness question you mention regarding code formatting. (I use aggressive-indent when editing Lisp) Also, if you somehow end up with non-syntactically correct code, how easy is it to fix? In Lispy, I sometimes end up having to use comments to insert or delete extra parentheses. 😊 🙁

I find the conception of Lispy to be brilliant, and the longer I've used structural editing, the more I find myself wanting and expecting all editing commands to respect and take advantage of the syntax. For example, I used to love using C-k to delete and move lines, and now it just feels inefficient, unsafe, and like I'm butchering the code. Same with (un-)commenting by lines or blocks.

Thanks again, and I'll try it out and get a feel for it in Python.

@carcot
Copy link
Author

carcot commented Dec 5, 2021

I tried installing combobulate by running
git clone https://github.com/mickeynp/combobulate.git
in my ~/.emacs.d directory and then putting

  (use-package combobulate
    ;; Ensure `combobulate-mode` is activated when you launch a mode it supports
    :hook ((python-mode . combobulate-mode)
           ;; (js-mode . combobulate-mode)
           ;; (typescript-mode . combobulate-mode)
           )
    :load-path "~/.emacs.d/combobulate"))

in my init.el file, but I'm getting the error

Debugger entered--Lisp error: (error "Could not find package combobulate. Updating recip...")
... (etc.)

I don't know the finer points of use-package, and I'm actually using straight.

I've done some web searches and haven't found a fix. Do you happen to know how to resolve this problem?

@mickeynp
Copy link
Owner

mickeynp commented Dec 6, 2021

@carcot, I can't comment on why that won't work in your Emacs, but if you prefer straight, by all means use that :) Do submit a pull request to the README when you have it. It'd be good to add that to the list of install options

@gcentauri
Copy link

@carcot - did you happen to figure it out? the error posted looks like straight is trying to find a recipe maybe from MELPA or something. i've got my main config with straight and would be happy to help figure out what is going awry :)

@mickeynp - excited to see your latest endeavor. i've been using the xah-fly-keys modal map, but thinking about how some more "targeted" structural editing would potentially be better. I may try this out and see if i can adapt it to Ruby. i actually came here today because I was reading your article about discoverability in Emacs, something which I've been tackling in a very similar way using transient. i think it could be cool to have some kind of Emacs task force of folks interested in improving discoverability. transient is in ELPA now, so its easily available to folks even without setting up any additional package repos :) anyway, this is very off topic for this issue now, but i wanted to say thanks for all your efforts educating your fellow Emacs users

@carcot
Copy link
Author

carcot commented Jan 3, 2022

@gcentauri - no, I didn't, and if you were able to help, I'd greatly appreciate it. I suspect you're right. My problem is that although I use straight, I only understand it well enough to use it instead of use-package. (That's not even true, but at least I was able to get it working.) What would you suggest I try first?

@gcentauri
Copy link

gcentauri commented Jan 3, 2022

@carcot - well so far i've got this,

  (straight-use-package
   '(combobulate :type git :host github :repo "mickeynp/combobulate"))

and managed to get straight to clone and build the package. however, i'm not getting any of the combobulate functions loaded in my emacs and if i try to evaluate combomulate.el i am missing tree-sitter-langs dependency. i installed that with straight manually, and now it appears that combobulate-mode shows up for me.

i don't have time at the moment to test drive it, but maybe that will get you started!

@carcot
Copy link
Author

carcot commented Jan 9, 2022

@gcentauri - Following your advice, I added

(use-package tree-sitter)
(use-package tree-sitter-langs)
(straight-use-package
 '(combobulate :type git :host github :repo "mickeynp/combobulate"))
(load (concat user-emacs-directory "straight/repos/combobulate/combobulate.el"))

to my config, and everything loads. I don't know why I needed the last line, though. (Any ideas?)

But I can play with it now. Thanks!

@mickeynp
Copy link
Owner

mickeynp commented Feb 1, 2023

Things have now changed substantially in master, so I am closing this issue. Thanks all.

@mickeynp mickeynp closed this as completed Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants