slh
8 months agoSome nice updates/improvements to sy-git.el master
Steve Youngs [Fri, 27 Oct 2017 02:10:06 +0000 (12:10 +1000)] 
Some nice updates/improvements to sy-git.el

* gitgoodies:
  Drastically improve the speed of #'sy-git-blame
  Make #'sy-git-blame somewhat pretty and useful.
  Improve process handling in sy-git.el.
  Add a minor mode and keybindings to sy-git.
  Update/improve sy-git-log, sy-git-blame.
  Add rudimentary support for git diff, blame, and log.

8 months agoDrastically improve the speed of #'sy-git-blame
Steve Youngs [Fri, 27 Oct 2017 02:00:02 +0000 (12:00 +1000)] 
Drastically improve the speed of #'sy-git-blame

In the previous iteration of #'sy-git-blame there was 2 calls to git,
plus creating an extent and glyph for every single line in the file you
were blaming.  It took FOREVER even on small files.  Now there is 1 git
call per revision, blank lines and uncommitted lines are skipped, and
unique extents are only created once per revision, with the rest (vast
majority) being created as "child-extents" with `set-extent-parent'.

Please note that even with this speed-up blaming a large file can still
take some time, but now we're talking seconds and not minutes.

* sy-git.el (sy-git-process-blame-buffer): Rewrite, dramatically
increasing speed.
(sy-git-blame): Use '--root' to treat boundary commits as normal
commits.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
8 months agoMake #'sy-git-blame somewhat pretty and useful.
Steve Youngs [Thu, 26 Oct 2017 11:03:58 +0000 (21:03 +1000)] 
Make #'sy-git-blame somewhat pretty and useful.

With this changeset comes a reasonably useful Blame.  From within the
blame buffer you can display the log, or the log + diff for the commit
that touches the current line in the file. Hovering your rat over a line
will display a short summary in the echo area (author, date).  And if you
have balloon-help enabled, you'll get a popup displaying a brief summary
of the commit (sha1, author, date, log subject).

The downside is that it is bloody slow.  Sorry about that, I am working on
it.

* sy-git.el (sy-git-diff): Bind `C-x G a' here.
(sy-git-blame-log): New. View log from Blame buffer.
(sy-git-blame-log-mouse): Ditto, via rat.
(sy-git-blame-show): New. View log + diff from Blame buffer.
(sy-git-blame-show-mouse): Ditto, via rat.
(sy-git-blame-map): New. Keymap for blame extents.
(sy-git-process-blame-buffer): New. Prettify the Blame buffer,
adds extents, margins, keymaps, and stuffs.
(sy-git-blame): Record current major-mode for later use, use
registers to track window config. Use
#'sy-git-process-blame-buffer.
(sy-git-log): Use registers to track window config.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
8 months agoImprove process handling in sy-git.el.
Steve Youngs [Sun, 22 Oct 2017 06:26:05 +0000 (16:26 +1000)] 
Improve process handling in sy-git.el.

This changeset adds 2 new functions for running git commands...

  .#'sy-git-run-buffer -- runs with output to a buffer.
  .#'sy-git-run-string -- runs with output to a string.

Also added were default command line options that are used for every git
invocation. They are git options, not subcommand options, so git is called
like...

  $ git DEFAULT_OPTS_HERE subcommand...

* sy-git.el (sy-gitbin): New.  The git binary to use.
(sy-git-default-binopts): New.  The default options to always pass
to git.  These are git's options, not git subcommand options.
(sy-git-run-buffer): New.  Run a git process with output going to
a buffer.
(sy-git-run-string): New.  Run a git process with output going to
a string.
(sy-git-blame): Use #'sy-git-run-buffer.
(sy-git-log): Use #'sy-git-run-buffer.
(sy-git-add-log-entry): Use #'sy-git-run-string.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
8 months agoAdd a minor mode and keybindings to sy-git.
Steve Youngs [Fri, 20 Oct 2017 02:26:57 +0000 (12:26 +1000)] 
Add a minor mode and keybindings to sy-git.

With this changeset the goodies in sy-git.el are only available in buffers
of files that are under git control.  And new keybindings were added:

  `C-x G a' -- #'sy-git-add-log-entry
  `C-x G b' -- #'sy-git-blame
  `C-x G =' -- #'sy-git-diff
  `C-x G d' -- #'sy-git-diff
  `C-x G e' -- #'sy-git-ediff
  `C-x G l' -- #'sy-git-log

The global binding for #'sy-git-add-log-entry has been removed.

