From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/65046 Path: news.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.gnus.general Subject: Re: Sticky article buffers Date: Tue, 14 Aug 2007 14:18:07 +0900 Organization: Emacsen advocacy group Message-ID: 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 1187068792 16783 80.91.229.12 (14 Aug 2007 05:19:52 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 14 Aug 2007 05:19:52 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M13556@lists.math.uh.edu Tue Aug 14 07:19:51 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 1IKooo-0006ME-AR for ding-account@gmane.org; Tue, 14 Aug 2007 07:19:50 +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 1IKonu-0007tr-4O; Tue, 14 Aug 2007 00:18:54 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1IKons-0007tb-DC for ding@lists.math.uh.edu; Tue, 14 Aug 2007 00:18:52 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.67) (envelope-from ) id 1IKonp-0004TE-7H for ding@lists.math.uh.edu; Tue, 14 Aug 2007 00:18:52 -0500 Original-Received: from orlando.hostforweb.net ([216.246.45.90]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1IKonn-0000Tt-00 for ; Tue, 14 Aug 2007 07:18:47 +0200 Original-Received: from [66.225.201.151] (port=36965 helo=mail.jpl.org) by orlando.hostforweb.net with esmtpa (Exim 4.63) (envelope-from ) id 1IKonE-000777-1i for ding@gnus.org; Tue, 14 Aug 2007 00:18:12 -0500 X-Hashcash: 1:20:070814:ding@gnus.org::wQsI08zeV4j+HCpA:00000X44 X-Face: #kKnN,xUnmKia.'[pp`;Omh}odZK)?7wQSl"4o04=EixTF+V[""w~iNbM9ZL+.b*_CxUmFk B#Fu[*?MZZH@IkN:!"\w%I_zt>[$nm7nQosZ<3eu;B:$Q_:p!',P.c0-_Cy[dz4oIpw0ESA^D*1Lw= L&i*6&( User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1.50 (gnu/linux) Cancel-Lock: sha1:qrGYauwZDGZBTWVnrrxkmGj4R+w= X-Antivirus-Scanner: Clean mail though you should still use an Antivirus X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - orlando.hostforweb.net X-AntiAbuse: Original Domain - gnus.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - jpl.org X-Source: X-Source-Args: X-Source-Dir: X-Spam-Score: -2.5 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:65046 Archived-At: --=-=-= Hi, Thank you for contributing a good feature. I tried it today and realized it is really useful. Though I have no plan for the moment, people might want a browser function for many sticky articles. :) 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. 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>"... 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. 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. I tried improving these problems. Here are a replacement of the `gnus-sticky-article' function and a patch for gnus-sum.el: --=-=-= Content-Type: application/emacs-lisp Content-Disposition: attachment Content-Description: gnus-sticky-article (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." (interactive "P") (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 (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)) --=-=-= Content-Type: text/x-patch Content-Disposition: attachment Content-Description: patch for gnus-sum.el --- gnus-sum.el~ 2007-08-12 22:04:34 +0000 +++ gnus-sum.el 2007-08-14 05:13: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 --=-=-=--