[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Emacs-diffs] /srv/bzr/emacs/trunk r102179: Silence gnus-util.el com
From: |
Stefan Monnier |
Subject: |
Re: [Emacs-diffs] /srv/bzr/emacs/trunk r102179: Silence gnus-util.el compilation. |
Date: |
Mon, 01 Nov 2010 09:48:22 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) |
> -(autoload 'iswitchb-read-buffer "iswitchb")
> +(declare-function iswitchb-read-buffer "iswitchb"
> + (prompt &optional default require-match start matches-set))
> +(defvar iswitchb-temp-buflist)
> +
> (defun gnus-iswitchb-completing-read (prompt collection &optional
> require-match
> initial-input history def)
> "`iswitchb' based completing-read function."
> + (require 'iswitchb)
> (let ((iswitchb-make-buflist-hook
> (lambda ()
> (setq iswitchb-temp-buflist
I'm not convinced that declare-function+require is better than autoload.
What was the problem with autoload?
> -(if (fboundp 'select-frame-set-input-focus)
> +(if (featurep 'emacs)
> (defalias 'gnus-select-frame-set-input-focus
> 'select-frame-set-input-focus)
> - ;; XEmacs 21.4, SXEmacs
> - (defun gnus-select-frame-set-input-focus (frame)
> - "Select FRAME, raise it, and set input focus, if possible."
> - (raise-frame frame)
> - (select-frame frame)
> - (focus-frame frame)))
> + (if (fboundp 'select-frame-set-input-focus)
> + (defalias 'gnus-select-frame-set-input-focus
> 'select-frame-set-input-focus)
> + ;; XEmacs 21.4, SXEmacs
> + (defun gnus-select-frame-set-input-focus (frame)
> + "Select FRAME, raise it, and set input focus, if possible."
> + (raise-frame frame)
> + (select-frame frame)
> + (focus-frame frame))))
(featurep 'emacs) is not bad since it results in more efficient code,
but note that another way to get rid of the warning is:
(defalias 'gnus-select-frame-set-input-focus
(if (fboundp 'select-frame-set-input-focus)
#'select-frame-set-input-focus
(lambda (frame)
"Select FRAME, raise it, and set input focus, if possible."
(raise-frame frame)
(select-frame frame)
(focus-frame frame))))
Of course yet another (better) way would be to change the byte-compiler
so as to correctly keep track of defined functions in top-level conditionals.
-- Stefan
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Emacs-diffs] /srv/bzr/emacs/trunk r102179: Silence gnus-util.el compilation.,
Stefan Monnier <=