unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* cus-misc: customize autoloads, environment variables (and key bindings)
@ 2004-04-20 19:43 Simon Josefsson
  2004-04-21 18:58 ` Richard Stallman
  0 siblings, 1 reply; 6+ messages in thread
From: Simon Josefsson @ 2004-04-20 19:43 UTC (permalink / 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-04-23 17:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-20 19:43 cus-misc: customize autoloads, environment variables (and key bindings) Simon Josefsson
2004-04-21 18:58 ` 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

Code repositories for project(s) associated with this public inbox

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

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 read-only IMAP folder(s) and NNTP newsgroup(s).