unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#8963: 24.0.50; gnus-no-server tries to connect to IMAP server
@ 2011-06-30  6:59 Daiki Ueno
  0 siblings, 0 replies; 7+ messages in thread
From: Daiki Ueno @ 2011-06-30  6:59 UTC (permalink / raw)
  To: 8963

I have been using M-x gnus-no-server to reduce Gnus startup time when
using it off-line.  However, the current Gnus always tries to connect to
all the known servers on startup.  Here is my configuration (host names
are masked):

(setq gnus-select-method '(nnnil "")
      gnus-secondary-select-methods
      '((nnimap "a"
		(nnimap-address "a.example.org")
		(nnimap-username "daiki")
		(nnir-search-engine imap))
	(nnimap "b"
		(nnimap-address "b.example.com")
		(nnimap-username "dueno")
		(nnir-search-engine imap))))

Here is the log:

Reading /home/ueno/.newsrc.eld...
Checking new news...
Reading active file via nnnil...done
Reading active file from a via nnimap...
Opening nnimap server on a...
Opening connection to a.example.org via tls...
Opening nnimap server on a...done
Reading active file from a via nnimap...done
Reading active file from b via nnimap...
Opening nnimap server on b...
Opening connection to b.example.com via tls...
Opening nnimap server on b...done
Reading active file from b via nnimap...done
Reading active file via nndraft...done
Checking new news...done


In GNU Emacs 24.0.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.0.11)
 of 2011-06-30 on localhost.localdomain
Windowing system distributor `Fedora Project', version 11.0.11002000
configured using `configure  '--with-x-toolkit=gtk3''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Group

Minor modes in effect:
  gnus-topic-mode: t
  gnus-undo-mode: t
  which-function-mode: t
  recentf-mode: t
  iswitchb-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
<escape> x g n u s SPC n o SPC SPC <return> y <escape> 
x r e p o r t SPC e m <tab> <return>

Recent messages:
Reading active file from daiki via nnimap...done
Reading active file from redhat via nnimap...
Opening nnimap server on redhat...
Opening connection to mail.corp.redhat.com via tls...
Opening nnimap server on redhat...done
Reading active file from redhat via nnimap...done
Reading active file via nndraft...done
Checking new news...done
No Gnus is good news
No more unread newsgroups

Load-path shadows:
~/.emacs.d/custom hides /usr/local/share/emacs/24.0.50/lisp/custom
~/.emacs.d/socks hides /usr/local/share/emacs/24.0.50/lisp/net/socks

Features:
(shadow sort gnus-cite flyspell ispell mail-extr emacsbug gnus-topic
nndraft nnmh utf-7 plstore epg gnutls network-stream auth-source eieio
byte-opt bytecomp byte-compile cconv assoc starttls nnimap parse-time
tls utf7 netrc nnnil gnus-agent gnus-srvr gnus-score score-mode
nnvirtual gnus-msg gnus-art mm-uu mml2015 epg-config mm-view mml-smime
smime password-cache dig mailcap nntp gnus-cache nnir gnus-sum macroexp
gnus-group gnus-undo nnmail mail-source nnoo gnus-start gnus-spec
gnus-int gnus-range message sendmail regexp-opt format-spec rfc822 mml
mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045
ietf-drums mailabbrev gmm-utils mailheader gnus-win gnus gnus-ems
nnheader gnus-util time-date mail-utils mm-util mail-prsvr uniquify
advice help-fns advice-preload deal which-func imenu recentf tree-widget
wid-edit easymenu iswitchb cus-start cus-load tooltip ediff-hook
vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image
fringe lisp-mode register page menu-bar rfn-eshadow timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham
georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese hebrew greek romanian slovak czech european ethiopic
indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple
abbrev minibuffer loaddefs button faces cus-face files text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process dbusbind
dynamic-setting system-font-setting font-render-setting move-toolbar gtk
x-toolkit x multi-tty emacs)





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#8963: 24.0.50; gnus-no-server tries to connect to IMAP server
       [not found] <mailman.709.1309417212.785.bug-gnu-emacs@gnu.org>
@ 2011-06-30 16:56 ` Lars Magne Ingebrigtsen
  2011-07-01  1:44   ` Daiki Ueno
  0 siblings, 1 reply; 7+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-06-30 16:56 UTC (permalink / raw)
  To: Daiki Ueno; +Cc: 8963

