;;; lisp file for xyzzy ver0.2.2.233 or ver0.2.2.234
;;; control-char-view.l ver.0.0.2.2 // crayonzen [2023-01-30]11:28:11(+0900)

(provide "control-char-view")

(in-package "editor")

(export '(*control-character-view*
	  ))

(defvar-local *control-character-view* nil)

(defun control-character-view ()
  (interactive)
  (if *control-character-view*
      (progn
	(set-local-window-flags (selected-buffer) *window-flag-newline* nil)
	(set-local-window-flags (selected-buffer) *window-flag-tab* nil)
	(set-local-window-flags (selected-buffer) *window-flag-eof* nil)
	(set-local-window-flags (selected-buffer) *window-flag-zenkaku-space* nil)
	(set-local-window-flags (selected-buffer) *window-flag-full-width-space* nil)
	(set-local-window-flags (selected-buffer) *window-flag-half-width-space* nil)
	(setq *control-character-view* nil)
	)
    (progn
      (set-local-window-flags (selected-buffer) *window-flag-newline* t)
      (set-local-window-flags (selected-buffer) *window-flag-tab* t)
      (set-local-window-flags (selected-buffer) *window-flag-eof* t)
      (set-local-window-flags (selected-buffer) *window-flag-zenkaku-space* t)
      (set-local-window-flags (selected-buffer) *window-flag-full-width-space* t)
      (set-local-window-flags (selected-buffer) *window-flag-half-width-space* t)
      (setq *control-character-view* t)
      )
    )
  )

(defun control-character-view-default ()
  (interactive)
  (setq def "d")
  (progn
	(set-local-window-flags (selected-buffer) *window-flag-newline* def)
	(set-local-window-flags (selected-buffer) *window-flag-tab* def)
	(set-local-window-flags (selected-buffer) *window-flag-eof* def)
	(set-local-window-flags (selected-buffer) *window-flag-zenkaku-space* def)
	(set-local-window-flags (selected-buffer) *window-flag-full-width-space* def)
	(set-local-window-flags (selected-buffer) *window-flag-half-width-space* def)
	(setq *control-character-view* nil)
	)
  )
