GNU bug report logs - #31148
26.1; require w32 errors

Previous Next

Package: emacs;

Reported by: Alex Branham <alex.branham <at> gmail.com>

Date: Fri, 13 Apr 2018 14:52:01 UTC

Severity: normal

Merged with 6997, 32157

Found in versions 24.0.50, 26.1

Fixed in version 27.1

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 31148 in the body.
You can then email your comments to 31148 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#31148; Package emacs. (Fri, 13 Apr 2018 14:52:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Alex Branham <alex.branham <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 13 Apr 2018 14:52:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Alex Branham <alex.branham <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.1; require w32 errors
Date: Fri, 13 Apr 2018 09:50:47 -0500
Hi -

If you try

(require 'w32-fns)

or

(require 'w32-fns nil t)

It produces an error void-function set-message-beep. This is reproducible for me from emacs -q.



Debugger entered--Lisp error: (void-function set-message-beep)
  set-message-beep(nil)
  byte-code("\300\301\302\303#\210\304\301\302\305#\210\306\307\310\"\210\311\303!\207" [defalias set-w32-system-coding-system w32-set-system-coding-system nil make-obsolete "26.1" defvaralias w32-system-coding-system locale-coding-system set-message-beep] 4)
  #<subr require>(w32-fns nil t)
  ad-Advice-require(#<subr require> w32-fns nil t)
  apply(ad-Advice-require #<subr require> (w32-fns nil t))
  require(w32-fns nil t)
  eval((require 'w32-fns nil t) nil)
  eval-expression((require 'w32-fns nil t) nil nil 127)
  funcall-interactively(eval-expression (require 'w32-fns nil t) nil nil 127)
  call-interactively(eval-expression nil nil)
  command-execute(eval-expression)

In GNU Emacs 26.1 (build 1, x86_64-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2018-04-10 built on earth
Windowing system distributor 'The X.Org Foundation', version 11.0.11906000

Configured using:
 'configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib
 --localstatedir=/var --mandir=/usr/share/man --with-gameuser=:games
 --with-sound=alsa --with-modules --without-gconf --without-gsettings
 --with-mailutils --with-xml2 --with-x-toolkit=lucid --with-xft
 --with-xaw3d --with-imagemagick 'CFLAGS=-march=x86-64 -mtune=generic
 -O2 -pipe -fstack-protector-strong -fno-plt'
 CPPFLAGS=-D_FORTIFY_SOURCE=2
 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now'

Configured features:
XAW3D XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS NOTIFY ACL
GNUTLS LIBXML2 FREETYPE LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS LUCID X11
MODULES THREADS LIBSYSTEMD LCMS2

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31148; Package emacs. (Fri, 13 Apr 2018 15:14:02 GMT) Full text and rfc822 format available.

Message #8 received at 31148 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Alex Branham <alex.branham <at> gmail.com>
Cc: 31148 <at> debbugs.gnu.org
Subject: Re: bug#31148: 26.1; require w32 errors
Date: Fri, 13 Apr 2018 18:13:41 +0300
> From: Alex Branham <alex.branham <at> gmail.com>
> Date: Fri, 13 Apr 2018 09:50:47 -0500
> 
> If you try
> 
> (require 'w32-fns)
> 
> or
> 
> (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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31148; Package emacs. (Fri, 13 Apr 2018 15:17:02 GMT) Full text and rfc822 format available.

Message #11 received at 31148 <at> debbugs.gnu.org (full text, mbox):

From: Alex Branham <alex.branham <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 31148 <at> debbugs.gnu.org
Subject: Re: bug#31148: 26.1; require w32 errors
Date: Fri, 13 Apr 2018 10:15:59 -0500
On Fri 13 Apr 2018 at 10:13, Eli Zaretskii <eliz <at> gnu.org> wrote:

>> From: Alex Branham <alex.branham <at> gmail.com>
>> Date: Fri, 13 Apr 2018 09:50:47 -0500
>>
>> If you try
>>
>> (require 'w32-fns)
>>
>> or
>>
>> (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-...))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31148; Package emacs. (Fri, 13 Apr 2018 17:23:01 GMT) Full text and rfc822 format available.

Message #14 received at 31148 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Alex Branham <alex.branham <at> gmail.com>
Cc: 31148 <at> debbugs.gnu.org
Subject: Re: bug#31148: 26.1; require w32 errors
Date: Fri, 13 Apr 2018 20:22:41 +0300
> From: Alex Branham <alex.branham <at> gmail.com>
> Cc: 31148 <at> 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?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31148; Package emacs. (Fri, 13 Apr 2018 17:46:02 GMT) Full text and rfc822 format available.

Message #17 received at 31148 <at> debbugs.gnu.org (full text, mbox):

From: Alex Branham <alex.branham <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 31148 <at> debbugs.gnu.org
Subject: Re: bug#31148: 26.1; require w32 errors
Date: Fri, 13 Apr 2018 12:45:37 -0500
On Fri 13 Apr 2018 at 12:22, Eli Zaretskii <eliz <at> gnu.org> wrote:

>> From: Alex Branham <alex.branham <at> gmail.com>
>> Cc: 31148 <at> 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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31148; Package emacs. (Fri, 13 Apr 2018 17:56:02 GMT) Full text and rfc822 format available.

Message #20 received at 31148 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Alex Branham <alex.branham <at> gmail.com>
Cc: 31148 <at> debbugs.gnu.org
Subject: Re: bug#31148: 26.1; require w32 errors
Date: Fri, 13 Apr 2018 20:54:53 +0300
> From: Alex Branham <alex.branham <at> gmail.com>
> Cc: 31148 <at> debbugs.gnu.org
> Date: Fri, 13 Apr 2018 12:45:37 -0500
> 
> (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?

Yes, declare-function should solve at least some of those.

As for the rest, I suggest to define a variable/function (seems like
ess-microsoft-p is already doing that) to tell you whether you are on
MS-Windows, e.g., by looking at system-type, and then condition all
the calls to w32-specific functions on that variable/function.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31148; Package emacs. (Fri, 13 Apr 2018 17:59:02 GMT) Full text and rfc822 format available.

Message #23 received at 31148 <at> debbugs.gnu.org (full text, mbox):

From: Alex Branham <alex.branham <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 31148 <at> debbugs.gnu.org
Subject: Re: bug#31148: 26.1; require w32 errors
Date: Fri, 13 Apr 2018 12:58:46 -0500
On Fri 13 Apr 2018 at 12:54, Eli Zaretskii <eliz <at> gnu.org> wrote:

>> From: Alex Branham <alex.branham <at> gmail.com>
>> Cc: 31148 <at> debbugs.gnu.org
>> Date: Fri, 13 Apr 2018 12:45:37 -0500
>> 
>> (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?
>
> Yes, declare-function should solve at least some of those.
>
> As for the rest, I suggest to define a variable/function (seems like
> ess-microsoft-p is already doing that) to tell you whether you are on
> MS-Windows, e.g., by looking at system-type, and then condition all
> the calls to w32-specific functions on that variable/function.

Thanks, will do. I guess this bug report can be closed (can I do that myself?)

Thanks again,
Alex




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31148; Package emacs. (Fri, 13 Apr 2018 18:59:01 GMT) Full text and rfc822 format available.

Message #26 received at 31148 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Alex Branham <alex.branham <at> gmail.com>
Cc: 31148 <at> debbugs.gnu.org
Subject: Re: bug#31148: 26.1; require w32 errors
Date: Fri, 13 Apr 2018 21:58:41 +0300
> From: Alex Branham <alex.branham <at> gmail.com>
> Cc: 31148 <at> debbugs.gnu.org
> Date: Fri, 13 Apr 2018 12:58:46 -0500
> 
> I guess this bug report can be closed (can I do that myself?)

Yes, you can: send email to 31148-done <at> debbugs.gnu.org.

Thanks.




Reply sent to Alex Branham <alex.branham <at> gmail.com>:
You have taken responsibility. (Fri, 13 Apr 2018 19:05:02 GMT) Full text and rfc822 format available.

Notification sent to Alex Branham <alex.branham <at> gmail.com>:
bug acknowledged by developer. (Fri, 13 Apr 2018 19:05:02 GMT) Full text and rfc822 format available.

Message #31 received at 31148-done <at> debbugs.gnu.org (full text, mbox):

From: Alex Branham <alex.branham <at> gmail.com>
To: 31148-done <at> debbugs.gnu.org
Subject: Close
Date: Fri, 13 Apr 2018 14:04:06 -0500
Close bug report




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31148; Package emacs. (Sat, 14 Apr 2018 04:23:02 GMT) Full text and rfc822 format available.

Message #34 received at 31148 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> gmail.com>
To: Alex Branham <alex.branham <at> gmail.com>
Cc: 31148 <at> debbugs.gnu.org
Subject: Re: bug#31148: 26.1; require w32 errors
Date: Sat, 14 Apr 2018 00:22:51 -0400
merge 31148 6997
quit

Alex Branham <alex.branham <at> gmail.com> writes:

> Hi -
>
> If you try
>
> (require 'w32-fns)
>
> or
>
> (require 'w32-fns nil t)
>
> It produces an error void-function set-message-beep. This is reproducible for me from emacs -q.

This is fixed on master (except you need to use (load "w32-fns") because
w32-fns.el doesn't (provide 'w32-fns)).






Merged 6997 31148. Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Sat, 14 Apr 2018 04:24:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 12 May 2018 11:24:06 GMT) Full text and rfc822 format available.

bug unarchived. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Sun, 15 Jul 2018 17:36:03 GMT) Full text and rfc822 format available.

Forcibly Merged 6997 31148 32157. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Sun, 15 Jul 2018 17:36:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 15 Aug 2018 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 6 years and 306 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.