Zulip Chat Archive

Stream: general

Topic: emacs users


Simon Hudon (Jun 08 2019 at 20:23):

Hello fellow emacs user(s)! I have just put a package yasnippet-lean up on melpa. Feel free to contribute other snippets if I missed any. https://github.com/leanprover-community/yasnippet-lean

Jesse Michael Han (Jun 09 2019 at 06:27):

we added some more features! a GIF is worth a thousand words: yasnippet-lean-test.gif

Mario Carneiro (Jun 09 2019 at 06:29):

The suffices formatting doesn't make sense for tactic mode

Mario Carneiro (Jun 09 2019 at 06:30):

not sure whether you can do something about this without lean server giving you more info

Jesse Michael Han (Jun 09 2019 at 06:32):

i think snippets can execute arbitrary elisp so it might be possible to accommodate that

Jesse Michael Han (Jun 09 2019 at 06:42):

i think the only indicator of whether or not you're in tactic mode is that the replies to info requests include a formatted tactic_state iff you're in tactic mode... so it might be a bit of a hack to implement

Gun Pinyo (Jul 16 2019 at 10:47):

I am having a problem with expand-region and lean-mode
basically if I have "abc.def_gh" and put the cursor at "e", expand the region once we should get "def" then "def_gh" then "abc.def_gh" however, in my case, it goes from "e" to "abc.def_gh" directly. This is very wired since lisp-mode and text-mode agree on the correct behaviour.

Is there anyone has the same problem?

Kevin Buzzard (Jul 16 2019 at 11:15):

Hardly anyone here uses emacs for Lean (which is funny in my case because I use it for everything else). We could try pinging @Reid Barton

Patrick Massot (Jul 16 2019 at 11:16):

Sebastian also uses it

Sebastian Ullrich (Jul 16 2019 at 11:37):

Unfortunately I don't use expand-region

Kevin Buzzard (Jul 16 2019 at 11:41):

...because you broke it? :P

Yury G. Kudryashov (Jul 16 2019 at 11:52):

I use Lean with Emacs but don't use expand-region

Yury G. Kudryashov (Jul 16 2019 at 11:55):

I can try it tomorrow

Jesse Michael Han (Jul 16 2019 at 13:35):

I am having a problem with expand-region and lean-mode
basically if I have "abc.def_gh" and put the cursor at "e", expand the region once we should get "def" then "def_gh" then "abc.def_gh" however, in my case, it goes from "e" to "abc.def_gh" directly. This is very wired since lisp-mode and text-mode agree on the correct behaviour.

Is there anyone has the same problem?

this might be because there expand-region has mode-specific expansions for lisp-mode and text-mode which aren't enabled in a lean-mode buffer. you might be able to get away with copying whatever configuration is there for lisp-mode and changing lisp-mode to lean-mode

Gun Pinyo (Jul 16 2019 at 15:54):

I am having a problem with expand-region and lean-mode
basically if I have "abc.def_gh" and put the cursor at "e", expand the region once we should get "def" then "def_gh" then "abc.def_gh" however, in my case, it goes from "e" to "abc.def_gh" directly. This is very wired since lisp-mode and text-mode agree on the correct behaviour.

Is there anyone has the same problem?

this might be because there expand-region has mode-specific expansions for lisp-mode and text-mode which aren't enabled in a lean-mode buffer. you might be able to get away with copying whatever configuration is there for lisp-mode and changing lisp-mode to lean-mode

I have searched the entire expand-region repository but it doesn't mention lisp-mode at all. The functionality is there by default. Even I state explicitly, it doesn't work.

Jesse Michael Han (Jul 16 2019 at 16:10):

that's odd, maybe expand-region queries something else which does change depending on the current mode

Jesse Michael Han (Aug 27 2019 at 18:07):

for the convenience of other emacs users of lean-mode, i've made a gist available with my lean-mode customizations here

Alexandre Rademaker (Sep 21 2019 at 15:48):

It is annoying that if you use C-c C-b to see message boxes, if a command is followed by a comment, the message is inserted after it

Reid Barton (Sep 21 2019 at 19:58):

You can work around this by ending the command with a .


Last updated: Dec 20 2023 at 11:08 UTC