0

I use this command to describe the character at point, but I want the result of describe-char to occupy the entire frame. How can I achieve this?

Here is my current function:

(defun deschar-frame () "Describe the character at point in a new frame." (interactive) (let ( (bframe (make-frame '((name . "My Frame Name"))) ) (select-frame-set-input-focus bframe) (describe-char (point))))) 

I am looking for a way to make the new frame fully occupied by the describe-char buffer, without other windows splitting the frame.

3
  • I'm pretty sure this has been covered in a previous question of yours: switch to the Help buffer and delete-other-windows. Commented Sep 9 at 2:30
  • Have tried (delete-other-windows) before (describe-char (point)) but the buffer containing the file gets displayed nonetheless. Commented Sep 9 at 2:40
  • Reread my comment... Commented Sep 9 at 2:41

1 Answer 1

0
(defun deschar-frame () "Describe the character at point in a new frame." (interactive) (let ((bframe (make-frame '((name . "My Frame Name"))) ) buf pt) (setq buf (current-buffer) pt (point)) (select-frame-set-input-focus bframe) (describe-char pt buf) (switch-to-buffer "*Help*") (delete-other-windows)))) 

buf and pt are saved to begin with just in case somebody mucks around with the current buffer or point before describe-char is called. Probably unnecessary.

You are right about switch-to-buffer: I edited the get-buffer out.

5
  • Because switch-to-buffer accepts BUFFER-OR-NAME, one could just use (switch-to-buffer "*Help*"). Commented Sep 9 at 2:49
  • What is the reason for storing buf to call (describe-char (point) buf) rather than (describe-char (point))? Commented Sep 9 at 2:51
  • Edited the answer. Commented Sep 9 at 3:03
  • I wonder how one can modify (current-buffer) or (point) when a user runs "M-x deschar-frame" on a buffer at point. Is it because of the call to (select-frame-set-input-focus bframe)? Commented Sep 9 at 3:29
  • 1
    Partly yes: my ignorance of what that does made me a bit paranoid. But if the function gets modified in the future, that might add additional concerns. But as I said, it's probably unnecessary, as it stands. Commented Sep 9 at 4:04

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.