all messages for Emacs-related lists mirrored at yhetil.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

* Re: cus-misc: customize autoloads, environment variables (and key bindings)
  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-21 20:13   ` Simon Josefsson
  0 siblings, 2 replies; 6+ messages in thread
From: Richard Stallman @ 2004-04-21 18:58 UTC (permalink / raw)
  Cc: emacs-devel

I think the `repeat' customization widget is rather inconvenient to
use.

I think that it is a mistake for [Ins] and [Del] to look similar.
They do entirely different kinds of things.  [Del] applies to an
existing entry, but [Ins] does not.  Having two similar-looking
buttons for these two disparate operations can't help being confusing.

Also, there is no way to reorder existing entries except to delete
some and reinsert them from zero.

This suggests the idea that the interface should provide a way to
(1) delete any entry
(2) move any entry to a new position
(3) insert a new entry at the front

[Del] and [Move] would both apply to an existing entry, so it would
make sense to have these two buttons side by side.  Instead of [Ins],
which is cryptic, we could have [Add new entry].  There would only
be one such button, at the start of the list, so a long name is ok.

With this change, perhaps these methods of customizing key bindings
and env vars would be convenient enough to use.

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

* Re: cus-misc: customize autoloads, environment variables (and key bindings)
  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
  1 sibling, 1 reply; 6+ messages in thread
From: Ted Zlatanov @ 2004-04-21 19:08 UTC (permalink / raw)


On Wed, 21 Apr 2004, rms@gnu.org wrote:

> [Del] and [Move] would both apply to an existing entry, so it would
> make sense to have these two buttons side by side.  Instead of
> [Ins], which is cryptic, we could have [Add new entry].  There would
> only be one such button, at the start of the list, so a long name is
> ok.

[Ins] at every entry makes sense as "insert new entry right here"
instead of "at the end of the list."  That way you don't have to add,
then move an entry.

Ted

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

* Re: cus-misc: customize autoloads, environment variables (and key bindings)
  2004-04-21 18:58 ` Richard Stallman
  2004-04-21 19:08   ` Ted Zlatanov
@ 2004-04-21 20:13   ` Simon Josefsson
  2004-04-23 17:22     ` Richard Stallman
  1 sibling, 1 reply; 6+ messages in thread
From: Simon Josefsson @ 2004-04-21 20:13 UTC (permalink / raw)
  Cc: emacs-devel

Richard Stallman <rms@gnu.org> writes:

> I think the `repeat' customization widget is rather inconvenient to
> use.
>
> I think that it is a mistake for [Ins] and [Del] to look similar.
> They do entirely different kinds of things.  [Del] applies to an
> existing entry, but [Ins] does not.  Having two similar-looking
> buttons for these two disparate operations can't help being confusing.
>
> Also, there is no way to reorder existing entries except to delete
> some and reinsert them from zero.
>
> This suggests the idea that the interface should provide a way to
> (1) delete any entry
> (2) move any entry to a new position
> (3) insert a new entry at the front
>
> [Del] and [Move] would both apply to an existing entry, so it would
> make sense to have these two buttons side by side.  Instead of [Ins],
> which is cryptic, we could have [Add new entry].  There would only
> be one such button, at the start of the list, so a long name is ok.
>
> With this change, perhaps these methods of customizing key bindings
> and env vars would be convenient enough to use.

Perhaps the "Move" idea can be refined by providing two buttons, one
"Move Up" and one "Move down" (possibly using some arrow glyph).  I
believe this is commonly used in other GUIs, so users should be
familiar with it.  The alternative, of having only one "Move" button,
implies clicking on that should question the user somehow, on where
she wants to move the entry.  This might get complicated.

But otherwise I think the suggestions are good.  Alas, I don't have
time, right now, to learn how custom widgets work to implement this.

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

* Re: cus-misc: customize autoloads, environment variables (and key bindings)
  2004-04-21 19:08   ` Ted Zlatanov
@ 2004-04-23 17:21     ` Richard Stallman
  0 siblings, 0 replies; 6+ messages in thread
From: Richard Stallman @ 2004-04-23 17:21 UTC (permalink / raw)
  Cc: emacs-devel

    [Ins] at every entry makes sense as "insert new entry right here"
    instead of "at the end of the list."

I understand that that was the intention, but I don't think it works
well.  In my previous message I explained why that interface is
confusing.  I think it needs to be changed.

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

* Re: cus-misc: customize autoloads, environment variables (and key bindings)
  2004-04-21 20:13   ` Simon Josefsson
@ 2004-04-23 17:22     ` Richard Stallman
  0 siblings, 0 replies; 6+ messages in thread
From: Richard Stallman @ 2004-04-23 17:22 UTC (permalink / raw)
  Cc: emacs-devel

    Perhaps the "Move" idea can be refined by providing two buttons, one
    "Move Up" and one "Move down" (possibly using some arrow glyph).  I
    believe this is commonly used in other GUIs, so users should be
    familiar with it.

If this is compatible with what users have come to expect,
then it is probably a good idea.

^ 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 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.