-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
evil-unimpaired: Switch from normal state to motion state #11787
Conversation
This change will make buffers with the motion state (e.g., help and spacemacs homepage) be able to use the keybindings. Note that the normal state will inherit the motion state map anyway, so there's no need to set the normal state map separately.
I'm not seeing any change when I apply this PR as a patch. In the Spacemacs home buffer
The help buffer also calls the previous commands: I use the current help bindings to navigate between help pages, but I see that It's better to have consistent key bindings where ever possible. System Info 💻
(autohotkey helm auto-completion emacs-lisp git github multiple-cursors org spell-checking themes-megapack treemacs version-control)
|
@duianto are you sure you applied the patch correctly? Here's a GIF showing before and after I apply the patch. It seems to work as I expect. |
The bindings are not being applied automatically on startup for me. When I select them and evaluate region Both buffers are in motion state.
Applying a PR as a patchThis is how I'm applying all patches before testing and pushing them to the develop branch. I have these functions/bindings for downloading a PR as a .patch: (defun open-changelog-develop ()
(interactive)
(find-file "~/.emacs.d/CHANGELOG.develop"))
(defvar github-pr-patch-dir nil)
;; Ubuntu directory
;; (setq github-pr-patch-dir "~/projects/spacemacs/prs/")
;; Windows 10 directory
(setq github-pr-patch-dir "C:\\Users\\username\\projects\\spacemacs\\prs\\")
(defun open-github-pr-patch-dir ()
(interactive)
(let ((dir (or github-pr-patch-dir
(read-file-name "Open dir: "))))
(dired dir)))
;; Ask for a Spacemacs PR number, and download the PR as a .patch
;; TODO add an option to apply the PR to either:
;; the current branch, ask if the branch isn't develop,
;; or apply it to a new branch with the name of the PR number
(defun save-github-pr-to-patch-file ()
"Ask for the PR number of a Spacemacs PR on github,
either ask for a location where the PRs patch file should be stored,
or save directly to the `github-pr-patch-dir' location if it's set."
(interactive)
(let* (;; (url (read-string "Github PR URL: "))
;; (pr-nr (substring url (1+ (string-match "/[[:digit:]]*$" url))))
(pr-url-prefix "https://github.com/syl20bnr/spacemacs/pull/")
(pr-nr (read-string "Github Spacemacs PR nr: "))
(patch-suffix ".patch")
;; (filename (concat pr-nr patch-suffix))
(dir (or github-pr-patch-dir
(read-file-name "Save PR patch file in: ")))
;; (full-file-path (concat dir filename)))
(filename (concat pr-url-prefix pr-nr patch-suffix))
(full-file-path (concat dir pr-nr patch-suffix)))
;; (url-copy-file (concat url patch-suffix) full-file-path)))
;; (message "%s %s" filename full-file-path)
(url-copy-file filename full-file-path 'replace)))
(spacemacs/declare-prefix " op" "PRs")
(spacemacs/set-leader-keys
"opc" 'open-changelog-develop
"opd" 'open-github-pr-patch-dir
"ops" 'save-github-pr-to-patch-file) When the patch has been downloaded, then I open the spacemacs And apply the patch with |
Oh, the help doesn't work for me as well because
I guess one way to put it is that this PR focuses on only mode maps that don't override |
The evil-unimpaired bindings don't seem to be loaded on startup. I added:
before the comment: spacemacs/layers/+spacemacs/spacemacs-evil/local/evil-unimpaired/evil-unimpaired.el Line 83 in 6f34185
But the message doesn't appear in the messages buffer on startup. This seems to be where the package is called: spacemacs/layers/+spacemacs/spacemacs-evil/packages.el Lines 337 to 339 in 6f34185
The comment says that they should be available right away, but it doesn't seem to happen. If I add:
in |
I think I found the issue, there's also an But the PR changes the local version: Adding a message in the elpa dir version shows it in the messages buffer, so that's where the bindings are loaded from. |
Do you want to update the PR to support the other modes? Or should we apply it as is for now? |
I'd rather be conservative, so I think we should apply as it is. |
Since they keys don't work in the help buffer, the commit message need to be updated. And it might be helpful to mention I made a possible rewrite below, with these changes:
Before
After
Changelog.developWe have also started suggesting that PR authors add an entry in the A possible entry for this PR could be:
in the section:
Would you like to make any changes or are the suggestions acceptable? |
Is it possible to change a commit message? (I guess I can force push, but I'm not sure if that's a good idea). But yes, all of these look good to me. |
I can make the changes before pushing. |
Please make the changes then! Thanks again :) |
Thank you for contributing to Spacemacs!
It's fine to force push to a PR, as long as you don't change your forks branch name. A PR can be changed by a collaborator like this: When it's downloaded it can be applied it to the current Spacemacs branch in Magit with Then any necessary modifications can be made and added to the commit with: |
This change will make buffers with the motion state
(e.g., spacemacs homepage) be able to use the
keybindings. Note that the normal state will inherit
the motion state map anyway, so there's no need to set
the normal state map separately.