[libvirt] Emacs tip for easily adding Reviewed-by tags & friends

Daniel P. Berrangé berrange at redhat.com
Thu Mar 15 11:36:28 UTC 2018


It is nice that git has the short-hand for adding Signed-off-by, but
adding other tags during reviews is kind of tedious and long winded.
eg "ACK" is much shorter than typing "Reviewed-by: ...blah blah blah.."

Good editors have a way to setup macros though, and so I thought I'd
share the emacs approach to making life easy again...

In my $HOME/.emacs.d/abbrev_defs file I have this:

(define-abbrev-table 'global-abbrev-table
  '(
    ("8rev" "Reviewed-by: Daniel P. Berrangé <berrange at redhat.com>" nil 1)
    ("8ack" "Acked-by: Daniel P. Berrangé <berrange at redhat.com>" nil 1)
    ("8test" "Tested-by: Daniel P. Berrangé <berrange at redhat.com>" nil 1)
    ("8sob" "Signed-off-by: Daniel P. Berrangé <berrange at redhat.com>" nil 1)
   ))

Now, if I type the "8rev" [1] and then hit space-bar or enter, emacs expands
it to the full "Reviewed-by: ....blah blah blah..." line. This makes adding
the full tags just as quick & easy as it was to type a traditional "ACK".

Anyone have an equivalent tip for Vim ?

Perhaps we could add them to the hacking file.

Regards,
Daniel

[1] Why the leading "8" you might ask ?  I've no idea. I just got this
    tip from QEMU developers - guess you just want some character seq
    that you're unlikely to want to type for real, to avoid accidental
    expansions.
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|




More information about the libvir-list mailing list