Shelagh Manton <shelagh.man...@gmail.com> writes: > Someone mentioned in a previous post about a function you use to create a > new org-generic-alist called set-alist which is not known in gnu emacs. > > (defun org-set-generic-type (type definition) > "Adds a TYPE and DEFINITION to the existing list of defined generic > export definitions." > (set-alist 'org-generic-alist type definition)) > > I went searching for the function. I found the library which seems to be > part of the xemacs bundle. What could we use for people who use gnu > emacs? Is there a function in emacs that would be a good substitute?
(defun set-alist (symbol key value) "Set cdr of an element (KEY . ...) in the alist bound to SYMBOL to VALUE." (or (boundp symbol) (set symbol nil)) (set symbol (put-alist key value (symbol-value symbol)))) (defun put-alist (key value alist) "Set cdr of an element (KEY . ...) in ALIST to VALUE and return ALIST. If there is no such element, create a new pair (KEY . VALUE) and return a new alist whose car is the new pair and cdr is ALIST." (let ((elm (assoc key alist))) (if elm (progn (setcdr elm value) alist) (cons (cons key value) alist)))) Those two functions come from alist.el which is included in Apel: http://pdb.finkproject.org/pdb/package.php/apel PS: On debian ~$ apt-get install apel should be okay... -- Bastien _______________________________________________ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode