-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
kotct/packup ui #84
kotct/packup ui #84
Conversation
This is a great start—thanks for your work so far on this, @samontea! 🎉 💯 Some off-hand notes from my initial evaluation, which aren't really criticisms of this work but more general ideas of where we can go from this:
I will do an actual code review shortly, but again, this looks pretty awesome. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good, just a couple of tweaks to be made I think.
.emacs.d/lisp/package/packup.el
Outdated
(defvar kotct/packup-marker-char ?x | ||
"In Packup, the current mark character. | ||
This is what the do-commands look for, and the flag the mark-commands store." | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move to previous line? I don't think we do this anywhere else.
.emacs.d/lisp/package/packup.el
Outdated
Returns \"\" if there is no package name on the line." | ||
(save-excursion | ||
(beginning-of-line) | ||
(let (p) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is p
? (Better name?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't feel like it's ambiguous, and i don't feel like it deserves a better name. it's just a variable that's like not used and assigned two lines below to be a point. ¯_(ツ)_/¯
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay so like would point
be better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure w/e
.emacs.d/lisp/package/packup.el
Outdated
(while next-position | ||
(goto-char next-position) | ||
(setq results (cons ,body results)) | ||
(message "hi") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove "hi"?
|
||
(defun kotct/packup-help () | ||
(interactive) | ||
(message "g-refresh m-mark u-unmark x-execute ?-help")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we're going to end up with a lot of commands bound. if we document everything in the help it's going to be insane. i think we should just let people run describe-bindings
. this is the way that dired
does things.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That works. Then bind ?
to describe-bindings
, maybe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uhm no that would be confusing to a new user. i think that we should do what dired
does. if a user wants the keybindings described they can just run C-h b
. we might investigate creating a control panel style help/command dialogue like magit
has, but that's future work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about adding U
and M
, besides? dired
still has a short help, and these would not be out of the scope of our short help.
.emacs.d/lisp/package/packup.el
Outdated
"Creates an interactive buffer to install/update packages." | ||
(interactive) | ||
(let ((old-buf (current-buffer)) | ||
(buffer (create-file-buffer "*packup*"))) ;; this is wrong... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, buffer has name packup
for me with no cool asterisks. We should figure out how. Here is list-packages
from package.el
in Emacs, which seems to use get-buffer-create
instead.
;;;###autoload
(defun list-packages (&optional no-fetch)
"Display a list of packages.
This first fetches the updated list of packages before
displaying, unless a prefix argument NO-FETCH is specified.
The list is displayed in a buffer named `*Packages*'."
(interactive "P")
(require 'finder-inf nil t)
;; Initialize the package system if necessary.
(unless package--initialized
(package-initialize t))
;; Integrate the package-menu with updating the archives.
(add-hook 'package--post-download-archives-hook
#'package-menu--post-refresh)
(add-hook 'package--post-download-archives-hook
#'package-menu--mark-or-notify-upgrades 'append)
;; Generate the Package Menu.
(let ((buf (get-buffer-create "*Packages*")))
(with-current-buffer buf
(package-menu-mode)
;; Fetch the remote list of packages.
(unless no-fetch (package-menu-refresh))
;; If we're not async, this would be redundant.
(when package-menu-async
(package-menu--generate nil t)))
;; The package menu buffer has keybindings. If the user types
;; `M-x list-packages', that suggests it should become current.
(switch-to-buffer buf)))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uhm you're straight tripping if you run M-x kotct/packup
it creates a buffer that is called *packup*
. i'm like sure of that
i used create-file-buffer
because it was what dired
uses. i agree i should have used get-buffer-create
. pushing that up now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On Emacs HEAD it doesn't have asterisks, then, or they aren't displayed properly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
¯_(ツ)_/¯
Re: points you brought up in your comment, but not your code review.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My only remaining problems are just a couple of leftovers from my previous review.
.emacs.d/lisp/package/packup.el
Outdated
@@ -47,7 +229,8 @@ If UPDATE is non-nil, out-of-date packages will be updated." | |||
(terpri) | |||
(princ (symbol-name (car package))) | |||
(princ (if (cdr package) " (update)" " (install)")))) | |||
(if (y-or-n-p "Auto install/update these package?") | |||
(if (or auto-update | |||
(y-or-n-p "Auto install/update these package?")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Auto install/update these package(s)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is part of existing code. Open an issue.
"Creates an interactive buffer to install/update packages." | ||
(interactive) | ||
(let ((old-buf (current-buffer)) | ||
(buffer (get-buffer-create "*packup*"))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, never mind. It's not. It seems to be a problem with the mode.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I revise this again. It's because you set mode-line-buffer-identification
to packup
that we get rid of the bolded name.
EDIT: Added additional review for this.
|
||
(defun kotct/packup-help () | ||
(interactive) | ||
(message "g-refresh m-mark u-unmark x-execute ?-help")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about adding U
and M
, besides? dired
still has a short help, and these would not be out of the scope of our short help.
.emacs.d/lisp/package/packup.el
Outdated
(setq major-mode 'packup-mode | ||
mode-name "Packup" | ||
buffer-read-only t ;; read only | ||
mode-line-buffer-identification "packup") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be removed? I like the default buffer ID, and it's less confusing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good enough to me now.
This is in accordance with our code style.
yooooooooo |
implemented
kotct/packup
from #66