From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: patch: add-log.el: changelog find file under poin Date: Sun, 20 Jan 2008 01:14:55 -0500 Message-ID: References: <1194211092.13041.13.camel@peder.flower> Reply-To: rms@gnu.org NNTP-Posting-Host: lo.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: ger.gmane.org 1200809808 13975 80.91.229.12 (20 Jan 2008 06:16:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 20 Jan 2008 06:16:48 +0000 (UTC) Cc: Jan Nieuwenhuizen To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 20 07:17:05 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 1JGTUO-0006cz-LL for ged-emacs-devel@m.gmane.org; Sun, 20 Jan 2008 07:17:04 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JGTTz-0002gv-9a for ged-emacs-devel@m.gmane.org; Sun, 20 Jan 2008 01:16:39 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JGTSM-0001FN-C5 for emacs-devel@gnu.org; Sun, 20 Jan 2008 01:14:58 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JGTSL-0001EU-3Z for emacs-devel@gnu.org; Sun, 20 Jan 2008 01:14:57 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JGTSK-0001EG-Jr for emacs-devel@gnu.org; Sun, 20 Jan 2008 01:14:56 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JGTSK-0005JG-Lv for emacs-devel@gnu.org; Sun, 20 Jan 2008 01:14:56 -0500 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1JGTSJ-0004QR-N5; Sun, 20 Jan 2008 01:14:55 -0500 In-reply-to: <1194211092.13041.13.camel@peder.flower> (message from Jan Nieuwenhuizen on Sun, 04 Nov 2007 22:18:12 +0100) 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:87102 Archived-At: Would someone please install this, and update NEWS? (Please add a doc string for the new variable.) 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