diff options
| author | Richard M. Stallman | 1994-10-13 06:34:09 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-10-13 06:34:09 +0000 |
| commit | 6e3af6305a07eda134fde4c61cd59e0b6f41c96d (patch) | |
| tree | 8ea6d67cf1b2d3d3bc0622ca6e037934a0423446 | |
| parent | 4060e6ee3b796ecac506b1ca54217b100795d73a (diff) | |
| download | emacs-6e3af6305a07eda134fde4c61cd59e0b6f41c96d.tar.gz emacs-6e3af6305a07eda134fde4c61cd59e0b6f41c96d.zip | |
(add-to-list): New function.
| -rw-r--r-- | lisp/subr.el | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lisp/subr.el b/lisp/subr.el index 3c4308bf8c2..7c0ae0cb914 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -710,6 +710,11 @@ To make a hook variable buffer-local, always use | |||
| 710 | (if (equal hook-value function) | 710 | (if (equal hook-value function) |
| 711 | (setq hook-value nil))) | 711 | (setq hook-value nil))) |
| 712 | (set-default hook hook-value))))) | 712 | (set-default hook hook-value))))) |
| 713 | |||
| 714 | (defun add-to-list (list-var element) | ||
| 715 | "Add to the value of LIST-VAR the element ELEMENT if it isn't there yet." | ||
| 716 | (or (member element (symbol-value list-var)) | ||
| 717 | (set list-var (cons element (symbol-value list-var))))) | ||
| 713 | 718 | ||
| 714 | ;;;; Specifying things to do after certain files are loaded. | 719 | ;;;; Specifying things to do after certain files are loaded. |
| 715 | 720 | ||