From: Darryl O. <da...@us...> - 2001-06-28 22:15:04
|
Update of /cvsroot/cscope/cscope/contrib/xcscope In directory usw-pr-cvs1:/tmp/cvs-serv29033/contrib/xcscope Modified Files: xcscope.el Log Message: Updated AUTHORS and ChangeLog. Also updated documentation in xcscope.el, and added the ability to use cscope databases that can have different names (they no longer must all have the same name). Index: xcscope.el =================================================================== RCS file: /cvsroot/cscope/cscope/contrib/xcscope/xcscope.el,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** xcscope.el 2001/06/28 04:45:05 1.8 --- xcscope.el 2001/06/28 22:15:00 1.9 *************** *** 7,11 **** ; Author: Darryl Okahata ; Created: Wed Apr 19 17:03:38 2000 ! ; Modified: Wed Jun 27 20:59:17 2001 ; Language: Emacs-Lisp ; Package: N/A --- 7,11 ---- ; Author: Darryl Okahata ; Created: Wed Apr 19 17:03:38 2000 ! ; Modified: Thu Jun 28 15:10:40 2001 (Darryl Okahata) da...@so... ; Language: Emacs-Lisp ; Package: N/A *************** *** 140,148 **** ;; current directory will be used. ;; ! ;; A cscope database directory is one in which EITHER a cscope ! ;; database file (e.g., "cscope.out") OR a cscope file list (e.g., ;; "cscope.files") exists. If only "cscope.files" exists, the ;; corresponding "cscope.out" will be automatically created by cscope ! ;; when a search is done. ;; ;; Note that the variable, `cscope-database-regexps', is generally not --- 140,152 ---- ;; current directory will be used. ;; ! ;; A cscope database directory is one in which EITHER a cscope database ! ;; file (e.g., "cscope.out") OR a cscope file list (e.g., ;; "cscope.files") exists. If only "cscope.files" exists, the ;; corresponding "cscope.out" will be automatically created by cscope ! ;; when a search is done. By default, the cscope database file is called ! ;; "cscope.out", but this can be changed (on a global basis) via the ! ;; variable, `cscope-database-file'. There is limited support for cscope ! ;; databases that are named differently than that given by ! ;; `cscope-database-file', using the variable, `cscope-database-regexps'. ;; ;; Note that the variable, `cscope-database-regexps', is generally not *************** *** 322,330 **** ;; t ;; ! ;; Here, DBDIR is a directory that contains a cscope database. If only ! ;; DBDIR is specified, then that cscope database will be searched without ! ;; any additional cscope command-line options. If OPTIONS is given, then ! ;; OPTIONS is a list of strings, where each string is a separate cscope ! ;; command-line option. ;; ;; In the case of "( t )", this specifies that the search is to use the --- 326,339 ---- ;; t ;; ! ;; Here, DBDIR is a directory (or a file) that contains a cscope ! ;; database. If DBDIR is a directory, then it is expected that the ! ;; cscope database, if present, has the filename given by the variable, ! ;; `cscope-database-file'; if DBDIR is a file, then DBDIR is the path ! ;; name to a cscope database file (which does not have to be the same as ! ;; that given by `cscope-database-file'). If only DBDIR is specified, ! ;; then that cscope database will be searched without any additional ! ;; cscope command-line options. If OPTIONS is given, then OPTIONS is a ! ;; list of strings, where each string is a separate cscope command-line ! ;; option. ;; ;; In the case of "( t )", this specifies that the search is to use the *************** *** 358,363 **** ;; ;; A cscope database directory is one in which EITHER a cscope database ! ;; file (e.g., "cscope.out") OR a cscope file list (e.g., "cscope.files") ! ;; exists. ;; ;; Here is an example of `cscope-database-regexps': --- 367,378 ---- ;; ;; A cscope database directory is one in which EITHER a cscope database ! ;; file (e.g., "cscope.out") OR a cscope file list (e.g., ! ;; "cscope.files") exists. If only "cscope.files" exists, the ! ;; corresponding "cscope.out" will be automatically created by cscope ! ;; when a search is done. By default, the cscope database file is called ! ;; "cscope.out", but this can be changed (on a global basis) via the ! ;; variable, `cscope-database-file'. There is limited support for cscope ! ;; databases that are named differently than that given by ! ;; `cscope-database-file', using the variable, `cscope-database-regexps'. ;; ;; Here is an example of `cscope-database-regexps': *************** *** 368,372 **** ;; ( t ) ;; ( "/users/jdoe/sources/proj2") ! ;; ( "/users/jdoe/sources/proj3") ;; t ;; ( "/some/master/directory" ("-d" "-I/usr/local/include") ) --- 383,388 ---- ;; ( t ) ;; ( "/users/jdoe/sources/proj2") ! ;; ( "/users/jdoe/sources/proj3/mycscope.out") ! ;; ( "/users/jdoe/sources/proj4") ;; t ;; ( "/some/master/directory" ("-d" "-I/usr/local/include") ) *************** *** 385,390 **** ;; ;; 2. Next, searches will be done using the cscope database ! ;; directories, "/users/jdoe/sources/proj2" and ! ;; "/users/jdoe/sources/proj3". ;; ;; 3. If a match was found, searching will stop. --- 401,409 ---- ;; ;; 2. Next, searches will be done using the cscope database ! ;; directories, "/users/jdoe/sources/proj2", ! ;; "/users/jdoe/sources/proj3/mycscope.out", and ! ;; "/users/jdoe/sources/proj4". Note that, instead of the file, ! ;; "cscope.out", the file, "mycscope.out", will be used in the ! ;; directory "/users/jdoe/sources/proj3". ;; ;; 3. If a match was found, searching will stop. *************** *** 421,426 **** ;; 1. Cannot handle whitespace in directory or file names. ;; ;; - ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; --- 440,472 ---- ;; 1. Cannot handle whitespace in directory or file names. ;; + ;; 2. By default, colored faces are used to display results. If you happen + ;; to use a black background, part of the results may be invisible + ;; (because the foreground color may be black, too). There are at least + ;; two solutions for this: + ;; + ;; 2a. Turn off colored faces, by setting `cscope-use-face' to `nil', + ;; e.g.: + ;; + ;; (setq cscope-use-face nil) + ;; + ;; 2b. Explicitly set colors for the faces used by cscope. The faces + ;; are: + ;; + ;; cscope-file-face + ;; cscope-function-face + ;; cscope-line-number-face + ;; cscope-line-face + ;; cscope-mouse-face + ;; + ;; The face most likely to cause problems (e.g., black-on-black + ;; color) is `cscope-line-face'. + ;; + ;; 3. The support for cscope databases different from that specified by + ;; `cscope-database-file' is quirky. If the file does not exist, it + ;; will not be auto-created (unlike files names by + ;; `cscope-database-file'). You can manually force the file to be + ;; created by using touch(1) to create a zero-length file; the + ;; database will be created the next time a search is done. ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; *************** *** 472,480 **** t ! Here, DBDIR is a directory that contains a cscope database. If only ! DBDIR is specified, then that cscope database will be searched without ! any additional cscope command-line options. If OPTIONS is given, then ! OPTIONS is a list of strings, where each string is a separate cscope ! command-line option. In the case of \"( t )\", this specifies that the search is to use the --- 518,530 ---- t ! Here, DBDIR is a directory (or a file) that contains a cscope database. ! If DBDIR is a directory, then it is expected that the cscope database, ! if present, has the filename given by the variable, ! `cscope-database-file'; if DBDIR is a file, then DBDIR is the path name ! to a cscope database file (which does not have to be the same as that ! given by `cscope-database-file'). If only DBDIR is specified, then that ! cscope database will be searched without any additional cscope ! command-line options. If OPTIONS is given, then OPTIONS is a list of ! strings, where each string is a separate cscope command-line option. In the case of \"( t )\", this specifies that the search is to use the *************** *** 508,513 **** A cscope database directory is one in which EITHER a cscope database ! file (e.g., \"cscope.out\") OR a cscope file list (e.g., \"cscope.files\") ! exists. Here is an example of `cscope-database-regexps': --- 558,569 ---- A cscope database directory is one in which EITHER a cscope database ! file (e.g., \"cscope.out\") OR a cscope file list (e.g., ! \"cscope.files\") exists. If only \"cscope.files\" exists, the ! corresponding \"cscope.out\" will be automatically created by cscope ! when a search is done. By default, the cscope database file is called ! \"cscope.out\", but this can be changed (on a global basis) via the ! variable, `cscope-database-file'. There is limited support for cscope ! databases that are named differently than that given by ! `cscope-database-file', using the variable, `cscope-database-regexps'. Here is an example of `cscope-database-regexps': *************** *** 518,522 **** ( t ) ( \"/users/jdoe/sources/proj2\") ! ( \"/users/jdoe/sources/proj3\") t ( \"/some/master/directory\" (\"-d\" \"-I/usr/local/include\") ) --- 574,579 ---- ( t ) ( \"/users/jdoe/sources/proj2\") ! ( \"/users/jdoe/sources/proj3/mycscope.out\") ! ( \"/users/jdoe/sources/proj4\") t ( \"/some/master/directory\" (\"-d\" \"-I/usr/local/include\") ) *************** *** 535,540 **** 2. Next, searches will be done using the cscope database ! directories, \"/users/jdoe/sources/proj2\" and ! \"/users/jdoe/sources/proj3\". 3. If a match was found, searching will stop. --- 592,600 ---- 2. Next, searches will be done using the cscope database ! directories, \"/users/jdoe/sources/proj2\", ! \"/users/jdoe/sources/proj3/mycscope.out\", and ! \"/users/jdoe/sources/proj4\". Note that, instead of the file, ! \"cscope.out\", the file, \"mycscope.out\", will be used in the ! directory \"/users/jdoe/sources/proj3\". 3. If a match was found, searching will stop. *************** *** 1264,1267 **** --- 1324,1329 ---- (let (this-directory database-dir) (catch 'done + (if (file-regular-p directory) + (throw 'done directory)) (setq directory (cscope-canonicalize-directory directory) this-directory directory) *************** *** 1527,1531 **** (defun cscope-search-one-database () "Pop a database entry from cscope-search-list and do a search there." ! (let ( next-item options cscope-directory database-file outbuf done) (setq outbuf (get-buffer-create cscope-output-buffer-name)) (save-excursion --- 1589,1594 ---- (defun cscope-search-one-database () "Pop a database entry from cscope-search-list and do a search there." ! (let ( next-item options cscope-directory database-file outbuf done ! base-database-file-name) (setq outbuf (get-buffer-create cscope-output-buffer-name)) (save-excursion *************** *** 1536,1539 **** --- 1599,1603 ---- (setq next-item (car cscope-search-list) cscope-search-list (cdr cscope-search-list) + base-database-file-name cscope-database-file ) (if (listp next-item) *************** *** 1544,1547 **** --- 1608,1620 ---- (cscope-search-directory-hierarchy default-directory))) + (if (file-regular-p cscope-directory) + (progn + ;; Handle the case where `cscope-directory' is really + ;; a full path name to a cscope database. + (setq base-database-file-name + (file-name-nondirectory cscope-directory) + cscope-directory + (file-name-directory cscope-directory)) + )) (setq cscope-directory (file-name-as-directory cscope-directory)) *************** *** 1571,1575 **** (if cscope-command-args (setq options (append options cscope-command-args))) ! (setq database-file (concat cscope-directory cscope-database-file) cscope-searched-dirs (cons cscope-directory cscope-searched-dirs) --- 1644,1648 ---- (if cscope-command-args (setq options (append options cscope-command-args))) ! (setq database-file (concat cscope-directory base-database-file-name) cscope-searched-dirs (cons cscope-directory cscope-searched-dirs) *************** *** 1585,1590 **** (goto-char (point-max)) (setq cscope-item-start (point)) ! (insert "\nDatabase directory: " cscope-directory "\n" ! cscope-separator-line) (setq cscope-output-start (point)) (setq default-directory cscope-directory) --- 1658,1670 ---- (goto-char (point-max)) (setq cscope-item-start (point)) ! (if (string= base-database-file-name cscope-database-file) ! (insert "\nDatabase directory: " cscope-directory "\n" ! cscope-separator-line) ! (insert "\nDatabase directory/file: " ! cscope-directory base-database-file-name "\n" ! cscope-separator-line)) ! ;; Add the correct database file to search ! (setq options (cons base-database-file-name options)) ! (setq options (cons "-f" options)) (setq cscope-output-start (point)) (setq default-directory cscope-directory) |