Gnus development mailing list
 help / color / mirror / Atom feed
From: Ralf Angeli <angeli@iwi.uni-sb.de>
Subject: Buttons for M-x customize-*
Date: Mon, 12 Dec 2005 19:55:48 +0100	[thread overview]
Message-ID: <dnkh34$jp4$1@sea.gmane.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 785 bytes --]

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:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 1295 bytes --]

--- 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\\|<?[Ff]1>?\\)")
 
@@ -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 ` '.

[-- Attachment #3: Type: text/plain, Size: 93 bytes --]


(I'll provide a ChangeLog entry once it is settled what exactly to do
with this.)

-- 
Ralf

             reply	other threads:[~2005-12-12 18:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-12 18:55 Ralf Angeli [this message]
2005-12-12 22:30 ` Reiner Steib
2005-12-13  9:05   ` Ralf Angeli
2005-12-13 16:39   ` Simon Josefsson
2005-12-14 11:25     ` Ralf Angeli
2005-12-14 13:17       ` Reiner Steib
2005-12-14 13:37         ` Ralf Angeli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='dnkh34$jp4$1@sea.gmane.org' \
    --to=angeli@iwi.uni-sb.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).