From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel,gmane.emacs.pretest.bugs Subject: RE: no doc string for tag functions and variables Date: Sun, 10 Feb 2008 18:23:54 -0800 Message-ID: <000b01c86c55$26a47070$c341908d@us.oracle.com> References: <000401c86c0d$61d8c530$2958908d@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_000C_01C86C12.18813070" X-Trace: ger.gmane.org 1202696729 1343 80.91.229.12 (11 Feb 2008 02:25:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 11 Feb 2008 02:25:29 +0000 (UTC) Cc: emacs-pretest-bug@gnu.org To: Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 11 03:25:50 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JOOMe-0002OA-QG for ged-emacs-devel@m.gmane.org; Mon, 11 Feb 2008 03:25:49 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JOOMA-0003Uu-Vj for ged-emacs-devel@m.gmane.org; Sun, 10 Feb 2008 21:25:19 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JOOM1-0003R8-2V for emacs-devel@gnu.org; Sun, 10 Feb 2008 21:25:09 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JOOLy-0003Nl-Ij for emacs-devel@gnu.org; Sun, 10 Feb 2008 21:25:08 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JOOLy-0003NZ-EY for emacs-devel@gnu.org; Sun, 10 Feb 2008 21:25:06 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JOOLx-0000XW-TU for emacs-devel@gnu.org; Sun, 10 Feb 2008 21:25:06 -0500 Original-Received: from mail.gnu.org ([199.232.76.166] helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1JOOLx-0005xA-I9 for emacs-pretest-bug@gnu.org; Sun, 10 Feb 2008 21:25:05 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1JOOLu-0000XA-DX for emacs-pretest-bug@gnu.org; Sun, 10 Feb 2008 21:25:05 -0500 Original-Received: from agminet01.oracle.com ([141.146.126.228]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JOOLp-0000WN-Sw; Sun, 10 Feb 2008 21:24:58 -0500 Original-Received: from rgmgw1.us.oracle.com (rgmgw1.us.oracle.com [138.1.186.110]) by agminet01.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id m1B2OstS003930; Sun, 10 Feb 2008 20:24:54 -0600 Original-Received: from acsmt350.oracle.com (acsmt350.oracle.com [141.146.40.150]) by rgmgw1.us.oracle.com (Switch-3.2.4/Switch-3.2.4) with ESMTP id m1B2Ori5006163; Sun, 10 Feb 2008 19:24:53 -0700 Original-Received: from inet-141-146-46-1.oracle.com by acsmt351.oracle.com with ESMTP id 3566951451202696636; Sun, 10 Feb 2008 18:23:56 -0800 Original-Received: from dradamslap1 (/141.144.65.195) by bhmail.oracle.com (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 10 Feb 2008 18:23:55 -0800 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: AchsQ7QVzHIIUQZDSjCa6GdQHBbbWgACe84Q X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:88707 gmane.emacs.pretest.bugs:21013 Archived-At: This is a multi-part message in MIME format. ------=_NextPart_000_000C_01C86C12.18813070 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit > How about writing doc strings and sending us a patch. Attached is a patch. Amend as needed. I transferred existing comments to doc strings, rewording a bit in some cases. I tried only to understand the existing comments; I did not try to understand uncommented code to guess what the doc strings should be. So some functions still have no doc strings. ------=_NextPart_000_000C_01C86C12.18813070 Content-Type: application/octet-stream; name="etags-2008-02-10.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="etags-2008-02-10.patch" diff -c -w etags-2008-02-10.el etags-2008-02-10-patched.el=0A= *** etags-2008-02-10.el Sun Feb 10 17:33:54 2008=0A= --- etags-2008-02-10-patched.el Sun Feb 10 18:20:22 2008=0A= ***************=0A= *** 258,268 ****=0A= (defvar verify-tags-table-function nil=0A= "Function to return t if current buffer contains valid tags file.")=0A= =0C=0A= - ;; Initialize the tags table in the current buffer.=0A= - ;; Returns non-nil if it is a valid tags table. On=0A= - ;; non-nil return, the tags table state variable are=0A= - ;; made buffer-local and initialized to nil.=0A= (defun initialize-new-tags-table ()=0A= (set (make-local-variable 'tags-table-files) nil)=0A= (set (make-local-variable 'tags-completion-table) nil)=0A= (set (make-local-variable 'tags-included-tables) nil)=0A= --- 258,268 ----=0A= (defvar verify-tags-table-function nil=0A= "Function to return t if current buffer contains valid tags file.")=0A= =0C=0A= (defun initialize-new-tags-table ()=0A= + "Initialize the tags table in the current buffer.=0A= + Returns non-nil if it is a valid tags table. On=0A= + non-nil return, the tags table state variables are=0A= + made buffer-local and initialized to nil."=0A= (set (make-local-variable 'tags-table-files) nil)=0A= (set (make-local-variable 'tags-completion-table) nil)=0A= (set (make-local-variable 'tags-included-tables) nil)=0A= ***************=0A= *** 357,369 ****=0A= (setq tags-table-computed-list-for compute-for=0A= tags-table-computed-list (nreverse computed))))))=0A= =0A= - ;; Extend `tags-table-computed-list' to remove the first `t' = placeholder.=0A= - ;; An element of the list that is `t' is a placeholder indicating that = the=0A= - ;; preceding element is a table that has not been read into core and = might=0A= - ;; contain included tables to search. On return, the first placeholder=0A= - ;; element will be gone and the element before it read into core and = its=0A= - ;; included tables inserted into the list.=0A= (defun tags-table-extend-computed-list ()=0A= (let ((list tags-table-computed-list))=0A= (while (not (eq (nth 1 list) t))=0A= (setq list (cdr list)))=0A= --- 357,369 ----=0A= (setq tags-table-computed-list-for compute-for=0A= tags-table-computed-list (nreverse computed))))))=0A= =0A= (defun tags-table-extend-computed-list ()=0A= + "Extend `tags-table-computed-list' to remove the first `t' = placeholder.=0A= + An element of the list that is `t' is a placeholder indicating that the=0A= + preceding element is a table that has not been read into core and might=0A= + contain included tables to search. On return, the first placeholder=0A= + element will be gone and the element before it read into core and its=0A= + included tables inserted into the list."=0A= (let ((list tags-table-computed-list))=0A= (while (not (eq (nth 1 list) t))=0A= (setq list (cdr list)))=0A= ***************=0A= *** 398,405 ****=0A= ;; It was not a valid table, so just remove the following placeholder.=0A= (setcdr list (cdr (cdr list)))))))=0A= =0A= - ;; Expand tags table name FILE into a complete file name.=0A= (defun tags-expand-table-name (file)=0A= (setq file (expand-file-name file))=0A= (if (file-directory-p file)=0A= (expand-file-name "TAGS" file)=0A= --- 398,405 ----=0A= ;; It was not a valid table, so just remove the following placeholder.=0A= (setcdr list (cdr (cdr list)))))))=0A= =0A= (defun tags-expand-table-name (file)=0A= + "Expand tags table name FILE into a complete file name."=0A= (setq file (expand-file-name file))=0A= (if (file-directory-p file)=0A= (expand-file-name "TAGS" file)=0A= ***************=0A= *** 408,413 ****=0A= --- 408,416 ----=0A= ;; Like member, but comparison is done after tags-expand-table-name on = both=0A= ;; sides and elements of LIST that are t are skipped.=0A= (defun tags-table-list-member (file list)=0A= + "Like (member FILE LIST) after applying `tags-expand-table-name'.=0A= + That is, apply `tags-expand-table-name' to FILE and elements of LIST.=0A= + LIST elements equal to t are skipped."=0A= (setq file (tags-expand-table-name file))=0A= (while (and list=0A= (or (eq (car list) t)=0A= ***************=0A= *** 464,469 ****=0A= --- 467,478 ----=0A= ;; we return. If CORE-ONLY is non-nil, check only tags tables that are=0A= ;; already in buffers--don't visit any new files.=0A= (defun tags-table-including (this-file core-only)=0A= + "Search current tags tables for tags for THIS-FILE.=0A= + Subroutine of `visit-tags-table-buffer'.=0A= + Looks for a tags table that has such tags or that includes a table=0A= + that has them. Returns the name of the first such table.=0A= + Non-nil CORE-ONLY means check only tags tables that are already in=0A= + buffers. Nil CORE-ONLY is ignored."=0A= (let ((tables tags-table-computed-list)=0A= (found nil))=0A= ;; Loop over the list, looking for a table containing tags for = THIS-FILE.=0A= ***************=0A= *** 509,517 ****=0A= ;; included the one we found.=0A= could-be))))=0A= =0A= - ;; Subroutine of visit-tags-table-buffer. Move tags-table-list-pointer=0A= - ;; along and set tags-file-name. Returns nil when out of tables.=0A= (defun tags-next-table ()=0A= ;; If there is a placeholder element next, compute the list to = replace it.=0A= (while (eq (nth 1 tags-table-list-pointer) t)=0A= (tags-table-extend-computed-list))=0A= --- 518,527 ----=0A= ;; included the one we found.=0A= could-be))))=0A= =0A= (defun tags-next-table ()=0A= + "Move `tags-table-list-pointer' along and set `tags-file-name'.=0A= + Subroutine of `visit-tags-table-buffer'.\=0A= + Returns nil when out of tables."=0A= ;; If there is a placeholder element next, compute the list to = replace it.=0A= (while (eq (nth 1 tags-table-list-pointer) t)=0A= (tags-table-extend-computed-list))=0A= ***************=0A= *** 742,751 ****=0A= (or tags-included-tables=0A= (setq tags-included-tables (funcall = tags-included-tables-function))))=0A= =0C=0A= - ;; Build tags-completion-table on demand. The single current tags = table=0A= - ;; and its included tags tables (and their included tables, etc.) have=0A= - ;; their tags included in the completion table.=0A= (defun tags-completion-table ()=0A= (or tags-completion-table=0A= ;; No cached value for this buffer.=0A= (condition-case ()=0A= --- 752,761 ----=0A= (or tags-included-tables=0A= (setq tags-included-tables (funcall = tags-included-tables-function))))=0A= =0C=0A= (defun tags-completion-table ()=0A= + "Build `tags-completion-table' on demand.=0A= + The tags included in the completion table are those in the current=0A= + tags table and its (recursively) included tags tables."=0A= (or tags-completion-table=0A= ;; No cached value for this buffer.=0A= (condition-case ()=0A= ***************=0A= *** 769,777 ****=0A= (quit (message "Tags completion table construction aborted.")=0A= (setq tags-completion-table nil)))))=0A= =0A= - ;; Completion function for tags. Does normal try-completion,=0A= - ;; but builds tags-completion-table on demand.=0A= (defun tags-complete-tag (string predicate what)=0A= (save-excursion=0A= ;; If we need to ask for the tag table, allow that.=0A= (let ((enable-recursive-minibuffers t))=0A= --- 779,788 ----=0A= (quit (message "Tags completion table construction aborted.")=0A= (setq tags-completion-table nil)))))=0A= =0A= (defun tags-complete-tag (string predicate what)=0A= + "Completion function for tags.=0A= + Does normal `try-completion', but builds `tags-completion-table' on=0A= + demand."=0A= (save-excursion=0A= ;; If we need to ask for the tag table, allow that.=0A= (let ((enable-recursive-minibuffers t))=0A= ***************=0A= *** 780,787 ****=0A= (all-completions string (tags-completion-table) predicate)=0A= (try-completion string (tags-completion-table) predicate))))=0A= =0C=0A= - ;; Read a tag name from the minibuffer with defaulting and completion.=0A= (defun find-tag-tag (string)=0A= (let* ((completion-ignore-case (if (memq tags-case-fold-search '(t = nil))=0A= tags-case-fold-search=0A= case-fold-search))=0A= --- 791,798 ----=0A= (all-completions string (tags-completion-table) predicate)=0A= (try-completion string (tags-completion-table) predicate))))=0A= =0C=0A= (defun find-tag-tag (string)=0A= + "Read a tag name, with defaulting and completion."=0A= (let* ((completion-ignore-case (if (memq tags-case-fold-search '(t = nil))=0A= tags-case-fold-search=0A= case-fold-search))=0A= ***************=0A= *** 802,809 ****=0A= (defvar last-tag nil=0A= "Last tag found by \\[find-tag].")=0A= =0A= - ;; Get interactive args for find-tag{-noselect,-other-window,-regexp}.=0A= (defun find-tag-interactive (prompt &optional no-default)=0A= (if (and current-prefix-arg last-tag)=0A= (list nil (if (< (prefix-numeric-value current-prefix-arg) 0)=0A= '-=0A= --- 813,822 ----=0A= (defvar last-tag nil=0A= "Last tag found by \\[find-tag].")=0A= =0A= (defun find-tag-interactive (prompt &optional no-default)=0A= + "Get interactive arguments for tag functions.=0A= + The functions using this are `find-tag-noselect',=0A= + `find-tag-other-window', and `find-tag-regexp'."=0A= (if (and current-prefix-arg last-tag)=0A= (list nil (if (< (prefix-numeric-value current-prefix-arg) 0)=0A= '-=0A= ***************=0A= *** 812,818 ****=0A= (read-string prompt)=0A= (find-tag-tag prompt)))))=0A= =0A= ! (defvar find-tag-history nil)=0A= =0A= ;; Dynamic bondage:=0A= (eval-when-compile=0A= --- 825,831 ----=0A= (read-string prompt)=0A= (find-tag-tag prompt)))))=0A= =0A= ! (defvar find-tag-history nil) ; Doc string?=0A= =0A= ;; Dynamic bondage:=0A= (eval-when-compile=0A= ***************=0A= *** 1028,1053 ****=0A= (goto-char (marker-position marker))=0A= (set-marker marker nil nil)))=0A= =0C=0A= ! ;; Internal tag finding function.=0A= ! =0A= ! ;; PATTERN is a string to pass to second arg SEARCH-FORWARD-FUNC, and = to=0A= ! ;; any member of the function list ORDER (third arg). If ORDER is nil,=0A= ! ;; use saved state to continue a previous search.=0A= ! =0A= ! ;; Fourth arg NEXT-LINE-AFTER-FAILURE-P is non-nil if after a failed = match,=0A= ! ;; point should be moved to the next line.=0A= ! =0A= ! ;; Fifth arg MATCHING is a string, an English '-ing' word, to be used = in=0A= ! ;; an error message.=0A= ! =0A= ! ;; Algorithm is as follows. For each qualifier-func in ORDER, go to=0A= ! ;; beginning of tags file, and perform inner loop: for each naive = match for=0A= ! ;; PATTERN found using SEARCH-FORWARD-FUNC, qualify the naive match = using=0A= ! ;; qualifier-func. If it qualifies, go to the specified line in the=0A= ! ;; specified source file and return. Qualified matches are remembered = to=0A= ! ;; avoid repetition. State is saved so that the loop can be continued.=0A= ! =0A= ! (defvar tag-lines-already-matched nil) ;matches remembered here = between calls=0A= =0A= (defun find-tag-in-order (pattern=0A= search-forward-func=0A= --- 1041,1048 ----=0A= (goto-char (marker-position marker))=0A= (set-marker marker nil nil)))=0A= =0C=0A= ! (defvar tag-lines-already-matched nil=0A= ! "Matches remembered between calls.") ; Doc string: calls to what?=0A= =0A= (defun find-tag-in-order (pattern=0A= search-forward-func=0A= ***************=0A= *** 1055,1060 ****=0A= --- 1050,1072 ----=0A= next-line-after-failure-p=0A= matching=0A= first-search)=0A= + "Internal tag-finding function.=0A= + PATTERN is a string to pass to arg SEARCH-FORWARD-FUNC, and to any=0A= + member of the function list ORDER. If ORDER is nil, use saved state=0A= + to continue a previous search.=0A= + =0A= + Arg NEXT-LINE-AFTER-FAILURE-P is non-nil if after a failed match,=0A= + point should be moved to the next line.=0A= + =0A= + Arg MATCHING is a string, an English `-ing' word, to be used in an=0A= + error message."=0A= + ;; Algorithm is as follows:=0A= + ;; For each qualifier-func in ORDER, go to beginning of tags file, and=0A= + ;; perform inner loop: for each naive match for PATTERN found using=0A= + ;; SEARCH-FORWARD-FUNC, qualify the naive match using qualifier-func. = If=0A= + ;; it qualifies, go to the specified line in the specified source file=0A= + ;; and return. Qualified matches are remembered to avoid repetition.=0A= + ;; State is saved so that the loop can be continued.=0A= (let (file ;name of file containing tag=0A= tag-info ;where to find the tag in FILE=0A= (first-table t)=0A= ***************=0A= *** 1147,1156 ****=0A= (current-buffer))))=0A= =0A= (defun tag-find-file-of-tag-noselect (file)=0A= ! ;; Find the right line in the specified file.=0A= ! ;; If we are interested in compressed-files,=0A= ! ;; we search files with extensions.=0A= ! ;; otherwise only the real file.=0A= (let* ((buffer-search-extensions (if (featurep 'jka-compr)=0A= tags-compression-info-list=0A= '("")))=0A= --- 1159,1167 ----=0A= (current-buffer))))=0A= =0A= (defun tag-find-file-of-tag-noselect (file)=0A= ! "Find the right line in the specified FILE."=0A= ! ;; If interested in compressed-files, search files with extensions.=0A= ! ;; Otherwise, search only the real file.=0A= (let* ((buffer-search-extensions (if (featurep 'jka-compr)=0A= tags-compression-info-list=0A= '("")))=0A= ***************=0A= *** 1180,1186 ****=0A= (error "File %s not found" file))=0A= (set-buffer the-buffer))))=0A= =0A= ! (defun tag-find-file-of-tag (file)=0A= (let ((buf (tag-find-file-of-tag-noselect file)))=0A= (condition-case nil=0A= (switch-to-buffer buf)=0A= --- 1191,1197 ----=0A= (error "File %s not found" file))=0A= (set-buffer the-buffer))))=0A= =0A= ! (defun tag-find-file-of-tag (file) ; Doc string?=0A= (let ((buf (tag-find-file-of-tag-noselect file)))=0A= (condition-case nil=0A= (switch-to-buffer buf)=0A= ***************=0A= *** 1188,1196 ****=0A= =0C=0A= ;; `etags' TAGS file format support.=0A= =0A= - ;; If the current buffer is a valid etags TAGS file, give it local = values of=0A= - ;; the tags table format variables, and return non-nil.=0A= (defun etags-recognize-tags-table ()=0A= (and (etags-verify-tags-table)=0A= ;; It is annoying to flash messages on the screen briefly,=0A= ;; and this message is not useful. -- rms=0A= --- 1199,1208 ----=0A= =0C=0A= ;; `etags' TAGS file format support.=0A= =0A= (defun etags-recognize-tags-table ()=0A= + "If `etags-verify-tags-table', make buffer-local format variables.=0A= + If current buffer is a valid etags TAGS file, then give it=0A= + buffer-local values of tags table format variables."=0A= (and (etags-verify-tags-table)=0A= ;; It is annoying to flash messages on the screen briefly,=0A= ;; and this message is not useful. -- rms=0A= ***************=0A= *** 1225,1231 ****=0A= ;; Use eq instead of =3D in case char-after returns nil.=0A= (eq (char-after (point-min)) ?\f))=0A= =0A= ! (defun etags-file-of-tag (&optional relative)=0A= (save-excursion=0A= (re-search-backward "\f\n\\([^\n]+\\),[0-9]*\n")=0A= (let ((str (buffer-substring (match-beginning 1) (match-end 1))))=0A= --- 1237,1243 ----=0A= ;; Use eq instead of =3D in case char-after returns nil.=0A= (eq (char-after (point-min)) ?\f))=0A= =0A= ! (defun etags-file-of-tag (&optional relative) ; Doc string?=0A= (save-excursion=0A= (re-search-backward "\f\n\\([^\n]+\\),[0-9]*\n")=0A= (let ((str (buffer-substring (match-beginning 1) (match-end 1))))=0A= ***************=0A= *** 1235,1241 ****=0A= (file-truename default-directory))))))=0A= =0A= =0A= ! (defun etags-tags-completion-table ()=0A= (let ((table (make-vector 511 0))=0A= (progress-reporter=0A= (make-progress-reporter=0A= --- 1247,1253 ----=0A= (file-truename default-directory))))))=0A= =0A= =0A= ! (defun etags-tags-completion-table () ; Doc string?=0A= (let ((table (make-vector 511 0))=0A= (progress-reporter=0A= (make-progress-reporter=0A= ***************=0A= *** 1265,1271 ****=0A= table)))=0A= table))=0A= =0A= ! (defun etags-snarf-tag (&optional use-explicit)=0A= (let (tag-text line startpos explicit-start)=0A= (if (save-excursion=0A= (forward-line -1)=0A= --- 1277,1283 ----=0A= table)))=0A= table))=0A= =0A= ! (defun etags-snarf-tag (&optional use-explicit) ; Doc string?=0A= (let (tag-text line startpos explicit-start)=0A= (if (save-excursion=0A= (forward-line -1)=0A= ***************=0A= *** 1305,1319 ****=0A= (forward-line 1)=0A= (cons tag-text (cons line startpos))))=0A= =0A= - ;; TAG-INFO is a cons (TEXT LINE . POSITION) where TEXT is the initial = part=0A= - ;; of a line containing the tag and POSITION is the character position = of=0A= - ;; TEXT within the file (starting from 1); LINE is the line number. If=0A= - ;; TEXT is t, it means the tag refers to exactly LINE or POSITION=0A= - ;; (whichever is present, LINE having preference, no searching. Either=0A= - ;; LINE or POSITION may be nil; POSITION is used if present. If the = tag=0A= - ;; isn't exactly at the given position then look around that position = using=0A= - ;; a search window which expands until it hits the start of file.=0A= (defun etags-goto-tag-location (tag-info)=0A= (let ((startpos (cdr (cdr tag-info)))=0A= (line (car (cdr tag-info)))=0A= offset found pat)=0A= --- 1317,1336 ----=0A= (forward-line 1)=0A= (cons tag-text (cons line startpos))))=0A= =0A= (defun etags-goto-tag-location (tag-info)=0A= + "Go to location of tag specified by TAG-INFO.=0A= + TAG-INFO is a cons (TEXT LINE . POSITION).=0A= + TEXT is the initial part of a line containing the tag.=0A= + LINE is the line number.=0A= + POSITION is the (one-based) char position of TEXT within the file.=0A= + =0A= + If TEXT is t, it means the tag refers to exactly LINE or POSITION,=0A= + whichever is present, LINE having preference, no searching.=0A= + Either LINE or POSITION can be nil. POSITION is used if present.=0A= + =0A= + If the tag isn't exactly at the given position, then look near that=0A= + position using a search window that expands progressively until it=0A= + hits the start of file."=0A= (let ((startpos (cdr (cdr tag-info)))=0A= (line (car (cdr tag-info)))=0A= offset found pat)=0A= ***************=0A= *** 1362,1368 ****=0A= (forward-char 1))=0A= (beginning-of-line)))=0A= =0A= ! (defun etags-list-tags (file)=0A= (goto-char (point-min))=0A= (when (re-search-forward (concat "\f\n" "\\(" file "\\)" ",") nil t)=0A= (let ((path (save-excursion (forward-line 1) (file-of-tag)))=0A= --- 1379,1385 ----=0A= (forward-char 1))=0A= (beginning-of-line)))=0A= =0A= ! (defun etags-list-tags (file) ; Doc string?=0A= (goto-char (point-min))=0A= (when (re-search-forward (concat "\f\n" "\\(" file "\\)" ",") nil t)=0A= (let ((path (save-excursion (forward-line 1) (file-of-tag)))=0A= ***************=0A= *** 1435,1441 ****=0A= (funcall ins-symb (car sy))))=0A= (sort-lines nil beg (point))))))=0A= =0A= ! (defun etags-tags-apropos (string)=0A= (when tags-apropos-verbose=0A= (princ "Tags in file `")=0A= (tags-with-face 'highlight (princ buffer-file-name))=0A= --- 1452,1458 ----=0A= (funcall ins-symb (car sy))))=0A= (sort-lines nil beg (point))))))=0A= =0A= ! (defun etags-tags-apropos (string) ; Doc string?=0A= (when tags-apropos-verbose=0A= (princ "Tags in file `")=0A= (tags-with-face 'highlight (princ buffer-file-name))=0A= ***************=0A= *** 1496,1502 ****=0A= (message nil))=0A= (when tags-apropos-verbose (princ "\n")))=0A= =0A= ! (defun etags-tags-table-files ()=0A= (let ((files nil)=0A= beg)=0A= (goto-char (point-min))=0A= --- 1513,1519 ----=0A= (message nil))=0A= (when tags-apropos-verbose (princ "\n")))=0A= =0A= ! (defun etags-tags-table-files () ; Doc string?=0A= (let ((files nil)=0A= beg)=0A= (goto-char (point-min))=0A= ***************=0A= *** 1508,1514 ****=0A= (setq files (cons (buffer-substring beg (1- (point))) files))))=0A= (nreverse files)))=0A= =0A= ! (defun etags-tags-included-tables ()=0A= (let ((files nil)=0A= beg)=0A= (goto-char (point-min))=0A= --- 1525,1531 ----=0A= (setq files (cons (buffer-substring beg (1- (point))) files))))=0A= (nreverse files)))=0A= =0A= ! (defun etags-tags-included-tables () ; Doc string?=0A= (let ((files nil)=0A= beg)=0A= (goto-char (point-min))=0A= ***************=0A= *** 1524,1532 ****=0A= =0C=0A= ;; Empty tags file support.=0A= =0A= - ;; Recognize an empty file and give it local values of the tags table = format=0A= - ;; variables which do nothing.=0A= (defun tags-recognize-empty-tags-table ()=0A= (and (zerop (buffer-size))=0A= (mapc (lambda (sym) (set (make-local-variable sym) 'ignore))=0A= '(tags-table-files-function=0A= --- 1541,1550 ----=0A= =0C=0A= ;; Empty tags file support.=0A= =0A= (defun tags-recognize-empty-tags-table ()=0A= + "Returns non-nil if current buffer is empty.=0A= + If empty, make buffer-local values of the tags table format variables=0A= + that do nothing."=0A= (and (zerop (buffer-size))=0A= (mapc (lambda (sym) (set (make-local-variable sym) 'ignore))=0A= '(tags-table-files-function=0A= ***************=0A= *** 1560,1574 ****=0A= --- 1578,1597 ----=0A= ;; exact file name match, i.e. searched tag must match complete file=0A= ;; name including directories parts if there are some.=0A= (defun tag-exact-file-name-match-p (tag)=0A= + "Return non-nil if TAG matches complete file name.=0A= + Any directory part of the file name is also matched."=0A= (and (looking-at ",[0-9\n]")=0A= (save-excursion (backward-char (+ 2 (length tag)))=0A= (looking-at "\f\n"))))=0A= + =0A= ;; file name match as above, but searched tag must match the file=0A= ;; name not including the directories if there are some.=0A= (defun tag-file-name-match-p (tag)=0A= + "Returns non-nil if TAG matches file name, excluding directory part."=0A= (and (looking-at ",[0-9\n]")=0A= (save-excursion (backward-char (1+ (length tag)))=0A= (looking-at "/"))))=0A= + =0A= ;; this / to detect we are after a directory separator is ok for unix,=0A= ;; is there a variable that contains the regexp for directory separator=0A= ;; on whatever operating system ?=0A= ***************=0A= *** 1577,1582 ****=0A= --- 1600,1607 ----=0A= ;; t if point is at a tag line that matches TAG exactly.=0A= ;; point should be just after a string that matches TAG.=0A= (defun tag-exact-match-p (tag)=0A= + "Returns non-nil if current tag line matches TAG exactly.=0A= + Point should be just after a string that matches TAG."=0A= ;; The match is really exact if there is an explicit tag name.=0A= (or (and (eq (char-after (point)) ?\001)=0A= (eq (char-after (- (point) (length tag) 1)) ?\177))=0A= ***************=0A= *** 1586,1591 ****=0A= --- 1611,1618 ----=0A= ;; t if point is at a tag line that has an implicit name.=0A= ;; point should be just after a string that matches TAG.=0A= (defun tag-implicit-name-match-p (tag)=0A= + "Returns non-nil if current tag line has an implicit name.=0A= + Point should be just after a string that matches TAG."=0A= ;; Look at the comment of the make_tag function in lib-src/etags.c = for=0A= ;; a textual description of the four rules.=0A= (and (string-match "^[^ \t()=3D,;]+$" tag) ;rule #1=0A= ***************=0A= *** 1597,1602 ****=0A= --- 1624,1631 ----=0A= ;; t if point is at a tag line that matches TAG as a symbol.=0A= ;; point should be just after a string that matches TAG.=0A= (defun tag-symbol-match-p (tag)=0A= + "Returns non-nil if current tag line matches TAG as a symbol.=0A= + Point should be just after a string that matches TAG."=0A= (and (looking-at "\\Sw.*\177") (looking-at "\\S_.*\177")=0A= (save-excursion=0A= (backward-char (1+ (length tag)))=0A= ***************=0A= *** 1605,1610 ****=0A= --- 1634,1641 ----=0A= ;; t if point is at a tag line that matches TAG as a word.=0A= ;; point should be just after a string that matches TAG.=0A= (defun tag-word-match-p (tag)=0A= + "Returns non-nil if current tag line matches TAG as a word.=0A= + Point should be just after a string that matches TAG."=0A= (and (looking-at "\\b.*\177")=0A= (save-excursion (backward-char (length tag))=0A= (looking-at "\\b"))))=0A= ***************=0A= *** 1612,1617 ****=0A= --- 1643,1651 ----=0A= ;; partial file name match, i.e. searched tag must match a substring=0A= ;; of the file name (potentially including a directory separator).=0A= (defun tag-partial-file-name-match-p (tag)=0A= + "Returns non-nil if current tag matches file name.=0A= + This is a substring match, and it can include directory separators.=0A= + Point should be just after a string that matches TAG."=0A= (and (looking-at ".*,[0-9\n]")=0A= (save-excursion (beginning-of-line)=0A= (backward-char 2)=0A= ***************=0A= *** 1619,1628 ****=0A= --- 1653,1664 ----=0A= =0A= ;; t if point is in a tag line with a tag containing TAG as a = substring.=0A= (defun tag-any-match-p (tag)=0A= + "Returns non-nil if current tag line contains TAG as a substring."=0A= (looking-at ".*\177"))=0A= =0A= ;; t if point is at a tag line that matches RE as a regexp.=0A= (defun tag-re-match-p (re)=0A= + "Returns non-nil if current tag line matches regexp RE."=0A= (save-excursion=0A= (beginning-of-line)=0A= (let ((bol (point)))=0A= ***************=0A= *** 1845,1851 ****=0A= tags-loop-operate `(perform-replace ',from ',to t t ',delimited))=0A= (tags-loop-continue (or file-list-form t)))=0A= =0C=0A= ! (defun tags-complete-tags-table-file (string predicate what)=0A= (save-excursion=0A= ;; If we need to ask for the tag table, allow that.=0A= (let ((enable-recursive-minibuffers t))=0A= --- 1881,1887 ----=0A= tags-loop-operate `(perform-replace ',from ',to t t ',delimited))=0A= (tags-loop-continue (or file-list-form t)))=0A= =0C=0A= ! (defun tags-complete-tags-table-file (string predicate what) ; Doc = string?=0A= (save-excursion=0A= ;; If we need to ask for the tag table, allow that.=0A= (let ((enable-recursive-minibuffers t))=0A= ***************=0A= *** 1966,1972 ****=0A= (set-buffer-modified-p nil)=0A= (select-tags-table-mode))=0A= =0A= ! (defvar select-tags-table-mode-map=0A= (let ((map (make-sparse-keymap)))=0A= (set-keymap-parent map button-buffer-map)=0A= (define-key map "t" 'push-button)=0A= --- 2002,2008 ----=0A= (set-buffer-modified-p nil)=0A= (select-tags-table-mode))=0A= =0A= ! (defvar select-tags-table-mode-map ; Doc string?=0A= (let ((map (make-sparse-keymap)))=0A= (set-keymap-parent map button-buffer-map)=0A= (define-key map "t" 'push-button)=0A= =0A= Diff finished. Sun Feb 10 18:20:58 2008=0A= ------=_NextPart_000_000C_01C86C12.18813070--