emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Michael Sperber <sperber@deinprogramm.de>
To: Eric Schulte <schulte.eric@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: org-babel and Xemacs incompatibilities
Date: Mon, 07 Jun 2010 15:04:41 +0200	[thread overview]
Message-ID: <y9lsk4zhu3a.fsf@deinprogramm.de> (raw)
In-Reply-To: <877hmrmrsy.fsf@gmail.com> (Eric Schulte's message of "Tue, 25 May 2010 18:26:37 -0600")

[-- Attachment #1: Type: text/plain, Size: 727 bytes --]


"Eric Schulte" <schulte.eric@gmail.com> writes:

>> And two more
>>
>>  o Symbol's function definition is void: assoc-default when trying to display an image
>> [...]
>>  o Symbol's function definition is void: make-temp-file when using org-babel-dot
>> [...]

Both of these are in XEmacs 21.5, but not 21.4.  As 21.4 is almost not
moving anymore, it may not be worth the effort to add them to 21.4.
(Volker would have to wait quite a while to get a 21.4 that works with
this.)  My suggestion is to leave org-mode and XEmacs 21.4 as is, and
for Volker to copy the definitions from 21.5 to his init.el.
(Attached.)  Is this acceptable?

-- 
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla

[-- Attachment #2: Type: text/plain, Size: 2387 bytes --]

(defun assoc-default (key alist &optional test default)
  "Find object KEY in a pseudo-alist ALIST.
ALIST is a list of conses or objects.  Each element (or the element's car,
if it is a cons) is compared with KEY by evaluating (TEST (car elt) KEY).
If that is non-nil, the element matches;
then `assoc-default' returns the element's cdr, if it is a cons,
or DEFAULT if the element is not a cons.

If no element matches, the value is nil.
If TEST is omitted or nil, `equal' is used."
  (let (found (tail alist) value)
    (while (and tail (not found))
      (let ((elt (car tail)))
	(when (funcall (or test 'equal) (if (consp elt) (car elt) elt) key)
	  (setq found t value (if (consp elt) (cdr elt) default))))
      (setq tail (cdr tail)))
    value))


(defun make-temp-file (prefix &optional dir-flag suffix)
  "Create a temporary file.
The returned file name (created by appending some random characters at the
end of PREFIX, and expanding against the return value of `temp-directory' if
necessary), is guaranteed to point to a newly created empty file.  You can
then use `write-region' to write new data into the file.

If DIR-FLAG is non-nil, create a new empty directory instead of a file.

If SUFFIX is non-nil, add that at the end of the file name.

This function is analagous to mkstemp(3) under POSIX, avoiding the race
condition between testing for the existence of the generated filename (under
POSIX with mktemp(3), under Emacs Lisp with `make-temp-name') and creating
it."
  (let ((umask (default-file-modes))
	(temporary-file-directory (temp-directory))
	file)
    (unwind-protect
	(progn
	  ;; Create temp files with strict access rights.  It's easy to
	  ;; loosen them later, whereas it's impossible to close the
	  ;; time-window of loose permissions otherwise.
	  (set-default-file-modes #o700)
	  (while (condition-case ()
		     (progn
		       (setq file
			     (make-temp-name
			      (expand-file-name prefix
						temporary-file-directory)))
		       (if suffix
			   (setq file (concat file suffix)))
		       (if dir-flag
			   (make-directory file)
			 (write-region "" nil file nil 'silent nil 'excl))
		       nil)
		   (file-already-exists t))
	    ;; the file was somehow created by someone else between
	    ;; `make-temp-name' and `write-region', let's try again.
	    nil)
	  file)
      ;; Reset the umask.
      (set-default-file-modes umask))))

[-- Attachment #3: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

  reply	other threads:[~2010-06-07 13:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-11  9:09 org-babel and Xemacs incompatibilities Dr. Volker Zell
2010-05-17 23:17 ` Eric Schulte
2010-05-25 11:16   ` Dr. Volker Zell
2010-05-25 12:42     ` Dr. Volker Zell
2010-05-26  0:26       ` Eric Schulte
2010-06-07 13:04         ` Michael Sperber [this message]
2010-05-25 23:36     ` Eric Schulte
2010-06-07 12:48       ` Michael Sperber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=y9lsk4zhu3a.fsf@deinprogramm.de \
    --to=sperber@deinprogramm.de \
    --cc=emacs-orgmode@gnu.org \
    --cc=schulte.eric@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).