emacs-pretest-bug
[Top][All Lists]
Advanced

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

RE: Bad defcustom in speedbar, or non-interactive message in locate-libr


From: Drew Adams
Subject: RE: Bad defcustom in speedbar, or non-interactive message in locate-library (was: How to suppress messages?)
Date: Thu, 27 Jan 2005 15:31:03 -0800

    The situation appears to be the same in the code of Emacs 20
    and Emacs 21. I
    see the pb only in Emacs 20. However, I get a different message
    periodically
    (same symptoms) in Emacs 21, and that message may be masking
    this message.
    [That other pb has already been reported (and fixed, I
    believe): superfluous
    message "Defining colors..." in w32-win.el's version of
    xw-defined-colors.]

    In any case, I believe that the defcustom and/or locate-library should
    probably be improved to prevent such an inappropriate message.

BTW, wrapping the defcustom that calls locate-library with a non-nil binding
of executing-kbd-macro solves the Emacs 20 pb, as indicated.

But wrapping the call to defined-colors in widget-color-complete does not
solve the "Defining colors..." message bug in Emacs 21. I was thinking that
it might, because I was guessing that my custom code also indirectly called
widget-color-complete, which calls defined-colors (which calls
xw-defined-colors). Here is widget-color-complete:

(defun widget-color-complete (widget)
  "Complete the color in WIDGET."
  (require 'facemenu)                   ; for facemenu-color-alist
  (let* ((prefix (buffer-substring-no-properties (widget-field-start widget)
                                                 (point)))
         (list (or facemenu-color-alist (defined-colors)))
         (completion (try-completion prefix list)))
    (cond ((eq completion t)
           (message "Exact match."))
          ((null completion)
           (error "Can't find completion for \"%s\"" prefix))
          ((not (string-equal prefix completion))
           (insert-and-inherit (substring completion (length prefix))))
          (t
           (message "Making completion list...")
           (with-output-to-temp-buffer "*Completions*"
             (display-completion-list (all-completions prefix list nil)))
           (message "Making completion list...done")))))





reply via email to

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