- .. 'only when the current list is null.')
- end
- else
- local w = node_new(id_whatsit, sid_user)
- setfield(w, 'next', hd)
- setfield(w, 'user_id', DIR)
- setfield(w, 'type', 110)
- set_attr(w, attr_dir, v)
- Dnode.write(w)
- tex_set_attr('global', attr_dir, 0)
- end
- tex_set_attr('global', attr_icflag, 0)
- end
- end
- luatexja.direction.set_list_direction = set_list_direction
+ .. 'only when the current list is null.')
+ end
+ else
+ local w = node_new(id_whatsit, sid_user)
+ setfield(w, 'next', hd)
+ setfield(w, 'user_id', DIR)
+ setfield(w, 'type', 110)
+ set_attr(w, attr_dir, v)
+ Dnode.write(w)
+ end
+ tex_set_attr('global', attr_icflag, 0)
+ end
+ tex_set_attr('global', attr_dir, 0)
+ end
+ luatexja.direction.set_list_direction = set_list_direction
+end
+
+function luatexja.direction.freeze_list_dir()
+ local w = to_direct(tex.nest[tex.nest.ptr].tail)
+ set_attr(w, attr_dir, -has_attr(w, attr_dir))