* 23.0.50; open-network-stream should return an error when SERVICE is a string number
@ 2007-09-18 21:00 Luca Capello
2007-09-19 15:49 ` Richard Stallman
0 siblings, 1 reply; 5+ messages in thread
From: Luca Capello @ 2007-09-18 21:00 UTC (permalink / raw)
To: emacs-pretest-bug; +Cc: rfrancoise
Please write in English if possible, because the Emacs maintainers
usually do not have translators to read other languages for them.
Your bug report will be posted to the emacs-pretest-bug@gnu.org mailing list.
Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:
Please Cc: me, I'm not subscribed to the list.
When I discover the bug in erc-default-port [1], I found that
open-network-stream behaves differently than
socks-open-network-stream WRT the SERVICE parameter:
=====
*** Welcome to IELM *** Type (describe-mode) for help.
ELISP> (open-network-stream "http-www.gnu.org" nil "www.gnu.org" "80")
#<process http-www.gnu.org>
ELISP> (open-network-stream "http-www.gnu.org" nil "www.gnu.org" 80)
#<process http-www.gnu.org<1>>
ELISP> (open-network-stream "http-www.gnu.org" nil "www.gnu.org" "www")
#<process http-www.gnu.org<2>>
ELISP> (socks-open-network-stream "http-www.gnu.org" nil "www.gnu.org" "80")
*** Eval error *** Wrong type argument: integerp, nil
ELISP> (socks-open-network-stream "http-www.gnu.org" nil "www.gnu.org" 80)
#<process socks<1>>
ELISP> (socks-open-network-stream "http-www.gnu.org" nil "www.gnu.org" "www")
#<process socks<2>>
ELISP>
=====
To be consistent, shouldn't open-network-stream return the same error
as socks-open-network-stream when SERVICE is a string number? This is
at least what it's in (describe-function 'open-network-stream):
=====
open-network-stream is a compiled Lisp function in `subr.el'.
(open-network-stream NAME BUFFER HOST SERVICE)
[...]
SERVICE is name of the service desired, or an integer specifying
a port number to connect to.
=====
Thx, bye,
Gismo / Luca
Footnotes:
[1] http://lists.gnu.org/archive/html/emacs-devel/2007-09/msg00087.html
If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
`bt full' and `xbacktrace'.
If you would like to further debug the crash, please read the file
/usr/share/emacs/23.0.50/etc/DEBUG for instructions.
In GNU Emacs 23.0.50.1 (x86_64-pc-linux-gnu)
of 2007-09-09 on elegiac, modified by Debian
(Debian emacs-snapshot package, version 1:20070909-1)
configured using `configure '--build' 'x86_64-linux-gnu' '--host' 'x86_64-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs-snapshot:/etc/emacs:/usr/local/share/emacs/23.0.50/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.0.50/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/23.0.50/leim' '--with-x=no' 'build_alias=x86_64-linux-gnu' 'host_alias=x86_64-linux-gnu' 'CFLAGS=-DDEBIAN -DSITELOAD_PURESIZE_EXTRA=5000 -g -O2''
Important settings:
value of $LC_ALL: nil
value of $LC_COLLATE: nil
value of $LC_CTYPE: en_US.UTF-8
value of $LC_MESSAGES: nil
value of $LC_MONETARY: nil
value of $LC_NUMERIC: nil
value of $LC_TIME: nil
value of $LANG: nil
locale-coding-system: utf-8
default-enable-multibyte-characters: t
Major mode: Group
Minor modes in effect:
erc-truncate-mode: t
erc-track-mode: t
erc-track-minor-mode: t
erc-spelling-mode: t
erc-services-mode: t
erc-ring-mode: t
erc-netsplit-mode: t
erc-match-mode: t
erc-pcomplete-mode: t
erc-button-mode: t
erc-fill-mode: t
erc-autojoin-mode: t
erc-autoaway-mode: t
gnus-topic-mode: t
gnus-undo-mode: t
display-battery-mode: t
display-time-mode: t
show-paren-mode: t
erc-stamp-mode: t
erc-log-mode: t
erc-scrolltobottom-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
unify-8859-on-encoding-mode: t
utf-translate-cjk-mode: t
auto-compression-mode: t
column-number-mode: t
line-number-mode: t
transient-mark-mode: t
Recent input:
ESC [ B C-c C-c d q l L ESC [ A ESC [ A C-u RET RET
q l g ESC [ B ESC [ B ESC [ B ESC [ B ESC [ B ESC [
B ESC [ B ESC [ B ESC [ B ESC [ B ESC [ B ESC [ B ESC
[ B ESC [ B ESC [ B ESC [ B ESC [ B ESC [ B ESC [ B
ESC [ B ESC [ B ESC [ B ESC [ B ESC [ B ESC [ B ESC
[ B ESC [ B ESC [ B ESC [ B ESC [ B ESC [ B ESC [ B
ESC [ B ESC [ B RET RET B r RET x q l ESC [ A ESC [
A ESC [ A ESC [ A ESC [ A ESC [ A ESC [ A ESC [ A ESC
[ A ESC [ A ESC [ A ESC [ B ESC [ B RET q ESC [ A ESC
[ A ESC [ A ESC [ A ESC [ A ESC [ A ESC [ A ESC [ A
ESC [ A ESC [ A ESC [ A ESC [ A ESC [ B ESC [ B ESC
[ B ESC [ B ESC [ B ESC [ B ESC [ B ESC [ B ESC [ B
ESC [ B ESC [ B ESC [ B ESC [ B ESC [ B ESC [ B ESC
[ B ESC [ B ESC [ B ESC [ B ESC [ B ESC [ B ESC [ B
C-c ESC f i ESC [ B C-c ESC f g ESC x r e p o r t -
e TAB b u TAB RET
Recent messages:
Exiting summary buffer and applying spam rules
Marking spam as expired without moving it
Auto-saving...done
Retrieving newsgroup: nnimap+pca.it:INBOX...
nnimap: Updating info for nnimap+pca.it:INBOX...done
Fetching headers for nnimap+pca.it:INBOX...done
Generating summary...done
Exiting summary buffer and applying spam rules
Marking spam as expired without moving it
Loading emacsbug...done
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: 23.0.50; open-network-stream should return an error when SERVICE is a string number
2007-09-18 21:00 23.0.50; open-network-stream should return an error when SERVICE is a string number Luca Capello
@ 2007-09-19 15:49 ` Richard Stallman
2007-09-20 2:46 ` Glenn Morris
0 siblings, 1 reply; 5+ messages in thread
From: Richard Stallman @ 2007-09-19 15:49 UTC (permalink / raw)
To: emacs-pretest-bug, rfrancoise; +Cc: Luca Capello
Would someone please DTRT and ack?
MIME-version: 1.0
Content-type: text/plain; charset=us-ascii
To: emacs-pretest-bug@gnu.org
From: Luca Capello <luca@pca.it>
Date: Tue, 18 Sep 2007 23:00:20 +0200
Cc: rfrancoise@debian.org
Subject: 23.0.50;
open-network-stream should return an error when SERVICE is a
string number
Please write in English if possible, because the Emacs maintainers
usually do not have translators to read other languages for them.
Your bug report will be posted to the emacs-pretest-bug@gnu.org mailing list.
Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:
Please Cc: me, I'm not subscribed to the list.
When I discover the bug in erc-default-port [1], I found that
open-network-stream behaves differently than
socks-open-network-stream WRT the SERVICE parameter:
=====
*** Welcome to IELM *** Type (describe-mode) for help.
ELISP> (open-network-stream "http-www.gnu.org" nil "www.gnu.org" "80")
#<process http-www.gnu.org>
ELISP> (open-network-stream "http-www.gnu.org" nil "www.gnu.org" 80)
#<process http-www.gnu.org<1>>
ELISP> (open-network-stream "http-www.gnu.org" nil "www.gnu.org" "www")
#<process http-www.gnu.org<2>>
ELISP> (socks-open-network-stream "http-www.gnu.org" nil "www.gnu.org" "80")
*** Eval error *** Wrong type argument: integerp, nil
ELISP> (socks-open-network-stream "http-www.gnu.org" nil "www.gnu.org" 80)
#<process socks<1>>
ELISP> (socks-open-network-stream "http-www.gnu.org" nil "www.gnu.org" "www")
#<process socks<2>>
ELISP>
=====
To be consistent, shouldn't open-network-stream return the same error
as socks-open-network-stream when SERVICE is a string number? This is
at least what it's in (describe-function 'open-network-stream):
=====
open-network-stream is a compiled Lisp function in `subr.el'.
(open-network-stream NAME BUFFER HOST SERVICE)
[...]
SERVICE is name of the service desired, or an integer specifying
a port number to connect to.
=====
Thx, bye,
Gismo / Luca
Footnotes:
[1] http://lists.gnu.org/archive/html/emacs-devel/2007-09/msg00087.html
If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
`bt full' and `xbacktrace'.
If you would like to further debug the crash, please read the file
/usr/share/emacs/23.0.50/etc/DEBUG for instructions.
In GNU Emacs 23.0.50.1 (x86_64-pc-linux-gnu)
of 2007-09-09 on elegiac, modified by Debian
(Debian emacs-snapshot package, version 1:20070909-1)
configured using `configure '--build' 'x86_64-linux-gnu' '--host' 'x86_64-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs-snapshot:/etc/emacs:/usr/local/share/emacs/23.0.50/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.0.50/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/23.0.50/leim' '--with-x=no' 'build_alias=x86_64-linux-gnu' 'host_alias=x86_64-linux-gnu' 'CFLAGS=-DDEBIAN -DSITELOAD_PURESIZE_EXTRA=5000 -g -O2''
Important settings:
value of $LC_ALL: nil
value of $LC_COLLATE: nil
value of $LC_CTYPE: en_US.UTF-8
value of $LC_MESSAGES: nil
value of $LC_MONETARY: nil
value of $LC_NUMERIC: nil
value of $LC_TIME: nil
value of $LANG: nil
locale-coding-system: utf-8
default-enable-multibyte-characters: t
Major mode: Group
Minor modes in effect:
erc-truncate-mode: t
erc-track-mode: t
erc-track-minor-mode: t
erc-spelling-mode: t
erc-services-mode: t
erc-ring-mode: t
erc-netsplit-mode: t
erc-match-mode: t
erc-pcomplete-mode: t
erc-button-mode: t
erc-fill-mode: t
erc-autojoin-mode: t
erc-autoaway-mode: t
gnus-topic-mode: t
gnus-undo-mode: t
display-battery-mode: t
display-time-mode: t
show-paren-mode: t
erc-stamp-mode: t
erc-log-mode: t
erc-scrolltobottom-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
unify-8859-on-encoding-mode: t
utf-translate-cjk-mode: t
auto-compression-mode: t
column-number-mode: t
line-number-mode: t
transient-mark-mode: t
Recent input:
ESC [ B C-c C-c d q l L ESC [ A ESC [ A C-u RET RET
q l g ESC [ B ESC [ B ESC [ B ESC [ B ESC [ B ESC [
B ESC [ B ESC [ B ESC [ B ESC [ B ESC [ B ESC [ B ESC
[ B ESC [ B ESC [ B ESC [ B ESC [ B ESC [ B ESC [ B
ESC [ B ESC [ B ESC [ B ESC [ B ESC [ B ESC [ B ESC
[ B ESC [ B ESC [ B ESC [ B ESC [ B ESC [ B ESC [ B
ESC [ B ESC [ B RET RET B r RET x q l ESC [ A ESC [
A ESC [ A ESC [ A ESC [ A ESC [ A ESC [ A ESC [ A ESC
[ A ESC [ A ESC [ A ESC [ B ESC [ B RET q ESC [ A ESC
[ A ESC [ A ESC [ A ESC [ A ESC [ A ESC [ A ESC [ A
ESC [ A ESC [ A ESC [ A ESC [ A ESC [ B ESC [ B ESC
[ B ESC [ B ESC [ B ESC [ B ESC [ B ESC [ B ESC [ B
ESC [ B ESC [ B ESC [ B ESC [ B ESC [ B ESC [ B ESC
[ B ESC [ B ESC [ B ESC [ B ESC [ B ESC [ B ESC [ B
C-c ESC f i ESC [ B C-c ESC f g ESC x r e p o r t -
e TAB b u TAB RET
Recent messages:
Exiting summary buffer and applying spam rules
Marking spam as expired without moving it
Auto-saving...done
Retrieving newsgroup: nnimap+pca.it:INBOX...
nnimap: Updating info for nnimap+pca.it:INBOX...done
Fetching headers for nnimap+pca.it:INBOX...done
Generating summary...done
Exiting summary buffer and applying spam rules
Marking spam as expired without moving it
Loading emacsbug...done
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: 23.0.50; open-network-stream should return an error when SERVICE is a string number
2007-09-19 15:49 ` Richard Stallman
@ 2007-09-20 2:46 ` Glenn Morris
2007-09-20 14:05 ` Luca Capello
0 siblings, 1 reply; 5+ messages in thread
From: Glenn Morris @ 2007-09-20 2:46 UTC (permalink / raw)
To: rms; +Cc: emacs-pretest-bug, rfrancoise, Luca Capello
Richard Stallman wrote:
> Would someone please DTRT and ack?
I've installed a doc fix.
> To: emacs-pretest-bug@gnu.org
> From: Luca Capello <luca@pca.it>
> Date: Tue, 18 Sep 2007 23:00:20 +0200
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: 23.0.50; open-network-stream should return an error when SERVICE is a string number
2007-09-20 2:46 ` Glenn Morris
@ 2007-09-20 14:05 ` Luca Capello
2007-09-20 18:28 ` Glenn Morris
0 siblings, 1 reply; 5+ messages in thread
From: Luca Capello @ 2007-09-20 14:05 UTC (permalink / raw)
To: Glenn Morris; +Cc: emacs-pretest-bug, rfrancoise, rms
Hello!
On Thu, 20 Sep 2007 04:46:51 +0200, Glenn Morris wrote:
> Richard Stallman wrote:
>
>> Would someone please DTRT and ack?
>
> I've installed a doc fix.
I saw the fix is in `socks-open-network-stream' [1]. While this
indeed improves the error handling, this doesn't address the issue:
`socks-open-network-stream' correctly behaves WRT the documentation
(SERVICE should be either an integer or a string service), which is
not the case for `open-network-stream' (as the title of this bug).
Please reconsider the whole problem and be consistent with the
behavior of `socks-open-network-stream' instead. Or we should change
the documentation and in that case modify `socks-open-network-stream',
but I still think that the former is the solution.
I see two possibilities:
1) we generalize `socks-find-services-entry' (something like
`find-network-services-entry') and use the same (if ...) in
`open-network-stream'. This is my preferred solution, because it
means less duplicate code...
2) we modify `open-network-stream' like the following dirty hack:
--8<---------------cut here---------------start------------->8---
--- subr.el 02 Sep 2007 01:55:11 +0200 1.564
+++ subr.el 20 Sep 2007 09:13:09 +0200
@@ -1556,6 +1556,9 @@
HOST is name of the host to connect to, or its IP address.
SERVICE is name of the service desired, or an integer specifying
a port number to connect to."
+ (when (and (stringp service)
+ (not (eq 0 (string-to-number service))))
+ (error "SERVICE should be an integer or a service string, not a string number."))
(make-network-process :name name :buffer buffer
:host host :service service)))
--8<---------------cut here---------------end--------------->8---
I can implement the first solution ;-)
BTW, I didn't propose the two solutions before because:
a) I wasn't sure this is a bug
b) I think the real problem is `make-network-process':
=====
ELISP> (make-network-process :name "http-www.gnu.org" :buffer nil
:host "www.gnu.org" :service "80")
#<process http-www.gnu.org>
ELISP> (make-network-process :name "http-www.gnu.org" :buffer nil
:host "www.gnu.org" :service 80)
#<process http-www.gnu.org<1>>
ELISP> (make-network-process :name "http-www.gnu.org" :buffer nil
:host "www.gnu.org" :service "www")
#<process http-www.gnu.org<2>>
ELISP>
=====
The first one should return an error as well:
=====
make-network-process is a built-in function in `C source code'.
(make-network-process &rest ARGS)
[...]
:service SERVICE -- SERVICE is name of the service desired, or an
integer specifying a port number to connect to. If SERVICE is t,
a random port number is selected for the server.
=====
Thx, bye,
Gismo / Luca
Footnotes:
[1] http://cvs.sv.gnu.org/viewvc/emacs/emacs/lisp/net/socks.el?r1=1.5&r2=1.6
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: 23.0.50; open-network-stream should return an error when SERVICE is a string number
2007-09-20 14:05 ` Luca Capello
@ 2007-09-20 18:28 ` Glenn Morris
0 siblings, 0 replies; 5+ messages in thread
From: Glenn Morris @ 2007-09-20 18:28 UTC (permalink / raw)
To: Luca Capello; +Cc: emacs-pretest-bug, rfrancoise, rms
Luca Capello wrote:
>> I've installed a doc fix.
>
> I saw the fix is in `socks-open-network-stream' [1].
No, that's a separate issue. The doc fix is in make-network-process in
process.c.
> b) I think the real problem is `make-network-process':
Which is where I installed the doc fix.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-09-20 18:28 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-18 21:00 23.0.50; open-network-stream should return an error when SERVICE is a string number Luca Capello
2007-09-19 15:49 ` Richard Stallman
2007-09-20 2:46 ` Glenn Morris
2007-09-20 14:05 ` Luca Capello
2007-09-20 18:28 ` Glenn Morris
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.