From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bob Rogers Newsgroups: gmane.emacs.devel Subject: change-log-goto-source: recognising . within tag names Date: Sat, 21 Mar 2009 22:49:41 -0400 Message-ID: <18885.42821.907043.840826@rgr.rgrjr.com> References: <20806.1237544562@maps> <49C3F31F.6090902@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1237690237 14103 80.91.229.12 (22 Mar 2009 02:50:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 22 Mar 2009 02:50:37 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stephen Eglen , martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Mar 22 03:51:54 2009 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 1LlDmv-0005EG-Av for ged-emacs-devel@m.gmane.org; Sun, 22 Mar 2009 03:51:49 +0100 Original-Received: from localhost ([127.0.0.1]:33413 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LlDlY-0001AT-OS for ged-emacs-devel@m.gmane.org; Sat, 21 Mar 2009 22:50:24 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LlDlF-00014W-LH for emacs-devel@gnu.org; Sat, 21 Mar 2009 22:50:05 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LlDlA-00012L-Ff for emacs-devel@gnu.org; Sat, 21 Mar 2009 22:50:04 -0400 Original-Received: from [199.232.76.173] (port=46286 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LlDlA-00012H-B2 for emacs-devel@gnu.org; Sat, 21 Mar 2009 22:50:00 -0400 Original-Received: from rgrjr.com ([216.146.47.5]:60584) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LlDl9-0001Pe-V1 for emacs-devel@gnu.org; Sat, 21 Mar 2009 22:50:00 -0400 Original-Received: from rgrjr.dyndns.org (c-66-30-196-77.hsd1.ma.comcast.net [66.30.196.77]) by rgrjr.com (Postfix on CentOS) with ESMTP id 97F33160143 for ; Sun, 22 Mar 2009 02:49:58 +0000 (UTC) Original-Received: (qmail 9036 invoked by uid 89); 22 Mar 2009 02:49:58 -0000 Original-Received: from unknown (HELO rgr.rgrjr.com) (192.168.57.1) by home with SMTP; 22 Mar 2009 02:49:58 -0000 Original-Received: by rgr.rgrjr.com (Postfix, from userid 500) id 47207485F1; Sat, 21 Mar 2009 22:49:42 -0400 (EDT) In-Reply-To: <20806.1237544562@maps> X-Mailer: VM 7.19 under Emacs 23.0.91.1 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) 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:109770 Archived-At: From: martin rudalics Date: Fri, 20 Mar 2009 20:48:47 +0100 . . . I'm afraid `change-log-search-tag-name' is too clever when trying to find a suitable tag. Usually, it seems sufficient to search for the previous and next property change of the `change-log-list' text property near `point' and return the corresponding string. Maybe we should provide a `change-log-search-tag-name-function' people could set to do the job. Or, simply set the `syntax-table' text property to `symbol' for periods preceded _and_ followed by word/symbol characters. martin A simple fix would be to find the file name first, read it into a buffer (since we'll need it anyway), and then use its syntax table to parse the tag name. The code below is a start at this; it seems to work. But it would have to be integrated with the change-log-goto-source logic that finds both the file at point and the file near the tag and then picks the best one. The logic seems rather obscure; I suspect I would break it if I tried to change it. ;-} ================ From: Stephen Eglen Date: Fri, 20 Mar 2009 10:22:42 +0000 . . . This is also a problem in lisp, as it seems . can be used within lisp defuns (but not used in practice I think) . . . As a matter of fact, lisp/ChangeLog.12 (and probably others) contain elisp names with dots such as newsticker--parse-rss-1.0, which is why I used this particular change log for testing. For Lisp in particular, the problem is actually fairly broad, as people often use "+", "*", "$", "%", etc., to distinguish certain definition names. A better solution might be to ask the language mode itself to do the name parsing, in order to handle such things as name quoting conventions. But, of course, that's a much bigger job. -- Bob Rogers http://www.rgrjr.com/ ------------------------------------------------------------------------ (defun change-log-file-and-tag () ;; Find the nearest file first, then use that file's syntax table to ;; find the tag. (interactive) (let ((file (change-log-search-file-name (point)))) (if file (let* ((buffer (find-file-noselect file)) (tag (with-syntax-table (with-current-buffer buffer (syntax-table)) (change-log-search-tag-name)))) (message "file %S tag %S" file tag) (list file tag)))))