[Date Prev] [Date Index] [Date Next]
[Thread Prev] [Thread Index] [Thread Next]

[xyzzy:00157] 教えてください



亀井さん、こんにちは。

次のようなのをでっち上げましたが、window を分割している
ときに、うまくいきません。勝手なお願いで申し訳ありません
が、どうすれば分割時にもうまくいくのか、お教え願えません
でしょうか。
---------------------------------------------
;;; -*- Mode: Lisp; Package: EDITOR -*-
;;;
;;; This file is part of xyzzy.
;;;

(provide "outline")
(in-package "editor")
(export '(*oldbuffer* outline outline-jump outline-search))
(defvar *oldbuffer* "")

(defun outline ()
  (interactive)
  (setq *oldbuffer* (buffer-name (selected-buffer)))
  (split-window-vertically -90)
  (long-operation
    (with-output-to-temp-buffer ("*outline*") 
      (let ((sbuffer (buffer-stream-buffer *standard-output*)))
          (set-buffer-fold-width nil sbuffer)
          (save-excursion
             (message "Scanning (~A)" *oldbuffer*)
              (set-buffer *oldbuffer*)
                (save-excursion
                    (goto-char (point-min))
                          (while (scan-buffer "^[■◆◇●○□・]"
                           :case-fold *case-fold-search*
                           :left-bound *word-search*
                           :right-bound *word-search*
                           :regexp t)
       (format t "~A~%"
          (buffer-substring (progn
          (goto-bol)
            (point))
     (progn
       (goto-eol)
       (point))))
       (or (forward-char 1)
    (return)))))))
    (message "completed.")
    t))

(defun outline-jump ()
  (interactive)
  (let ((string (save-excursion
    (buffer-substring
     (progn
       (goto-bol)
       (point))
     (progn
       (goto-eol)
       (point))))))
    (other-window)
    (goto-char (point-min))
    (outline-search string)))

(defun outline-search (pattern &optional noerror)
  (interactive "*p")
  (search-command pattern nil nil (interactive-p) noerror))

(global-set-key #\F12 'outline-jump)
(global-set-key #\C-F12 'outline)

--------
須田誠也
EZU11330@xxxxxxxxxxxxxxxx

Index Home