|
From: Darryl O. <da...@us...> - 2002-04-05 01:26:04
|
Update of /cvsroot/cscope/cscope/contrib/xcscope
In directory usw-pr-cvs1:/tmp/cvs-serv19924
Modified Files:
xcscope.el
Log Message:
Intermediate checkin.
Merge cscope patch #482960.
Fix some minor nits (but others still remain).
Index: xcscope.el
===================================================================
RCS file: /cvsroot/cscope/cscope/contrib/xcscope/xcscope.el,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** xcscope.el 2 Nov 2001 00:42:55 -0000 1.12
--- xcscope.el 5 Apr 2002 01:26:00 -0000 1.13
***************
*** 7,16 ****
; Author: Darryl Okahata
; Created: Wed Apr 19 17:03:38 2000
! ; Modified: Thu Nov 1 16:34:54 2001 (Darryl Okahata) da...@so...
; Language: Emacs-Lisp
; Package: N/A
; Status: Experimental
;
! ; (C) Copyright 2000, 2001, Darryl Okahata <da...@so...>,
; all rights reserved.
; GNU Emacs enhancements (C) Copyright 2001,
--- 7,16 ----
; Author: Darryl Okahata
; Created: Wed Apr 19 17:03:38 2000
! ; Modified: Thu Apr 4 17:22:22 2002 (Darryl Okahata) da...@so...
; Language: Emacs-Lisp
; Package: N/A
; Status: Experimental
;
! ; (C) Copyright 2000, 2001, 2002, Darryl Okahata <da...@so...>,
; all rights reserved.
; GNU Emacs enhancements (C) Copyright 2001,
***************
*** 20,24 ****
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
! ;; ALPHA VERSION 0.95
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
--- 20,24 ----
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
! ;; ALPHA VERSION 0.96
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
***************
*** 114,117 ****
--- 114,119 ----
;; (define-key global-map [(control f11)] 'cscope-prev-symbol)
;; (define-key global-map [(control f12)] 'cscope-prev-file)
+ ;; (define-key global-map [(meta f9)] 'cscope-display-buffer)
+ ;; (defin-ekey global-map [(meta f10)] 'cscope-display-buffer-toggle)
;;
;; 6. Restart (X)Emacs. That's it.
***************
*** 220,223 ****
--- 222,227 ----
;; These pertain to navigation through the search results:
;;
+ ;; C-c s b Display *cscope* buffer.
+ ;; C-c s B Auto display *cscope* buffer toggle.
;; C-c s n Next symbol.
;; C-c s N Next file.
***************
*** 1070,1073 ****
--- 1074,1083 ----
+ (defvar cscope-adjust t
+ "True if the symbol searched for (cscope-symbol) should be on
+ the line specified by the cscope database. In such cases the point will be
+ adjusted if need be (fuzzy matching).")
+
+
(defvar cscope-adjust-range 1000
"How far the point should be adjusted if the symbol is not on the line
***************
*** 1117,1120 ****
--- 1127,1132 ----
(define-key cscope:map "\C-csi" 'cscope-find-files-including-file)
;; --- (The '---' indicates that this line corresponds to a menu separator.)
+ (define-key cscope:map "\C-csb" 'cscope-display-buffer)
+ (define-key cscope:map "\C-csB" 'cscope-display-buffer-toggle)
(define-key cscope:map "\C-csn" 'cscope-next-symbol)
(define-key cscope:map "\C-csN" 'cscope-next-file)
***************
*** 1152,1199 ****
cscope-find-files-including-file t ]
"-----------"
! [ "Next symbol" cscope-next-symbol t ]
! [ "Next file" cscope-next-file t ]
! [ "Previous symbol" cscope-prev-symbol t ]
! [ "Previous file" cscope-prev-file t ]
! [ "Pop mark" cscope-pop-mark t ]
! "-----------"
! [ "Set initial directory" cscope-set-initial-directory t ]
! [ "Unset initial directory"
! cscope-unset-initial-directory t ]
"-----------"
! [ "Create list of files to index"
! cscope-create-list-of-files-to-index t ]
! [ "Create list and index"
! cscope-index-files t ]
! [ "Edit list of files to index"
! cscope-edit-list-of-files-to-index t ]
! [ "Locate this buffer's cscope directory"
! cscope-tell-user-about-directory t ]
! [ "Dired this buffer's cscope directory"
! cscope-dired-directory t ]
"-----------"
! [ "Auto edit single match" (setq cscope-edit-single-match
! (not cscope-edit-single-match))
! :style toggle :selected cscope-edit-single-match ]
! [ "Auto display *cscope* buffer"
! (setq cscope-display-cscope-buffer
! (not cscope-display-cscope-buffer))
! :style toggle :selected cscope-display-cscope-buffer ]
! [ "Stop at first matching database"
! (setq cscope-stop-at-first-match-dir
! (not cscope-stop-at-first-match-dir))
! :style toggle :selected cscope-stop-at-first-match-dir ]
! [ "Index recursively" (setq cscope-index-recursively
! (not cscope-index-recursively))
! :style toggle :selected cscope-index-recursively ]
! [ "Suppress empty matches" (setq cscope-suppress-empty-matches
! (not cscope-suppress-empty-matches))
! :style toggle :selected cscope-suppress-empty-matches ]
! [ "Use relative paths" (setq cscope-use-relative-paths
! (not cscope-use-relative-paths))
! :style toggle :selected cscope-use-relative-paths ]
! [ "No mouse prompts" (setq cscope-no-mouse-prompts
! (not cscope-no-mouse-prompts))
! :style toggle :selected cscope-no-mouse-prompts ]
))
--- 1164,1228 ----
cscope-find-files-including-file t ]
"-----------"
! [ "Display *cscope* buffer" cscope-display-buffer t ]
! [ "Auto display *cscope* buffer toggle"
! cscope-display-buffer-toggle t ]
! [ "Next symbol" cscope-next-symbol t ]
! [ "Next file" cscope-next-file t ]
! [ "Previous symbol" cscope-prev-symbol t ]
! [ "Previous file" cscope-prev-file t ]
! [ "Pop mark" cscope-pop-mark t ]
"-----------"
! ( "More ..."
! [ "Set initial directory"
! cscope-set-initial-directory t ]
! [ "Unset initial directory"
! cscope-unset-initial-directory t ]
! "-----------"
! [ "Create list of files to index"
! cscope-create-list-of-files-to-index t ]
! [ "Create list and index"
! cscope-index-files t ]
! [ "Edit list of files to index"
! cscope-edit-list-of-files-to-index t ]
! [ "Locate this buffer's cscope directory"
! cscope-tell-user-about-directory t ]
! [ "Dired this buffer's cscope directory"
! cscope-dired-directory t ]
! )
"-----------"
! ( "Options"
! [ "Auto edit single match"
! (setq cscope-edit-single-match
! (not cscope-edit-single-match))
! :style toggle :selected cscope-edit-single-match ]
! [ "Auto display *cscope* buffer"
! (setq cscope-display-cscope-buffer
! (not cscope-display-cscope-buffer))
! :style toggle :selected cscope-display-cscope-buffer ]
! [ "Stop at first matching database"
! (setq cscope-stop-at-first-match-dir
! (not cscope-stop-at-first-match-dir))
! :style toggle
! :selected cscope-stop-at-first-match-dir ]
! [ "Never update cscope database"
! (setq cscope-do-not-update-database
! (not cscope-do-not-update-database))
! :style toggle :selected cscope-do-not-update-database ]
! [ "Index recursively"
! (setq cscope-index-recursively
! (not cscope-index-recursively))
! :style toggle :selected cscope-index-recursively ]
! [ "Suppress empty matches"
! (setq cscope-suppress-empty-matches
! (not cscope-suppress-empty-matches))
! :style toggle :selected cscope-suppress-empty-matches ]
! [ "Use relative paths"
! (setq cscope-use-relative-paths
! (not cscope-use-relative-paths))
! :style toggle :selected cscope-use-relative-paths ]
! [ "No mouse prompts" (setq cscope-no-mouse-prompts
! (not cscope-no-mouse-prompts))
! :style toggle :selected cscope-no-mouse-prompts ]
! )
))
***************
*** 1278,1282 ****
(goto-line line-number)
(setq old-point (point))
! (if cscope-adjust-range
(progn
;; Calculate the length of the line specified by cscope.
--- 1307,1311 ----
(goto-line line-number)
(setq old-point (point))
! (if (and cscope-adjust cscope-adjust-range)
(progn
;; Calculate the length of the line specified by cscope.
***************
*** 1447,1450 ****
--- 1476,1497 ----
+ (defun cscope-display-buffer ()
+ "Display the *cscope* buffer."
+ (interactive)
+ (let ((buffer (get-buffer cscope-output-buffer-name)))
+ (if buffer
+ (pop-to-buffer buffer)
+ (error "The *cscope* buffer does not exist yet"))))
+
+
+ (defun cscope-display-buffer-toggle ()
+ "Toggle cscope-display-cscope-buffer, which corresponds to
+ \"Auto display *cscope* buffer\"."
+ (interactive)
+ (setq cscope-display-cscope-buffer (not cscope-display-cscope-buffer))
+ (message "The cscope-display-cscope-buffer variable is now %s."
+ (if cscope-display-cscope-buffer "set" "unset")))
+
+
(defun cscope-next-symbol ()
"Move to the next symbol in the *cscope* buffer."
***************
*** 1780,1785 ****
(let (buffer-read-only continue)
(goto-char (point-max))
- (if (not cscope-first-match)
- (message "No matches were found."))
(if (and cscope-suppress-empty-matches
(= cscope-output-start (point)))
--- 1827,1830 ----
***************
*** 1817,1820 ****
--- 1862,1867 ----
(if cscope-start-directory
(setq default-directory cscope-start-directory))
+ (if (not cscope-first-match)
+ (message "No matches were found."))
)
))
***************
*** 1841,1845 ****
)
)
! (if (and done (eq old-buffer buffer))
(cscope-help))
(set-buffer old-buffer)
--- 1888,1892 ----
)
)
! (if (and done (eq old-buffer buffer) cscope-first-match)
(cscope-help))
(set-buffer old-buffer)
***************
*** 2254,2258 ****
(cscope-prompt-for-symbol "Find this symbol: " nil)
))
! (let ()
(setq cscope-symbol symbol)
(cscope-call (format "Finding symbol: %s" symbol)
--- 2301,2305 ----
(cscope-prompt-for-symbol "Find this symbol: " nil)
))
! (let ( (cscope-adjust t) ) ;; Use fuzzy matching.
(setq cscope-symbol symbol)
(cscope-call (format "Finding symbol: %s" symbol)
***************
*** 2267,2271 ****
(cscope-prompt-for-symbol "Find this global definition: " nil)
))
! (let ()
(setq cscope-symbol symbol)
(cscope-call (format "Finding global definition: %s" symbol)
--- 2314,2318 ----
(cscope-prompt-for-symbol "Find this global definition: " nil)
))
! (let ( (cscope-adjust t) ) ;; Use fuzzy matching.
(setq cscope-symbol symbol)
(cscope-call (format "Finding global definition: %s" symbol)
***************
*** 2278,2282 ****
"Find a symbol's global definition without prompting."
(interactive)
! (let ( (symbol (cscope-extract-symbol-at-cursor nil)) )
(setq cscope-symbol symbol)
(cscope-call (format "Finding global definition: %s" symbol)
--- 2325,2330 ----
"Find a symbol's global definition without prompting."
(interactive)
! (let ( (symbol (cscope-extract-symbol-at-cursor nil))
! (cscope-adjust t) ) ;; Use fuzzy matching.
(setq cscope-symbol symbol)
(cscope-call (format "Finding global definition: %s" symbol)
***************
*** 2292,2296 ****
"Find functions called by this function: " nil)
))
! (let ()
(setq cscope-symbol symbol)
(cscope-call (format "Finding functions called by: %s" symbol)
--- 2340,2344 ----
"Find functions called by this function: " nil)
))
! (let ( (cscope-adjust nil) ) ;; Suppress fuzzy matching.
(setq cscope-symbol symbol)
(cscope-call (format "Finding functions called by: %s" symbol)
***************
*** 2306,2310 ****
"Find functions calling this function: " nil)
))
! (let ()
(setq cscope-symbol symbol)
(cscope-call (format "Finding functions calling: %s" symbol)
--- 2354,2358 ----
"Find functions calling this function: " nil)
))
! (let ( (cscope-adjust t) ) ;; Use fuzzy matching.
(setq cscope-symbol symbol)
(cscope-call (format "Finding functions calling: %s" symbol)
***************
*** 2319,2323 ****
(cscope-prompt-for-symbol "Find this text string: " nil)
))
! (let ()
(setq cscope-symbol symbol)
(cscope-call (format "Finding text string: %s" symbol)
--- 2367,2371 ----
(cscope-prompt-for-symbol "Find this text string: " nil)
))
! (let ( (cscope-adjust t) ) ;; Use fuzzy matching.
(setq cscope-symbol symbol)
(cscope-call (format "Finding text string: %s" symbol)
***************
*** 2333,2337 ****
(cscope-prompt-for-symbol "Find this egrep pattern: " nil))
))
! (let ()
(setq cscope-symbol symbol)
(cscope-call (format "Finding egrep pattern: %s" symbol)
--- 2381,2385 ----
(cscope-prompt-for-symbol "Find this egrep pattern: " nil))
))
! (let ( (cscope-adjust t) ) ;; Use fuzzy matching.
(setq cscope-symbol symbol)
(cscope-call (format "Finding egrep pattern: %s" symbol)
***************
*** 2347,2351 ****
(cscope-prompt-for-symbol "Find this file: " t))
))
! (let ()
(setq cscope-symbol symbol)
(cscope-call (format "Finding file: %s" symbol)
--- 2395,2399 ----
(cscope-prompt-for-symbol "Find this file: " t))
))
! (let ( (cscope-adjust nil) ) ;; Disable fuzzy matching.
(setq cscope-symbol symbol)
(cscope-call (format "Finding file: %s" symbol)
***************
*** 2362,2366 ****
"Find files #including this file: " t))
))
! (let ()
(setq cscope-symbol symbol)
(cscope-call (format "Finding files #including file: %s" symbol)
--- 2410,2415 ----
"Find files #including this file: " t))
))
! (let ( (cscope-adjust nil) ) ;; Disable fuzzy matching.
! ;; Is this needed?
(setq cscope-symbol symbol)
(cscope-call (format "Finding files #including file: %s" symbol)
|