From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Simon Josefsson Newsgroups: gmane.emacs.devel Subject: cus-misc: customize autoloads, environment variables (and key bindings) Date: Tue, 20 Apr 2004 21:43:03 +0200 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1082491071 3925 80.91.224.253 (20 Apr 2004 19:57:51 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 20 Apr 2004 19:57:51 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Tue Apr 20 21:57:38 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BG1NB-0000ZV-00 for ; Tue, 20 Apr 2004 21:57:37 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BG1NB-0005EQ-00 for ; Tue, 20 Apr 2004 21:57:37 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1BG1LK-0007Fm-QH for emacs-devel@quimby.gnus.org; Tue, 20 Apr 2004 15:55:42 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1BG1LF-0007FF-NS for emacs-devel@gnu.org; Tue, 20 Apr 2004 15:55:37 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1BG1Ki-00076T-6p for emacs-devel@gnu.org; Tue, 20 Apr 2004 15:55:35 -0400 Original-Received: from [217.13.230.178] (helo=yxa.extundo.com) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.30) id 1BG1JH-0006rg-Vm for emacs-devel@gnu.org; Tue, 20 Apr 2004 15:53:36 -0400 Original-Received: from latte.josefsson.org (yxa.extundo.com [217.13.230.178]) (authenticated bits=0) by yxa.extundo.com (8.12.11/8.12.11) with ESMTP id i3KJrXeg001222 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Tue, 20 Apr 2004 21:53:34 +0200 Original-To: emacs-devel@gnu.org X-Hashcash: 0:040420:emacs-devel@gnu.org:f91af86ee9b832f0 User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:21955 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:21955 There were some discussion on cus-misc.el before, and I think one comment was that the key binding part should use a better widget for entering keys than the custom "string" widget. But what do people think of the other parts? Autoload cookies and environment variables? Do anyone think it would be useful to add this to Emacs? If so, we could add the following except for the custom-key-alist part, until someone look into making a better key binding widget. I just realized adding entries to `load-path' could be made customizable with this approach as well. And `auto-mode-alist' is another example. ;;; cus-misc.el --- Customize key bindings, autoloads and env. variables. ;; Copyright (C) 2003, 2004 Free Software Foundation, Inc. ;; Author: Simon Josefsson ;; 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 2, 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; see the file COPYING. If not, write to the ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. ;;; Commentary: ;; Put this file in your load-path, evaluate it, and run M-x ;; customize-variable RET custom-key-alist RET and add some key ;; bindings, for example: ;; ;; custom-key-alist's value is ;; (("" . compile) ;; ("" . next-error) ;; ("" . previous-error) ;; ("C-x 4h" . gtk-doc-insert)) ;; ;; Click on 'Save', and restart Emacs to enjoy the now (hopefully) ;; automagically configured new global key bindings. ;; ;; Similarly, customize `custom-autoload-alist' and ;; `custom-environment-variable-alist' to add autoload cookies and ;; environment variables, respectively. For example: ;; ;; custom-autoload-alist's value is ;; ((mail-add-payment . "hashcash")) ;; ;; custom-environment-variable-alist's value is ;; (("CVS_RSH" . "ssh")) ;;; History: ;; 2003-12-30 initial release ;; 2003-12-30 second release, fixed comments and added :require to defcustom. ;; 2004-01-04 added autoloads and environment variables, ;; renamed to cus-misc.el. (defcustom custom-key-alist nil "Association list with key bindings and functions." :type '(alist :key-type (string :tag "Key") :value-type (function :tag "Command")) :set '(lambda (symbol infolist) (set-default symbol infolist) (mapcar (lambda (info) (global-set-key (read-kbd-macro (car info)) (cdr info))) infolist)) :require 'cus-misc) (defcustom custom-autoload-alist nil "Association list with autoload definitions to set on startup." :type '(alist :key-type (symbol :tag "Function") :value-type (string :tag "Elisp file")) :set '(lambda (symbol infolist) (set-default symbol infolist) (mapcar (lambda (info) (autoload (car info) (cdr info))) infolist)) :require 'cus-misc) (defcustom custom-environment-variable-alist nil "Association list with environment variables to `setenv' on startup." :type '(alist :key-type (string :tag "Environment Variable") :value-type (string :tag "Value")) :set '(lambda (symbol infolist) (set-default symbol infolist) (mapcar (lambda (info) (setenv (car info) (cdr info))) infolist)) :require 'cus-misc) (provide 'cus-misc) ;;; cus-misc.el ends here