Select sjis if the characters are not shown properly. Internet Expolorer is the targetted browser.
(Ref "foo" "Foo")
(Label "foo"
001: ; Ref 002: ; (Ref "foo" "Foo") のように書かれた箇所で、 003: ; C-c C-e (my-eval-last-sexp) を実行すると、 004: ; (Label "foo" を探して、そこに jump します。 005: (defun Ref (tag displayWord) 006: (interactive) 007: (setq *lastpos* (point)) 008: (setq *searchword* (concat "[^=]¥(Label " "¥¥¥"" tag "¥¥¥"")) 009: ; (beginning-of-buffer) 010: ; (message-box searchword) 011: (if (re-search-forward *searchword* t) 012: (progn 013: (search-forward ")") 014: (forward-char 1)) 015: (if (re-search-backward *searchword* t) 016: (progn 017: (search-forward ")") 018: (forward-char 1)) 019: (message-box "対応する Label がありません。")) 020: ) 021: )
022: ; N 023: ; (N "Foo") のように書かれた箇所で、 024: ; C-c C-e (my-eval-last-sexp) を実行すると、 025: ; (Note "Foo" を探して、そこに jump します。 026: (defun N (tag) 027: (interactive) 028: (let (searchword) 029: (setq *lastpos* (point)) 030: (setq searchword (concat "^[^=]¥(Note " "¥¥¥"" tag "¥¥¥"")) 031: (setq *searchword* searchword) 032: ; (message-box searchword) 033: (if (re-search-forward searchword t) 034: (progn 035: (search-forward ")") 036: (forward-char 1)) 037: (if (re-search-backward searchword t) 038: (progn 039: (search-forward ")") 040: (forward-char 1)) 041: (message-box "対応する Note がありません。")) 042: ) 043: ))
044: ; Label 045: ; (Label "Foo") のように書かれた箇所で、 046: ; C-c C-e (my-eval-last-sexp) を実行すると、 047: ; (Ref "Foo" を探して、そこに jump します。 048: ; 049: (defun Label (tag displayWord) 050: (interactive) 051: (let (searchword) 052: (setq searchword (concat "[^=]¥(Ref " "¥¥¥"" tag "¥¥¥"")) 053: (if (re-search-backward searchword t) 054: (progn 055: (search-forward ")") 056: (forward-char 1)) 057: (if (re-search-forward searchword t) 058: (progn 059: (search-forward ")") 060: (forward-char 1)) 061: (message-box "対応するRefがありません。")) 062: ); end of if 063: (setq *searchword* searchword) 064: ))
065: ; Note 066: ; (Note "foo" "Foo") のように書かれた箇所で、 067: ; C-c C-e (my-eval-last-sexp) を実行すると、 068: ; (N "foo" を探して、そこに jump します。 069: ; 070: (defun Note (tag) 071: (interactive) 072: (let (searchword) 073: (setq searchword 074: (concat "[^=]¥(N " "¥¥¥"" tag "¥¥¥"")) 075: (setq *searchword* searchword) 076: (goto-char (point-min)) 077: (if (re-search-forward searchword t) 078: (progn 079: (search-forward ")") 080: (forward-char 1)) 081: (message-box "対応する N 関数呼び出しがありません。")) 082: ); end of if 083: )
084: ; NoteSearchAgain 085: ; 086: ; 前回の検索語を *searchword* に記憶しているので、その検索語 087: ; でもう一度検索します。 088: ; 089: ; 見出し行、拡張見出しを定義している行があって、そこを参照し 090: ; ている箇所を検索しているときに使用します。一度、参照してい 091: ; る箇所を発見して、それ以外にも同じ見出しを参照している箇所 092: ; がないか探すときに便利です。 093: ; 094: (defun NoteSearchAgain () 095: (interactive) 096: (if (re-search-forward *searchword* t) 097: (progn 098: (search-forward ")") 099: (forward-char 1)) 100: (message-box "これ以降、対応する参照はありません。") 101: ); end of if 102: ); end of defun
103: ; H 104: ; 105: ; (H str) とあると、str が見出し行にあるか 106: ; (Head str) とあるところに jump します。 107: (defun H (str) 108: (interactive) 109: (setq *lastpos* (point)) 110: (goto-char (point-min)) 111: (if (not (re-search-forward 112: ; (concat "^[/%; ]*¥¥*¥¥** " str) t)) 113: (concat "¥¥(^[/%; ]*¥¥*¥¥** " str "$¥¥|" 114: "^[ ]*■" str "$¥¥|" 115: "^[ ]*※ " str "$¥¥|" 116: "^[ ]*● " str "$¥¥|" 117: "^=.*[ ]¥*[ ]" str "$¥¥|" 118: "(Head ¥"" str "¥")¥¥|" 119: "(Hd ¥"" str "¥")¥¥|" 120: "(Anchor ¥"" str "¥")¥¥)" 121: ) t)) 122: (progn 123: (message-box 124: (concat "検索語¥n¥n「" str "」¥n¥nを含んだ見出し行" 125: "が見つかりません。")) 126: (goto-char *lastops*)) 127: ))
128: ; Head 129: ; 130: ; (Head tag) とあると、(H tag) とあるところに jump します。 131: (defun Head (tag) 132: (interactive) 133: (let (searchword) 134: (setq searchword 135: (concat "[^=]¥(H " "¥¥¥"" tag "¥¥¥"")) 136: (setq *searchword* searchword) 137: (goto-char (point-min)) 138: (if (re-search-forward searchword t) 139: (progn 140: (search-forward ")") 141: (forward-char 1)) 142: (message-box "対応する H 関数呼び出しがありません。")) 143: ); end of if 144: )
145: (defun Hd (tag) 146: (interactive) 147: (let (searchword) 148: (setq searchword 149: (concat "[^=]¥(H " "¥¥¥"" tag "¥¥¥"")) 150: (setq *searchword* searchword) 151: (goto-char (point-min)) 152: (if (re-search-forward searchword t) 153: (progn 154: (search-forward ")") 155: (forward-char 1)) 156: (message-box "対応する H 関数呼び出しがありません。")) 157: ); end of if 158: )
159: (defun Anchor (tag) 160: (interactive) 161: (let (searchword) 162: (setq searchword 163: (concat "[^=]¥(H " "¥¥¥"" tag "¥¥¥"")) 164: (setq *searchword* searchword) 165: (goto-char (point-min)) 166: (if (re-search-forward searchword t) 167: (progn 168: (search-forward ")") 169: (forward-char 1)) 170: (message-box "対応する H 関数呼び出しがありません。")) 171: ); end of if 172: )
173: ; pathname で指定するファイルを Start で表示します。 174: ; 175: ; pathname の拡張子が .odr の場合(ODR ファイル) は、その html フ 176: ; ァイルと比べて ODR ファイルの方が新しければ、html ファイルを作 177: ; り直しで、html ファイルを表示します。 178: 179: (defun Show (pathname showstring) 180: (let (htmlfile extension) 181: (setq extension (pathname-type pathname)) 182: (if (string= extension "odr") 183: (progn 184: (if (string= pathname 185: (file-namestring pathname)) 186: ; pathname にはディレクトリ部分がない 187: (setq pathname 188: (merge-pathnames 189: pathname (directory-namestring "."))) 190: ) 191: (setq pathname (map-slash-to-backslash pathname)) 192: (setq htmlfile 193: (merge-pathnames 194: (concat (pathname-name pathname) ".html") 195: (directory-namestring pathname) 196: ) 197: ) 198: (if (file-newer-than-file-p pathname htmlfile) 199: (call-process 200: (concat "o2hs.bat " "¥"" pathname "¥"") 201: :show :minimize 202: ) 203: (Start htmlfile) 204: ) 205: ) 206: (Start pathname) 207: ) 208: ) 209: ) 210: 211: ; (my-replace-once "^¥*[¥*]+[ ]" "¥* ") 212: ; 213: ;
214: (defun Next (tag) 215: (interactive) 216: (call-interactively 'goto-following-midashi-line) 217: )
218: (defun Prev (tag) 219: (interactive) 220: (call-interactively 'goto-previous-midashi-line) 221: )
222: (defun tabtocolon () 223: "タブをコロンに変換する" 224: (interactive) 225: (let (from to) 226: (if (not (get-selection-type)) 227: (if (mark t) 228: (exchange-region-and-selection) 229: (progn 230: (message-box 231: "マークがないのでセレクションに変換できません。") 232: (return-from tabtocolon)))) 233: (setq from (selection-mark)) 234: (setq to (selection-point)) 235: (if (> from to) 236: (rotatef from to)) 237: (save-excursion 238: (save-restriction 239: (narrow-to-region from to) 240: (goto-char (point-min)) 241: (perform-replace "¥t" " : " nil t t t) 242: ); end of save-restriction 243: ); end of save-excursion 244: (exchange-region-and-selection) 245: ); end of let 246: )
aaaaaaaaaa bbbbbbbbbbbbb cccccc
247: (defun enclmark () 248: "insert enclosing markstrings" 249: (interactive) 250: (let (prefix-string pos clmn prefix) 251: (auto-fill-mode nil) 252: (setq pos (point)) 253: (setq clmn (current-column)) 254: (setq prefix 255: (read-string (concat "Enter a mark string (ex. " 256: "-- や ,,, や . など) : "))) 257: (beginning-of-line) 258: (setq prefix-string (buffer-substring (point) pos)) 259: (goto-char pos) 260: (beginning-of-line) 261: (insert "¥n") 262: (forward-line -1) 263: (insert (concat prefix-string prefix "~")) 264: (if (not (string= (substring prefix 0 1) ".")) 265: (progn 266: (insert " ") 267: (char-line (substring prefix 0 1)))) 268: (insert "¥n") 269: (beginning-of-line) 270: (insert (concat prefix-string prefix ".")) 271: (if (not (string= (substring prefix 0 1) ".")) 272: (progn 273: (insert " ") 274: (char-line (substring prefix 0 1)))) 275: (insert "¥n") 276: (previous-line 1) 277: (kill-line 1) 278: (delete-char 1) 279: ; (forward-char clmn) 280: (auto-fill-mode t) 281: (message "") 282: (message "終わりの行の次の行の行頭で C-y で閉じる行を挿入できます。") 283: ))
284: (defun user::enclcomma () 285: "insert enclosing markstrings" 286: (interactive) 287: (let (prefix-string pos clmn prefix) 288: (auto-fill-mode nil) 289: (setq pos (point)) 290: (setq clmn (current-column)) 291: (setq prefix ",,,") 292: (beginning-of-line) 293: (setq prefix-string (buffer-substring (point) pos)) 294: (goto-char pos) 295: (beginning-of-line) 296: (insert "¥n") 297: (forward-line -1) 298: (insert (concat prefix-string prefix "~")) 299: (if (not (string= (substring prefix 0 1) ".")) 300: (progn 301: (insert " ") 302: (char-line (substring prefix 0 1)))) 303: (insert "¥n") 304: (beginning-of-line) 305: (insert (concat prefix-string prefix ".")) 306: (if (not (string= (substring prefix 0 1) ".")) 307: (progn 308: (insert " ") 309: (char-line (substring prefix 0 1)))) 310: (insert "¥n") 311: (previous-line 1) 312: (kill-line 1) 313: (delete-char 1) 314: ; (forward-char clmn) 315: (auto-fill-mode t) 316: (message "") 317: (message "終わりの行の次の行の行頭で C-y で閉じる行を挿入できます。") 318: ))
319: (defun user::enclcode (column) 320: (interactive 321: "n,,,~ の挿入位置(左端は1、0なら最初の非空白文字の位置) : ") 322: (let (startposition endposition startline 323: lastline cnum) 324: (setq startposition (region-beginning)) 325: (setq endposition (region-end)) 326: (goto-char startposition) 327: (if (= column 0) 328: (progn 329: (back-to-indentation) 330: (setq column (+ (current-column) 1)) 331: )) 332: (setq column (- column 1)) 333: (progn 334: (save-restriction 335: (narrow-to-region startposition endposition) 336: (goto-char (point-min)) 337: (insert "¥n") 338: (goto-char (point-min)) 339: (beginning-of-line) 340: (setq cnum (current-column)) 341: (while (< cnum column) 342: (insert " ") 343: (setq cnum (current-column))) 344: (insert "@begin{code} ") 345: (line) 346: (goto-char (point-max)) 347: (beginning-of-line) 348: (setq cnum (current-column)) 349: (while (< cnum column) 350: (insert " ") 351: (setq cnum (current-column))) 352: (insert "@end{code} ") 353: (line) 354: (insert "¥n") 355: ) 356: ) 357: ) 358: )
359: (defun checkcommas () 360: (interactive) 361: (while (re-search-forward "^[ ]*¥¥(,¥¥{1,3¥¥}?$¥¥|,¥¥{1,3¥¥}?[ ],¥¥)" t) 362: (progn 363: (goto-char (match-beginning 0)) 364: (refresh-screen) 365: (case 366: (message-box 367: (concat "3個以下の , の並びの後に、~ か . を付加しますか。¥n¥n" 368: "yes --> ~ を付加。¥n" 369: "no --> . を付加。¥n" 370: "cancel --> スキップ") 371: nil 372: '(:yes-no-cancel :question :button1)) 373: (:yes 374: (if (looking-at "^[ ]*,¥¥{1,3¥¥}?$") 375: (progn 376: (end-of-line) 377: (insert "~ ") 378: (cline)) 379: (progn 380: (re-search-forward "[ ]*,¥¥{1,3¥¥}? ") 381: (goto-char (match-end 0)) 382: (backward-char 1) 383: (insert "~") 384: (end-of-line) 385: (delete-backward-char 1)) 386: )) 387: (:no 388: (if (looking-at "^[ ]*,¥¥{1,3¥¥}?$") 389: (progn 390: (end-of-line) 391: (insert ". ") 392: (cline)) 393: (progn 394: (re-search-forward "[ ]*,¥¥{1,3¥¥}? ") 395: (goto-char (match-end 0)) 396: (backward-char 1) 397: (insert ".") 398: (end-of-line) 399: (delete-backward-char 1)) 400: )) 401: (:cancel 402: (progn 403: (forward-line 1))) 404: (t nil) 405: ) 406: (refresh-screen) 407: (call-process (concat (si:system-root) "xyzzycli.exe")) 408: )) 409: (message-box "この後には、3個以下の , の並びは見つかりませんでした。") 410: (call-process (concat (si:system-root) "xyzzycli.exe")) 411: )
412: (defun checkdashes () 413: (interactive) 414: (while (re-search-forward "^[ ]*¥¥(-¥¥{1,3¥¥}?$¥¥|-¥¥{1,3¥¥}?[ ]-¥¥)" t) 415: (progn 416: (goto-char (match-beginning 0)) 417: (refresh-screen) 418: (case 419: (message-box 420: (concat "3個以下の - の並びの後に、~ か . を付加しますか。¥n¥n" 421: "yes --> ~ を付加。¥n" 422: "no --> . を付加。¥n" 423: "cancel --> スキップ") 424: nil 425: '(:yes-no-cancel :question :button1)) 426: (:yes 427: (if (looking-at "^[ ]*-¥¥{1,3¥¥}?$") 428: (progn 429: (end-of-line) 430: (insert "~ ") 431: (line)) 432: (progn 433: (re-search-forward "[ ]*-¥¥{1,3¥¥}? ") 434: (goto-char (match-end 0)) 435: (backward-char 1) 436: (insert "~") 437: (end-of-line) 438: (delete-backward-char 1)) 439: )) 440: (:no 441: (if (looking-at "^[ ]*-¥¥{1,3¥¥}?$") 442: (progn 443: (end-of-line) 444: (insert ". ") 445: (line)) 446: (progn 447: (re-search-forward "[ ]*-¥¥{1,3¥¥}? ") 448: (goto-char (match-end 0)) 449: (backward-char 1) 450: (insert ".") 451: (end-of-line) 452: (delete-backward-char 1)) 453: )) 454: (:cancel 455: (progn 456: (forward-line 1))) 457: (t nil) 458: ) 459: (refresh-screen) 460: (call-process (concat (si:system-root) "xyzzycli.exe")) 461: )) 462: (message-box "この後には、3個以下の - の並びは見つかりませんでした。") 463: (call-process (concat (si:system-root) "xyzzycli.exe")) 464: )
465: (defun checkdot () 466: (interactive) 467: (while (re-search-forward "^[ ]*¥¥.$" t) 468: (progn 469: (goto-char (match-beginning 0)) 470: (refresh-screen) 471: (case 472: (message-box 473: (concat ". (ピリオド) の後に、~ か . を付加しますか。¥n¥n" 474: "yes --> ~ を付加。¥n" 475: "no --> . を付加。¥n" 476: "cancel --> スキップ") 477: nil 478: '(:yes-no-cancel :question :button1)) 479: (:yes 480: (progn 481: (end-of-line) 482: (insert "~"))) 483: (:no 484: (progn 485: (end-of-line) 486: (insert "."))) 487: (:cancel 488: (progn 489: (forward-line 1))) 490: (t nil) 491: ) 492: (refresh-screen) 493: (call-process (concat (si:system-root) "xyzzycli.exe")) 494: )) 495: (message-box "この後には、. (ピリオド) だけがある行は見つかりませんでした。") 496: (call-process (concat (si:system-root) "xyzzycli.exe")) 497: )