* sy-git.el (sy-git-mode-map): New.
(sy-git-mode): New minor mode.
(sy-git-activate-maybe): New, for use in `find-file-hooks'. Will
only activate if the visited file is under git control.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
8 months agoUpdate/improve sy-git-log, sy-git-blame.
Steve Youngs [Thu, 19 Oct 2017 11:46:55 +0000 (21:46 +1000)] 
Update/improve sy-git-log, sy-git-blame.

With this change, viewing the log looks much nicer with a little
font-locking.  You can also pass on custom git log options via a 2nd
prefix arg.

* sy-git.el (sy-git-log): Allow setting custom git log options via
a 2nd prefix arg. Add some font-locking. Don't use electric-help.
(sy-git-log-font-lock-keywords): New.
(sy-git-blame): Don't use electric-help, shrink the window if the
buffer is smaller.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
9 months agoAdd rudimentary support for git diff, blame, and log.
Steve Youngs [Mon, 16 Oct 2017 00:01:46 +0000 (10:01 +1000)] 
Add rudimentary support for git diff, blame, and log.

* sy-git.el (sy-git-diff): New.
(sy-git-ediff): New.
(sy-git-blame): New.
(sy-git-log): New.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
2 years agoQuick doc update in sy-git
Steve Youngs [Fri, 15 Jul 2016 05:03:45 +0000 (15:03 +1000)] 
Quick doc update in sy-git

Signed-off-by: Steve Youngs <steve@sxemacs.org>
2 years agoSupport displaying embedded cover art via FFmpeg.
Steve Youngs [Sun, 10 Jan 2016 13:00:58 +0000 (23:00 +1000)] 
Support displaying embedded cover art via FFmpeg.

* mpd.el (mpd-cover-file): Use ffmpeg to extract embedded cover
art and prefer it to the external art.
(mpd-update-cover): Use a more consise syntax with #'make-glyph
calls.
(mpd-balloon-cover): Ditto.
(mpd-new-frame): Ditto.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
3 years agoAdd new file sy-git.el for easier commit logging from SXEmacs
Steve Youngs [Sun, 5 Jul 2015 05:27:23 +0000 (15:27 +1000)] 
Add new file sy-git.el for easier commit logging from SXEmacs

* sy-git.el: New.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
4 years agoVarious updates
Steve Youngs [Tue, 25 Mar 2014 11:43:50 +0000 (21:43 +1000)] 
Various updates

* misc-updates/fixes:
  Updates to google-query.el, linux-kernel.el, and lj.el

4 years agoUpdates to google-query.el, linux-kernel.el, and lj.el
Steve Youngs [Tue, 25 Mar 2014 11:43:19 +0000 (21:43 +1000)] 
Updates to google-query.el, linux-kernel.el, and lj.el

New Addition: footnote-balloons.el.  Display footnotes in balloon-help
frames.

google-query.el was made a lot simpler and more impervious to changes in the
way google displays results by simply calling browse-url instead of trying
to do raw HTTP in-house.

linux-kernel.el works again.

Removed all of the twitter stuff from lj.el

* footnote-balloons.el: New.

* README: Mention footnote-balloons.el

* google-query.el (google-query): Complete refactoring.  Instead
of trying to do it all "in-house" with #'open-network-stream and
parsing process buffers, simply call #'browse-url on it.
(google-query-process-results): Removed.
(google-query-mode): Removed.
(google-query-make-url-extents): Removed.
(google-query-ext-map): Removed.
(google-query-mode-map): Removed.
(google-query-kill-buffer): Removed.
(google-query-url-at-mouse): Removed.
(google-query-url-at-point): Removed.
(google-query-url-regexp): Removed.
(google-query-debug): Removed.
(google-query-mirror): Default to "https://www.google.com".
(google-query-maxlen): Bump default to 1024.
(google-query-version): Bump to 2.0

* linux-kernel.el (linux-kernel-check-latest): Retrieve the info
via #'curl:download.

* lj.el (lj-music-mpd): Removed.
(lj-music): Use #'mpd-now-playing
(lj-twitter): Removed.
(lj-twitter-flag): Removed.
(lj-twitter-username): Removed.
(lj-twitter-password): Removed.
(lj-twitter-compress-url): Renamed to lj-compress-url.
(lj-twitter-sentinel): Removed.
(lj-twitter-update-status): Removed.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
4 years agompd update
Steve Youngs [Mon, 19 Aug 2013 07:31:15 +0000 (17:31 +1000)] 
mpd update

* mpd:
  New convenience function for displaying "Now Playing".

4 years agoNew convenience function for displaying "Now Playing".
Steve Youngs [Mon, 19 Aug 2013 07:30:51 +0000 (17:30 +1000)] 
New convenience function for displaying "Now Playing".

* mpd.el (mpd-now-playing): New.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
4 years agoMore mpd updates
Steve Youngs [Sun, 18 Aug 2013 04:49:36 +0000 (14:49 +1000)] 
More mpd updates

* mpd:
  Various mpd updates and improvements.

4 years agoVarious mpd updates and improvements.
Steve Youngs [Sun, 18 Aug 2013 04:44:47 +0000 (14:44 +1000)] 
Various mpd updates and improvements.

This changeset primarily adds inserting coverart into the balloon-help
buffer, but it also cleans up the code and fixes a couple of tiny bugs
and prevents bytecompiler warnings.

* mpd.el (mpd-start-connection): Add #'mpd-clear-variables to
mpd-before-variables-update-hook.
(mpd-disconnect): Remove it here.
(define-mpd-command): Improve docstring.
(mpd-state): New.  Returns the value of `**mpd-var-state*'.
(mpd-stopped-p, mpd-paused-p): Use it.
(mpd-volume): New. Returns the current volume as int.
(mpd-muted-p): New.  Return t when volume is zero.
(mpd-volume-up): Use #'mpd-volume, don't run any hooks.
(mpd-volume-down): Ditto.
(mpd-volume-mute): Define with `mpd-define-command' to have hooks
run.  Use #'mpd-volume.
(mpd-volume-min): Use #'mpd-volume, improve docstring.
(mpd-songpos): Prevent bytecompiler warnings.
(mpd-seek): Ditto.
(mpd-seek-forward, mpd-seek-backward): Add docstring.
(mpd-file): New. Return a mpd track filename.
(mpd-cover-file): New. Returns a possible coverart filename.
(mpd-has-cover-p): New.  Returns t when coverart exists
for the current track.
(mpd-scale-cover): New.  Scales coverart image.
(mpd-update-cover): Rewrite with #'mpd-file, #'mpd-cover-file,
#'mpd-has-cover-p, #'mpd-scale-cover
(mpd-clear-variables): New.  Sets Title, Artist, Album, Genre, and
Date variables to nil when they don't exist in the metainfo.
(mpd-info): Prevent bytecompiler warnings.  Allow space for
coverart in balloon when necessary.
(mpd-balloon-cover): New.  Inserts coverart into mpd balloon.
(balloon-help-display-help): Advised to insert coverart.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
4 years agoCover art code update
Steve Youngs [Thu, 15 Aug 2013 08:16:03 +0000 (18:16 +1000)] 
Cover art code update

* coverart:
  Improve cover art glyph updates.

4 years agoImprove cover art glyph updates.
Steve Youngs [Thu, 15 Aug 2013 08:15:34 +0000 (18:15 +1000)] 
Improve cover art glyph updates.

With this change the cover art glyph is only updated after the track
changes instead of every time the mpd-itimer fired.  So now it is once per
track as opposed to every 5 seconds.

* mpd.el (mpd-current-filename): New.  Track filename that is only
updated when the track changes, rather than every time the itimer
fires.

* mpd.el (mpd-update-cover): Test against `mpd-current-filename'
to only update cover art when the track changes instead of every
time the itimer fires.

