Hot answers tagged

10

magit-popup has it's own manual! But unless you actually want to set arguments in the popup which are then passed to the invoked action, you are probably better off using hydra instead. Also note that I don't intend to further develop magit-popup. Instead I will write a similar package from scratch. There's just to much accidental complexity in the current ...


6

Hydras are pretty simple to write: (defhydra hydra-launcher (:color blue :columns 2) "Launch" ("h" man "man") ("r" (browse-url "http://www.reddit.com/r/emacs/") "reddit") ("w" (browse-url "http://www.emacswiki.org/") "emacswiki") ("s" shell &...


6

Have you tried installing gpg version greater than 2.1, and then (setq epa-pinentry-mode 'loopback)? This should prompt for the password in the minibuffer. Edit: epa-pinentry-mode has been marked obsolete from Emacs 27. Use epg-pinentry-mode instead.


6

Use with-help-window: (with-help-window "*My Help Buffer*" ; Whatever buffer name you like. ;; Use `princ`, `prin1`, `terpri`, etc. to put text in the displayed buffer ) Key q will automatically be bound to do what you want. C-h f with-help-window says: with-help-window is a Lisp macro in help.el. (with-help-window BUFFER-OR-NAME &rest BODY)...


4

To disable dialog windows set use-dialog-box to nil (setq use-dialog-box nil)


4

It works if tooltip-mode is enabled with: GNU Emacs 26.1 (build 1, x86<sub>64</sub>-unknown-cygwin, GTK+ Version 3.22.28) of 2018-05-28 (Note especially the GTK+ toolkit since that feature may be toolkit dependent.) Put the 'help-echo text property on the text to be augmented with the tooltip. Append a space to the help echo text. Propertize ...


4

You can use a minor-mode and use a default mapping. Have a look at the define-key documentation for details about default definitions in keymaps. (define-minor-mode disable-keys-mode "Disables all keys." :lighter " dk" :keymap (let ((map (make-sparse-keymap))) (define-key map (kbd "C-g") (lambda () ...


3

I doubt that using a dummy function which always returns nil as split-window-preferred-function is what you should be doing, but since it otherwise works for you, here's how you can tell magit-popup to use the default splitter function: (advice-add 'magit-popup-mode-display-buffer :around 'magit-popup-mode-display-buffer--split-window-sensibly) ...


3

yes-or-no-p provides this for yes/no answers (and it's often used cousin y-or-no-p). Several arguments to the interactive macro can allow prompting for arguments when a function is called interactively (using M-x to call the function, binding a key to the function, or using call-interactively). As mentioned in the documentation for interactive above, read-...


2

Don't know what kind of documentation you want, I use the following to display a short summary of elisp function/variable's docstring with popup: (defun chunyang-elisp-function-or-variable-quickhelp (symbol) "Display summary of function or variable at point. Adapted from `describe-function-or-variable'." (interactive (let* ((v-or-f (variable-at-...


2

What @JohnKitchin shows is a typical way to return something different from (but associated with) the candidate string that is chosen by the user. In your case, it sounds like you might want the completion candidates (possible choices) to show more information than what is returned after choosing. E.g., you display a bunch of text describing something, and ...


2

The following packages may help you: which-key ;;; Display available keybindings in popup hydra ;;; Make bindings that stick around Which key will remind you of available commands as you type. Then pick bindings that group your commands so they are easier to remember (C-c p is projectile-map). I type C-c p and which-key shows ...


1

I use a custom menu. with the package easy-menu you can create your own menus. They show a title, a popup help and the key shortcut. Do it like this: (easy-menu-define my-menu global-map "My-Menu" '("My-Menu" ("General" ("File" [ "insert file content" insert-file :help "Copy content of file at point" ] ) ( "---" ) ...


1

As @Drew says, it's not clear what you're looking for. However, since I found your question while creating my own function to reuse an eww window, I thought you might find it helpful. It looks for a buffer called "*eww*" (the default name for an eww buffer). If there's a live window, then use that. Otherwise, call eww in the current window. I've ...


1

I think you are looking for the magit-display-buffer-function option.


1

The following seems to work. Though it still feels like reinventing the wheel. (require 'popup) (setq my-map (let ((map (make-sparse-keymap))) (set-keymap-parent map popup-menu-keymap) (define-key map [mouse-1] 'mouse-1) map)) (defun mouse-1 (event) (interactive "e") (let ((res (popup-menu-item-of-mouse-event event))) (popup-delete ...


1

The only problem you mention with the "stock" solutions are the positioning. For popup-menu you can provide the position you got from posn-at-point so it appears "at point" instead of "at mouse position". For x-show-tip you need a bit more plumbing to take out the x/y position out of the "posn" and pass it to x-show-tip.


1

Library mouse3.el gives you what you request: a context-dependent right-click popup menu that's configurable. See Mouse3 for a complete description, screenshots, and details. By default such menus are region-related if the region is active, and it is global and click-position-related if not.


1

I usually do something like this: (defun player-choice () (let* ((choices '(("player 1" . 1440) ("player 2" . 4400))) (candidates (mapcar (lambda (cell) (cons (format "%s (%s)" (car cell) (cdr cell)) (car cell))) choices))) (cdr (assoc (completing-read "Player: " candidates) candidates)))) ...


1

I've decided to do some looking around for you on the github popup.el issues. What I found was this post which seems to say that if there is a scroll bar the window won't go over it. There also seems to be a max-width variable which you can set to limit how large the grey portion of the popup is. That is talked about in this pull request. Good luck!


1

The following example relies upon two functions from the frame-fns.el library written by Drew Adams -- http://www.emacswiki.org/emacs/frame-fns.el -- which has been consolidated into just one function for the purposes of this example. The original poster has indicated that the function tuareg-run-ocaml is the most likely suspect that causes behavior ...


1

interactive has several code characters which can be what you are looking for. If you write a function, you can specify that the user needs to provide a plain string, a buffer name, etc. All from the minibuffer. If you want to provide completion look at ido-completing-read, from ido, to request user input anywhere in your function (and it's easy to use IMHO)...


1

Here is a 3rd-party solution, using Icicles. Your code pops up a window with the candidates arranged neatly as a menu. For how, see below. You prefix each menu item with a unique character. E.g., a, b, c... or 1, 2, 3... The user hits the char to choose the item. You bind a few variables around a call to completing-read. You pass it a list of your menu ...


1

After some research I've found an idiom that can be used to create a window at the bottom (or indeed anywhere) of currently active window. This itself has effect of temporary, auxiliary window: (let ((buffer (get-buffer-create "*Name of Buffer*"))) (with-current-buffer buffer (with-current-buffer-window ;; buffer or name buffer ;; ...


1

You might also be interested in looking at the package makey. It is intended to provide similar functionality as magit-popup, and it is a fork of the predecessor of magit-popup (magit-key-mode, mentionned in the comment) from when it was not yet a package available separately from magit. Let me also mention discover : that is an example of how to use makey (...


Only top voted, non community-wiki answers of a minimum length are eligible