From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juanma Barranquero Newsgroups: gmane.emacs.devel Subject: Re: Rename `eww' to `web' Date: Fri, 5 Jul 2013 03:14:55 +0200 Message-ID: References: <8738s087wj.fsf@gmail.com> <87bo6mjv4s.fsf@lifelogs.com> <871u7gavwx.fsf@catnip.gol.com> <87obaj39sc.fsf@lifelogs.com> <4btxkb7gw7.fsf@fencepost.gnu.org> <87k3l72z81.fsf@lifelogs.com> <87obaixhkr.fsf@informatimago.com> <2jd2qxsxlk.fsf@fencepost.gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1372986944 18571 80.91.229.3 (5 Jul 2013 01:15:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 5 Jul 2013 01:15:44 +0000 (UTC) Cc: Emacs developers To: Glenn Morris Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 05 03:15:46 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Uuucj-00055p-H7 for ged-emacs-devel@m.gmane.org; Fri, 05 Jul 2013 03:15:45 +0200 Original-Received: from localhost ([::1]:41552 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uuuci-0002zd-Rn for ged-emacs-devel@m.gmane.org; Thu, 04 Jul 2013 21:15:44 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34928) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uuucf-0002zJ-9t for emacs-devel@gnu.org; Thu, 04 Jul 2013 21:15:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uuucd-0000LT-Qu for emacs-devel@gnu.org; Thu, 04 Jul 2013 21:15:41 -0400 Original-Received: from mail-ee0-x233.google.com ([2a00:1450:4013:c00::233]:63998) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uuuca-0000KA-Ku; Thu, 04 Jul 2013 21:15:36 -0400 Original-Received: by mail-ee0-f51.google.com with SMTP id e52so1070858eek.10 for ; Thu, 04 Jul 2013 18:15:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=bS9ALit2nO1Bivj1fwGXm7/cU7gKNXBafo7/qZNBoTk=; b=F/2Qb+HSWEEOzuV+iNVFyS3XDrhaCJ3V6lUGYlwQWI9nZRl/2y8tRniSO1a7M/p53M yt30C8X1E0RY3XUNXM5BT9i85NfHQKGbGc+7mlciA1U+MOnZSW5NDSvQLD9YCRUU+1f0 ObHBHZyp70ssl1HM7bsAA67vK2cWlGvOp0YJCQtoYAQA+znn7Dvy+qRNPRPF5ZVAADjk pG+lmbOAjWR5NFeDfJSgcTCofrBw+C0OK1/QqD8xhHemHWWPjZ1O8s+CoRB0SsiX0JcU OxmQvg8e1yQIllwi3VtyF1uxG2uA0vH8lU8CWpWfWijigeYoH9GTuhdYJvtEtsrHLctI xxMg== X-Received: by 10.14.213.135 with SMTP id a7mr9104179eep.152.1372986935687; Thu, 04 Jul 2013 18:15:35 -0700 (PDT) Original-Received: by 10.14.142.4 with HTTP; Thu, 4 Jul 2013 18:14:55 -0700 (PDT) In-Reply-To: <2jd2qxsxlk.fsf@fencepost.gnu.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c00::233 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:161553 Archived-At: On Fri, Jul 5, 2013 at 1:40 AM, Glenn Morris wrote: > If someone would like to actually DO this, that would be useful. (defgroup dispatcher nil "Generic dispatcher") (defmacro def-dispatcher (command) (let* ((commandn (symbol-name command)) (varaltn (concat commandn "-alternatives")) (varalts (intern varaltn)) (varimps (intern (concat commandn "-implementation")))) `(progn (defcustom ,varalts nil ,(format "Alist of alternative implementations for the `%s' command. Each entry must be a pair (ALTNAME . ALTFUN), where: ALTNAME - The name shown at user to describe the alternative implementation. ALTFUN - The function called to implement this alternative." commandn) :type '(alist :key-type string :value-type function)) (defcustom ,varimps nil "Internal use only.") (defun ,command (&optional arg) ,(format "Run the generic command `%s'. If used for the first time, or with interactive ARG, ask the user which implementation to use for `%s'. The variable `%s' contains the list of implementations currently supported for this command." commandn commandn varaltn) (interactive "P") (when (or arg (null ,varimps)) (let ((val (completing-read ,(format "Select implementation for command `%s': " commandn) ,varalts nil t))) (unless (string-equal val "") (customize-save-variable ',varimps (cdr (assoc-string val ,varalts)))))) (if ,varimps (funcall ,varimps) (message ,(format "No implementation selected for commmand `%s'" commandn)))))))