Modify ri.el and define an access key `Q' that does kill-buffer &

delete-window at once for convenience.  The patch is already submitted
to the author.
This commit is contained in:
Akinori MUSHA 2001-04-06 18:09:38 +00:00
parent 9abb9f6b42
commit 6336356c43
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=40958
2 changed files with 37 additions and 18 deletions

View File

@ -7,6 +7,7 @@
PORTNAME= ri
PORTVERSION= 0.7a
PORTREVISION= 1
CATEGORIES= lang ruby
MASTER_SITES= ftp://www.pragmaticprogrammer.com/ruby/downloads/files/
PKGNAMEPREFIX= ${RUBY_PKGNAMEPREFIX}
@ -27,7 +28,7 @@ EMACSLISPDIR= ${PREFIX}/share/emacs/site-lisp
XEMACSLISPDIR= ${PREFIX}/lib/xemacs/site-lisp
post-patch:
${RUBY} -i -pe 'gsub /!!PREFIX!!/, "${PREFIX}"' \
${RUBY} -i -pe 'gsub %r|/usr/local|, "${PREFIX}"' \
${WRKSRC}/contrib/dblack/emacs/ri.el
do-install:

View File

@ -1,33 +1,51 @@
--- contrib/dblack/emacs/ri.el.orig Fri Mar 16 12:25:28 2001
+++ contrib/dblack/emacs/ri.el Thu Apr 5 23:01:04 2001
@@ -63,11 +63,11 @@
;; (autoload 'ri-show-term-composite-at-point "ri.el" "ri utility" t)
;;
;;;; Set this command to whatever you use to run ri:
-;; (setq ri-ri-command "/usr/local/bin/ri")
+(setq ri-ri-command "!!PREFIX!!/bin/ri")
;;
;;;; If you put Emacs.rb somewhere other than the main ri/op
;;;; directory, then change "Emacs" to "/full/path/to/Emacs.rb":
-;; (setq ri-emacsrb "Emacs")
+(setq ri-emacsrb "Emacs")
;;
;;;; These two global key bindings enable the instant ri lookup of a
;;;; term at point.
@@ -82,7 +82,7 @@
+++ contrib/dblack/emacs/ri.el Sat Apr 7 02:55:55 2001
@@ -82,7 +82,10 @@
;;; <ENTER> for convenience)
;;;
;;; (setq ri-key-quit "q")
-;;; bound to function ri-quit, which is probably quit-window)
+;;; bound to function ri-quit, which is probably delete-window)
+;;;
+;;; (setq ri-key-kill "Q")
+;;; bound to function ri-kill, which is probably kill-buffer & delete-window)
;;;
;;; (setq ri-key-fnt "\C-i")
;;; find-next-term (TAB)
@@ -365,7 +365,7 @@
@@ -233,9 +236,14 @@
(defvar ri-switch-to-ri-buffer t)
(defvar ri-read-only t)
+;; Locations
+(defvar ri-ri-command "/usr/local/bin/ri")
+(defvar ri-emacsrb "Emacs")
+
;; Key bindings
(defvar ri-key-stcap "\C-m")
(defvar ri-key-quit "q")
+(defvar ri-key-kill "Q")
(defvar ri-key-fnt "\C-i")
(defvar ri-key-fpt "\M-\C-i")
@@ -276,6 +284,7 @@
(and ri-read-only
(setq buffer-read-only t))
(local-set-key ri-key-quit 'ri-quit)
+ (local-set-key ri-key-kill 'ri-kill)
(local-set-key ri-key-stcap 'ri-show-term-composite-at-point)
(local-set-key ri-key-fnt 'ri-find-next-term)
(local-set-key ri-key-fpt 'ri-find-previous-term))
@@ -365,7 +374,13 @@
(defun ri-quit()
"Function bound to 'q' key in ri output buffer(s)"
(interactive)
- (quit-window))
+ (delete-window))
+
+(defun ri-kill()
+ "Function bound to 'Q' key in ri output buffer(s)"
+ (interactive)
+ (kill-buffer nil)
+ (delete-window))
;;; Functions to find and show terms at or beyond point