emacs-devel
[Top][All Lists]
Advanced

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

Re: Feature request : Tab-completion for 'shell-comand'


From: Juri Linkov
Subject: Re: Feature request : Tab-completion for 'shell-comand'
Date: Fri, 07 Mar 2008 01:48:32 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (x86_64-unknown-linux-gnu)

>> I think that when the minibuffer is active, we should still output
>> a message, only differently (as does minibuffer-message).  Maybe just
>> using minibuffer-message (and changing it so it uses plain "message"
>> when the minibuffer is not active) would do the trick.
>
> I wish _all_ messages would display ala minibuffer-message when the
> user's editing in the minibuffer -- the current behavior (temporarily
> ovewriting the minibuffer to show messages) is stupid and annoying,
> especially given that many errors one gets are fairly trivial or
> transient.
>
> I made a patch to do this sometime before Emacs 21 was released, and
> recall various issues popping up though... I think mainly it was the
> somewhat more exotic users of message, like quail completion info etc.

I see that quail completion currently doesn't work correctly in the
minibuffer: it doesn't display completions in the minibuffer for
multi-key input methods.  So this needs fixing anyway.

BTW, I see there are several duplicate implementations of
`minibuffer-message' in Emacs.  Maybe they all can be replaced
with a simple call to `minibuffer-message'?

(defun quail-minibuffer-message (string)
  (message nil)
  (let ((point-max (point-max))
        (inhibit-quit t))
    (save-excursion
      (goto-char point-max)
      (insert string))
    (sit-for 1000000)
    (delete-region point-max (point-max))
    (when quit-flag
      (setq quit-flag nil
            unread-command-events '(7)))))

(defun file-cache-temp-minibuffer-message (msg)
  "A Lisp version of `temp_minibuffer_message' from minibuf.c."
  (let ((savemax (point-max)))
    (save-excursion
      (goto-char (point-max))
      (insert msg))
    (let ((inhibit-quit t))
      (sit-for 2)
      (delete-region savemax (point-max))
      (if quit-flag
          (setq quit-flag nil
                unread-command-events (list 7))))))

(defun calc-temp-minibuffer-message (m)
  (let ((savemax (point-max)))
    (save-excursion
      (goto-char (point-max))
      (insert m))
    (let ((okay nil))
      (unwind-protect
          (progn
            (sit-for 2)
            (identity 1)   ; this forces a call to QUIT; in bytecode.c.
            (setq okay t))
        (progn
          (delete-region savemax (point-max))
          (or okay (abort-recursive-edit)))))))

(defun PC-temp-minibuffer-message (message)
  "A Lisp version of `temp_minibuffer_message' from minibuf.c."
  (cond (PC-not-minibuffer
         (message "%s" message)
         (sit-for 2)
         (message ""))
        ((fboundp 'temp-minibuffer-message)
         (temp-minibuffer-message message))
        (t
         (let ((point-max (point-max)))
           (save-excursion
             (goto-char point-max)
             (insert message))
           (let ((inhibit-quit t))
             (sit-for 2)
             (delete-region point-max (point-max))
             (when quit-flag
               (setq quit-flag nil
                     unread-command-events '(7))))))))

-- 
Juri Linkov
http://www.jurta.org/emacs/




reply via email to

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