From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/61505 Path: news.gmane.org!not-for-mail From: Ralf Angeli Newsgroups: gmane.emacs.gnus.general Subject: Buttons for M-x customize-* Date: Mon, 12 Dec 2005 19:55:48 +0100 Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1134420813 15286 80.91.229.2 (12 Dec 2005 20:53:33 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 12 Dec 2005 20:53:33 +0000 (UTC) Original-X-From: ding-owner+m10037@lists.math.uh.edu Mon Dec 12 21:53:23 2005 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Eluci-00032S-9i for ding-account@gmane.org; Mon, 12 Dec 2005 21:50:16 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu ident=lists) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1Elucd-0000fS-00; Mon, 12 Dec 2005 14:50:11 -0600 Original-Received: from nas02.math.uh.edu ([129.7.128.40]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1Elswe-0000WT-00 for ding@lists.math.uh.edu; Mon, 12 Dec 2005 13:02:44 -0600 Original-Received: from quimby.gnus.org ([80.91.224.244]) by nas02.math.uh.edu with esmtp (Exim 4.52) id 1ElswY-0002h5-D3 for ding@lists.math.uh.edu; Mon, 12 Dec 2005 13:02:44 -0600 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 1ElswW-0003DZ-00 for ; Mon, 12 Dec 2005 20:02:36 +0100 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Elssv-0006qx-EZ for ding@gnus.org; Mon, 12 Dec 2005 19:58:53 +0100 Original-Received: from dialin-212-144-208-067.pools.arcor-ip.net ([212.144.208.67]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 12 Dec 2005 19:58:53 +0100 Original-Received: from angeli by dialin-212-144-208-067.pools.arcor-ip.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 12 Dec 2005 19:58:53 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-To: ding@gnus.org Original-Lines: 63 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: dialin-212-144-208-067.pools.arcor-ip.net Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAANlBMVEUAAAD7+vVSPEL+/v79 /v1rDy/y7uQtAhK3tbD99doDAALV08n////+//78/fw7ARdgBieLg4LQmlLpAAACPklEQVR4nK2V 27KrMAiGTUCC0OLi/V92kRitp73HziwuOq3m4+cQ6PD60oY/AVCZEzwHkBXZ6Tmgikmc7yVuAGQD UOLHCqgEL7DnCpCYEFUfK1TCs9tz4AXokvEL4AUq5RuFF5DIF30IwES+SLoSRZ73Ifyri+To3xMA AMxlkDCPjsMZugLEWYZmkp3p/wAaeRl2JsXJENDwCgBgXKAiMhyIkMk5+zYeGwBG7J4P/ltYzYPk lfgAfD7bFSQEQpfxBCSpb6+Aa6SQONMZsOxK6VOifn6ZiigG2xEA1Vp0SOR7Ii/NI+d1PlbAFg+Y i+5z8SWQuO3GR6A7AM/Jd0A/FQrYR3YD+m02xF1MkQL0Htk/gKbfzvbrtD6lUw601hksWlVy9LBW XxT603OVMHZjfQfI4XeKLZCdtEgmeLfz5z7U3WJtFMKvTrnGw1OMReHaHd4i3t0lj2LzEk98cVeN 4ntDM8IFiLzbK9cprH0spl52ue+BGLTC05252/sGwJTp9vw0MV2Aeo/IWwjcTav58t1OOcTgx6YY R47jyqafFFRtV6INqLM8VvMIim2fCZsnvABA42pRTdoB5DEJ7yMQs/8535iltDUbrx4OC60BqcYT TSg/4425nUIC4Hhc2kzLDeJ4DimNTaBviZD5mRs3N8VMh3+KCqwC22IRiQfzOEvfsEcgbt1HYNuQ s5RwUtdYOQFv06reHB/2V/1dgXWGVmAVCFdyPF+ntMQK8RNAY6/pvKUd80AxERXKsZsOwC94/1VQ /4fx6QAAAABJRU5ErkJggg== User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:gAKoT4Y6YMBFFuwgyptc1O7J5mA= X-Spam-Score: -2.6 (--) Precedence: bulk Original-Sender: ding-owner@lists.math.uh.edu Xref: news.gmane.org gmane.emacs.gnus.general:61505 Archived-At: --=-=-= Following up on a discussion in de.comm.software.gnus I'd like to propose a change in the handling of `M-x customize-*' buttons. Currently `customize-apropos' is called on any such string. This may result in a little bit unexpected behavior. Check for example the result of `M-x customize-face RET highlight RET'. In my opinion it would be better if the given function were called exactly instead of `customize-apropos'. The attached patch accomplishes this. The patch also removes support for "custom:" and "custom:/" type urls which I've never seen before. Of course this is discussable. Keeping it included would either require two separate functions for handling the customize stuff or a conditionalization inside of `gnus-button-handle-custom'. WDYT? Here is the patch: --=-=-= Content-Type: text/x-patch Content-Disposition: inline --- gnus-art.el 26 Nov 2005 15:11:37 +0100 7.132 +++ gnus-art.el 12 Dec 2005 19:37:07 +0100 @@ -6295,9 +6295,10 @@ (gnus-url-mailto url-mailto)) (t (gnus-message 3 "Invalid string."))))) -(defun gnus-button-handle-custom (url) - "Follow a Custom URL." - (customize-apropos (gnus-url-unhex-string url))) +(defun gnus-button-handle-custom (fun symbol) + "Call function FUN on SYMBOL. +Both FUN and SYMBOL are supposed to be strings." + (funcall (intern fun) (intern symbol))) (defvar gnus-button-handle-describe-prefix "^\\(C-h\\|?\\)") @@ -6477,10 +6478,8 @@ ;; Info links like `C-h i d m CC Mode RET' 0 (>= gnus-button-emacs-level 1) gnus-button-handle-info-keystrokes 2) ;; This is custom - ("\\bcustom:\\(//\\)?\\([^'\">\n\t ]+\\)" - 0 (>= gnus-button-emacs-level 5) gnus-button-handle-custom 2) - ("M-x[ \t\n]customize-[^ ]+[ \t\n]RET[ \t\n]\\([^ ]+\\)[ \t\n]RET" 0 - (>= gnus-button-emacs-level 1) gnus-button-handle-custom 1) + ("M-x[ \t\n]\\(customize-[^ ]+\\)[ \t\n]RET[ \t\n]\\([^ ]+\\)[ \t\n]RET" 0 + (>= gnus-button-emacs-level 1) gnus-button-handle-custom 1 2) ;; Emacs help commands ("M-x[ \t\n]+apropos[ \t\n]+RET[ \t\n]+\\([^ \t\n]+\\)[ \t\n]+RET" ;; regexp doesn't match arguments containing ` '. --=-=-= (I'll provide a ChangeLog entry once it is settled what exactly to do with this.) -- Ralf --=-=-=--