From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/64958 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.gnus.general Subject: Sticky article buffers Date: Wed, 25 Jul 2007 17:32:16 +0200 Message-ID: <876448eby7.fsf@baldur.tsdh.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1185377613 17796 80.91.229.12 (25 Jul 2007 15:33:33 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 25 Jul 2007 15:33:33 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M13468@lists.math.uh.edu Wed Jul 25 17:33:32 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 1IDirk-000581-4L for ding-account@gmane.org; Wed, 25 Jul 2007 17:33:32 +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 1IDiqu-0008W5-K0; Wed, 25 Jul 2007 10:32:40 -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 1IDiqs-0008Vj-Ez for ding@lists.math.uh.edu; Wed, 25 Jul 2007 10:32:38 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.67) (envelope-from ) id 1IDiqq-0000R9-Av for ding@lists.math.uh.edu; Wed, 25 Jul 2007 10:32:38 -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 1IDiqo-0004pv-00 for ; Wed, 25 Jul 2007 17:32:34 +0200 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1IDiqk-0002TF-QE for ding@gnus.org; Wed, 25 Jul 2007 17:32:30 +0200 Original-Received: from dslb-084-063-004-050.pools.arcor-ip.net ([84.63.4.50]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 25 Jul 2007 17:32:30 +0200 Original-Received: from tassilo by dslb-084-063-004-050.pools.arcor-ip.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 25 Jul 2007 17:32:30 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 154 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: dslb-084-063-004-050.pools.arcor-ip.net Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAD1BMVEU8PDyjo6P5+fm+v8F/ gIO4imEzAAAACXBIWXMAAArrAAAK6wGCiw1aAAAATnRFWHRSYXcgcHJvZmlsZSB0eXBlIGV4aWYA CmV4aWYKICAgICAgMjAKNDU3ODY5NjYwMDAwNGQ0ZDAwMmEwMDAwMDAwODAwMDAwMDAwMDAwMAqJ uBZbAAAACXZwQWcAAAAwAAAAMADO7oxXAAABnklEQVQ4y6WU0YGDIAyGozIAFAY4iAM0iQNAZf+Z LkBrr1f7cseDIp8JyZ8ApA8D/gaiI/9cQne5A6wAcJCYwcwdIEEbbqyH/tGBZHjZ6apgbuALgF/2 XQfArK826CB5gGGA3gUNr9taMApkGLQIbIYeatRNQVcaiBbgCG6ADRadu77aqJo07w3M3W0bdQIo /a+HBQ4/pT1Y/2pRhZaeNTsRBTvlAlPMD6C+kS2UIEvZN7hnHsckwkT+koyjh1ZxTK5QZPdozEWl W7qIum60CJVMIcnGX7um0DWbVIy6Wc+ca6WeGHTNluTIiBNJa65yO0oLN/Q0sTAjglExj2ZglOvC CZNgzvUHQJE8tSIThzTqcy+qBFN6TTz9bB+kAE5rtBo2ifkJKM+roIK8EOPlAGg1GWFJuAEz3V5a tAHxuDmXf/WuZ4w7Ct1b5gmcYJo1ujcQVahNMxf7+xgUlnXHYOYTwMGY/HZwnIalnuobiF4VoxOL VCQ++vsVRKfBLmfA+O3UIgXv8ilIJcD5OQ92PgcrfLgZvvKnK2P9zyXzDWhiiUxowX0ZAAAAGnpU WHRqcGVnOmNvbG9yc3BhY2UAAHjaMwIAADMAM4k4IzUAAAAmelRYdGpwZWc6c2FtcGxpbmctZmFj dG9yAAB42jOqMNIxrDAEYQARgwLpPZcvTwAAAABJRU5ErkJggg== User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1.50 (gnu/linux) Cancel-Lock: sha1:Ol+yOxfF+8aD9nJ/FZZ0xVF1dG4= X-Spam-Score: -2.6 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:64958 Archived-At: Hi, my assignment papers have arrived at the FSF. Here's my patch, created with a CVS checkout half an hour old. Please feel free to comment on it. One thing that I'm aware of it that the binding `C-c s' is not too good, because bindings with `C-c' should be reserved for the user. But what other free binding could be used? Bye, Tassilo --8<---------------cut here---------------start------------->8--- Index: lisp/gnus.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/gnus.el,v retrieving revision 7.66 diff -r7.66 gnus.el 911a912,923 > (defun gnus-kill-all-sticky-article-buffers (confirm) > "Kills all sticky article buffers. If a prefix arg is given, > it'll ask for confirmation." > (interactive "P") > (dolist (buf (gnus-buffers)) > (with-current-buffer buf > (when (eq major-mode 'gnus-sticky-article-mode) > (if (not confirm) > (gnus-kill-buffer buf) > (when (yes-or-no-p (concat "Kill buffer " (buffer-name buf))) > (gnus-kill-buffer buf))))))) > 4360a4373,4378 > > ;; Local Variables: > ;; coding: iso-8859-1 > ;; indent-tabs-mode: t > ;; tab-width: 8 > ;; End: Index: lisp/gnus-art.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/gnus-art.el,v retrieving revision 7.222 diff -r7.222 gnus-art.el 4354a4355,4383 > ;;; Gnus Sticky Article Mode > ;;; > > (define-derived-mode gnus-sticky-article-mode gnus-article-mode "StickyArticle" > "Mode for sticky articles." > ;; Release bindings that won't work. > (substitute-key-definition 'gnus-article-read-summary-keys 'undefined > gnus-sticky-article-mode-map) > (substitute-key-definition 'gnus-article-refer-article 'undefined > gnus-sticky-article-mode-map) > (dolist (k '("e" "h" "s" "F" "R")) > (define-key gnus-sticky-article-mode-map k nil)) > (define-key gnus-sticky-article-mode-map "q" 'gnus-sticky-article-kill-buffer) > (define-key gnus-sticky-article-mode-map "\C-hc" 'describe-key-briefly) > (define-key gnus-sticky-article-mode-map "\C-hk" 'describe-key)) > > > (defun gnus-sticky-article-kill-buffer (&optional buffer) > "Kills the given sticky article buffer. If none is given, it'll > assume the current buffer and kill it if it has > `gnus-sticky-article-mode'." > (interactive) > (unless buffer > (setq buffer (current-buffer))) > (with-current-buffer buffer > (when (eq major-mode 'gnus-sticky-article-mode) > (gnus-kill-buffer buffer)))) > > ;;; 8089a8119,8124 > > ;; Local Variables: > ;; coding: iso-8859-1 > ;; indent-tabs-mode: t > ;; tab-width: 8 > ;; End: Index: lisp/gnus-sum.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/gnus-sum.el,v retrieving revision 7.191 diff -r7.191 gnus-sum.el 1770a1771 > "\C-cs" gnus-summary-make-sticky-article 2446a2448 > ["Make article buffer sticky" gnus-summary-make-sticky-article t] 6940,6942c6942,6948 < (gnus-kill-buffer gnus-article-buffer) < (gnus-kill-buffer gnus-original-article-buffer) < (setq gnus-article-current nil)) --- > (when (gnus-buffer-live-p gnus-article-buffer) > (with-current-buffer gnus-article-buffer > ;; Don't kill sticky article buffers > (unless (eq major-mode 'gnus-sticky-article-mode) > (gnus-kill-buffer gnus-article-buffer) > (setq gnus-article-current nil)))) > (gnus-kill-buffer gnus-original-article-buffer)) 6974,6978d6979 < ;; If we have several article buffers, we kill them at exit. < (unless gnus-single-article-buffer < (gnus-kill-buffer gnus-article-buffer) < (gnus-kill-buffer gnus-original-article-buffer) < (setq gnus-article-current nil)) 7910a7912,7953 > (defun gnus-summary-make-sticky-article (arg) > "Make the current article sticky. If a prefix arg is given you > will be asked for a name for this sticky 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))) > (setq gnus-article-buffer new-art-buf-name)) > (gnus-summary-recenter) > (gnus-summary-position-point) > (set-buffer gnus-article-buffer) > (gnus-sticky-article-mode)) > 12434a12478,12479 > ;; indent-tabs-mode: t > ;; tab-width: 8 --8<---------------cut here---------------end--------------->8---