[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#11939: 24.1; `save-buffers-kill-emacs' loses minibuffer focuswhenit

From: martin rudalics
Subject: bug#11939: 24.1; `save-buffers-kill-emacs' loses minibuffer focuswhenit calls `list-processes'
Date: Sun, 29 Jul 2012 15:56:04 +0200

>>  > And I think (still, so far) that that is the case because
>>  > (somehow) the minibuffer frame got _selected_, and did not
>>  > just have its input focus redirected to it.  And I think,
>>  > a priori, that is not TRT.
>> Yes.  But as long as we don't know how this happens there's
>> not much we can do about it.
> I don't understand.  Your other message, sent at the same time as that one, 
> that you know it is `yes-or-no-p' that does that, and that that is necessary.

I "know that `yes-or-no-p' does that, and that that is necessary" but I
do not know whether "it is `yes-or-no-p' that does that".  Only you
could find out by going through this with the debugger.

>> Can't you try displaying in the mode-line of each
>> window (1) that window (2) the selected window and (3) the current
>> buffer.  So after redisplay we know which window is selected ...
> Can you tell me how to do that?

No.  I forgot that when displaying the modeline, its window is selected
and its buffer made current.  But the following unnecessarily complex
part of my setup displays the window number in the modeline.

(defun prettify (size-string pretty-string)
  "Prettify number by inserting dots."
  (if (> (length size-string) 3)
      (prettify (substring size-string 0 -3)
                (concat "." (substring size-string -3) pretty-string))
    (concat size-string pretty-string)))

(defface mode-line-numbers
  '((t :family "Verdana"
       :weight bold))
  "Basic mode line face for selected window."
  :version "23.1"
  :group 'mode-line-faces)

(let* ((help-echo
        ;; The multi-line message doesn't work terribly well on the
        ;; bottom mode line...  Better ideas?
        ;;        "\
        ;; mouse-1: select window, mouse-2: delete others, mouse-3: delete,
        ;; drag-mouse-1: resize, C-mouse-2: split horizontally"
        "mouse-1: select (drag to resize), mouse-3: delete or split")
       (dashes (propertize "--" 'help-echo help-echo)))
  (setq-default mode-line-format
                 (propertize " " 'help-echo help-echo)
                 (propertize " " 'help-echo help-echo)
                 (propertize "   " 'help-echo help-echo)
                 '(vc-mode vc-mode)
                 (propertize "   " 'help-echo help-echo)
                 `(which-func-mode ("" which-func-format ,dashes))
                 `(global-mode-string (,dashes global-mode-string))
                 (propertize " " 'help-echo help-echo)))

  (setq-default mode-line-modes
                 `(:propertize ("" mode-name)
                               help-echo "mouse-1: major mode menu   mouse-3: minor 
modes menu"
                               mouse-face mode-line-highlight
                               local-map ,mode-line-major-mode-keymap)
                 '("" mode-line-process)
                 `(:propertize ("" minor-mode-alist)
                               mouse-face mode-line-highlight
                               help-echo "mouse-1: minor mode menu  mouse-3: minor 
modes menu"
                               local-map ,mode-line-minor-mode-keymap)
                 (propertize "%n" 'help-echo "mouse-3: widen"
                             'mouse-face 'mode-line-highlight
                             'local-map (make-mode-line-mouse-map
                                         'mouse-3 #'mode-line-widen))))

   '(:eval (let ((help-echo "mouse-1: select (drag to resize), mouse-3: 
             `(10 ,(propertize
                    (concat "  %l  /  %c  /  "
                             (prettify (format "%i" (point)) "")
                             'face 'mode-line-numbers)

                             (concat            ; WINDOW
                               ">" ""
                                " on.+" ""
                                 "#<window " "#" (format "   %s" 
                              (when (window-dedicated-p)
                             'face 'mode-line-numbers)

                            "  ")
                    'face 'mode-line-numbers
                    'mouse-face 'mode-line-highlight
                    'help-echo help-echo))))))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]