Source

hyperbole / hvar.el

;;!emacs
;;
;; FILE:         hvar.el
;; SUMMARY:      Variable manipulation routines for Hyperbole.
;; USAGE:        GNU Emacs Lisp Library
;; KEYWORDS:     extensions, hypermedia
;;
;; AUTHOR:       Bob Weiner
;; ORG:          BeOpen.com
;;
;; ORIG-DATE:     1-Oct-91 at 14:00:24
;; LAST-MOD:     13-Jun-99 at 01:48:01 by Bob Weiner
;;
;; Copyright (C) 1991-1995, 1998  BeOpen.com
;; See the HY-COPY (Hyperbole) or BR-COPY (OO-Browser) file for license
;; information.
;;
;; This file is part of Hyperbole and the OO-Browser.
;;
;; DESCRIPTION:  
;; DESCRIP-END.

;;; ************************************************************************
;;; Other required Elisp libraries
;;; ************************************************************************

(require 'set)

;;; ************************************************************************
;;; Public functions
;;; ************************************************************************

;;;###autoload
(defun var:append (var-symbol-name list-to-add)
  "Appends to value held by VAR-SYMBOL-NAME, LIST-TO-ADD.  Returns new value.
If VAR-SYMBOL-NAME is unbound, it is set to LIST-TO-ADD.
Often used to append to 'hook' variables."
  (let ((val))
    (if (and (boundp var-symbol-name)
	     (setq val (symbol-value var-symbol-name))
	     (or (if (symbolp val) (setq val (cons val nil)))
		 (listp val)))
	;; Don't add if list elts are already there.
	(if (memq nil (mapcar (function
				(lambda (elt) (set:member elt val)))
			      list-to-add))
	    (set-variable var-symbol-name
			  (if (eq (car val) 'lambda)
			      (apply 'list val list-to-add)
			    (append val list-to-add)))
	  val)
      (set-variable var-symbol-name list-to-add))))

(provide 'hvar)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.