From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/65048 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.gnus.general Subject: Re: Sticky article buffers Date: Tue, 14 Aug 2007 09:34:20 +0200 Message-ID: <87ps1qbmdf.fsf@baldur.tsdh.de> References: <876448eby7.fsf@baldur.tsdh.de> <87ir888cgd.fsf@baldur.tsdh.de> <873ayprmja.fsf@baldur.tsdh.de> <87hcn3oabn.fsf@baldur.tsdh.de> <87zm0vmsxw.fsf@baldur.tsdh.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1187077173 14797 80.91.229.12 (14 Aug 2007 07:39:33 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 14 Aug 2007 07:39:33 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M13558@lists.math.uh.edu Tue Aug 14 09:36:33 2007 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.50) id 1IKqwC-00044p-8V for ding-account@gmane.org; Tue, 14 Aug 2007 09:35:36 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1IKqvh-00006Y-8n; Tue, 14 Aug 2007 02:35:05 -0500 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1IKqve-00006F-1X for ding@lists.math.uh.edu; Tue, 14 Aug 2007 02:35:02 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtp (Exim 4.67) (envelope-from ) id 1IKqvZ-0003FC-NW for ding@lists.math.uh.edu; Tue, 14 Aug 2007 02:35:01 -0500 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1IKqvY-0002On-00 for ; Tue, 14 Aug 2007 09:34:56 +0200 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1IKqvW-0000Km-AC for ding@gnus.org; Tue, 14 Aug 2007 09:34:54 +0200 Original-Received: from dslb-084-063-059-104.pools.arcor-ip.net ([84.63.59.104]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 14 Aug 2007 09:34:54 +0200 Original-Received: from tassilo by dslb-084-063-059-104.pools.arcor-ip.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 14 Aug 2007 09:34:54 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 211 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: dslb-084-063-059-104.pools.arcor-ip.net Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAD1BMVEW2mhnYvEn26qD+/vbC t5CEWCLiAAAACXBIWXMAAAsSAAALEgHS3X78AAAATnRFWHRSYXcgcHJvZmlsZSB0eXBlIGV4aWYA CmV4aWYKICAgICAgMjAKNDU3ODY5NjYwMDAwNGQ0ZDAwMmEwMDAwMDAwODAwMDAwMDAwMDAwMAqJ uBZbAAAACXZwQWcAAAAwAAAAMADO7oxXAAABkElEQVQ4y3WTDZLCIAyFQ08A6AFK0gNowgG6de9/ pn2Bau22ZRyF+ZKXX8lOjqZs1K9i+gUmStKAxmzTsjlECtwBEUfKb1CJKDvQkfwEWUFZCsD0shpi I8MbZAWoQWNI+KS3S2VhACaolwSAXzGkUD0ok7q4liwID4vFJAGEG1DIorDV4pGmXBCKka7GJPb0 ItwlIMHsHkJQMftlPKQQIVDA+wmAXgi70pg5pTyiGwC5t2SCw0LBOHNJ3oDH2sQf2CciETXNMLKx A82IhtCtbV6kQsJfT+aYuJB8+jtIA/OQiK3QNpDUgZeMtDYA7QZQl0fsUn6rK4heE+I36+WFvnMH paVobYJ6l5Ztr0M+IlgQr0vMvlKRPj0X5R1oDuXmXnICpDV9B6ooeugX//oCs2ry8dlzDyCASd2O HtNg2CC/jbwDMybYd24PoMSx8HugG3gMUoZtIhuYuRV3ANXX8XUCvIBRjkDjDStgR1CD/PuDrmDM dg7i6xwclVZQDkoriHwB7nYBlgugcgXsSurk/AEJvb3wF7X09QAAABp6VFh0anBlZzpjb2xvcnNw YWNlAAB42jMCAAAzADOJOCM1AAAAJnpUWHRqcGVnOnNhbXBsaW5nLWZhY3RvcgAAeNozqjDSMaww BGEAEYMC6T2XL08AAAAASUVORK5CYII= User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1.50 (gnu/linux) Cancel-Lock: sha1:XBI0EdP+m4ryMlq/+r7CzUcoShE= X-Spam-Score: -2.6 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:65048 --=-=-= Katsumi Yamaoka writes: Hi Katsumi, > Thank you for contributing a good feature. I tried it today and > realized it is really useful. Thanks for the compliments! > Though I have no plan for the moment, people might want a browser > function for many sticky articles. :) Currently I use `ibuffer' and `s m' which sorts buffers by mode. But it might be useful to switch between sticky article buffers with something like `switch-to-buffer' which tab-completes only sticky articles. Or do you have another suggestion? Anyway, I applied your patch and tested it. > Please let me write about a few problems in `gnus-sticky-article'. > > 1. (gnus-configure-windows 'article) makes an empty article > buffer and leads creating of an empty sticky article if there > is no article buffer initially, but is not necessary because > `gnus-summary-select-article' runs it by way of > `gnus-summary-display-article' and `gnus-article-prepare' > after preparing an article. Seems to work now. > 2. It seems to be useless that this command always makes a new > sticky article buffer. I mean, performing of the `A S' > command repeatedly on an article creates "*Sticky Article*", > "*Sticky Article*<2>", "*Sticky Article*<3>"... Yes, that's indeed useless. With your patch it's fixed. > 3. The value of the `gnus-article-buffer' variable in the summary > buffer is not updated when I select another (normal) article. > Because of this, a non-ASCII article or a QP-encoded article > is not decoded when I type `P' or `N' in the summary buffer. Seems to be fixed, too. > 4. I wish you to leave the value of the `indent-tabs-mode' > variable the default if there is no good reason. Now some > lines are indented with tabs but others aren't. Oh, sorry. I've put file local variables into the files I modified, but maybe I inserted the spaces before I did that. Is there a mechanism to set variables based on the directory a file resides? If not I'll do something home-brewed and hook it into find-file-hook. > I tried improving these problems. Thanks. As far as I can see all problems are fixed. Here's a patch that incorporates all your changes plus a changelog entry. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=fix-sticky-articles.patch Content-Description: Fix sticky articles Index: lisp/gnus-sum.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/gnus-sum.el,v retrieving revision 7.194 diff -u -r7.194 gnus-sum.el --- lisp/gnus-sum.el 12 Aug 2007 11:02:19 -0000 7.194 +++ lisp/gnus-sum.el 14 Aug 2007 07:31:43 -0000 @@ -7413,15 +7413,15 @@ (defun gnus-summary-display-article (article &optional all-header) "Display ARTICLE in article buffer." - (when (gnus-buffer-live-p gnus-article-buffer) - (with-current-buffer gnus-article-buffer - (mm-enable-multibyte))) + (unless (and (gnus-buffer-live-p gnus-article-buffer) + (with-current-buffer gnus-article-buffer + (eq major-mode 'gnus-article-mode))) + (gnus-article-setup-buffer)) (gnus-set-global-variables) - (when (gnus-buffer-live-p gnus-article-buffer) - (with-current-buffer gnus-article-buffer - (setq gnus-article-charset gnus-newsgroup-charset) - (setq gnus-article-ignored-charsets gnus-newsgroup-ignored-charsets) - (mm-enable-multibyte))) + (with-current-buffer gnus-article-buffer + (setq gnus-article-charset gnus-newsgroup-charset) + (setq gnus-article-ignored-charsets gnus-newsgroup-ignored-charsets) + (mm-enable-multibyte)) (if (null article) nil (prog1 Index: lisp/gnus-art.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/gnus-art.el,v retrieving revision 7.225 diff -u -r7.225 gnus-art.el --- lisp/gnus-art.el 12 Aug 2007 11:02:19 -0000 7.225 +++ lisp/gnus-art.el 14 Aug 2007 07:31:57 -0000 @@ -4371,46 +4371,46 @@ (defun gnus-sticky-article (arg) "Make the current article sticky. -If a prefix ARG is given, ask for a name for this sticky article -buffer." +If a prefix ARG is given, ask for a name for this sticky article buffer." (interactive "P") - (gnus-configure-windows 'article) (gnus-summary-show-thread) (gnus-summary-select-article nil nil 'pseudo) (let (new-art-buf-name) (gnus-eval-in-buffer-window gnus-article-buffer (setq new-art-buf-name - (rename-buffer - (concat - "*Sticky Article: " - (if arg - (read-from-minibuffer "Sticky article buffer name: ") - (gnus-with-article-headers - (gnus-article-goto-header "subject") - (setq new-art-buf-name - (buffer-substring-no-properties - (line-beginning-position) (line-end-position))) - (goto-char (point-min)) - (gnus-article-goto-header "from") - (setq new-art-buf-name - (concat - new-art-buf-name ", " - (buffer-substring-no-properties - (line-beginning-position) (line-end-position)))) - (goto-char (point-min)) - (gnus-article-goto-header "date") - (setq new-art-buf-name - (concat - new-art-buf-name ", " - (buffer-substring-no-properties - (line-beginning-position) (line-end-position)))))) - "*") - t))) + (concat + "*Sticky Article: " + (if arg + (read-from-minibuffer "Sticky article buffer name: ") + (gnus-with-article-headers + (gnus-article-goto-header "subject") + (setq new-art-buf-name + (buffer-substring-no-properties + (line-beginning-position) (line-end-position))) + (goto-char (point-min)) + (gnus-article-goto-header "from") + (setq new-art-buf-name + (concat + new-art-buf-name ", " + (buffer-substring-no-properties + (line-beginning-position) (line-end-position)))) + (goto-char (point-min)) + (gnus-article-goto-header "date") + (setq new-art-buf-name + (concat + new-art-buf-name ", " + (buffer-substring-no-properties + (line-beginning-position) (line-end-position)))))) + "*")) + (if (and (gnus-buffer-live-p new-art-buf-name) + (with-current-buffer new-art-buf-name + (eq major-mode 'gnus-sticky-article-mode))) + (switch-to-buffer new-art-buf-name) + (rename-buffer new-art-buf-name t)) + (gnus-sticky-article-mode)) (setq gnus-article-buffer new-art-buf-name)) (gnus-summary-recenter) - (gnus-summary-position-point) - (set-buffer gnus-article-buffer) - (gnus-sticky-article-mode)) + (gnus-summary-position-point)) (defun gnus-kill-sticky-article-buffer (&optional buffer) "Kill the given sticky article BUFFER. Index: lisp/ChangeLog =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/ChangeLog,v retrieving revision 7.1601 diff -u -r7.1601 ChangeLog --- lisp/ChangeLog 13 Aug 2007 13:52:52 -0000 7.1601 +++ lisp/ChangeLog 14 Aug 2007 07:32:15 -0000 @@ -1,3 +1,10 @@ +2007-08-14 Tassilo Horn + + * gnus-art.el (gnus-sticky-article): Fixed problems described in + on ding. Thanks to Katsumi. + + * gnus-sum.el (gnus-summary-display-article): Likewise. + 2007-08-13 Katsumi Yamaoka * gnus-agent.el (gnus-agent-decoded-group-names): New variable. --=-=-= Bye, Tassilo --=-=-=--