From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/66209 Path: news.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.gnus.general Subject: Re: Quoting the active region when doing `S W' ? Date: Thu, 31 Jan 2008 20:56:41 +0900 Organization: Emacsen advocacy group Message-ID: References: <87hcje31x0.fsf@bzg.ath.cx> <87lk8m80vw.fsf@bzg.ath.cx> <87tzmr8ja4.fsf@bzg.ath.cx> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1201780726 27324 80.91.229.12 (31 Jan 2008 11:58:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 31 Jan 2008 11:58:46 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M14700@lists.math.uh.edu Thu Jan 31 12:59:07 2008 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 1JKY4O-00080O-S1 for ding-account@gmane.org; Thu, 31 Jan 2008 12:59:05 +0100 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 1JKY2x-0000n9-JD; Thu, 31 Jan 2008 05:57:35 -0600 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 1JKY2v-0000mt-Ul for ding@lists.math.uh.edu; Thu, 31 Jan 2008 05:57:33 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.67) (envelope-from ) id 1JKY2p-000711-M7 for ding@lists.math.uh.edu; Thu, 31 Jan 2008 05:57:33 -0600 Original-Received: from orlando.hostforweb.net ([216.246.45.90]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1JKY2s-00017z-00 for ; Thu, 31 Jan 2008 12:57:30 +0100 Original-Received: from [66.225.201.151] (port=60790 helo=mail.jpl.org) by orlando.hostforweb.net with esmtpa (Exim 4.68) (envelope-from ) id 1JKY2J-0007As-1t for ding@gnus.org; Thu, 31 Jan 2008 05:56:56 -0600 X-Hashcash: 1:20:080131:ding@gnus.org::sFlKM6u5LR8haKet:00000tvq 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.90 (gnu/linux) Cancel-Lock: sha1:S859IpnyYzLga9p9/AeE7QBaFf8= 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:66209 Archived-At: --=-=-= >>>>> Katsumi Yamaoka wrote: >>> In addition, I've added the new article command which the `C-h b' >>> key is bound to (`gnus-article-describe-bindings'). It shows the >>> real summary commands instead of `gnus-article-read-summary-keys' >>> that is meaningless for a user. In relation to this, I tried letting the *article* menu bar items also display the keyboard equivalents for those items as follows: Treatment --------- Hide headers W W h Hide signature W W s Hide citation W W c [...] (Note that your Gnus doesn't display "W W h", etc. when clicking the `Treatment' menu bar in the *article* buffer.) The Lisp code which achieves this is attached below. I think it is useful especially for users who haven't gotten used to using such command keys. However, I hesitate to install it to the Gnus CVS trunk because it wastes about one second when beginning to read an article only for the first time and it works only with Emacs 22 and greater (and both seem to be hard to solve. :-<) --=-=-= Content-Type: application/emacs-lisp Content-Disposition: inline (defun gnus-article-add-keys-to-menu (menu) "Add strings to display as keyboard equivalents for menu items to MENU." (let (command key keys) (map-keymap (lambda (event def) (when (eq (car def) 'menu-item) (if (keymapp (setq command (nth 2 def))) (unless (equal (nth 1 def) "View as different encoding") (gnus-article-add-keys-to-menu command)) (when (setq key (or (where-is-internal command gnus-article-mode-map t) (where-is-internal command gnus-summary-mode-map t))) (setq key (key-description key)) (if (setq keys (memq :keys def)) (setcdr keys (list key)) (setcdr def (append (cdr def) (list :keys key)))) ;; Remove cached keys if any. (when (consp (nth 3 def)) (setcdr (nthcdr 2 def) (nthcdr 4 def))))))) menu))) (add-hook 'gnus-article-menu-hook (lambda () (gnus-article-add-keys-to-menu gnus-article-commands-menu) (gnus-article-add-keys-to-menu gnus-article-post-menu) (gnus-article-add-keys-to-menu gnus-article-treatment-menu))) --=-=-=--