Code Monkey home page Code Monkey logo

Comments (5)

abo-abo avatar abo-abo commented on May 28, 2024

Can't reproduce. I get a Undo in region! message instead and
everything is fine. Could be an issue with Emacs version or a clash
with a package that I don't have.

Try to reproduce it with a minimal config:

emacs -Q -l config.el

Here's the contents of config.el (just customize your package dir):

(setq package-user-dir "~/Dropbox/source/site-lisp/elpa")
(package-initialize)
(mapc (lambda (h) (add-hook h (lambda () (lispy-mode 1))))
      '(emacs-lisp-mode-hook
        lisp-interaction-mode-hook
        clojure-mode-hook
        scheme-mode-hook
        lisp-mode-hook))
(lispy-mode 1)

from lispy.

wrachwal avatar wrachwal commented on May 28, 2024

Emacs is 24.4 compiled from source. This time with minimal config, as suggested.

(defun list-of (n elt)
  (if (zerop n)
      nil
      (cons elt (list-of (- n 1) elt))))

Run commands => q g m w s C-/

(defun list-of (n elt)
  (if (zerop n)
      nil
      (cons elt (list-of list-of elt))))

Got "Undo in region!" and resulting buffer looks like above (note: list-of list-of). Is it expected?

from lispy.

wrachwal avatar wrachwal commented on May 28, 2024

Originally I had C-/ bound to undo-tree-undo from undo-tree package required by Evil.
The binding itself presumably activated by (global-undo-tree-mode). Hope this helps.

from lispy.

abo-abo avatar abo-abo commented on May 28, 2024

OK, I can reproduce (list-of list-of elt). This is indeed a bug
which I'll try to fix soon.

As for undo-tree-undo, could you move it to a new issue?
It could be a separate bug. I haven't tried undo-tree yet, so it might take
a while to fix that one.

from lispy.

abo-abo avatar abo-abo commented on May 28, 2024

I've looked more at (list-of list-of elt). It's not a bug, since the contents
of region are restored from (- n 1) to its previous content list-of by the default
Emacs undo command.

I you want a different behavior, use lispy-undo (bound to u).
=> q g m w s u <= results in:

(defun list-of (n elt)
  (if (zerop n)
      nil
    (cons elt ((- n 1) list-of elt))))

which is reasonable, although the region is deactivated. This is because undo doesn't
track point and mark.

from lispy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.