Daiki Ueno <ueno@unixuser.org> writes:

> I have been using M-x gnus-no-server to reduce Gnus startup time when
> using it off-line.  However, the current Gnus always tries to connect to
> all the known servers on startup.  Here is my configuration (host names
> are masked):
>
> (setq gnus-select-method '(nnnil "")
>       gnus-secondary-select-methods
>       '((nnimap "a"
> 		(nnimap-address "a.example.org")
> 		(nnimap-username "daiki")
> 		(nnir-search-engine imap))
> 	(nnimap "b"
> 		(nnimap-address "b.example.com")
> 		(nnimap-username "dueno")
> 		(nnir-search-engine imap))))

What `gnus-no-server' does is start Gnus on level 2 instead of the
default level 5 level.  So if you have groups on level 1 and 2,
`gnus-no-server' will still contact the servers with groups on those
levels.

Is that the case?

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#8963: 24.0.50; gnus-no-server tries to connect to IMAP server
  2011-06-30 16:56 ` bug#8963: 24.0.50; gnus-no-server tries to connect to IMAP server Lars Magne Ingebrigtsen
@ 2011-07-01  1:44   ` Daiki Ueno
  2011-07-01 10:07     ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 7+ messages in thread
From: Daiki Ueno @ 2011-07-01  1:44 UTC (permalink / raw)
  To: Lars Magne Ingebrigtsen; +Cc: 8963

Lars Magne Ingebrigtsen <lmi@gnus.org> writes:

>> (setq gnus-select-method '(nnnil "")
>>       gnus-secondary-select-methods
>>       '((nnimap "a"
>> 		(nnimap-address "a.example.org")
>> 		(nnimap-username "daiki")
>> 		(nnir-search-engine imap))
>> 	(nnimap "b"
>> 		(nnimap-address "b.example.com")
>> 		(nnimap-username "dueno")
>> 		(nnir-search-engine imap))))
>
> What `gnus-no-server' does is start Gnus on level 2 instead of the
> default level 5 level.  So if you have groups on level 1 and 2,
> `gnus-no-server' will still contact the servers with groups on those
> levels.

I'm not sure that gnus-secondary-select-methods actually works, but Gnus
in Emacs 23 (or earlier) doesn't contact to the server even if I have
the above gnus-secondary-select-methods setting.

My understanding is that levels are per-group and not per-server, and
all groups defined in ~/.newsrc.eld have level 3.  So I'm wondering
which group Gnus is trying to open.

Regards,
-- 
Daiki Ueno





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#8963: 24.0.50; gnus-no-server tries to connect to IMAP server
  2011-07-01  1:44   ` Daiki Ueno
@ 2011-07-01 10:07     ` Lars Magne Ingebrigtsen
  2011-07-02  5:42       ` Daiki Ueno
  0 siblings, 1 reply; 7+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-07-01 10:07 UTC (permalink / raw)
  To: Daiki Ueno; +Cc: 8963

Daiki Ueno <ueno@unixuser.org> writes:

> My understanding is that levels are per-group and not per-server, and
> all groups defined in ~/.newsrc.eld have level 3.  So I'm wondering
> which group Gnus is trying to open.

Could you try to `M-x debug-on-entry RET nntp-open-server RET'?  The
backtrace should then possibly tell you what group is triggering this.

The code to retrieve the startup data has been totally reworked in No
Gnus, and there may be use cases that I don't have that's triggering
this buggy behaviour.

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#8963: 24.0.50; gnus-no-server tries to connect to IMAP server
  2011-07-01 10:07     ` Lars Magne Ingebrigtsen
@ 2011-07-02  5:42       ` Daiki Ueno
  2011-07-05  5:58         ` Daiki Ueno
  0 siblings, 1 reply; 7+ messages in thread
From: Daiki Ueno @ 2011-07-02  5:42 UTC (permalink / raw)
  To: Lars Magne Ingebrigtsen; +Cc: 8963

[-- Attachment #1: Type: text/plain, Size: 590 bytes --]

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

>> My understanding is that levels are per-group and not per-server, and
>> all groups defined in ~/.newsrc.eld have level 3.  So I'm wondering
>> which group Gnus is trying to open.
>
> Could you try to `M-x debug-on-entry RET nntp-open-server RET'?  The
> backtrace should then possibly tell you what group is triggering this.