* mpd.el (mpd-music-directory): Insert the conf file content into
a temp buffer instead of visiting it directly.  This avoids having
to explicitly close the buffer.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
4 years agompd update
Steve Youngs [Wed, 14 Aug 2013 01:46:32 +0000 (11:46 +1000)] 
mpd update

* coverart:
  Display album cover art in mpd.el's mpd-dock-frame

4 years agoDisplay album cover art in mpd.el's mpd-dock-frame
Steve Youngs [Wed, 14 Aug 2013 01:45:32 +0000 (11:45 +1000)] 
Display album cover art in mpd.el's mpd-dock-frame

Note that embedded album art is not currently supported so this changeset
comes with some limitations, notably...

o You need `cover.jpg' files present in the same directory as the
  audio file(s) it applies to.  So you're probably screwed if you
  don't sort your music by album.

o For the albums you don't have a cover art for you will need a
  placeholder image `~/.mpd/nocover.jpg' (48x48).

o Only jpeg images are supported at this time.

The balloon-help for the cover art glyph extent contains the track info
(title, artist, album, year, genre, filename).

This changeset also removes all of the lyrics code.

* mpd.el (mpd-conf-file): New.

* mpd.el (mpd-music-directory): New.

* mpd.el (mpd-cover-glyph): New.

