all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* "push" creating circular objects
@ 2008-08-20 13:25 Charles Sebold
  2008-08-20 16:27 ` Charles Sebold
  2008-08-21 16:14 ` John Paul Wallington
  0 siblings, 2 replies; 14+ messages in thread
From: Charles Sebold @ 2008-08-20 13:25 UTC (permalink / raw)
  To: help-gnu-emacs

This is killing me.

I'm running GNU Emacs 22.2.1 (i386-mingw-nt5.1.2600), the one that's
distributed from the FSF website.  I've also verified this with 21.3,
21.4, and 22.1 from Debian sarge, etch, and lenny.  I've done this with
"-q -no-site-file".

Here's the code in question:

(defun Textile-list-context (textile-list-tag)
  "Return list of HTML tags corresponding to list context (ol, ul)."
  (let ((my-list nil))
    (dolist (this-tag (delete "" (split-string textile-list-tag "")))
      (cond
       ((string= this-tag "#")
        (push "ol" my-list))
       ((string= this-tag "*")
        (push "ul" my-list))))
    my-list))

What gets passed in is a string, like "** ", and the function ought to
iterate through each character, cons an "ol" onto my-list for "#"
characters or a "ul" for "*" characters, ignore everything else, and
return my-list when it's done.

In the scratch buffer, it works.  In my program, it creates a circular
list, represented as (#1="ul" #1#) as I edebug this.

Why is it doing that?  Bypassing the push macro and using something like
(setq my-list (cons "ol" my-list)) doesn't help.  And I can't figure out
why I can't get it to do this from the scratch buffer with what appears
to be the same string.  The Edebug output looks identical, until the
second push of "ul" onto the list, at which point it becomes circular.
-- 
Charles Sebold                                      20th of August, 2008


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2008-08-23 12:17 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-20 13:25 "push" creating circular objects Charles Sebold
2008-08-20 16:27 ` Charles Sebold
2008-08-20 19:07   ` Charles Sebold
2008-08-20 21:47     ` weber
2008-08-20 21:50     ` weber
2008-08-21 14:12       ` Charles Sebold
2008-08-21 14:25         ` xraysmalevich
2008-08-21 15:23           ` Charles Sebold
2008-08-21 18:41         ` Pascal J. Bourguignon
2008-08-21 20:25           ` Charles Sebold
2008-08-21 16:14 ` John Paul Wallington
2008-08-21 16:49   ` Charles Sebold
2008-08-23 11:43     ` Nikolaj Schumacher
2008-08-23 12:17     ` Pascal J. Bourguignon

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.