[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] Re: Orgmodeorg-export-generic gives an error

From: Bastien
Subject: Re: [Orgmode] Re: Orgmodeorg-export-generic gives an error
Date: Wed, 22 Jul 2009 01:59:12 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

Shelagh Manton <address@hidden> 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
          (setcdr elm value)
      (cons (cons key value) alist))))

Those two functions come from alist.el which is included in Apel:


PS: On debian ~$ apt-get install apel should be okay...


reply via email to

[Prev in Thread] Current Thread [Next in Thread]