* mpd.el (mpd-update-cover): New.

* mpd.el (mpd-update-variables): Use `mpd-update-cover'.

* mpd.el (mpd-dock-frame-plist): Change dimensions of the frame to
accomodate the extra room needed for the cover art glyph.

* mpd.el (mpd-new-frame): Don't insert the "[Song Info]" text
extent. Do insert cover art.

* mpd.el (mpd-dock-face): Removed.

* mpd.el (mpd-lyrics-*): All removed.

* README: Mention mpd.el.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
7 years agoEdit or delete old posts.
Steve Youngs [Thu, 30 Jun 2011 04:25:29 +0000 (14:25 +1000)] 
Edit or delete old posts.

This patchset adds the ability to edit (including delete) Livejournal
entries that have already been posted to Livejournal.

There are three caveats to this:

  1) For it to work, `lj-archive-posts' must be t (now the default).

  2) You can't edit/delete a post that wasn't originally posted from
     SXEmacs/LJ (that has the editing/deletion features)

  3) Post date/time cannot be altered.  You either get it right when
     you post the entry the first time, or you edit the date from the
     Livejournal site.

Yes, I know that is a little sucky, but hopefully that won't be the
case for long.  I am working on ways to eliminate at least the 2nd
caveat.

* lj.el (lj-post-proc-parser): Save the itemid as well.

* lj.el (lj-item-id): New.  Stores the itemid from the just posted
journal entry.

* lj.el (lj-archive-post): Put the itemid and permalink at the top
of the achived post.

* lj.el (lj-stringify-id): New.  Turns an itemid into a string.

* lj.el (lj-delete-post-internal): New.

* lj.el (lj-delete-post-proc-parser): New.

* lj.el (lj-header-regexp): Add X-LJ-URL, X-LJ-ItemID

* lj.el (lj-header-itemid): New face.

* lj.el (lj-header-url): New face.

* lj.el (lj-font-lock-keywords): Add X-LJ-URL and X-LJ-ItemID
headers.

* lj.el (lj-goto-x-lj-url): New.

* lj.el (lj-goto-x-lj-itemid): New.

* lj.el (lj-edit-old-post): New.

* lj.el (lj-construct-url): Update to allow for editing old posts.

* lj.el (lj-archive-post): Handle editing old posts.

* lj.el (lj-generate-new-buffer): Lose some whitespace being
injected into the created buffer.

* lj.el (lj-delete-old-post): New.

* lj.el (lj-archive-posts): Change default to t.

* lj.el (lj-version): Bump.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
7 years agoIncrease the limit on subject length.
Steve Youngs [Mon, 27 Jun 2011 05:44:20 +0000 (15:44 +1000)] 
Increase the limit on subject length.

Turns out that the limit on the maximum length of a subject header is 255
characters, not 100 as I first thought.

* lj.el (lj-check-limits): Subject limit is 255 chars, not 100

Signed-off-by: Steve Youngs <steve@sxemacs.org>
7 years agoWriter's Block fixes -- allow for signature.
Steve Youngs [Sun, 26 Jun 2011 04:19:42 +0000 (14:19 +1000)] 
Writer's Block fixes -- allow for signature.

* lj.el (lj-qotd-subject): Don't go to point-max in the post body
as there might be a signature that we should leave at the bottom.

* lj.el (lj-narrow-to-qotd): Recenter the qotd buffer after
selecting a qotd so #'shrink-window-if-larger-than-buffer will
work properly.
Also, insert qotd template at top of post body, not the bottom.

* lj.el (lj-qotd-quit): The lj-goto-* commands set point, so no
need to set it explicitly.

* lj.el (lj-writers-block): Ditto.
Also, allow for a signature being present and don't delete it if
it is.

* lj.el (lj-version): Bump.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
7 years agoMerge branch 'lj-limits'
Steve Youngs [Sat, 25 Jun 2011 10:10:53 +0000 (20:10 +1000)] 
Merge branch 'lj-limits'

7 years agoImpose size limits as per Livejournal API docs.
Steve Youngs [Sat, 25 Jun 2011 10:10:07 +0000 (20:10 +1000)] 
Impose size limits as per Livejournal API docs.

This patchset makes sure you don't exceed the limits on size that
Livejournal imposes on entries.

It also fixes a quick little bug to do with abbrevs... I kinda forgot
to turn them on.

