unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* New Function vc-annotate-chosen-revision - PATCH
@ 2004-09-10 21:29 jbyler+emacs-lists
  2004-09-10 21:48 ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: jbyler+emacs-lists @ 2004-09-10 21:29 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 1356 bytes --]

Hi folks,

Included is a very simple patch to vc.el which implements a useful
addition to the vc annotate functionality: the ability to jump to a
specific version prompted for via the minibuffer.  Among other things,
this is useful because it lets you jump to a named tag or branch.

I would appreciate it if someone would check this in to CVS, as it's a
low risk change that could be useful to a lot of people who will be
using 21.4.  If you need a statement of assignment of copyright for
these 9 lines of code, just let me know what it should look like. 
Here's a possible ChangeLog entry:

2004-08-27  First Last <email@address>

        * vc.el (vc-annotate-chosen-revision): New function. 

Thanks,
Jesse

----- Original message -----
From: jbyler+emacs-lists@anon41.eml.cc
To: emacs-pretest-bug@gnu.org
Date: Fri, 27 Aug 2004 16:46:11 -0400
Subject: New Function vc-annotate-chosen-revision

Hi all,

I just discovered the new functionality added to vc-annotate back in
January, and it's GREAT! - very handy features (viewing logs & diffs &
changing versions).

One thing I thought would augment it a little would be the ability to
jump to an arbitrary revision.  Since the code is all so nicely modular
it was a snap to write; I'm including a patch to vc.el in the hopes that
it can be installed in CVS for inclusion in emacs 21.4.

Thanks!
-Jesse

[-- Attachment #2: vc.el-patch --]
[-- Type: application/octet-stream, Size: 1365 bytes --]

Index: vc.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/vc.el,v
retrieving revision 1.377
diff -c -r1.377 vc.el
*** vc.el	23 Apr 2004 21:02:23 -0000	1.377
--- vc.el	27 Aug 2004 20:41:18 -0000
***************
*** 661,666 ****
--- 661,667 ----
  (define-key vc-annotate-mode-map "N" 'vc-annotate-next-version)
  (define-key vc-annotate-mode-map "P" 'vc-annotate-prev-version)
  (define-key vc-annotate-mode-map "W" 'vc-annotate-workfile-version)
+ (define-key vc-annotate-mode-map "V" 'vc-annotate-chosen-version)
  
  (defvar vc-annotate-mode-menu nil
    "Local keymap used for VC-Annotate mode's menu bar menu.")
***************
*** 3112,3117 ****
--- 3113,3127 ----
  	  (message "Already at version %s" warp-rev)
  	(vc-annotate-warp-version warp-rev)))))
  
+ (defun vc-annotate-chosen-version ()
+   "Visit the annotation of this file for a version selected via the minibuffer"
+   (interactive)
+   (let* ((rev (vc-annotate-extract-revision-at-line))
+          (chosen-rev (read-string
+ 		      (format "Annotate from version: (default %s) " rev)
+ 		      nil nil rev)))
+     (vc-annotate-warp-version chosen-rev)))
+ 
  (defun vc-annotate-extract-revision-at-line ()
    "Extract the revision number of the current line."
    ;; This function must be invoked from a buffer in vc-annotate-mode

[-- Attachment #3: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

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

end of thread, other threads:[~2004-09-12 17:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-10 21:29 New Function vc-annotate-chosen-revision - PATCH jbyler+emacs-lists
2004-09-10 21:48 ` Stefan Monnier
2004-09-11 18:46   ` jbyler+emacs-lists
2004-09-11 21:22     ` Stefan
2004-09-12 17:30       ` jbyler+emacs-lists

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).