From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jan Nieuwenhuizen Newsgroups: gmane.emacs.devel Subject: patch: add-log.el: changelog find file under poin Date: Sun, 04 Nov 2007 22:18:12 +0100 Organization: lilypond-design.org Message-ID: <1194211092.13041.13.camel@peder.flower> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1194211110 11022 80.91.229.12 (4 Nov 2007 21:18:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 4 Nov 2007 21:18:30 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Nov 04 22:18:32 2007 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 1IomrX-0003Ac-0U for ged-emacs-devel@m.gmane.org; Sun, 04 Nov 2007 22:18:31 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IomrM-0004IE-FW for ged-emacs-devel@m.gmane.org; Sun, 04 Nov 2007 16:18:20 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IomrJ-0004I9-Gf for emacs-devel@gnu.org; Sun, 04 Nov 2007 16:18:17 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IomrI-0004Hx-1l for emacs-devel@gnu.org; Sun, 04 Nov 2007 16:18:16 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IomrH-0004Hu-Ra for emacs-devel@gnu.org; Sun, 04 Nov 2007 16:18:15 -0500 Original-Received: from smtp-vbr6.xs4all.nl ([194.109.24.26]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IomrH-00055E-F9 for emacs-devel@gnu.org; Sun, 04 Nov 2007 16:18:15 -0500 Original-Received: from peder.flower (peder.xs4all.nl [82.93.198.126]) by smtp-vbr6.xs4all.nl (8.13.8/8.13.8) with ESMTP id lA4LIEEo050957; Sun, 4 Nov 2007 22:18:14 +0100 (CET) (envelope-from janneke-list@xs4all.nl) Original-Received: from [127.0.0.1] (localhost [127.0.0.1]) by peder.flower (Postfix) with ESMTP id C7CC910E8034; Sun, 4 Nov 2007 22:18:13 +0100 (CET) X-Mailer: Evolution 2.12.0 X-Virus-Scanned: by XS4ALL Virus Scanner X-detected-kernel: by monty-python.gnu.org: FreeBSD 4.6-4.9 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:82521 Archived-At: 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