.. -*- coding: utf-8 -*- .. \||<-snip->|| start .. Copyright (C) 2013, Wolfgang Scherer, .. .. This file is part of DOGgy Style Programming. .. .. Permission is granted to copy, distribute and/or modify this document .. under the terms of the GNU Free Documentation License, Version 1.3 .. or any later version published by the Free Software Foundation; .. with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. .. A copy of the license is included in the section entitled "GNU .. Free Documentation License". .. inline comments (with ws_docutils) .. role:: rem(span) :format: '' .. role:: html(span) :format: html :raw: ################################################## :rem:`|||:sec:|||`\ Satoku Matrix ################################################## .. \||<-snap->|| skip :Author: `Wolfgang Scherer`_ .. contents:: .. \||<-snap->|| skip .. \||<-snap->|| include ^index-header.snip$ See http://sw-amt.ws/README-Satoku.html for an explanation of the satoku matrix. To get started, put `xemacs-fsf-compat.el` somewhere in your `load-path`, then load `satoku.el`: Press `C-x C-e` at end of the following expression:: (load-file "satoku.el") or press:: `M-x load-file RET satoku.el RET' Then execute the command satoku-insert-matrix:: `M-x satoku-insert-matrix RET' Which will give you a Satoku matrix with a single clause sub-matrix:: // | || S|| 0| 0|| 1 1 1 | // +----++----++---+----++-------+ // +-----+----++---+----++-------+ // | | 0|| | || 1 * * | // | | 1|| | || * 1 * | // | | 2|| | || * * 1 | // +-----+----++---+----++-------+ // |:info:| move point inside and press `C-u M-x satoku-mode RET' Position point somewhere inside the matrix and execute:: `C-u M-x satoku-mode RET' This constrains your cursor movements to the matrix and assigns special commands to certain keys. (Note: Outside the matrix, the keys work as usual). Press `?` for help. Some commands are prefix commands (e.g. `g`). Press `?` after the prefix command to get help. To extend the matrix with another 3x3 clause sub-matrix, press:: `C-u 3 > >' // | || S|| 0| 0|| 1 1 1 | 1 1 1 | // +----++----++---+----++-------+-------+ // +-----+----++---+----++-------+-------+ // | | 0|| | || 1 * * | _ _ _ | // | | 1|| | || * 1 * | _ _ _ | // | | 2|| | || * * 1 | _ _ _ | // +-----+----++---+----++-------+-------+ // | | 3|| | || _ _ _ | 1 * * | // | | 4|| | || _ _ _ | * 1 * | // | | 5|| | || _ _ _ | * * 1 | // +-----+----++---+----++-------+-------+ // |:info:| move point inside and press `C-u M-x satoku-mode RET' Press `> >` to get a separator line:: // | || S|| 0| 0|| 1 1 1 | 1 1 1 || // +----++----++---+----++-------+-------++ // +-----+----++---+----++-------+-------++ // | | 0|| | || 1 * * | _ _ _ || // | | 1|| | || * 1 * | _ _ _ || // | | 2|| | || * * 1 | _ _ _ || // +-----+----++---+----++-------+-------++ // | | 3|| | || _ _ _ | 1 * * || // | | 4|| | || _ _ _ | * 1 * || // | | 5|| | || _ _ _ | * * 1 || // +-----+----++---+----++-------+-------++ // +-----+----++---+----++-------+-------++ // |:info:| move point inside and press `C-u M-x satoku-mode RET' Press `C-u 2 > >` to get a 2x2 clause sub-matrix, repeat, and repeat again (hint: you can use keyboard macros). Normal keys are disabled inside the matrix (but not the legend), use `0` to mark selection conflicts, `-` to clear a cell. (Mirror cells are automatically changed accordingly.) Do not use `1` to mark required selections. Exclude all other selections with `0` instead:: // | || S|| 0| 0|| 1 1 1 | 1 1 1 || 1 1 | 1 1 | 1 1 | // +----++----++---+----++-------+-------++-----+-----+-----+ // +-----+----++---+----++-------+-------++-----+-----+-----+ // | | 0|| | || 1 * * | 0 _ _ || _ 0 | _ _ | _ _ | // | | 1|| | || * 1 * | _ _ 0 || _ _ | _ _ | _ _ | // | | 2|| | || * * 1 | _ _ 0 || _ _ | _ _ | _ _ | // +-----+----++---+----++-------+-------++-----+-----+-----+ // | | 3|| | || 0 _ _ | 1 * * || 0 _ | _ _ | _ _ | // | | 4|| | || _ _ _ | * 1 * || _ _ | _ _ | _ _ | // | | 5|| | || _ 0 0 | * * 1 || _ _ | _ _ | _ _ | // +-----+----++---+----++-------+-------++-----+-----+-----+ // +-----+----++---+----++-------+-------++-----+-----+-----+ // | | 6|| | || _ _ _ | 0 _ _ || 1 * | _ _ | _ _ | a // | | 7|| | || 0 _ _ | _ _ _ || * 1 | _ _ | _ _ | ¬a // +-----+----++---+----++-------+-------++-----+-----+-----+ // | | 8|| | || _ _ _ | _ _ _ || _ _ | 1 * | _ _ | b // | | 9|| | || _ _ _ | _ _ _ || _ _ | * 1 | _ _ | ¬b // +-----+----++---+----++-------+-------++-----+-----+-----+ // | | 10|| | || _ _ _ | _ _ _ || _ _ | _ _ | 1 * | c // | | 11|| | || _ _ _ | _ _ _ || _ _ | _ _ | * 1 | ¬c // +-----+----++---+----++-------+-------++-----+-----+-----+ // |:info:| move point inside and press `C-u M-x satoku-mode RET' Then press `r u` to run the requirements update algorithm, which detects and fills in the *hard one* requirements. If you did use `1` and are no longer sure, whether the matrix conditions are proper, press `r c` to clear all *hard one* requirements. Then press `r u` to run the requirements update algorithm. :: // | || S|| 0| 0|| 1 1 1 | 1 1 1 || 1 1 | 1 1 | 1 1 | // +----++----++---+----++-------+-------++-----+-----+-----+ // +-----+----++---+----++-------+-------++-----+-----+-----+ // | | 0|| | || 1 * * | 0 _ _ || 1 0 | _ _ | _ _ | // | | 1|| | || * 1 * | _ _ 0 || _ _ | _ _ | _ _ | // | | 2|| | || * * 1 | _ _ 0 || _ _ | _ _ | _ _ | // +-----+----++---+----++-------+-------++-----+-----+-----+ // | | 3|| | || 0 _ _ | 1 * * || 0 1 | _ _ | _ _ | // | | 4|| | || _ _ _ | * 1 * || _ _ | _ _ | _ _ | // | | 5|| | || 1 0 0 | * * 1 || 1 0 | _ _ | _ _ | // +-----+----++---+----++-------+-------++-----+-----+-----+ // +-----+----++---+----++-------+-------++-----+-----+-----+ // | | 6|| | || _ _ _ | 0 _ _ || 1 * | _ _ | _ _ | a // | | 7|| | || 0 _ _ | _ _ 0 || * 1 | _ _ | _ _ | ¬a // +-----+----++---+----++-------+-------++-----+-----+-----+ // | | 8|| | || _ _ _ | _ _ _ || _ _ | 1 * | _ _ | b // | | 9|| | || _ _ _ | _ _ _ || _ _ | * 1 | _ _ | ¬b // +-----+----++---+----++-------+-------++-----+-----+-----+ // | | 10|| | || _ _ _ | _ _ _ || _ _ | _ _ | 1 * | c // | | 11|| | || _ _ _ | _ _ _ || _ _ | _ _ | * 1 | ¬c // +-----+----++---+----++-------+-------++-----+-----+-----+ // |:info:| move point inside and press `C-u M-x satoku-mode RET' .. ================================================== .. :rem:`|||:sec:|||`\ Footnotes .. ================================================== :html:`
` .. \[#] .. ================================================== .. :rem:`|||:sec:|||`\ References .. ================================================== .. \||<-snap->|| include ^index-footer.snip$ :rem:`|||:sec:|||`\ **Copyright** Copyright (C) 2013, Wolfgang Scherer, . See the document source for conditions of use under the GNU Free Documentation License. .. _`Wolfgang Scherer`: Wolfgang.Scherer@gmx.de .. \||<-snip->|| stop .. ================================================== .. :rem:`|||:sec:|||`\ END .. ================================================== .. .. :ide-menu: Emacs IDE Main Menu - Buffer @BUFFER@ .. . M-x `eIDE-menu' ()(eIDE-menu "z") .. :ide: DELIM: SNIPPETS (ABOUT) |q|<- SYM ->||, ||<- SYM ->||, @| SYM @ .. . (let nil (symbol-tag-normalize-delimiter (cons (cons nil "||<-") (cons "->||" nil)) t) (symbol-tag-switch-delimiter-sets) (symbol-tag-normalize-delimiter (cons (cons nil "||<-") (cons "->||" nil)) t) (setq symbol-tag-match-rx "sn[i]p") (setq symbol-tag-enclose-delimiter-set (symbol-tag-normalize-delimiter (cons (cons nil "@|") (cons "@" nil))))) .. :ide: DELIM: SNIPPETS (DOC) ||<- SYM ->||, |: SYM :|, ` SYM ` .. . (let nil (symbol-tag-normalize-delimiter (cons (cons nil "|:") (cons ":|" nil)) t) (symbol-tag-switch-delimiter-sets) (symbol-tag-normalize-delimiter (cons (cons nil "||<-") (cons "->||" nil)) t) (setq symbol-tag-match-rx "sn[i]p") (setq symbol-tag-enclose-delimiter-set (symbol-tag-normalize-delimiter (cons (cons "\\(\\`\\|[^\\]\\)" "`") (cons "`" nil))))) .. :ide: DELIM: SNIPPETS (SNIP DOC) ||<- SYM ->||, |: SYM :|, @ SYM @ .. . (let nil (symbol-tag-normalize-delimiter (cons (cons nil "|:") (cons ":|" nil)) t) (symbol-tag-switch-delimiter-sets) (symbol-tag-normalize-delimiter (cons (cons nil "||<-") (cons "->||" nil)) t) (setq symbol-tag-match-rx "sn[i]p") (setq symbol-tag-enclose-delimiter-set (symbol-tag-normalize-delimiter (cons (cons nil "@") (cons "@" nil))))) .. :ide: DELIM: SNIPPETS (FILLME) ||<- SYM ->||, :: SYM ::, @ SYM @ .. . (let nil (symbol-tag-normalize-delimiter (cons (cons nil "::") (cons "::" nil)) t) (symbol-tag-switch-delimiter-sets) (symbol-tag-normalize-delimiter (cons (cons nil "||<-") (cons "->||" nil)) t) (setq symbol-tag-match-rx "sn[i]p") (setq symbol-tag-enclose-delimiter-set (symbol-tag-normalize-delimiter (cons (cons nil "@") (cons "@" nil))))) .. :ide: DELIM: SNIPPETS (SUBST) ||<- SYM ->||, @ SYM @, @ SYM @ .. . (let nil (symbol-tag-normalize-delimiter (cons (cons nil "@") (cons "@" nil)) t) (symbol-tag-switch-delimiter-sets) (symbol-tag-normalize-delimiter (cons (cons nil "||<-") (cons "->||" nil)) t) (setq symbol-tag-match-rx "sn[i]p") (setq symbol-tag-enclose-delimiter-set (symbol-tag-normalize-delimiter (cons (cons "[^\\]" "`") (cons "`" nil))))) .. :ide: +#- .. . Snippet Delimiter Sets () .. :ide: DELIM: ReST (links) ` SYM `_, .. _` SYM `, ` SYM ` .. . (let nil (symbol-tag-normalize-delimiter (cons (cons "[^\\]" "`") (cons "`_" nil)) t) (symbol-tag-switch-delimiter-sets) (symbol-tag-normalize-delimiter (cons (cons nil ".. _`") (cons "`:" nil)) t) (setq symbol-tag-enclose-delimiter-set (symbol-tag-normalize-delimiter (cons (cons "\\(\\`\\|[^\\]\\)" "`") (cons "`" nil))))) .. :ide: DELIM: STANDARD (GNU quoting) |: SYM :|, :: SYM ::, ` SYM ' .. . (let nil (symbol-tag-normalize-delimiter (cons (cons nil "::") (cons "::" nil)) t) (symbol-tag-switch-delimiter-sets) (symbol-tag-normalize-delimiter (cons (cons nil "|:") (cons ":|" nil)) t) (setq symbol-tag-enclose-delimiter-set (symbol-tag-normalize-delimiter (cons (cons nil "`") (cons "'" nil))))) .. :ide: DELIM: STANDARD (ReST quoting) |: SYM :|, :: SYM ::, ` SYM ` .. . (let nil (symbol-tag-normalize-delimiter (cons (cons nil "::") (cons "::" nil)) t) (symbol-tag-switch-delimiter-sets) (symbol-tag-normalize-delimiter (cons (cons nil "|:") (cons ":|" nil)) t) (setq symbol-tag-enclose-delimiter-set (symbol-tag-normalize-delimiter (cons (cons "[^\\]" "`") (cons "`" nil))))) .. :ide: +#- .. . Delimiter Sets () .. :ide: COMPILE: render reST as LaTeX .. . (let* ((fp (buffer-file-name)) (fn (file-name-nondirectory fp))) (save-match-data (if (string-match-t "[.][^.]*$" fn) (setq fn (replace-match "" nil t fn)))) (let ((args (concat " " fp " | ws_rst2latex.py --traceback | tee " fn ".tex"))) (save-buffer) (compile (concat "PATH=\".:$PATH\"; cat " args)))) .. :ide: COMPILE: render reST as MAN .. . (let* ((fp (buffer-file-name)) (fn (file-name-nondirectory fp))) (save-match-data (if (string-match-t "[.][^.]*$" fn) (setq fn (replace-match "" nil t fn)))) (let ((args (concat " " fp " | ws_rst2man.py --traceback "))) (save-buffer) (compile (concat "PATH=\".:$PATH\"; cat " args)))) .. :ide: COMPILE: render reST as TXT (via MAN) .. . (let* ((fp (buffer-file-name)) (fn (file-name-nondirectory fp))) (save-match-data (if (string-match-t "[.][^.]*$" fn) (setq fn (replace-match "" nil t fn)))) (let ((args (concat " " fp " | ws_rst2man.py --traceback | man -l -"))) (save-buffer) (compile (concat "PATH=\".:$PATH\"; cat " args)))) .. :ide: COMPILE: render reST as ODT --strip-comments .. . (let* ((fp (buffer-file-name)) (fn (file-name-nondirectory fp))) (save-match-data (if (string-match-t "[.][^.]*$" fn) (setq fn (replace-match "" nil t fn)))) (let ((args (concat " " fp " | ws_rst2odt.py --traceback --strip-comments | cat >" fn ".odt "))) (save-buffer) (compile (concat "PATH=\".:$PATH\"; cat " args)))) .. :ide: COMPILE: render reST as LaTeX, compile PDF and view with gv .. . (let* ((fp (buffer-file-name)) (fn (file-name-nondirectory fp))) (save-match-data (if (string-match-t "[.][^.]*$" fn) (setq fn (replace-match "" nil t fn)))) (let ((args (concat " " fp " | ws_rst2latex.py --traceback | tee " fn ".tex && pdflatex '\\nonstopmode\\input " fn ".tex' && gv " fn ".pdf"))) (save-buffer) (compile (concat "PATH=\".:$PATH\"; cat " args)))) .. :ide: COMPILE: render reST as PDF .. . (let* ((fp (buffer-file-name)) (fn (file-name-nondirectory fp))) (save-match-data (if (string-match-t "[.][^.]*$" fn) (setq fn (replace-match "" nil t fn)))) (let ((args (concat " " fp " | ws_rst2pdf -e ws_docutils.raw_role >" fn ".pdf"))) (save-buffer) (compile (concat "PATH=\".:$PATH\"; cat " args)))) .. :ide: COMPILE: render reST as HTML .. . (let* ((fp (buffer-file-name)) (fn (file-name-nondirectory fp))) (save-match-data (if (string-match-t "[.][^.]*$" fn) (setq fn (replace-match "" nil t fn)))) (let ((args (concat " " fp " | ws_rst2html.py --traceback --cloak-email-addresses | tee " fn ".html "))) (save-buffer) (compile (concat "PATH=\".:$PATH\"; cat " args)))) .. :ide: COMPILE: render reST as pseudoXML .. . (let* ((fp (buffer-file-name)) (fn (file-name-nondirectory fp))) (save-match-data (if (string-match-t "[.][^.]*$" fn) (setq fn (replace-match "" nil t fn)))) (let ((args (concat " --traceback " fp " 2>&1 #| tee " fn ".pxml"))) (save-buffer) (compile (concat "PATH=\".:$PATH\"; ws_rst2pseudoxml.py " args)))) .. :ide: +#- .. . Process () .. :ide: QUO: ~~ Subsubsection ~~ .. . (insert "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\:rem\:`|\:sec\:|`\\ ::fillme\::\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ) .. :ide: QUO: -- Subsection -- .. . (insert "--------------------------------------------------\n\:rem\:`||\:sec\:||`\\ ::fillme\::\n--------------------------------------------------\n" ) .. :ide: QUO: == Section == .. . (insert "==================================================\n\:rem\:`|||\:sec\:|||`\\ ::fillme\::\n==================================================\n" ) .. :ide: +#- .. . Sections () .. :ide: OCCUR-OUTLINE: `|||: sec :|||' + ^.. + command comments .. . (x-symbol-tag-occur-outline "sec" '("|:" ":|") (cons (cons "^" ".. ") (cons nil nil)) "\\(_`[^`\n]+`\\|\\[[^]\n]+\\]\\|[|][^|\n]+[|]\\|[^:\n]+::\\)") .. :ide: MENU-OUTLINE: `|||: sec :|||' + ^.. + command comments .. . (x-eIDE-menu-outline "sec" '("|:" ":|") (cons (cons "^" ".. ") (cons nil nil)) "\\(_`[^`\n]+`\\|\\[[^]\n]+\\]\\|[|][^|\n]+[|]\\|[^:\n]+::\\)") .. .. Local Variables: .. mode: rst .. snip-mode: rst .. truncate-lines: t .. symbol-tag-symbol-regexp: "[-0-9A-Za-z_#]\\([-0-9A-Za-z_. ]*[-0-9A-Za-z_]\\|\\)" .. symbol-tag-auto-comment-mode: nil .. symbol-tag-srx-is-safe-with-nil-delimiters: nil .. End: