1

I added this function to my ~/.emacs file and run it by entering M-x my-turn-current-window-into-frame RET.

I added the following to my ~/.emacs file after that function:

(global-set-key (kbd "<f12>") 'my-turn-current-window-into-frame)

I copied that line to *scratch* and evaluated it.

When I press F12, Emacs returns:

Symbol's function definition is void: my-turn-current-window-into-frame

How can I configure a hot-key to run this function?

SabreWolfy
  • 1,378
  • 1
  • 13
  • 26

1 Answers1

3

This is what I did:

  • I put this code in my init.el:

    (defun my-turn-current-window-into-frame ()
      (interactive)
      (let ((buffer (current-buffer)))
        (unless (one-window-p)
          (delete-window))
        (display-buffer-pop-up-frame buffer nil)))
    
    (global-set-key (kbd "<f12>") #'my-turn-current-window-into-frame)
    
  • I restarted Emacs.

  • I issued F12.

The current window was turned into a frame.

Kaushal Modi
  • 25,203
  • 3
  • 74
  • 179
Manuel Uberti
  • 3,150
  • 18
  • 36