unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* patch: add-log.el: changelog find file under poin
@ 2007-11-04 21:18 Jan Nieuwenhuizen
  2007-11-06 23:45 ` Juri Linkov
                   ` (2 more replies)
  0 siblings, 3 replies; 70+ messages in thread
From: Jan Nieuwenhuizen @ 2007-11-04 21:18 UTC (permalink / raw)
  To: emacs-devel

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  <janneke@gnu.org>

	* 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 <janneke@gnu.org> | GNU LilyPond - The music typesetter
http://www.xs4all.nl/~jantien       | http://www.lilypond.org

^ permalink raw reply	[flat|nested] 70+ messages in thread

end of thread, other threads:[~2008-04-03 17:58 UTC | newest]

Thread overview: 70+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-04 21:18 patch: add-log.el: changelog find file under poin Jan Nieuwenhuizen
2007-11-06 23:45 ` Juri Linkov
2007-11-07 13:38   ` Jan Nieuwenhuizen
2007-11-09  8:40 ` Dan Nicolaescu
2007-11-09  9:40   ` Juri Linkov
2008-01-20  6:14 ` Richard Stallman
2008-01-21  3:02   ` Glenn Morris
2008-01-21 20:30     ` Richard Stallman
2008-01-21 20:35       ` Glenn Morris
2008-01-22 22:29         ` Richard Stallman
2008-01-22 22:38           ` Glenn Morris
2008-01-22 23:09           ` Dan Nicolaescu
2008-01-23  1:32             ` Juri Linkov
2008-01-23  2:25               ` Dan Nicolaescu
2008-01-23  9:28                 ` Juri Linkov
2008-01-23 16:20                 ` Richard Stallman
2008-01-27 19:54                   ` Dan Nicolaescu
2008-01-28 10:20                     ` martin rudalics
2008-01-30  2:58                       ` Dan Nicolaescu
2008-02-18 19:46                         ` patch: add-log.el: changelog find file under point martin rudalics
2008-02-18 20:09                           ` Unbearably slow editing in .h files (was: patch: add-log.el: changelog find file under point) Stefan Monnier
2008-02-23 22:49                             ` Alan Mackenzie
2008-02-23 22:51                               ` Unbearably slow editing in .h files martin rudalics
2008-02-23 23:25                                 ` Alan Mackenzie
2008-02-24  8:55                                   ` martin rudalics
2008-04-02 22:07                                 ` Alan Mackenzie
2008-04-02 23:47                                   ` Dan Nicolaescu
2008-04-03  9:14                                     ` Alan Mackenzie
2008-04-03 13:10                                       ` Dan Nicolaescu
2008-04-03 14:17                                         ` Alan Mackenzie
2008-04-03 15:22                                           ` Dan Nicolaescu
2008-04-03 17:58                                             ` Alan Mackenzie
2008-02-24  0:37                               ` Stefan Monnier
2008-02-24  8:39                                 ` Alan Mackenzie
2008-02-24 14:46                                   ` Jason Rumney
2008-02-24 19:48                                     ` Eli Zaretskii
2008-02-24 19:49                                   ` Eli Zaretskii
2008-02-24 10:28                                 ` Andreas Schwab
2008-02-24 13:49                                   ` Stefan Monnier
2008-02-24 14:41                                     ` Alan Mackenzie
2008-02-24 15:42                                       ` Stefan Monnier
2008-02-24 20:12                                         ` Alan Mackenzie
2008-02-24 22:29                                     ` Richard Stallman
2008-02-25  2:14                                       ` Stefan Monnier
2008-02-18 23:31                           ` patch: add-log.el: changelog find file under point Juri Linkov
2008-02-19  6:34                             ` martin rudalics
2008-02-20 21:29                               ` Juri Linkov
2008-02-21  7:26                                 ` martin rudalics
2008-02-21 22:29                                   ` Richard Stallman
2008-02-22 19:26                                     ` martin rudalics
2008-02-23 19:28                                       ` Richard Stallman
2008-02-23 22:32                                         ` martin rudalics
2008-02-24 15:23                                           ` Richard Stallman
2008-02-24 15:23                                           ` Richard Stallman
2008-02-24 22:34                                             ` martin rudalics
2008-02-25 10:57                                               ` Richard Stallman
2008-02-25 14:05                                                 ` martin rudalics
2008-01-22  0:08       ` patch: add-log.el: changelog find file under poin Juri Linkov
2008-01-22  1:17         ` Drew Adams
2008-01-22  9:54           ` Juri Linkov
2008-01-22 14:34             ` Drew Adams
2008-01-22 22:29         ` Richard Stallman
2008-01-23  1:29           ` Juri Linkov
2008-01-23 16:20             ` Richard Stallman
2008-01-28  8:55             ` Jan Nieuwenhuizen
2008-01-28  9:29               ` Johan Bockgård
2008-01-22  8:21   ` Dan Nicolaescu
2008-01-22  9:56     ` Juri Linkov
2008-01-22 23:13       ` Dan Nicolaescu
2008-01-22 22:29     ` Richard Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).