Coder Social home page Coder Social logo

Handle read-key? about emacs-mini-modeline HOT 15 CLOSED

kiennq avatar kiennq commented on August 15, 2024
Handle read-key?

from emacs-mini-modeline.

Comments (15)

AmaiKinono avatar AmaiKinono commented on August 15, 2024 1

Yes, it fixes the issue in both 27.0 and 26.3 🎉 Now the minibuffer window is super solid when test.

from emacs-mini-modeline.

kiennq avatar kiennq commented on August 15, 2024

@AmaiKinono Can you try with latest version, I think it should be fixed now

from emacs-mini-modeline.

AmaiKinono avatar AmaiKinono commented on August 15, 2024

No. It looks like this now. It's not folded but hidden:

Peek 2020-03-06 10-52

You can test with this one-liner:

(while (not (eq (read-key "multi\nline\nprompt") ?\C-g)))

from emacs-mini-modeline.

kiennq avatar kiennq commented on August 15, 2024

Not happen to me with the latest version though.
Can you check if you're using the origin/master already?
I think you're using straight.el which will have some problem with pulling the origin/master that deviates from current HEAD.
Or you can try just deleting this package and reinstall it via package-install or using Quelpa.
b689f87c-2f19-4c70-897a-aaeec29dc04d

from emacs-mini-modeline.

AmaiKinono avatar AmaiKinono commented on August 15, 2024

I am on the latest master. I've found the problem: It has something to do with blink-cursor-mode (yeah that's weird). Try this in emacs -Q:

(require 'mini-modeline)
(blink-cursor-mode -1)
(mini-modeline-mode)
(while (not (eq (read-key "multi\nline\nprompt") ?\C-g)))

Then press some key that's not C-g.

Update: I've found if you disable and enable blink-cursor-mode again, the behavior of read-key becomes even weirder.

from emacs-mini-modeline.

kiennq avatar kiennq commented on August 15, 2024

Even with blink-cursor-mode disabled, I still cannot repro this 😞
If you look at my gif, the blink-cursor-mode has been disabled.

from emacs-mini-modeline.

AmaiKinono avatar AmaiKinono commented on August 15, 2024

I'm using Emacs 26.3 on Linux. What version are you using? If it's different, I could install and test it tomorrow.

from emacs-mini-modeline.

kiennq avatar kiennq commented on August 15, 2024

I'm using emacs-snapshot 27.0.

from emacs-mini-modeline.

AmaiKinono avatar AmaiKinono commented on August 15, 2024

I'm on Emacs 27.0.90 now. The problem still happens, and I can tell you that mini-modeline-mode strongly interferes with blink-cursor-mode.

blink-cursor-mode

This is emacs -Q and I didn't do anything other than the code you see in the screenshot (so blink-cursor-mode is on, by default). After enabling mini-modeline-mode:

  • The cursor stops blinking.
  • When I type something, the cursor shows and immediately disappears. The GIF is not well recorded so it looks like glitching, but actually the cursor just gone.
  • When I move to somewhere, the cursor appears again and doesn't blink.

I didn't remember if I saw this in 26.3. One thing that's different from 26.3 is if I disable and enable blink-cursor-mode again, the read-key prompt shows correctly.

Did you notice this behavior in emacs -Q? If you didn't than I really don't know what's wrong... maybe switch to another PC and test it again.

from emacs-mini-modeline.

AmaiKinono avatar AmaiKinono commented on August 15, 2024

Ok, here's the situation now: You can merge #20, it solves the cursor problem perfectly. The thing described below has nothing to do with blink-cursor-mode since I've test them with blink-cursor-mode enabled and disabled.

In emacs -Q, when you test using this one liner:

(while (not (eq (read-key "multi\nline\nprompt") ?\C-g)))

when pressing any key, the prompt folds into one line and expands really quick. It looks like a blink so that's perfectly useable. I don't know what you see, does it blink or not?

In my own config, somehow the reaction is slow. When I press a key, it needs like 0.5s to fold, then another 0.5s to expand. So it doesn't look good, but useable too. This is affected by mini-modeline-update-interval, but even it's set to 0.0, the reaction is still slow.

I can't do more test since even if I leave only configurations of straight.el, use-package and mini-modeline, it's still slow.

You can take this issue as solved (since it's already useable). But don't close it for now, please let me confirm this also works on 26.3 later.

from emacs-mini-modeline.

kiennq avatar kiennq commented on August 15, 2024

When I've tried with Ubuntu, I did saw the blinking of minibuffer being expanded/retracted.
However, with Emacs on Windows, the problem don't happen.
Not sure why

from emacs-mini-modeline.

kiennq avatar kiennq commented on August 15, 2024

@AmaiKinono Can you try with latest master, it seems that the issues is fixed in my Ubuntu Emacs

from emacs-mini-modeline.

kiennq avatar kiennq commented on August 15, 2024

Thanks, I'm closing this issue, please open it again if you have found new undesired behaviors

from emacs-mini-modeline.

AmaiKinono avatar AmaiKinono commented on August 15, 2024

I have to reopen this. With 6b6efe6, read-from-minibuffer with multi-line prompt/content doesn't work. Try this:

(read-from-minibuffer "Hi: " "line1\nline2")

Update: I found I can't reopen this because it's not closed by me.

I think it's okay to not bother with resize-mini-windows. With this line in 2348b9f:

(setq mini-modeline--timer (run-with-timer 0 0.1 #'mini-modeline-display))

read-key is already perfectly useable.

from emacs-mini-modeline.

kiennq avatar kiennq commented on August 15, 2024

Let's track the new issue with #23

from emacs-mini-modeline.

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.