Giter Club home page Giter Club logo

Comments (25)

rnkn avatar rnkn commented on May 23, 2024 2

from olivetti.

rnkn avatar rnkn commented on May 23, 2024 1

I've managed to reproduce this on Emacs 26. The latest version on MELA (not stable) has a fix that should resolve it. Can you please give this a try when you get a chance?

from olivetti.

rnkn avatar rnkn commented on May 23, 2024

Hmm that sound bad. Thanks for reporting. Are you calling olivetti-expand with a key or with M-x?

from olivetti.

rnkn avatar rnkn commented on May 23, 2024

Also, can you reproduce by loading Emacs with emacs -Q then M-x load-file RET [PATH TO olivetti.el] RET then repeating the above?

from olivetti.

mohkale avatar mohkale commented on May 23, 2024

Hmm that sound bad. Thanks for reporting. Are you calling olivetti-expand with a key or with M-x?

Key, but I have it bound in my own leader map.

Also, can you reproduce by loading Emacs with emacs -Q then M-x load-file RET [PATH TO olivetti.el] RET then repeating the above?

Yes, this time I was using M-x. I'm on olivetti-20200207.749 and GNU Emacs 26.3 (build 1, x86_64-w64-mingw32) of 2019-08-29.

from olivetti.

rnkn avatar rnkn commented on May 23, 2024

I can’t reproduce this, so can you apply this patch and let me know how you go

diff --git a/olivetti.el b/olivetti.el
index 12063f5..0ce43d2 100644
--- a/olivetti.el
+++ b/olivetti.el
@@ -314,7 +314,7 @@ If prefixed with ARG, incrementally decrease."
     (let ((keys (seq-subseq (this-single-command-keys) 0 -1))
           (map (cdr olivetti-mode-map)))
       (seq-do (lambda (k) (setq map (assq k map))) keys)
-      (set-transient-map (cdr map) t))))
+      (when (consp map) (set-transient-map (cdr map) t)))))
 
 (defun olivetti-shrink (&optional arg)
   "Incrementally decrease the value of `olivetti-body-width'.

from olivetti.

mohkale avatar mohkale commented on May 23, 2024

Yep, that seems to have fixed it.

Also, now that I have your attention, might I suggest making how many columns olivetti expands by a user option. 2 is almost always too small for me, I'd prefer to make it expand by 4.

from olivetti.

rnkn avatar rnkn commented on May 23, 2024

Cool. Pushed the change.

Re adding an option for the expansion amount, I doubt it. The transient keymap code allows people to just hammer away at the last key of the binding to get what they want, or press \ and enter the column specifically. I think that’s enough.

from olivetti.

mohkale avatar mohkale commented on May 23, 2024

@rnkn I've never been able to get that hammering to work 😢. I'm using emacs evil-mode and so the transient bindings never really activate. It does seem super cool tho, I'll try to get it working.

from olivetti.

rnkn avatar rnkn commented on May 23, 2024

Yeah I had a look at your config earlier and thought that might be the issue. I suspect that something is using overriding-terminal-local-map when it shouldn’t.

from olivetti.

mohkale avatar mohkale commented on May 23, 2024

Thank you for the assistance, you're correct 😄. It's definitely not an evil-mode issue. In fact, I was looking at the problem wrong. It does work if I use the default bindings I.E. C-c { or C-c }. It doesn't work if I use a leader-key binding which I suspect is an issue with my own leader package.

I'll fix it when I get a chance, again thank u.

from olivetti.

Cumol avatar Cumol commented on May 23, 2024

Was this fit already pushed to melpa? Because I just had the same issue

from olivetti.

rnkn avatar rnkn commented on May 23, 2024

Was this fit already pushed to melpa? Because I just had the same issue

I don't know what you mean.

from olivetti.

Cumol avatar Cumol commented on May 23, 2024

I just installed olivetti straight from the github repo and I am getting the same issue.

I am not using the keybinding, but just the M-x and olivetti-expand multiple times in succession and it leads to that error.

from olivetti.

rnkn avatar rnkn commented on May 23, 2024

Please attempt to reproduce this with emacs -Q and M-x load-file RET [PATH TO FILE]

from olivetti.

Cumol avatar Cumol commented on May 23, 2024

It might be a GUI-specific problem. Doing this in emacs inside a terminal does not have that effect.

I am also doing multiple C-x C-+ in the GUI to increase the text size. An option not possible in the terminal emacs.

Starting the gui with emacs -Q -l "init.el" does not show the problem but using emacs alone does...

Any idea what this means?

from olivetti.

rnkn avatar rnkn commented on May 23, 2024

Unfortunately it means the issue is with your init.

from olivetti.

pietroiusti avatar pietroiusti commented on May 23, 2024

Hi,

I have the same problem with Emacs 26.3.

The problem persists without loading my init file (starting emacs with emacs -Q, yanking the content of olivetti.el into the scratch buffer, and evaluating the buffer)

from olivetti.

rnkn avatar rnkn commented on May 23, 2024

from olivetti.

pietroiusti avatar pietroiusti commented on May 23, 2024

This is what I got:

Debugger entered--Lisp error: (wrong-type-argument keymapp nil)
lookup-key(nil [16])
clear-transient-map()

Where '[16]' changes depending on what key, or key combination, I press. With C-x b, for example, I get:

Debugger entered--Lisp error: (wrong-type-argument keymapp nil)
lookup-key(nil [24 98])
clear-transient-map()

from olivetti.

rnkn avatar rnkn commented on May 23, 2024

from olivetti.

pietroiusti avatar pietroiusti commented on May 23, 2024

I think that's because the error is not triggered by olivetti-expand, but by any command executed after it (as the original post by mohkale says).

However, it seems that I've found the source of the problem. :)

I was executing olivetti-expand with C-c } and then I was repeating the command with C-x z (repeat). After some executions the problem started (with olivetti-shrink as well). I noticed that if I only hit C-c }, then everything seems working fine.

Apologies for having neglected my use of C-x z. Hope this helps.

(Thank you for your package, it's my favorite of the kind)

from olivetti.

rnkn avatar rnkn commented on May 23, 2024

from olivetti.

pietroiusti avatar pietroiusti commented on May 23, 2024
  1. emacs -Q
  2. M-x toggle-debug-on-error
  3. M-x load-file RET path/to/olivetti.el
  4. M-x olivetti-mode
  5. C-c }
  6. C-x z
  7. z
  8. z
    Debugger entered--Lisp error: (wrong-type-argument keymapp nil)
    lookup-key(nil [122])
    clear-transient-map()

from olivetti.

pietroiusti avatar pietroiusti commented on May 23, 2024

I confirm. Now the problem is gone. Thank you.

from olivetti.

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.