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

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

bug#31148: 26.1; require w32 errors


From: Alex Branham
Subject: bug#31148: 26.1; require w32 errors
Date: Fri, 13 Apr 2018 12:45:37 -0500
User-agent: mu4e 1.0; emacs 26.1

On Fri 13 Apr 2018 at 12:22, Eli Zaretskii <eliz@gnu.org> wrote:

>> From: Alex Branham <alex.branham@gmail.com>
>> Cc: 31148@debbugs.gnu.org
>> Date: Fri, 13 Apr 2018 10:15:59 -0500
>>
>> >> (require 'w32-fns nil t)
>> >>
>> >> It produces an error void-function set-message-beep. This is reproducible 
>> >> for me from emacs -q.
>> >
>> > Don't do that, then, unless you are in a w32 Emacs.
>>
>> What's the recommended way for packages to rely on these functions then?
>> It seems annoying to wrap every call to w32-functions in
>> (if (fboundp ...) (w32-...))
>
> I don't understand the question.  w32-fns.el is preloaded on
> MS-Windows, so packages that rely on some function from there can
> simply call them.
>
> IOW, why would you want to 'require' w32-fns?

I'm going through and editing some older ESS code, and they make checks
like this:

(if (not (w32-shell-dos-semantics))
      (add-hook 'comint-output-filter-functions 'ess-bugs-exit-notify-sh))

Which causes errors on non-windows machines unless you wrap the call to
w32-shell-dos-semantics in (and (fboundp ...)), which looks weird to me:

(if (not (and
           (fboundp 'w32-shell-dos-semantics)
           (w32-shell-dos-semantics)))
      (add-hook 'comint-output-filter-functions 'ess-bugs-exit-notify-sh))

They also have code like:

(if (ess-microsoft-p)
  (w32-short-file-name ...))

which causes byte compiler warnings about w32 being undefined. I guess
the best/only way to get rid of these is to (declare-function ... ),
right?

Thanks,
Alex





reply via email to

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