Giter Club home page Giter Club logo

Comments (6)

tkf avatar tkf commented on August 19, 2024

Thanks for the report. Yes, I noticed the problem. I think this is because python.el and MuMaMo do not work well in this particular situation. I just type C-o before hitting Tab to avoid this problem. It's lame, but I don't know what is the best way to solve this problem.

from emacs-ipython-notebook.

tkf avatar tkf commented on August 19, 2024

BTW, you are using Fabián E. Gallina's python.el, right? I am using it, so I don't know if it happens in other python modes.

from emacs-ipython-notebook.

epatters avatar epatters commented on August 19, 2024

Nope, I am using the vanilla python.el that ships with Emacs. (Although it looks like Gallina's version has just been merged into Emacs trunk, so I will be getting it sooner or later.)

Anyway, the trouble with that workaround is that it breaks my muscle memory. :)

But you've done a great job with the project. I've been hoping for a while that someone would take advantage of IPython's new client-server architecture to make a good Emacs client. Thanks for your hard work!

from emacs-ipython-notebook.

tkf avatar tkf commented on August 19, 2024

OK, I got a super dirty solution!

(defadvice mumamo-indent-line-function
  (around ein-workaround-mumamo-indent-line-function activate)
  (let (m)
    (unwind-protect
        (progn
          (insert "\n")
          (setq m (point-marker))
          (backward-char)
          ad-do-it)
      (save-excursion
        (goto-char m)
        (backward-char)
        (delete-char 1)))))

I will put this in my Emacs init.el for a while and see if it works properly. If it is an OK-solution, I will probably put in EIN and make it possible to optionally enable (or disable).

Yea, I really like IPython's client-server architecture. What is nice about it is that you can share server program with Vim guys. :) I hope many other program languages follow this way.

from emacs-ipython-notebook.

tkf avatar tkf commented on August 19, 2024

A bit better version:

(defadvice mumamo-indent-line-function
  (around ein-workaround-mumamo-indent-line-function activate)
  "Workaround the indentation problem when the cursor is at the
end of input area."
  (if (and (looking-at-p "\n")
           (get-char-property (point) 'read-only))
      (let (m)
        ;; The cursor is at the end of input area.
        ;; Indentation does not work as-is.  Here is the workaround:
        (unwind-protect
            (progn
              (insert "\n")
              (setq m (point-marker))
              (backward-char)
              ad-do-it)
          (save-excursion
            (goto-char m)
            (backward-char)
            (delete-char 1))))
    ad-do-it))

from emacs-ipython-notebook.

tkf avatar tkf commented on August 19, 2024

I added the above workaround code in master.
http://tkf.github.com/emacs-ipython-notebook/#ein:use-mumamo-indent-line-function-workaround

If you are using the above code, you can remove it after updating EIN.

from emacs-ipython-notebook.

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.