Hello! I like this version better, perhaps because it doesn’t prominently shifts and offsets. ;-)
Feel free to apply after the cosmetic changes below. Mark H Weaver <m...@netris.org> skribis: > From 77834798bb67076ff6c7a3fd939b2bb55353faff Mon Sep 17 00:00:00 2001 > From: Mark H Weaver <m...@netris.org> > Date: Tue, 23 Oct 2012 17:28:43 -0400 > Subject: [PATCH 1/3] Implement per-port read options. > > * libguile/read.c (scm_t_read_opts): Update comment to mention the > per-port read options. > > (sym_port_read_options): New symbol. “New variable.” > (set_port_read_option): New function. > > (init_read_options): Add new 'port' parameter, and consult the > per-port read option overrides when initializing the 'scm_t_read_opts' > struct. Move to bottom of file. > > (scm_read): Pass 'port' parameter to init_read_options. [...] > /* Internal read options structure. This is initialized by 'scm_read' > - from the global read options, and a pointer is passed down to all > - helper functions. */ > + from the global and per-port read options, and a pointer is passed > + down to all helper functions. */ > enum t_keyword_style { Brace on the next line. > @@ -1970,6 +1943,114 @@ SCM_DEFINE (scm_file_encoding, "file-encoding", 1, 0, > 0, > } > #undef FUNC_NAME > > +/* Per-port read options. A page break just above would be welcome. > + We store per-port read options in the 'port-read-options' key of the > + port's alist, which is stored in 'scm_i_port_weak_hash'. The value > + stored in the alist is a single integer that contains a two-bit field > + for each read option. > + > + If a bit field contains READ_OPTION_INHERIT (3), that indicates that > + the applicable value should be inherited from the corresponding > + global real option. Otherwise, the bit field contains the value of > + the read option. For boolean read options that have been set > + per-port, the possible values are 0 or 1. If the 'keyword_style' > + read option has been set per-port, its possible values are those in > + 'enum t_keyword_style'. */ Nice. > +SCM_SYMBOL (sym_port_read_options, "port-read-options"); Please add a comment above saying “Key to read options in per-port alists.” Thanks! Ludo’.