defunkt / gist.el

Yet another Emacs paste mode, this one for Gist.
548 stars 90 forks source link

Show gist name in *github:gists* buffer #82

Closed xged closed 7 years ago

sigma commented 8 years ago

@xged not sure I understand the request. What exactly would you like shown that's not there?

itkach commented 8 years ago

Gists don't have "names", but they have files and files do have names. If gist description is omitted (which is quite often) you see something like this:

6b4fe43... 02/01/15 20:55       public 

which is not nearly as useful as something like

6b4fe43... mathjax-perf.org 02/01/15 20:55       public 

where mathjax-perf.org is the name of the single file in this gist. gists containing multiple files are trickier but any method to show them - truncated list, name of first file (maybe with total file count), full-list on a separate line - would still be a useful improvement.

itkach commented 8 years ago

Looks like Github's web UI uses name of the first added files as gist name

sigma commented 7 years ago

you can customize the display with something like

(setq gist-list-format
      '((id "Id" 10 nil identity)
        (created "Created" 20 nil "%D %R")
        (visibility "Visibility" 10 nil
         (lambda
             (public)
           (or
            (and public "public")
            "private")))
        (description "Description" 60 nil identity)
        (files "Files" 0 nil
         (lambda
             (files)
           (mapconcat 'identity files ", ")))))
kaushalmodi commented 7 years ago

Thanks @sigma.

Here's a variant of that.. At first I was confused why that gist-list-format value did not work.. Then I realized that that was because the Description column was too wide for my screen and so the Files column ended up being 'hidden'.

(setq gist-list-format
      '((created "Created" 15 nil "%D %R")
        (id "Id" 10 nil identity)
        (files "Files" 35 nil (lambda (files)
                                (mapconcat 'identity files ", ")))
        (visibility "Private" 8 nil (lambda (public)
                                      (or (and public "") "   Y")))
        (description "Description" 0 nil identity)))