From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dan Nicolaescu Newsgroups: gmane.emacs.devel Subject: Re: patch: add-log.el: changelog find file under poin Date: Tue, 22 Jan 2008 00:21:09 -0800 Message-ID: <200801220821.m0M8LJ57017486@sallyv1.ics.uci.edu> References: <1194211092.13041.13.camel@peder.flower> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1200990276 18475 80.91.229.12 (22 Jan 2008 08:24:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 22 Jan 2008 08:24:36 +0000 (UTC) Cc: Jan Nieuwenhuizen , emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jan 22 09:24:52 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 1JHER9-0006BI-OT for ged-emacs-devel@m.gmane.org; Tue, 22 Jan 2008 09:24:52 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JHEQj-0003kn-UB for ged-emacs-devel@m.gmane.org; Tue, 22 Jan 2008 03:24:25 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JHEQf-0003jT-N6 for emacs-devel@gnu.org; Tue, 22 Jan 2008 03:24:21 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JHEQb-0003gq-KM for emacs-devel@gnu.org; Tue, 22 Jan 2008 03:24:20 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JHEQb-0003gn-FT for emacs-devel@gnu.org; Tue, 22 Jan 2008 03:24:17 -0500 Original-Received: from mx20.gnu.org ([199.232.41.8]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JHEQX-0000Pq-7d; Tue, 22 Jan 2008 03:24:13 -0500 Original-Received: from sallyv1.ics.uci.edu ([128.195.1.109]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JHEQU-0000tw-OX; Tue, 22 Jan 2008 03:24:11 -0500 X-ICS-MailScanner-Watermark: 1201594940.64318@/8G8utax3xqudRKBbZadIA Original-Received: from mothra.ics.uci.edu (mothra.ics.uci.edu [128.195.6.93]) by sallyv1.ics.uci.edu (8.13.7+Sun/8.13.7) with ESMTP id m0M8LJ57017486; Tue, 22 Jan 2008 00:21:19 -0800 (PST) In-Reply-To: (Richard Stallman's message of "Sun, 20 Jan 2008 01:14:55 -0500") Original-Lines: 110 X-ICS-MailScanner: Found to be clean X-ICS-MailScanner-SpamCheck: not spam, SpamAssassin (score=-1.363, required 5, autolearn=disabled, ALL_TRUSTED -1.44, TW_EP 0.08) X-ICS-MailScanner-From: dann@mothra.ics.uci.edu X-detected-kernel: by mx20.gnu.org: Solaris 10 (beta) 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:87279 Archived-At: Richard Stallman writes: > Would someone please install this, and update NEWS? > (Please add a doc string for the new variable.) I think this code needs a bit of bug fixing before it is ready to be applied. For example given this ChangeLog: * progmodes/hideif.el (hide-ifdef-initially, hide-ifdef-read-only) (hide-ifdef-lines, hide-ifdef-shadow, hide-ifdef-shadow): Remove autoload cookies. * vc.el (vc-diff-sentinel): Do not write a footer if there were differences. If the point is on the hide-ifdef-shadow line, C-c C-f will find vc.el, not progmodes/hideif.el, which sounds like a bug. An improvement that would make this even more useful would be that after finding the file, it should do a search for the item the point is on. That won't always find the correct function/variable/etc. the log entry refers to, but it will help the user a lot when it does. > From: Jan Nieuwenhuizen > To: emacs-devel@gnu.org > Content-Type: text/plain > Organization: lilypond-design.org > Date: Sun, 04 Nov 2007 22:18:12 +0100 > Mime-Version: 1.0 > Subject: patch: add-log.el: changelog find file under poin > > Hi, > > I found this function missing after applying a patch that had minor > conflicts in almost every file. > > Greetings, > Jan. > > ChangeLog > 2007-11-04 Jan Nieuwenhuizen > > * add-log.el (change-log-search-file-name, change-log-find-file): > New function. > (change-log-mode-map): New binding C-c C-f to change-log-find-file. > > --- lisp/add-log.el~ 2007-11-04 22:12:20.000000000 +0100 > +++ lisp/add-log.el 2007-11-04 22:12:31.000000000 +0100 > @@ -240,8 +240,10 @@ > ;; backward-compatibility alias > (put 'change-log-acknowledgement-face 'face-alias 'change-log-acknowledgement) > > +(defvar change-log-file-names-re "^\\( +\\|\t\\)\\* \\([^ ,:([\n]+\\)") > + > (defvar change-log-font-lock-keywords > - '(;; > + `(;; > ;; Date lines, new (2000-01-01) and old (Sat Jan 1 00:00:00 2000) styles. > ;; Fixme: this regepx is just an approximate one and may match > ;; wrongly with a non-date line existing as a random note. In > @@ -255,7 +257,7 @@ > (2 'change-log-email))) > ;; > ;; File names. > - ("^\\( +\\|\t\\)\\* \\([^ ,:([\n]+\\)" > + (,change-log-file-names-re > (2 'change-log-file) > ;; Possibly further names in a list: > ("\\=, \\([^ ,:([\n]+\\)" nil nil (1 'change-log-file)) > @@ -287,10 +289,27 @@ > 3 'change-log-acknowledgement)) > "Additional expressions to highlight in Change Log mode.") > > +(defun change-log-search-file-name (where) > + "Return the file-name for the change under point." > + (save-excursion > + (goto-char where) > + (beginning-of-line 1) > + (re-search-forward change-log-file-names-re) > + (match-string 2))) > + > +(defun change-log-find-file () > + "Visit the file for the change under point." > + (interactive) > + (let ((file (change-log-search-file-name (point)))) > + (if (and file (file-exists-p file)) > + (find-file file) > + (message "No such file or directory: ~s" file)))) > + > (defvar change-log-mode-map > (let ((map (make-sparse-keymap))) > (define-key map [?\C-c ?\C-p] 'add-log-edit-prev-comment) > (define-key map [?\C-c ?\C-n] 'add-log-edit-next-comment) > + (define-key map [?\C-c ?\C-f] 'change-log-find-file) > map) > "Keymap for Change Log major mode.") > > > > -- > Jan Nieuwenhuizen | GNU LilyPond - The music typesetter > http://www.xs4all.nl/~jantien | http://www.lilypond.org > > > > _______________________________________________ > Emacs-devel mailing list > Emacs-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-devel