Sure, please find below the backtrace.  I did (1) load gnus-int.el and
nnimap.el, (2) M-x debug-on-entry RET nnimap-open-server RET, and M-x
gnus-no-server.  There seems no specific group appeared in the log.


[-- Attachment #2: nnimap-open-server.txt --]
[-- Type: text/plain, Size: 6869 bytes --]

Debugger entered--entering a function:
  nnimap-open-server("a" ((nnimap-address "a.example.org")))
* funcall(nnimap-open-server "a" ((nnimap-address "a.example.org")))
  (condition-case err (funcall open-server-function (nth 1 gnus-command-method) (nthcdr 2 gnus-command-method)) (error (gnus-message 1 "Unable to open server %s due to: %s" server (error-message-string err)) nil) (quit (if debug-on-quit (debug "Quit") (gnus-message 1 "Quit trying to open server %s" server)) nil))
  (let* ((open-server-function (gnus-get-function gnus-command-method (quote open-server))) (result (condition-case err (funcall open-server-function (nth 1 gnus-command-method) (nthcdr 2 gnus-command-method)) (error (gnus-message 1 "Unable to open server %s due to: %s" server (error-message-string err)) nil) (quit (if debug-on-quit (debug "Quit") (gnus-message 1 "Quit trying to open server %s" server)) nil))) open-offline) (unless elem (setq elem (list gnus-command-method nil) gnus-opened-servers (cons elem gnus-opened-servers))) (setcar (cdr elem) (cond (result (if (eq open-server-function (function nnagent-open-server)) (quote offline) (quote ok))) ((and gnus-agent (gnus-agent-method-p gnus-command-method)) (cond (gnus-server-unopen-status (setq open-offline (eq gnus-server-unopen-status ...)) gnus-server-unopen-status) ((not gnus-batch-mode) (setq open-offline t) (quote offline)) (t (quote denied)))) (t (quote denied)))) (if open-offline (let ((gnus-server-unopen-status (quote denied))) (gnus-open-server gnus-command-method)) (when (and (eq (cadr elem) (quote ok)) gnus-agent (gnus-agent-method-p gnus-command-method)) (save-excursion (gnus-agent-possibly-synchronize-flags-server gnus-command-method))) result))
  (if (eq (nth 1 elem) (quote denied)) (progn (gnus-message 1 "Denied server %s" server) nil) (let* ((open-server-function (gnus-get-function gnus-command-method (quote open-server))) (result (condition-case err (funcall open-server-function (nth 1 gnus-command-method) (nthcdr 2 gnus-command-method)) (error (gnus-message 1 "Unable to open server %s due to: %s" server (error-message-string err)) nil) (quit (if debug-on-quit (debug "Quit") (gnus-message 1 "Quit trying to open server %s" server)) nil))) open-offline) (unless elem (setq elem (list gnus-command-method nil) gnus-opened-servers (cons elem gnus-opened-servers))) (setcar (cdr elem) (cond (result (if (eq open-server-function (function nnagent-open-server)) (quote offline) (quote ok))) ((and gnus-agent (gnus-agent-method-p gnus-command-method)) (cond (gnus-server-unopen-status (setq open-offline ...) gnus-server-unopen-status) ((not gnus-batch-mode) (setq open-offline t) (quote offline)) (t (quote denied)))) (t (quote denied)))) (if open-offline (let ((gnus-server-unopen-status (quote denied))) (gnus-open-server gnus-command-method)) (when (and (eq (cadr elem) (quote ok)) gnus-agent (gnus-agent-method-p gnus-command-method)) (save-excursion (gnus-agent-possibly-synchronize-flags-server gnus-command-method))) result)))
  (let ((elem (assoc gnus-command-method gnus-opened-servers)) (server (gnus-method-to-server-name gnus-command-method))) (if (eq (nth 1 elem) (quote denied)) (progn (gnus-message 1 "Denied server %s" server) nil) (let* ((open-server-function (gnus-get-function gnus-command-method (quote open-server))) (result (condition-case err (funcall open-server-function (nth 1 gnus-command-method) (nthcdr 2 gnus-command-method)) (error (gnus-message 1 "Unable to open server %s due to: %s" server ...) nil) (quit (if debug-on-quit ... ...) nil))) open-offline) (unless elem (setq elem (list gnus-command-method nil) gnus-opened-servers (cons elem gnus-opened-servers))) (setcar (cdr elem) (cond (result (if (eq open-server-function ...) (quote offline) (quote ok))) ((and gnus-agent (gnus-agent-method-p gnus-command-method)) (cond (gnus-server-unopen-status ... gnus-server-unopen-status) (... ... ...) (t ...))) (t (quote denied)))) (if open-offline (let ((gnus-server-unopen-status (quote denied))) (gnus-open-server gnus-command-method)) (when (and (eq (cadr elem) (quote ok)) gnus-agent (gnus-agent-method-p gnus-command-method)) (save-excursion (gnus-agent-possibly-synchronize-flags-server gnus-command-method))) result))))
  gnus-open-server((nnimap "a" (nnimap-address "a.example.org")))
  (setq result (gnus-open-server method))
  (prog1 (setq result (gnus-open-server method)) (unless silent (gnus-message (if result 5 3) "Opening %s server%s...%s" (car method) (if (equal (nth 1 method) "") "" (format " on %s" (nth 1 method))) (if result "done" (format "failed: %s" (nnheader-get-report-string (car method)))))))
  (if (gnus-server-opened method) t (unless silent (gnus-message 5 "Opening %s server%s..." (car method) (if (equal (nth 1 method) "") "" (format " on %s" (nth 1 method))))) (gnus-run-hooks (quote gnus-open-server-hook)) (prog1 (setq result (gnus-open-server method)) (unless silent (gnus-message (if result 5 3) "Opening %s server%s...%s" (car method) (if (equal (nth 1 method) "") "" (format " on %s" (nth 1 method))) (if result "done" (format "failed: %s" (nnheader-get-report-string (car method))))))))
  (let ((method (or method gnus-select-method)) result) (when (stringp method) (setq method (gnus-server-to-method method))) (if (gnus-server-opened method) t (unless silent (gnus-message 5 "Opening %s server%s..." (car method) (if (equal (nth 1 method) "") "" (format " on %s" (nth 1 method))))) (gnus-run-hooks (quote gnus-open-server-hook)) (prog1 (setq result (gnus-open-server method)) (unless silent (gnus-message (if result 5 3) "Opening %s server%s...%s" (car method) (if (equal (nth 1 method) "") "" (format " on %s" (nth 1 method))) (if result "done" (format "failed: %s" (nnheader-get-report-string ...))))))))
  gnus-check-server((nnimap "a" (nnimap-address "a.example.org")))
  gnus-read-active-file-1((nnimap "a" (nnimap-address "a.example.org")) nil)
  gnus-get-unread-articles(2)
  gnus-setup-news(nil 2 t)
  byte-code("\b\204\x0e\0	\204\x0e\0\306 \210\202L\0\307\310!\210\311\n!\x13\f\204\x1e\0\r\203!\0\312 \210\313\314\x0e\x18\b#\210\307\315!\210\x0e\x19\2036\0\316\317\320\"\210\321 \210\322\x0e\x18!\210\323 \210\324\325!\210\326 \210\307\327!\210\314\207" [dont-connect did-connect gnus-startup-file gnus-current-startup-file gnus-slave gnus-use-dribble-file gnus-group-quit gnus-run-hooks gnus-startup-hook gnus-make-newsrc-file gnus-dribble-read-file gnus-setup-news nil gnus-setup-news-hook gnus-request-create-group "queue" (nndraft "") gnus-start-draft-setup gnus-group-list-groups gnus-group-first-unread-group gnus-configure-windows group gnus-group-set-mode-line gnus-started-hook level gnus-agent] 4)
  gnus-1(2 t nil)
  gnus(2 t nil)
  gnus-no-server-1(nil nil)
  gnus-no-server(nil)
  call-interactively(gnus-no-server t nil)
  execute-extended-command(nil)
  call-interactively(execute-extended-command nil nil)

[-- Attachment #3: Type: text/plain, Size: 25 bytes --]


Regards,
-- 
Daiki Ueno

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#8963: 24.0.50; gnus-no-server tries to connect to IMAP server
  2011-07-02  5:42       ` Daiki Ueno
@ 2011-07-05  5:58         ` Daiki Ueno
  2011-07-05 15:01           ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 7+ messages in thread
From: Daiki Ueno @ 2011-07-05  5:58 UTC (permalink / raw)
  To: Lars Magne Ingebrigtsen; +Cc: 8963

[-- Attachment #1: Type: text/plain, Size: 337 bytes --]

Daiki Ueno <ueno@unixuser.org> writes:

>   gnus-read-active-file-1((nnimap "a" (nnimap-address "a.example.org")) nil)
>   gnus-get-unread-articles(2)

OK, I'm trying to fix it by myself.  The attached is a proposed patch.
I would appreciate if you could double-check since I'm not completely
sure what the original code intends to do.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: gnus-no-server.patch --]
[-- Type: text/x-patch, Size: 1733 bytes --]

=== modified file 'lisp/gnus/gnus-start.el'
--- lisp/gnus/gnus-start.el	2011-06-10 00:10:24 +0000
+++ lisp/gnus/gnus-start.el	2011-07-05 05:49:35 +0000
@@ -1043,7 +1043,7 @@
 
     ;; Find the number of unread articles in each non-dead group.
     (let ((gnus-read-active-file (and (not level) gnus-read-active-file)))
-      (gnus-get-unread-articles level))))
+      (gnus-get-unread-articles level dont-connect))))
 
 (defun gnus-call-subscribe-functions (method group)
   "Call METHOD to subscribe GROUP.
@@ -1606,7 +1606,7 @@
 
 ;; Go though `gnus-newsrc-alist' and compare with `gnus-active-hashtb'
 ;; and compute how many unread articles there are in each group.
-(defun gnus-get-unread-articles (&optional level)
+(defun gnus-get-unread-articles (&optional level dont-connect)
   (setq gnus-server-method-cache nil)
   (require 'gnus-agent)
   (let* ((newsrc (cdr gnus-newsrc-alist))
@@ -1702,12 +1702,13 @@
 
     ;; If we have primary/secondary select methods, but no groups from
     ;; them, we still want to issue a retrieval request from them.
-    (dolist (method (cons gnus-select-method
-			  gnus-secondary-select-methods))
-      (when (and (not (assoc method type-cache))
-		 (gnus-check-backend-function 'request-list (car method)))
-	(with-current-buffer nntp-server-buffer
-	  (gnus-read-active-file-1 method nil))))
+    (unless dont-connect
+      (dolist (method (cons gnus-select-method
+			    gnus-secondary-select-methods))
+	(when (and (not (assoc method type-cache))
+		   (gnus-check-backend-function 'request-list (car method)))
+	  (with-current-buffer nntp-server-buffer
+	    (gnus-read-active-file-1 method nil)))))
 
     ;; Start early async retrieval of data.
     (let ((done-methods nil)


[-- Attachment #3: Type: text/plain, Size: 24 bytes --]

Regards,
-- 
Daiki Ueno

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#8963: 24.0.50; gnus-no-server tries to connect to IMAP server
  2011-07-05  5:58         ` Daiki Ueno
@ 2011-07-05 15:01           ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 7+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-07-05 15:01 UTC (permalink / raw)
  To: Daiki Ueno; +Cc: 8963

Daiki Ueno <ueno@unixuser.org> writes:

>
> OK, I'm trying to fix it by myself.  The attached is a proposed patch.
> I would appreciate if you could double-check since I'm not completely
> sure what the original code intends to do.

Thanks; that looks correct, so I've applied it to git Gnus.

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-07-05 15:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.709.1309417212.785.bug-gnu-emacs@gnu.org>
2011-06-30 16:56 ` bug#8963: 24.0.50; gnus-no-server tries to connect to IMAP server Lars Magne Ingebrigtsen
2011-07-01  1:44   ` Daiki Ueno
2011-07-01 10:07     ` Lars Magne Ingebrigtsen
2011-07-02  5:42       ` Daiki Ueno
2011-07-05  5:58         ` Daiki Ueno
2011-07-05 15:01           ` Lars Magne Ingebrigtsen
2011-06-30  6:59 Daiki Ueno

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).