001: (require 'occur)
002:
003: (setq *occur-regexp* "^¥¥(¥¥*[¥¥*]* ¥¥|; ¥¥* ¥¥)")
004: (setq *my-occur-regexp* "^¥¥(¥¥*[¥¥*]* ¥¥|; ¥¥* ¥¥|(defun ¥¥)")
005: (setq *my-occur-string* nil)
006:
007: (global-set-key '(#¥C-5 #¥5); 見出し行のリストをポップアップ
008: 'list-headlines)
009:
010: (global-set-key '(#¥C-5 #¥l); 見出し行のリストをポップアップ
011: 'list-headlines)
012:
013: (global-set-key '(#¥C-5 #¥6); 検索語を含む見出行をpopアップ
014: 'search-word-in-headlines)
015:
016: (global-set-key '(#¥C-5 #¥7); occur 検索語を含む行をpopアップ
017: 'search-string-in-lines)
018: ; 見出し行にかぎらず、検索します。
019:
020: (global-set-key '(#¥C-5 #¥8); 前回実行した occur 操作の繰り返し
021: 'repeat-last-occur-work)
022:
023: ; ひとつ下のレベルの見出し行のリストをポップアップ
024: (global-set-key '(#¥C-5 #¥d); 一つ下位レベルの見出し行をpopup
025: 'user::occur-directlyunder-heading)
026:
027: ; 星一つの見出し行だけ
028: (global-set-key '(#¥C-5 #¥o); 星一つの見出し行をpopup
029: 'user::onestar)
030:
031: ; 星一つまたは星二つの見出し行だけ
032: ; (File "sitelisp.lnk" "occur.l")
033: (global-set-key '(#¥C-5 #¥t); 星2つまでの見出し行をpopup
034: 'user::twostar)
035:
036: ; * occur-suball-heading
037: ; その見出し行より下位のレベルの見出し行のリストをポップアップw
038: ; (File "sitelisp.lnk" "occur.l")
039: ;
040: (global-set-key '(#¥C-5 #¥a); 下位レベルの見出し行を popup
041: 'user::occur-suball-heading)
042:
043: ; * occur-samelevel-heading
044: ; その見出し行と同じレベルの見出し行のリストをポップアップ
045: ; (File "sitelisp.lnk" "occur.l")
046: (global-set-key '(#¥C-5 #¥s); 同位の見出し行をpopup
047: 'user::occur-samelevel-heading)
048:
049: ; * previous-samelevel-heading-line
050: ; * following-samelevel-heading-line
051: (global-set-key '(#¥C-5 #¥p) 'previous-samelevel-heading-line)
052: (global-set-key '(#¥C-5 #¥f) 'following-samelevel-heading-line)
053: (global-set-key '(#¥C-5 #¥n) 'following-samelevel-heading-line)
054:
055: (global-set-key '(#¥C-5 #¥4 #¥5); 見出し行をポップアップ
056: #'(lambda () (interactive)
057: (message "見出し行をポップアップします。")
058: (setq *lastpos* (point))
059: (setq *my-occur-regexp* *occur-regexp*)
060: (setq *my-occur-string* nil)
061: (my-occur-dialog-box *my-occur-regexp*)))
062:
063: (global-set-key '(#¥C-5 #¥4 #¥6); 検索語を含む見出行をpopアップ
064: #'(lambda (str)
065: (interactive "sSearch string in headings: ")
066: (message "検索語を含む見出行をポップアップします。")
067: (setq *lastpos* (point))
068: (setq *my-occur-regexp* *occur-regexp*)
069: (setq *my-occur-string* str)
070: (my-occur-dialog-box (concat *my-occur-regexp* ".*" str))))
071:
072: (global-set-key '(#¥C-5 #¥4 #¥7); 検索語を含む行をpopアップ
073: #'(lambda (str)
074: (interactive "sSearch string: ")
075: (message "検索語を含む行をポップアップします。")
076: (setq *lastpos* (point))
077: (setq *my-occur-regexp* nil)
078: (setq *my-occur-string* str)
079: (my-occur-dialog-box str)))
080:
081: (global-set-key '(#¥C-5 #¥4 #¥8); ひとつ前の occur 操作の繰り返し
082: #'(lambda () (interactive)
083: (setq *lastpos* (point))
084: (cond ((and *my-occur-regexp* *my-occur-string*)
085: (my-occur-dialog-box (concat *my-occur-regexp* ".*" *my-occur-string*)))
086: ((not *my-occur-regexp*)
087: (my-occur-dialog-box *my-occur-string*))
088: ((not *my-occur-string*)
089: (my-occur-dialog-box *my-occur-regexp*)))
090: ))