all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#16103: 24.3.50; `read' and circular objects
@ 2013-12-10 20:51 Drew Adams
  2013-12-10 22:47 ` Andreas Schwab
  0 siblings, 1 reply; 5+ messages in thread
From: Drew Adams @ 2013-12-10 20:51 UTC (permalink / raw)
  To: 16103

Dunno whether this is a bug.  If it is not, I'd appreciate some help
understanding it.  (elisp) `Circular Objects' does not seem to cover it,
AFAICT.

This Lisp code is in a file:

((last-sort-comparer
  (bmkp-info-cp bmkp-gnus-cp bmkp-url-cp bmkp-local-file-type-cp)
  bmkp-alpha-p)
 (last-reverse-sort-p)
 (last-reverse-multi-sort-p)
 (last-latest-bookmark-alist #1=(#4=#("setq" 0 4
				      (bmkp-full-record #1#))
				    (filename . "~/.emacs")
				    (buffer-name . ".emacs")
				    (front-context-string . "      (append (l")
				    (rear-context-string . "(setq load-path\n")
				    (front-context-region-string)
				    (rear-context-region-string)
				    (visits . 0)
				    (time . #2=(21158 44564 146055 551000))
				    (created . #2#)
				    (position . 17)))
 (last-bmenu-omitted-bookmarks)
 (last-bmenu-marked-bookmarks)
 (last-bmenu-filter-function)
 (last-bmenu-filter-pattern . #3="")
 (last-bmenu-title . #3#)
 (last-bmenu-bookmark . #4#)
 (last-specific-buffer . #3#)
 (last-specific-file . #3#)
 (last-bmenu-toggle-filenames . t)
 (last-bmenu-before-hide-marked-alist)
 (last-bmenu-before-hide-unmarked-alist)
 (last-bookmark-file . "/home/fcihh/.emacs.bmk"))

With point at bob in the file, I do (read (current-buffer)), and this
is the result:

((last-sort-comparer
  (bmkp-info-cp bmkp-gnus-cp bmkp-url-cp bmkp-local-file-type-cp)
  bmkp-alpha-p)
 (last-reverse-sort-p)
 (last-reverse-multi-sort-p)
 (last-latest-bookmark-alist
  (#("setq" 0 4
     (bmkp-full-record #2))
   (filename . "~/.emacs")
   (buffer-name . ".emacs")
   (front-context-string . "      (append (l")
   (rear-context-string . "(setq load-path\n")
   (front-context-region-string)
   (rear-context-region-string)
   (visits . 0)
   (time 21158 44564 146055 551000)
   (created 21158 44564 146055 551000)
   (position . 17)))
 (last-bmenu-omitted-bookmarks)
 (last-bmenu-marked-bookmarks)
 (last-bmenu-filter-function)
 (last-bmenu-filter-pattern . "")
 (last-bmenu-title . "")
 (last-bmenu-bookmark .
                      #("setq" 0 4
                        (bmkp-full-record
                         (#2
                          (filename . "~/.emacs")
                          (buffer-name . ".emacs")
                          (front-context-string . "      (append (l")
                          (rear-context-string . "(setq load-path\n")
                          (front-context-region-string)
                          (rear-context-region-string)
                          (visits . 0)
                          (time 21158 44564 146055 551000)
                          (created 21158 44564 146055 551000)
                          (position . 17)))))
 (last-specific-buffer . "")
 (last-specific-file . "")
 (last-bmenu-toggle-filenames . t)
 (last-bmenu-before-hide-marked-alist)
 (last-bmenu-before-hide-unmarked-alist)
 (last-bookmark-file . "/home/fcihh/.emacs.bmk"))

Notice the remaining #2 occurrences.  I would have expected the above
pp-written sexp to be similar to what was in the file: a representation
of similar circular list structure.

Or if not that, I would at least expect that all #-notation references
to shared structure would be resolved, so that there are no orphaned
references like #2.

I would prefer to have `read' give me the (equivalent/similar) list
structure, with circularities.  But I could probably live with
`read' giving me a tree with copies where there originally was shared
structure (i.e., all # references resolved).

What I'm seeing looks to me like a bug.  Help understanding is
appreciated.  I write out a list structure that has circularities,
and I want to `read' the result to get back a similar structure.  What
should I be doing differently, or what is it that I need to be aware
of, that I'm currently missing?  Thx.

In GNU Emacs 24.3.50.2 (i686-pc-mingw32)
 of 2013-11-28 on LEG570
Bzr revision: 115271 rgm@gnu.org-20131128203155-qjc1xsp19z2k64b2
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --enable-checking 'CFLAGS=-O0 -g3' CPPFLAGS=-DGLYPH_DEBUG=1'





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

* bug#16103: 24.3.50; `read' and circular objects
  2013-12-10 20:51 bug#16103: 24.3.50; `read' and circular objects Drew Adams
@ 2013-12-10 22:47 ` Andreas Schwab
  2013-12-10 23:04   ` Drew Adams
  0 siblings, 1 reply; 5+ messages in thread
From: Andreas Schwab @ 2013-12-10 22:47 UTC (permalink / raw)
  To: Drew Adams; +Cc: 16103-done

You didn't set print-circle.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."





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

* bug#16103: 24.3.50; `read' and circular objects
  2013-12-10 22:47 ` Andreas Schwab
@ 2013-12-10 23:04   ` Drew Adams
  2013-12-11  0:32     ` Michael Heerdegen
  0 siblings, 1 reply; 5+ messages in thread
From: Drew Adams @ 2013-12-10 23:04 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: 16103-done

> You didn't set print-circle.

Sorry, I don't understand.  Why do you say that?
Could you please elaborate?

The code does set `print-circle' (to `t') when it writes the
sexp using `pp'.  The sexp in the file shows that, no?
Do you see a problem with the sexp as printed in the file?





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

* bug#16103: 24.3.50; `read' and circular objects
  2013-12-10 23:04   ` Drew Adams
@ 2013-12-11  0:32     ` Michael Heerdegen
  2013-12-11  1:22       ` Drew Adams
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Heerdegen @ 2013-12-11  0:32 UTC (permalink / raw)
  To: Drew Adams; +Cc: 16103-done, Andreas Schwab

Drew Adams <drew.adams@oracle.com> writes:

> > You didn't set print-circle.
>
> Sorry, I don't understand.  Why do you say that?

I guess he meant the second action, when you did

   (read (current-buffer))

Did you have print-circle t there, too, when the result of `read' was
printed?


Regards,

Michael.





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

* bug#16103: 24.3.50; `read' and circular objects
  2013-12-11  0:32     ` Michael Heerdegen
@ 2013-12-11  1:22       ` Drew Adams
  0 siblings, 0 replies; 5+ messages in thread
From: Drew Adams @ 2013-12-11  1:22 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: 16103-done, Andreas Schwab

> > > You didn't set print-circle.
> >
> > Sorry, I don't understand.  Why do you say that?
> 
> I guess he meant the second action, when you did
> (read (current-buffer))   Did you have print-circle t there,
> too, when the result of `read' was printed?

Ah, right.  I just used `pp-last-expression'.  Thx, Michael.





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

end of thread, other threads:[~2013-12-11  1:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-10 20:51 bug#16103: 24.3.50; `read' and circular objects Drew Adams
2013-12-10 22:47 ` Andreas Schwab
2013-12-10 23:04   ` Drew Adams
2013-12-11  0:32     ` Michael Heerdegen
2013-12-11  1:22       ` Drew Adams

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.