* lj.el (lj-check-limits): New.  Livejournals puts limits on the
length of posts and the headers etc.  This ensures you don't
exceed them.

* lj.el (lj-post): Use it.

* lj.el (lj-mode): Turn on abbrev-mode.

* lj.el (lj-version): Bump.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
7 years agoMerge branch 'lj-new-stuff'
Steve Youngs [Sat, 25 Jun 2011 06:24:16 +0000 (16:24 +1000)] 
Merge branch 'lj-new-stuff'

7 years agoNew signature feature and self-promotion.
Steve Youngs [Sat, 25 Jun 2011 06:23:59 +0000 (16:23 +1000)] 
New signature feature and self-promotion.

This patchset brings some shameless self-promotion by adding a byline to
the bottom of a post: "Posted via: SXEmacs/LJ (version string)".  It is in
a fairly small font and out of the way so should be reasonably
inconspicuous, but you can turn it off if you want to with...

  (setq lj-self-promote nil)

There's a new user variable, `lj-signature', the value of which is
inserted at the bottom of the post buffer if it is non-nil.  It is
inserted verbatim, so making it pretty (HTML formatting) is up to the
user.

     * lj.el (lj-byline): New.  Nothing wrong with a bit of
self-advertising, I reckon. ;-)

     * lj.el (lj-self-promote): New.  When non-nil tell the world that
     you use sexy software.

     * lj.el (lj-post): Optionally add the byline.

     * lj.el (lj-preview): Include byline in preview.

     * lj.el (lj-validate): Ditto.

     * lj.el (lj-signature): New.  Lets you include a sig at the bottom
     of a post.

     * lj.el (lj-generate-new-buffer): Insert the signature if it is set.

     * lj.el (lj-version): Bump.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
7 years agoUpdate Writer's Block code to pre-fill Subject header.
Steve Youngs [Fri, 24 Jun 2011 06:28:19 +0000 (16:28 +1000)] 
Update Writer's Block code to pre-fill Subject header.

* lj.el (lj-parse-qotd-archive): Fix regexp.

* lj.el (lj-qotd-subject): New.  Pre-fills the Subject header with
the title of the Writer's Block question.

* lj.el (lj-narrow-to-qotd): Use it.

* lj.el (lj-version): Bump.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
7 years agoTweak the validation code a bit. Make it check for more problems
Steve Youngs [Fri, 24 Jun 2011 01:02:46 +0000 (11:02 +1000)] 
Tweak the validation code a bit.  Make it check for more problems

* lj.el (lj-validate-footer): Massage the validation command to
check for and warn about more things.

* lj.el: Add blurb about validating in commentary section.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
7 years agoFix an infinite loop, and disable twitter updates
Steve Youngs [Thu, 23 Jun 2011 07:36:48 +0000 (17:36 +1000)] 
Fix an infinite loop, and disable twitter updates

* lj.el (lj-get-cookies): Fix infinite loop when flavour is auto.

* lj.el (lj-post): Don't attempt to update Twitter.  It's broke.
Erm, I mean that SXEmacs/LJ twitter updating is broken, not that
Twitter itself is broken... at least not all the time. :-P

* lj.el (lj-version): Bump.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
7 years agoQuick doc fix
Steve Youngs [Tue, 21 Jun 2011 04:38:13 +0000 (14:38 +1000)] 
Quick doc fix

Signed-off-by: Steve Youngs <steve@sxemacs.org>
7 years agoAdd xz and lzma support to dired-tar.el
Steve Youngs [Tue, 21 Jun 2011 04:07:57 +0000 (14:07 +1000)] 
Add xz and lzma support to dired-tar.el

* dired-tar.el (dired-tar-compress-with): Add lzma and xz
  (dired-tar-lzma-extension): New.
  (dired-tar-xz-extension): New.
  (dired-tar-lzma-command): New.
  (dired-tar-xz-command): New.
  (dired-tar-unlzma-command): New.
  (dired-tar-unxz-command): New.
  (dired-tar-pack): Handle xz and lzma as well.
  (dired-tar-lzma-tarfile-regexp): New.
  (dired-tar-xz-tarfile-regexp): New.
  (dired-tar-unpack): Handle xz and lzma as well.
  (dired-tar-pack-unpack): Update doc string to
  mention xz and lzma.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
7 years agoInitial import from tla sources v1.0
Steve Youngs [Tue, 21 Jun 2011 03:17:42 +0000 (13:17 +1000)] 
Initial import from tla sources

Signed-off-by: Steve Youngs <steve@sxemacs.org>