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

Re: [Q]completion policy



Hi,

"T. V. Raman" <ramantv@xxxxxxxxxxx> writes:

> You can fix this problem by making the advice on completion
> commands smarter.

I have written an advice for mew-complete(for mailer Mew) based on
minibuffer-complete like this; it may be the same approach as you
mentikoned:

--code begin
(defadvice mew-complete-address (around emacspeak pre act)
  "Say what you completed."
  (let* ((beg (save-excursion
		 (re-search-backward "[ 	,:]")
		 (forward-char 1)
		 (point)))
        (dtk-stop-immediately t)
	(prior-key (buffer-substring beg (point)))
	(prior (point)))
    (emacspeak-kill-buffer-carefully "*Mew completions*")
    ad-do-it
    (let ((completions-buffer (get-buffer "*Mew completions*")))
      (if (or (> (point) prior)
	      (not (string-equal prior-key (buffer-substring beg prior))))
          (dtk-speak (buffer-substring beg (point )))
        (when (and completions-buffer
                   (window-live-p (get-buffer-window completions-buffer )))
          (save-excursion
            (set-buffer completions-buffer )
            (emacspeak-prepare-completions-buffer)
            (dtk-speak (buffer-string ))))))
    ad-return-value))
--code end

It is made for mail address completion so that it first
backward-searhces the address field separator.

It seems to work well, but, just like minibuffer-complete, user can't
know exactly whether 
(a) characters left to the point is changed or 
(b) simply new characters are added.
Do you think is it OK or have some idea about representing (1) or (b)?

Best regards.
-- 
                    Koichi Inoue
                    E-Mail: inopie@xxxxxxxxxxx
                    ICQ UIN: 74900690

-----------------------------------------------------------------------------
To unsubscribe from the emacspeak list or change your address on the
emacspeak list send mail to "emacspeak-request@xxxxxxxxxxx" with a
subject of "unsubscribe" or "help"


Emacspeak Files | Subscribe | Unsubscribe