Subject: bug#19012: 25.0.50; `help-window-select'

From: martin rudalics <[email-masked]>
Date: Fri, 14 Nov 2014 19:10:07 +0100

> Will try again after you update the code to use, if appropriate.

OK.  Please try the below.

martin

(defvar selected-window nil)

(setq pop-up-frames  t)
(setq help-window-select  t)
(setq w32-grab-focus-on-raise  nil)
(add-to-list 'special-display-buffer-names
	      '("*Help*" foo ((background-color . "Thistle"))))
(defun foo (buf &optional args)
   (let (win)
     (setq win  (funcall special-display-function buf args))
     (raise-frame)
     win))

(defun view-lossage ()
   "Display last 300 input keystrokes.

To record all your input, use `open-dribble-file'."
   (interactive)
   (help-setup-xref (list #'view-lossage)
		   (called-interactively-p 'interactive))
   (with-help-window (help-buffer)
     (princ (mapconcat (lambda (key)
			(if (or (integerp key) (symbolp key) (listp key))
			    (single-key-description key)
			  (prin1-to-string key nil)))
		      (recent-keys)
		      " "))
     (with-current-buffer standard-output
       (goto-char (point-min))
       (while (progn (move-to-column 50) (not (eobp)))
         (when (search-forward " " nil t)
           (delete-char -1))
         (insert "\n"))
       ;; jidanni wants to see the last keystrokes immediately.
       (set-marker help-window-point-marker (point))))

   (setq selected-window (selected-window)))