From: weber <hugows@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: "push" creating circular objects
Date: Wed, 20 Aug 2008 14:47:12 -0700 (PDT) [thread overview]
Message-ID: <991708f2-d4f4-47bb-b1ef-a632c12ea4a3@b1g2000hsg.googlegroups.com> (raw)
In-Reply-To: uabf7tsiw.fsf@gmail.com
On Aug 20, 4:07 pm, Charles Sebold <cseb...@gmail.com> wrote:
> On 20 Aug 2008, Charles Sebold wrote:
>
> > I just changed it from push to append, with no change in behavior:
>
> Now I tried something even more radical, a completely different approach
> to the problem, just to see what happens.
>
> (defun Textile-list-context (textile-list-tag)
> "Return list of HTML tags corresponding to list context (ol, ul)."
> (let ((my-list (delete " " (delete "" (split-string textile-list-tag "")))))
> (mapcar (lambda (x)
> (cond
> ((string= x "#")
> "ol")
> ((string= x "*")
> "ul")
> (t
> nil))) my-list)))
>
> _It still returns a circular list._
>
> And it still does the right thing, when I call it from a scratch buffer.
>
> Clearly there is something deep about lists that I don't get right now.
> --
> Charles Sebold 20th of August, 2008
It works for me on the scratch. As a sidenot, this is how I normally
write these things:
(defun Textile-list-context (str)
(let ((my-list nil))
(with-temp-buffer
(insert str)
(goto-char (point-min))
(while (not (eobp))
(cond
((looking-at "#")
(push "ol" my-list))
((looking-at "\*")
(push "ul" my-list)))
(forward-char 1)))
my-list))
HTH,
hugo
next prev parent reply other threads:[~2008-08-20 21:47 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=991708f2-d4f4-47bb-b1ef-a632c12ea4a3@b1g2000hsg.googlegroups.com \
--to=hugows@gmail.com \
--cc=help-gnu-emacs@gnu.org \
/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 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.