Giter VIP home page Giter VIP logo

Comments (11)

justbur avatar justbur commented on May 27, 2024

Not sure yet, but here's some more information. There seems to be something different about how iso-transl-ctl-x-8-map works that I haven't figured out yet.

This suggests the map should be quoted: http://www.emacswiki.org/emacs/PrefixKey

When I use global-set-key like this it works fine

(require 'iso-transl)
(define-key iso-transl-ctl-x-8-map (kbd ">") nil)
(defun success () (interactive) (message "Typed C-x 8 >>"))
(global-set-key (kbd "C-x 8 > >") 'success)

I'll do more digging later.

from emacs-which-key.

kaushalmodi avatar kaushalmodi commented on May 27, 2024

I have always been using keymap vars without quotes and they have worked.

But here is what I tried:

  • The > "maps" didn't get expanded with or without the quotes.
  • It expands fine in guide-key (But now I cannot go back to that. Thanks to your work, I am spoiled by how beautifully which-key is rendering the key maps :))

I can later try looking in guide-key code if it handles such bindings in a special manner.

from emacs-which-key.

justbur avatar justbur commented on May 27, 2024

If it works in guide-key, that should give me enough clues to see what's happening. I'll check it out when I get a chance

from emacs-which-key.

justbur avatar justbur commented on May 27, 2024

Found the issue but I'm not sure how I want to fix it yet. The problem is that (key-binding (kbd "C-x 8 >")) is returning nil in your setup when it should be returning a keymap. This has been working well in all the other prefix cases I've tested so I don't know why it's different here yet.

from emacs-which-key.

kaushalmodi avatar kaushalmodi commented on May 27, 2024

Hmm, I am setting it to nil first

                   (">"       . nil) ; First unbind ">" from the map

But then I am rebinding >=, >>, etc to other things. I cannot do the below bindings unless I unbind its existing binding.

                   (">="      . [?≥]) ; greater than or equal to
                   (">>"      . [?≫]) ; much greater than
                   (">\""     . []) ; right-pointing double angle quotation mark
                   (">'"      . [?›]) ; single right-pointing angle quotation mark
                   (">h"      . [?☛]) ; black right pointing index

from emacs-which-key.

justbur avatar justbur commented on May 27, 2024

I don't think that's the problem exactly
On Wed, Jul 15, 2015 at 4:40 PM Kaushal Modi [email protected]
wrote:

Hmm, I am setting it to nil first

               (">"       . nil) ; First unbind ">" from the map

But then I am rebinding >=, >>, etc to other things. I cannot do the
below bindings unless I unbind its existing binding.

               (">="      . [?≥]) ; greater than or equal to
               (">>"      . [?≫]) ; much greater than
               (">\""     . [?»]) ; right-pointing double angle quotation mark
               (">'"      . [?›]) ; single right-pointing angle quotation mark
               (">h"      . [?☛]) ; black right pointing index


Reply to this email directly or view it on GitHub
#39 (comment)
.

from emacs-which-key.

justbur avatar justbur commented on May 27, 2024

Can you check your code now? It should work. Had to add another test against the key-translation-map because iso-transl-ctl-x-8-map is stored there and not in the "regular" keymaps

from emacs-which-key.

justbur avatar justbur commented on May 27, 2024

By the way you can use something like this to fix the spacing issue (It just changes how the key is shown). Replace "ZWS" with whatever you want to display there.

(which-key-add-key-based-replacements "C-x 8 0" "ZWS")

from emacs-which-key.

kaushalmodi avatar kaushalmodi commented on May 27, 2024

Thanks! This is now fixed for me.

Also thanks for the "ZWS" tip. I was already using which-key-key-based-description-replacement-alist but it didn't occur to me that I can use that for stuff other than simply putting descriptive prefix names :)

https://github.com/kaushalmodi/.emacs.d/blob/f78ccb2415575939f8c4d1f4b2a76925faf94adc/setup-files/setup-which-key.el#L28

from emacs-which-key.

justbur avatar justbur commented on May 27, 2024

I like those arrows. I wanted to use more unicode characters as replacements, but I was worried about all the different fonts people may be using and all of the bug reports I'd get.

I was thinking that we could compile a list of nice unicode replacements and then include them as an option that you have to explicitly turn on.

from emacs-which-key.

kaushalmodi avatar kaushalmodi commented on May 27, 2024

Thanks! You can try using char-displayable-p function as used in pdf-tools.

I use this in my init to take care of unicodes:

from emacs-which-key.

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.