Giter Club home page Giter Club logo

which-key-posframe's Introduction

Which-key-posframe

https://melpa.org/packages/which-key-posframe-badge.svg https://stable.melpa.org/packages/which-key-posframe-badge.svg https://img.shields.io/badge/License-GPLv3-blue.svg

Introduction

This package is a emacs-which-key extension, which use posframe to show which-key popup. This package is inspired by ivy-posframe. ./screenshot/which-key-posframe-screenshot.gif

Table of Contents

Install

MELPA

After setting up MELPA as a repository, use M-x package-install which-key-posframe or your preferred method.

Use package

(use-package
  :load-path "path/to/which-key-posframe.el"
  :config
  (which-key-posframe-mode))

Customization

You can customize the appearance of the posframe, the options are derived directly from posframe.

Position of Posframe

You can change the position of posframe by modify the value of which-key-posframe-poshandler, feasible values are limited by posframe. You can use either one of followings.

(setq which-key-posframe-poshandler 'posframe-poshandler-frame-center)
(setq which-key-posframe-poshandler 'posframe-poshandler-frame-top-center)
(setq which-key-posframe-poshandler 'posframe-poshandler-frame-top-left-corner)
(setq which-key-posframe-poshandler 'posframe-poshandler-frame-top-right-corner)
(setq which-key-posframe-poshandler 'posframe-poshandler-frame-bottom-left-corner)
(setq which-key-posframe-poshandler 'posframe-poshandler-frame-bottom-right-corner)
(setq which-key-posframe-poshandler 'posframe-poshandler-window-center)
(setq which-key-posframe-poshandler 'posframe-poshandler-window-top-left-corner)
(setq which-key-posframe-poshandler 'posframe-poshandler-window-top-right-corner)
(setq which-key-posframe-poshandler 'posframe-poshandler-window-bottom-left-corner)
(setq which-key-posframe-poshandler 'posframe-poshandler-window-bottom-right-corner)
(setq which-key-posframe-poshandler 'posframe-poshandler-point-top-left-corner)
(setq which-key-posframe-poshandler 'posframe-poshandler-point-bottom-left-corner)

which-key-posframe's People

Contributors

tarsius avatar yanghaoxie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

which-key-posframe's Issues

Setting width to frame width

Hello,

I'd like to set the width of the which-key frame to full width, in other words equal to the frame-width.

How can I achieve this? I tried setting which-key-posframe-parameters to

`((width . ,(frame-width)))

But that didnt do it.

Thanks.

Performance issues

I started using the package, and recently I realized - for some reason, just moving the cursor around got noticeably slower. Profiler showed some which-key related functions to blame, i.e.:

which-key--hide-popup - why would it try to hide the popup when it was never opened, I'm just moving cursor around?
upd: it seems that function runs regardless of which-key-posframe - either it's enabled or not.

. For a while I thought there's something in my which-key settings causing that. Then after spending some more time, I found the culprit - it's which-key-posframe.

However, it is not as straightforward as saying "the package has issues". Interestingly, this is what's happening:

I have which-key and which-key-posframe enabled with the settings such these:

(setq
   which-key-show-early-on-C-h t
   which-key-idle-delay 1.0
   which-key-idle-secondary-delay 0.05)
          
(setq which-key-posframe-poshandler 'posframe-poshandler-window-bottom-right-corner
  which-key-min-display-lines 15)

When I open something (e.g., a big .org file), moving the cursor around initially is slow; I'd disable which-key-posframe and, voila - it gets fast again. I would re-enable the mode - and it is still fast, it won't go back to lagging as when I open the file. So, it is slow only when the first time I open the file.

I'm not exactly sure what's causing it. It could be Emacs 28 with native comp, or a Mac-specific problem.

I'll leave this here just in case someone experienced similar problems or suggests a work around.

C-h paging does not work.

my config:

(use-package which-key
  :hook (after-init . which-key-mode)
  :init
  (setq which-key-idle-delay 0
        which-key-idle-secondary-delay 0
        )
  )

(use-package which-key-posframe
  :after posframe
  :config
  (which-key-posframe-mode)
  )

When use C-x C-h , I get this:
Snipaste_2021-04-15_18-38-57

paging does not work.

Issue with autoloads on Windows 10

I am using Emacs 28.2 on Windows 10. I have installed the latest version of the package using straight.el. My which-key-posframe config is as follows.

(use-package which-key ; Show help popups for prefix keys
  :commands which-key-setup-side-window-right-bottom
  :hook
  (emacs-startup-hook . which-key-mode)
  :custom
  (which-key-sort-order 'which-key-key-order-alpha)
  :config
  (which-key-setup-side-window-right-bottom)
  :diminish)

(use-package which-key-posframe
  :hook
  (which-key-mode-hook . which-key-posframe-mode))

However, the package is not initialized properly, and the following two buffers show up every time. I have tried reinstalling the package.

;;; which-key-posframe-autoloads.el --- automatically extracted autoloads  -*- lexical-binding: t -*-
;;
;;; Code:

^M
(provide 'which-key-posframe-autoloads)
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; coding: utf-8
;; End:
;;; which-key-posframe-autoloads.el ends here

Contents of the Warnings buffer.

Warning (initialization): An error occurred while loading ‘c:/Users/swarnendu/AppData/Roaming/.emacs.d/init.el’:

error: which-key-posframe.el:0:0: error: error: (Local variables entry is missing the suffix)

To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file.  Start Emacs with
the ‘--debug-init’ option to view a complete error backtrace. Disable showing Disable logging

Error while deleting posframe

(posframe-delete which-key--buffer)

When which-key--buffer is nil, will get this error:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  get-buffer(nil)
  posframe-delete-frame(nil)
  posframe-delete(nil)
  which-key-posframe-mode(toggle)
  funcall-interactively(which-key-posframe-mode toggle)
  call-interactively(which-key-posframe-mode record nil)
  #f(compiled-function (cmd &optional record-flag keys special) "Execute CMD as an editor command.\nCMD must be a symbol that satisfies the `commandp' predicate.\n\nOptional second arg RECORD-FLAG non-nil means unconditionally put\nthis command in the variable `command-history'.  Otherwise, that\nis done only if an arg is read using the minibuffer.\n\nThe argument KEYS specifies the value to use instead of the\nreturn value of the `this-command-keys' function when reading the\narguments; if it is nil, `this-command-keys' is used.\n\nThe argument SPECIAL, if non-nil, means that this command is\nexecuting a special event, so ignore the prefix argument and\ndon't clear it." #<bytecode -0x9b30fbbdb128056>)(which-key-posframe-mode record nil nil)
  ad-Advice-command-execute(#f(compiled-function (cmd &optional record-flag keys special) "Execute CMD as an editor command.\nCMD must be a symbol that satisfies the `commandp' predicate.\n\nOptional second arg RECORD-FLAG non-nil means unconditionally put\nthis command in the variable `command-history'.  Otherwise, that\nis done only if an arg is read using the minibuffer.\n\nThe argument KEYS specifies the value to use instead of the\nreturn value of the `this-command-keys' function when reading the\narguments; if it is nil, `this-command-keys' is used.\n\nThe argument SPECIAL, if non-nil, means that this command is\nexecuting a special event, so ignore the prefix argument and\ndon't clear it." #<bytecode -0x9b30fbbdb128056>) which-key-posframe-mode record)
  apply(ad-Advice-command-execute #f(compiled-function (cmd &optional record-flag keys special) "Execute CMD as an editor command.\nCMD must be a symbol that satisfies the `commandp' predicate.\n\nOptional second arg RECORD-FLAG non-nil means unconditionally put\nthis command in the variable `command-history'.  Otherwise, that\nis done only if an arg is read using the minibuffer.\n\nThe argument KEYS specifies the value to use instead of the\nreturn value of the `this-command-keys' function when reading the\narguments; if it is nil, `this-command-keys' is used.\n\nThe argument SPECIAL, if non-nil, means that this command is\nexecuting a special event, so ignore the prefix argument and\ndon't clear it." #<bytecode -0x9b30fbbdb128056>) (which-key-posframe-mode record))
  command-execute(which-key-posframe-mode record)
  counsel-M-x-action("which-key-posframe-mode")
  ivy-call()
  #f(compiled-function (arg1 arg2 &rest rest) "Read a string in the minibuffer, with completion.\n\nPROMPT is a string, normally ending in a colon and a space.\n`ivy-count-format' is prepended to PROMPT during completion.\n\nCOLLECTION is either a list of strings, a function, an alist, or\na hash table, supplied for `minibuffer-completion-table'.\n\nPREDICATE is applied to filter out the COLLECTION immediately.\nThis argument is for compatibility with `completing-read'.\n\nWhen REQUIRE-MATCH is non-nil, only members of COLLECTION can be\nselected. In can also be a lambda.\n\nIf INITIAL-INPUT is non-nil, then insert that input in the\nminibuffer initially.\n\nHISTORY is a name of a variable to hold the completion session\nhistory.\n\nKEYMAP is composed with `ivy-minibuffer-map'.\n\nPRESELECT, when non-nil, determines which one of the candidates\nmatching INITIAL-INPUT to select initially.  An integer stands\nfor the position of the desired candidate in the collection,\ncounting from zero.  Otherwise, use the first occurrence of\nPRESELECT in the collection.  Comparison is first done with\n`equal'.  If that fails, and when applicable, match PRESELECT as\na regular expression.\n\nDEF is for compatibility with `completing-read'.\n\nUPDATE-FN is called each time the candidate list is re-displayed.\n\nWhen SORT is non-nil, `ivy-sort-functions-alist' determines how\nto sort candidates before displaying them.\n\nACTION is a function to call after selecting a candidate.\nIt takes one argument, the selected candidate. If COLLECTION is\nan alist, the argument is a cons cell, otherwise it's a string.\n\nMULTI-ACTION, when non-nil, is called instead of ACTION when\nthere are marked candidates. It takes the list of candidates as\nits only argument. When it's nil, ACTION is called on each marked\ncandidate.\n\nUNWIND is a function of no arguments to call before exiting.\n\nRE-BUILDER is a function transforming input text into a regex\npattern.\n\nMATCHER is a function which can override how candidates are\nfiltered based on user input.  It takes a regex pattern and a\nlist of candidates, and returns the list of matching candidates.\n\nDYNAMIC-COLLECTION is a boolean specifying whether the list of\ncandidates is updated after each input by calling COLLECTION.\n\nEXTRA-PROPS is a plist that can be used to store\ncollection-specific session-specific data.\n\nCALLER is a symbol to uniquely identify the caller to `ivy-read'.\nIt is used, along with COLLECTION, to determine which\ncustomizations apply to the current completion session." #<bytecode 0x130d8ae0694618a>)("M-x " ("which-key-posframe-mode" "toggle-debug-on-error" "centaur-update" "mpc" "tooltip-mode" "dap-tooltip-mode" "list-packages" "rainbow-mode" "all-the-icons-dired-mode" "emacs-init-time" "auto-composition-mode" "all-the-icons-insert" "package-reinstall" "lsp-shutdown-workspace" "lsp-update-server" "copyit-file-pathname" "simple-mpc-toggle" "ccls-reload" "lsp-workspace-restart" "simple-mpc-stop" "customize-group" "ivy-rich-mode" "update-packages" "doom-modeline-mode" "gnus" "company-box-mode" "all-the-icons-ivy-rich-mode" "grip-mode" "list-processes" "display-battery-mode" "overwrite-mode" "highlight-defined-mode" "mixed-pitch-mode" "esup" "all-the-icons-ibuffer-mode" "package-lint-current-buffer" "proxy-socks-toggle" "erc" "set-package-archives" "centaur-update-packages" "upgrade-packages" "vterm" "lsp-mode" "eshell" "flycheck-set-indication-mode" "shell" "sort-lines" "byte-recompile-directory" "package-refresh-contents" "org-toggle-narrow-to-subtree" ...) :predicate counsel--M-x-externs-predicate :require-match t :history counsel-M-x-history :action counsel-M-x-action :keymap (keymap (67108908 . counsel--info-lookup-symbol) (67108910 . counsel-find-symbol)) :initial-input nil :caller counsel-M-x)
  apply(#f(compiled-function (arg1 arg2 &rest rest) "Read a string in the minibuffer, with completion.\n\nPROMPT is a string, normally ending in a colon and a space.\n`ivy-count-format' is prepended to PROMPT during completion.\n\nCOLLECTION is either a list of strings, a function, an alist, or\na hash table, supplied for `minibuffer-completion-table'.\n\nPREDICATE is applied to filter out the COLLECTION immediately.\nThis argument is for compatibility with `completing-read'.\n\nWhen REQUIRE-MATCH is non-nil, only members of COLLECTION can be\nselected. In can also be a lambda.\n\nIf INITIAL-INPUT is non-nil, then insert that input in the\nminibuffer initially.\n\nHISTORY is a name of a variable to hold the completion session\nhistory.\n\nKEYMAP is composed with `ivy-minibuffer-map'.\n\nPRESELECT, when non-nil, determines which one of the candidates\nmatching INITIAL-INPUT to select initially.  An integer stands\nfor the position of the desired candidate in the collection,\ncounting from zero.  Otherwise, use the first occurrence of\nPRESELECT in the collection.  Comparison is first done with\n`equal'.  If that fails, and when applicable, match PRESELECT as\na regular expression.\n\nDEF is for compatibility with `completing-read'.\n\nUPDATE-FN is called each time the candidate list is re-displayed.\n\nWhen SORT is non-nil, `ivy-sort-functions-alist' determines how\nto sort candidates before displaying them.\n\nACTION is a function to call after selecting a candidate.\nIt takes one argument, the selected candidate. If COLLECTION is\nan alist, the argument is a cons cell, otherwise it's a string.\n\nMULTI-ACTION, when non-nil, is called instead of ACTION when\nthere are marked candidates. It takes the list of candidates as\nits only argument. When it's nil, ACTION is called on each marked\ncandidate.\n\nUNWIND is a function of no arguments to call before exiting.\n\nRE-BUILDER is a function transforming input text into a regex\npattern.\n\nMATCHER is a function which can override how candidates are\nfiltered based on user input.  It takes a regex pattern and a\nlist of candidates, and returns the list of matching candidates.\n\nDYNAMIC-COLLECTION is a boolean specifying whether the list of\ncandidates is updated after each input by calling COLLECTION.\n\nEXTRA-PROPS is a plist that can be used to store\ncollection-specific session-specific data.\n\nCALLER is a symbol to uniquely identify the caller to `ivy-read'.\nIt is used, along with COLLECTION, to determine which\ncustomizations apply to the current completion session." #<bytecode 0x130d8ae0694618a>) ("M-x " ("which-key-posframe-mode" "toggle-debug-on-error" "centaur-update" "mpc" "tooltip-mode" "dap-tooltip-mode" "list-packages" "rainbow-mode" "all-the-icons-dired-mode" "emacs-init-time" "auto-composition-mode" "all-the-icons-insert" "package-reinstall" "lsp-shutdown-workspace" "lsp-update-server" "copyit-file-pathname" "simple-mpc-toggle" "ccls-reload" "lsp-workspace-restart" "simple-mpc-stop" "customize-group" "ivy-rich-mode" "update-packages" "doom-modeline-mode" "gnus" "company-box-mode" "all-the-icons-ivy-rich-mode" "grip-mode" "list-processes" "display-battery-mode" "overwrite-mode" "highlight-defined-mode" "mixed-pitch-mode" "esup" "all-the-icons-ibuffer-mode" "package-lint-current-buffer" "proxy-socks-toggle" "erc" "set-package-archives" "centaur-update-packages" "upgrade-packages" "vterm" "lsp-mode" "eshell" "flycheck-set-indication-mode" "shell" "sort-lines" "byte-recompile-directory" "package-refresh-contents" "org-toggle-narrow-to-subtree" ...) :predicate counsel--M-x-externs-predicate :require-match t :history counsel-M-x-history :action counsel-M-x-action :keymap (keymap (67108908 . counsel--info-lookup-symbol) (67108910 . counsel-find-symbol)) :initial-input nil :caller counsel-M-x))
  ivy-posframe--read(#f(compiled-function (arg1 arg2 &rest rest) "Read a string in the minibuffer, with completion.\n\nPROMPT is a string, normally ending in a colon and a space.\n`ivy-count-format' is prepended to PROMPT during completion.\n\nCOLLECTION is either a list of strings, a function, an alist, or\na hash table, supplied for `minibuffer-completion-table'.\n\nPREDICATE is applied to filter out the COLLECTION immediately.\nThis argument is for compatibility with `completing-read'.\n\nWhen REQUIRE-MATCH is non-nil, only members of COLLECTION can be\nselected. In can also be a lambda.\n\nIf INITIAL-INPUT is non-nil, then insert that input in the\nminibuffer initially.\n\nHISTORY is a name of a variable to hold the completion session\nhistory.\n\nKEYMAP is composed with `ivy-minibuffer-map'.\n\nPRESELECT, when non-nil, determines which one of the candidates\nmatching INITIAL-INPUT to select initially.  An integer stands\nfor the position of the desired candidate in the collection,\ncounting from zero.  Otherwise, use the first occurrence of\nPRESELECT in the collection.  Comparison is first done with\n`equal'.  If that fails, and when applicable, match PRESELECT as\na regular expression.\n\nDEF is for compatibility with `completing-read'.\n\nUPDATE-FN is called each time the candidate list is re-displayed.\n\nWhen SORT is non-nil, `ivy-sort-functions-alist' determines how\nto sort candidates before displaying them.\n\nACTION is a function to call after selecting a candidate.\nIt takes one argument, the selected candidate. If COLLECTION is\nan alist, the argument is a cons cell, otherwise it's a string.\n\nMULTI-ACTION, when non-nil, is called instead of ACTION when\nthere are marked candidates. It takes the list of candidates as\nits only argument. When it's nil, ACTION is called on each marked\ncandidate.\n\nUNWIND is a function of no arguments to call before exiting.\n\nRE-BUILDER is a function transforming input text into a regex\npattern.\n\nMATCHER is a function which can override how candidates are\nfiltered based on user input.  It takes a regex pattern and a\nlist of candidates, and returns the list of matching candidates.\n\nDYNAMIC-COLLECTION is a boolean specifying whether the list of\ncandidates is updated after each input by calling COLLECTION.\n\nEXTRA-PROPS is a plist that can be used to store\ncollection-specific session-specific data.\n\nCALLER is a symbol to uniquely identify the caller to `ivy-read'.\nIt is used, along with COLLECTION, to determine which\ncustomizations apply to the current completion session." #<bytecode 0x130d8ae0694618a>) "M-x " ("which-key-posframe-mode" "toggle-debug-on-error" "centaur-update" "mpc" "tooltip-mode" "dap-tooltip-mode" "list-packages" "rainbow-mode" "all-the-icons-dired-mode" "emacs-init-time" "auto-composition-mode" "all-the-icons-insert" "package-reinstall" "lsp-shutdown-workspace" "lsp-update-server" "copyit-file-pathname" "simple-mpc-toggle" "ccls-reload" "lsp-workspace-restart" "simple-mpc-stop" "customize-group" "ivy-rich-mode" "update-packages" "doom-modeline-mode" "gnus" "company-box-mode" "all-the-icons-ivy-rich-mode" "grip-mode" "list-processes" "display-battery-mode" "overwrite-mode" "highlight-defined-mode" "mixed-pitch-mode" "esup" "all-the-icons-ibuffer-mode" "package-lint-current-buffer" "proxy-socks-toggle" "erc" "set-package-archives" "centaur-update-packages" "upgrade-packages" "vterm" "lsp-mode" "eshell" "flycheck-set-indication-mode" "shell" "sort-lines" "byte-recompile-directory" "package-refresh-contents" "org-toggle-narrow-to-subtree" ...) :predicate counsel--M-x-externs-predicate :require-match t :history counsel-M-x-history :action counsel-M-x-action :keymap (keymap (67108908 . counsel--info-lookup-symbol) (67108910 . counsel-find-symbol)) :initial-input nil :caller counsel-M-x)
  apply(ivy-posframe--read #f(compiled-function (arg1 arg2 &rest rest) "Read a string in the minibuffer, with completion.\n\nPROMPT is a string, normally ending in a colon and a space.\n`ivy-count-format' is prepended to PROMPT during completion.\n\nCOLLECTION is either a list of strings, a function, an alist, or\na hash table, supplied for `minibuffer-completion-table'.\n\nPREDICATE is applied to filter out the COLLECTION immediately.\nThis argument is for compatibility with `completing-read'.\n\nWhen REQUIRE-MATCH is non-nil, only members of COLLECTION can be\nselected. In can also be a lambda.\n\nIf INITIAL-INPUT is non-nil, then insert that input in the\nminibuffer initially.\n\nHISTORY is a name of a variable to hold the completion session\nhistory.\n\nKEYMAP is composed with `ivy-minibuffer-map'.\n\nPRESELECT, when non-nil, determines which one of the candidates\nmatching INITIAL-INPUT to select initially.  An integer stands\nfor the position of the desired candidate in the collection,\ncounting from zero.  Otherwise, use the first occurrence of\nPRESELECT in the collection.  Comparison is first done with\n`equal'.  If that fails, and when applicable, match PRESELECT as\na regular expression.\n\nDEF is for compatibility with `completing-read'.\n\nUPDATE-FN is called each time the candidate list is re-displayed.\n\nWhen SORT is non-nil, `ivy-sort-functions-alist' determines how\nto sort candidates before displaying them.\n\nACTION is a function to call after selecting a candidate.\nIt takes one argument, the selected candidate. If COLLECTION is\nan alist, the argument is a cons cell, otherwise it's a string.\n\nMULTI-ACTION, when non-nil, is called instead of ACTION when\nthere are marked candidates. It takes the list of candidates as\nits only argument. When it's nil, ACTION is called on each marked\ncandidate.\n\nUNWIND is a function of no arguments to call before exiting.\n\nRE-BUILDER is a function transforming input text into a regex\npattern.\n\nMATCHER is a function which can override how candidates are\nfiltered based on user input.  It takes a regex pattern and a\nlist of candidates, and returns the list of matching candidates.\n\nDYNAMIC-COLLECTION is a boolean specifying whether the list of\ncandidates is updated after each input by calling COLLECTION.\n\nEXTRA-PROPS is a plist that can be used to store\ncollection-specific session-specific data.\n\nCALLER is a symbol to uniquely identify the caller to `ivy-read'.\nIt is used, along with COLLECTION, to determine which\ncustomizations apply to the current completion session." #<bytecode 0x130d8ae0694618a>) ("M-x " ("which-key-posframe-mode" "toggle-debug-on-error" "centaur-update" "mpc" "tooltip-mode" "dap-tooltip-mode" "list-packages" "rainbow-mode" "all-the-icons-dired-mode" "emacs-init-time" "auto-composition-mode" "all-the-icons-insert" "package-reinstall" "lsp-shutdown-workspace" "lsp-update-server" "copyit-file-pathname" "simple-mpc-toggle" "ccls-reload" "lsp-workspace-restart" "simple-mpc-stop" "customize-group" "ivy-rich-mode" "update-packages" "doom-modeline-mode" "gnus" "company-box-mode" "all-the-icons-ivy-rich-mode" "grip-mode" "list-processes" "display-battery-mode" "overwrite-mode" "highlight-defined-mode" "mixed-pitch-mode" "esup" "all-the-icons-ibuffer-mode" "package-lint-current-buffer" "proxy-socks-toggle" "erc" "set-package-archives" "centaur-update-packages" "upgrade-packages" "vterm" "lsp-mode" "eshell" "flycheck-set-indication-mode" "shell" "sort-lines" "byte-recompile-directory" "package-refresh-contents" "org-toggle-narrow-to-subtree" ...) :predicate counsel--M-x-externs-predicate :require-match t :history counsel-M-x-history :action counsel-M-x-action :keymap (keymap (67108908 . counsel--info-lookup-symbol) (67108910 . counsel-find-symbol)) :initial-input nil :caller counsel-M-x))
  ivy-read("M-x " ("which-key-posframe-mode" "toggle-debug-on-error" "centaur-update" "mpc" "tooltip-mode" "dap-tooltip-mode" "list-packages" "rainbow-mode" "all-the-icons-dired-mode" "emacs-init-time" "auto-composition-mode" "all-the-icons-insert" "package-reinstall" "lsp-shutdown-workspace" "lsp-update-server" "copyit-file-pathname" "simple-mpc-toggle" "ccls-reload" "lsp-workspace-restart" "simple-mpc-stop" "customize-group" "ivy-rich-mode" "update-packages" "doom-modeline-mode" "gnus" "company-box-mode" "all-the-icons-ivy-rich-mode" "grip-mode" "list-processes" "display-battery-mode" "overwrite-mode" "highlight-defined-mode" "mixed-pitch-mode" "esup" "all-the-icons-ibuffer-mode" "package-lint-current-buffer" "proxy-socks-toggle" "erc" "set-package-archives" "centaur-update-packages" "upgrade-packages" "vterm" "lsp-mode" "eshell" "flycheck-set-indication-mode" "shell" "sort-lines" "byte-recompile-directory" "package-refresh-contents" "org-toggle-narrow-to-subtree" ...) :predicate counsel--M-x-externs-predicate :require-match t :history counsel-M-x-history :action counsel-M-x-action :keymap (keymap (67108908 . counsel--info-lookup-symbol) (67108910 . counsel-find-symbol)) :initial-input nil :caller counsel-M-x)
  counsel-M-x()
  funcall-interactively(counsel-M-x)
  call-interactively(counsel-M-x nil nil)
  #f(compiled-function (cmd &optional record-flag keys special) "Execute CMD as an editor command.\nCMD must be a symbol that satisfies the `commandp' predicate.\n\nOptional second arg RECORD-FLAG non-nil means unconditionally put\nthis command in the variable `command-history'.  Otherwise, that\nis done only if an arg is read using the minibuffer.\n\nThe argument KEYS specifies the value to use instead of the\nreturn value of the `this-command-keys' function when reading the\narguments; if it is nil, `this-command-keys' is used.\n\nThe argument SPECIAL, if non-nil, means that this command is\nexecuting a special event, so ignore the prefix argument and\ndon't clear it." #<bytecode -0x9b30fbbdb128056>)(counsel-M-x nil nil nil)
  ad-Advice-command-execute(#f(compiled-function (cmd &optional record-flag keys special) "Execute CMD as an editor command.\nCMD must be a symbol that satisfies the `commandp' predicate.\n\nOptional second arg RECORD-FLAG non-nil means unconditionally put\nthis command in the variable `command-history'.  Otherwise, that\nis done only if an arg is read using the minibuffer.\n\nThe argument KEYS specifies the value to use instead of the\nreturn value of the `this-command-keys' function when reading the\narguments; if it is nil, `this-command-keys' is used.\n\nThe argument SPECIAL, if non-nil, means that this command is\nexecuting a special event, so ignore the prefix argument and\ndon't clear it." #<bytecode -0x9b30fbbdb128056>) counsel-M-x)
  apply(ad-Advice-command-execute #f(compiled-function (cmd &optional record-flag keys special) "Execute CMD as an editor command.\nCMD must be a symbol that satisfies the `commandp' predicate.\n\nOptional second arg RECORD-FLAG non-nil means unconditionally put\nthis command in the variable `command-history'.  Otherwise, that\nis done only if an arg is read using the minibuffer.\n\nThe argument KEYS specifies the value to use instead of the\nreturn value of the `this-command-keys' function when reading the\narguments; if it is nil, `this-command-keys' is used.\n\nThe argument SPECIAL, if non-nil, means that this command is\nexecuting a special event, so ignore the prefix argument and\ndon't clear it." #<bytecode -0x9b30fbbdb128056>) counsel-M-x)
  command-execute(counsel-M-x)

Forked to Emacsorphanage

I have forked this repository to https://github.com/emacsorphanage/which-key-posframe and have updated Melpa and the Emacsmirror to get it from there. Unfortunately @yanghaoxie lately hasn't responded to any issues and pull-requests, making this move necessary. I will gladly revert this on Melpa and Emacsmirror once the package is being maintained here again.

Next I will address some of the outstanding issues.

Does not appear with minimal config

I followed the minimum install specified in the README and which-key does not appear. Am I missing anything?

(use-package which-key
  :defer 1
  :delight
  :config
  (setq which-key-sort-order 'which-key-prefix-then-key-order
        which-key-sort-uppercase-first nil
        which-key-add-column-padding 1
        which-key-max-display-columns nil
        which-key-min-display-lines 6
        which-key-side-window-max-width 0.33))
;; (which-key-setup-side-window-right-bottom)
;; (which-key-mode))
(use-package which-key-posframe
  :after which-key
  :quelpa (which-key-posframe :fetcher github :repo "yanghaoxie/which-key-posframe")
  :config
  (setq which-key-posframe-poshandler 'posframe-poshandler-frame-center)
  (which-key-posframe-enable))

No border shown

I have been struggling to get which-key-posframe to show a border around the posframe. I tried a very minimal configuration, with the following as the only contents of init.el:

(load "/Users/fintel/.emacs.d/straight/repos/emacs-which-key/which-key.el")
(load "/Users/fintel/.emacs.d/straight/repos/posframe/posframe.el")
(load "/Users/fintel/.emacs.d/straight/repos/which-key-posframe/which-key-posframe.el")
(which-key-mode)
(which-key-posframe-mode)

But no border appears when the posframe pops up.

Since the presets for the custom variable which-key-posframe-border-width and the face which-key-posframe-border might generate a fairly faint border, I tried other settings, but no border appears.

Any idea what might be going on?

spacing issues (width / line wrapping), possibly related to font/ligatures

EDIT: This might not actually have to do with the font; see update below.

My default font is Jetbrains Mono, which has ligatures. Unless I set which-key-posframe-font to Jetbrains Mono NL (no ligatures), the posframe is too narrow, so lines wrap, leading to further spacing horrors.

With Jetbrains Mono 😢:
image

With Jetbrains Mono NL 🎉 :
image

I've also seen this, though not consistently, with Fira Code, which has ligatures as well.

TBH the existence of which-key-posframe-font makes this nearly a non-issue, but it took me a long time to find the problem/solution, so this post is mostly to point others in the right direction if they run into this too.

which-key-posframe-height

thanks for this package. I'm having trouble adjusting the height of the which-key posframe. None of the height settings I add seem to have any effect. Everything else works fine though. Here's my setup:

(use-package which-key-posframe
  :if (and (window-system) (version<= "26.1" emacs-version))
  :hook (after-init . which-key-posframe-mode)
  :config
  (setq which-key-posframe-border-width 15)
  (setq which-key-posframe-poshandler 'posframe-poshandler-frame-center))

Right now when the frame is maximized the posframe is often too long (nearly the whole frame) and not high enough (the bottom key options are cut off). I'd rather it just be taller and less wide. I've tried setting the height via both custom interface and in the use package declaration but have seen no change. Any ideas as to what I'm doing incorrectly?

Error: "Attempt to make invisible the sole visible or iconified frame".

Hello,
Whenever I start emacs I have this error:

Error in pre-command-hook (which-key--hide-popup): (error "Attempt to make invisible the sole visible or iconified frame")

I have my configuration like this:

  (use-package which-key-posframe
    :straight (which-key-posframe :type git :host github :repo "yanghaoxie/which-key-posframe")
    :config
    (setq which-key-posframe-poshandler 'posframe-poshandler-frame-bottom-left-corner
          which-key-posframe-border-width 0)
    (which-key-posframe-enable))

Thanks

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.