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

[xyzzy:00480] Re: info



須田 さん、こんにちは。

    Sun, 27 Sep 1998 20:03:34 +0900 の
   “[xyzzy:00478] Re: info”
    への返事です.


| info の改訂版です。今度は最初から menu item の
| 最初にカーソルが来て、そこでリータンすると、すぐに
| そのファイルが開きます。Info-find-node の最後のと

そこまでやる必要はないんじゃないかなぁ?

それとは全然関係ありませんが、これで p が動くようになります。

(defun Info-extract-pointer (name &optional errorname)
  (save-excursion
    (goto-char (point-min))
    (forward-line 1)
    (unless (scan-buffer (concat name ":") :reverse t :case-fold t :regexp t)
      (error (concat "Node has no " (string-capitalize (or errorname name)))))
    (goto-char (match-end 0))
    (Info-following-node-name)))

m で補完できるようにしました。ただし、0.0.0.63.5 が必要です(^^;

(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 completions)))
	    (push (buffer-substring (match-beginning 1)
				    (match-end 1))
		  completions))
	  (if (and (null default) last
		   (< last p)
		   (<= p (progn (end-of-line) (point))))
	      (setq default (car completions))))
	(let (item)
	  (while (null item)
	    (setq item (completing-read "Menu item: " completions
					:default default
					:must-match completions))
	    ;; 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)))

--
亀井哲弥(Tetsuya Kamei)
kamei@xxxxxxxxxxxx/JCA00343@xxxxxxxxxxx

Index Home