all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Simon Josefsson <jas@extundo.com>
Subject: cus-misc: customize autoloads, environment variables (and key bindings)
Date: Tue, 20 Apr 2004 21:43:03 +0200	[thread overview]
Message-ID: <ilu65butozc.fsf@latte.josefsson.org> (raw)

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 <simon@josefsson.org>

;; 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
;; (("<f5>" . compile)
;;  ("<f6>" . next-error)
;;  ("<f7>" . 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

             reply	other threads:[~2004-04-20 19:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-20 19:43 Simon Josefsson [this message]
2004-04-21 18:58 ` cus-misc: customize autoloads, environment variables (and key bindings) Richard Stallman
2004-04-21 19:08   ` Ted Zlatanov
2004-04-23 17:21     ` Richard Stallman
2004-04-21 20:13   ` Simon Josefsson
2004-04-23 17:22     ` Richard Stallman

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=ilu65butozc.fsf@latte.josefsson.org \
    --to=jas@extundo.com \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.