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

[xyzzy:00476] Re: info



亀井さん、みなさん、こんにちは。

info.l の 次のコマンドのところ、
元の姿をあまり変えずに移植できましたので
報告します。

info.el の completion(s?)-read を xuzzy の read-string
に替えたらよくなりました。

カーソルが * の上にありうときにはその menu item が
default として出てきますので、return のみで、info
ファイルがでてきます。

interactive のかっこのなかに、下にあるような長いのがあって
もかまわないんですね。よくわかりませんけど。

--------
須田誠也
EZU11330@xxxxxxxxxxx


---ここから--------------------------  
(defun Info-menu (menu-item)
  (interactive
   (let ((completions '())
  (default)
  (last)
  (p (point)))
     (save-excursion
       (goto-char (point-min))
       (if (not (scan-buffer "\n* Menu:"))
    (error "No menu in this node"))
       (while (scan-buffer "\n\\* \\([^:\t\n]*\\):" :regexp t :tail t)
  (if (and (null default)
    (prog1 (when last (< last p))
      (setq last (match-beginning 0)))
    (<= p last))
      (setq default (car (car completions))))
  (setq completions (cons (cons (buffer-substring
      (match-beginning 1)
      (match-end 1))
           (match-beginning 1)) completions)))
       (if (and (null default) last
  (< last p)
  (<= p (progn (end-of-line) (point))))
    (setq default (car (car completions)))))
     (let (item)
       (while (null item)
  (setq item
        (if default
     (read-string
      (format nil "Menu item (default ~A): " default))
   (read-string (format nil "Menu item: "))))
  ;; we rely on the bug (which RMS won't change for his own reasons)
  ;; that ;; completing-read accepts an input of "" even when the
  ;; require-match argument is true and "" is not a valid possibility
  (if (string= item "")
      (if default
   (setq item default)
          ;; ask again
          (setq item nil))))
       (list item))))
  (Info-goto-node (Info-extract-menu-item menu-item)))
---------ここまで

Index Home