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 14:59:15 +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: multipart/mixed; boundary=047d7b66f3737b877604e0c345d6 X-Trace: ger.gmane.org 1373029214 21867 80.91.229.3 (5 Jul 2013 13:00:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 5 Jul 2013 13:00:14 +0000 (UTC) Cc: Emacs developers To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 05 15:00:16 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 1Uv5cT-00083S-VD for ged-emacs-devel@m.gmane.org; Fri, 05 Jul 2013 15:00:14 +0200 Original-Received: from localhost ([::1]:41965 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uv5cT-0002CV-Hc for ged-emacs-devel@m.gmane.org; Fri, 05 Jul 2013 09:00:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48973) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uv5cJ-0001yO-0V for emacs-devel@gnu.org; Fri, 05 Jul 2013 09:00:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uv5cF-0003sR-EN for emacs-devel@gnu.org; Fri, 05 Jul 2013 09:00:02 -0400 Original-Received: from mail-ea0-x22e.google.com ([2a00:1450:4013:c01::22e]:42286) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uv5cC-0003q3-Nu; Fri, 05 Jul 2013 08:59:56 -0400 Original-Received: by mail-ea0-f174.google.com with SMTP id o10so1452037eaj.33 for ; Fri, 05 Jul 2013 05:59:55 -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=iqyzWzT1BnhRxDNJOrNar2kKFEEiQIGF2FRDizZ2Xn0=; b=Wq5FvXaRvqia0HI8b/Gy5fuOZtT06qrc5S1KyrKALpcexiTHX6U+aTDr3tU4SyZmc+ NBpoFNo9Q/tNIeGK6y28MQ7KL1RRhMBn2hwQ+azT1ne7s1SVFHyvlP4z9+lbqLSvG32X QPzv96G37RVgRYQxyJEdY8T3eLVXxkEYXb05ipDsGjq7DTXOKREBw/CJdDwAUgCyJEBG mYbr0+ZlZ5Nc4B0hPaCU4iYo+B+WmpfG8rGWlU1UpjJOCmGKIr+SjC/3S2tCLs8j7LBK kZ99zJbccUdmb16IlkWNjg9hTQOVamF9tArFw+nn/ctEVQkWjVZsRfrrrHpkQJXaPA3n HjRw== X-Received: by 10.14.4.70 with SMTP id 46mr11546206eei.42.1373029195801; Fri, 05 Jul 2013 05:59:55 -0700 (PDT) Original-Received: by 10.14.142.4 with HTTP; Fri, 5 Jul 2013 05:59:15 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c01::22e 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:161583 Archived-At: --047d7b66f3737b877604e0c345d6 Content-Type: text/plain; charset=UTF-8 ;;; dispatcher.el --- generic command dispatcher -*- lexical-binding: t -*- ;; Copyright (C) 2013 Free Software Foundation, Inc. ;; Author: Juanma Barranquero ;; Maintainer: FSF ;; Keywords: ;; This file is part of GNU Emacs. ;; GNU Emacs is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. ;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . ;;; Commentary: ;; Defines a new macro `define-dispatcher' to create generic commands. ;; Generic commands are ones (like web, mail, news, encrypt, irc, etc.) ;; that can have different alternative implementations where choosing ;; among them is exclusively a matter of user preference. ;; (define-dispatcher COMMAND) creates a new interactive command ;; M-x COMMAND and a customizable variable dispatcher-COMMAND-alternatives. ;; Typically, the user will not need to customize this variable; packages ;; wanting to add alternative implementations should use ;; ;; ;;;###autoload (push '("My impl name" . my-impl-symbol) dispatcher-COMMAND-alternatives ;;; Code: (defgroup dispatcher nil "Generic dispatcher" :group 'applications) (defmacro define-dispatcher (command &rest customizations) "Define new command `COMMAND'. The variable `dispatcher-COMMAND-alternatives' will contain alternative implementations of COMMAND, so that running `C-u M-x COMMAND' will allow the user to chose among them. CUSTOMIZATIONS, if non-nil, should be composed of alternating `defcustom' keywords and values to add to the declaration of `dispatcher-COMMAND-alternatives' (typically to add new groups)." (let* ((command-name (symbol-name command)) (varalt-name (concat "dispatcher-" command-name "-alternatives")) (varalt-sym (intern varalt-name)) (varimp-sym (intern (concat "dispatcher--" command-name "-implementation")))) `(progn (defcustom ,varalt-sym 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." command-name) :type '(alist :key-type string :value-type function) :group 'dispatcher ,@customizations) (defvar ,varimp-sym nil "Internal use only.") (defun ,command (&optional arg) ,(format "Run 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." command-name command-name varalt-name) (interactive "P") (when (or arg (null ,varimp-sym)) (let ((val (completing-read ,(format "Select implementation for command `%s': " command-name) ,varalt-sym nil t))) (unless (string-equal val "") (customize-save-variable ',varimp-sym (cdr (assoc-string val ,varalt-sym)))))) (if ,varimp-sym (funcall ,varimp-sym) (message ,(format "No implementation selected for commmand `%s'" command-name))))))) (provide 'dispatcher) ;;; dispatcher.el ends here --047d7b66f3737b877604e0c345d6 Content-Type: application/octet-stream; name="dispatcher.el" Content-Disposition: attachment; filename="dispatcher.el" Content-Transfer-Encoding: base64 X-Attachment-Id: f_hire3krj0 Ozs7IGRpc3BhdGNoZXIuZWwgLS0tIGdlbmVyaWMgY29tbWFuZCBkaXNwYXRjaGVyICAtKi0gbGV4 aWNhbC1iaW5kaW5nOiB0IC0qLQ0KDQo7OyBDb3B5cmlnaHQgKEMpIDIwMTMgRnJlZSBTb2Z0d2Fy ZSBGb3VuZGF0aW9uLCBJbmMuDQoNCjs7IEF1dGhvcjogSnVhbm1hIEJhcnJhbnF1ZXJvIDxsZWtr dHVAZ21haWwuY29tPg0KOzsgTWFpbnRhaW5lcjogRlNGDQo7OyBLZXl3b3JkczoNCg0KOzsgVGhp cyBmaWxlIGlzIHBhcnQgb2YgR05VIEVtYWNzLg0KDQo7OyBHTlUgRW1hY3MgaXMgZnJlZSBzb2Z0 d2FyZTogeW91IGNhbiByZWRpc3RyaWJ1dGUgaXQgYW5kL29yIG1vZGlmeQ0KOzsgaXQgdW5kZXIg dGhlIHRlcm1zIG9mIHRoZSBHTlUgR2VuZXJhbCBQdWJ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YXJpYWJsZSAnLHZhcmltcC1zeW0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAoY2RyIChhc3NvYy1zdHJpbmcgdmFsICx2YXJhbHQtc3ltKSkpKSkpDQogICAgICAg ICAoaWYgLHZhcmltcC1zeW0NCiAgICAgICAgICAgICAoZnVuY2FsbCAsdmFyaW1wLXN5bSkNCiAg ICAgICAgICAgKG1lc3NhZ2UgLChmb3JtYXQgIk5vIGltcGxlbWVudGF0aW9uIHNlbGVjdGVkIGZv ciBjb21tbWFuZCBgJXMnIg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb21tYW5kLW5h bWUpKSkpKSkpDQoNCihwcm92aWRlICdkaXNwYXRjaGVyKQ0KDQo7OzsgZGlzcGF0Y2hlci5lbCBl bmRzIGhlcmUNCg== --047d7b66f3737b877604e0c345d6--