Skip to content
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

Possible renaming of a function from "..-micro-state" to "..-transient-state" #6989

Closed
duianto opened this issue Sep 2, 2016 · 6 comments
Closed
Assignees
Labels
- Mailling list - Fixed in develop stale marked as a stale issue/pr (usually by a bot)

Comments

@duianto
Copy link
Collaborator

duianto commented Sep 2, 2016

I seem to remember reading that the name "micro state" is deprecated in favor of "transient state", if that's true, then the following function probably should be renamed:

https://github.com/syl20bnr/spacemacs/blob/develop/layers/%2Bspacemacs/spacemacs-completion/packages.el#L199

        ;; Since ido is implemented in a while loop where each
        ;; iteration setup a whole new minibuffer, we have to keep
        ;; track of any activated ido navigation transient-state and force
        ;; the reactivation at each iteration.
        (when spacemacs--ido-navigation-ms-enabled
          (spacemacs/ido-navigation-micro-state)))

https://github.com/syl20bnr/spacemacs/blob/develop/layers/%2Bspacemacs/spacemacs-completion/packages.el#L241

        ;; initiate transient-state
        (define-key ido-completion-map (kbd "M-SPC") 'spacemacs/ido-navigation-micro-state)
        (define-key ido-completion-map (kbd "s-M-SPC") 'spacemacs/ido-navigation-micro-state)
        )

The comments before each call to the "..-micro-state" function even says: "... keep track of any activated ido navigation transient-state ..." and "initiate transient-state", "transient-state" is also mentioned several times throughout the packages.el file.

System Info 💻

  • OS: windows-nt
  • Emacs: 24.5.1
  • Spacemacs: 0.105.22
  • Spacemacs branch: develop (rev. 3290c8a)
  • Graphic display: t
  • Distribution: spacemacs
  • Editing style: vim
  • Completion: helm
  • Layers:
(helm emacs-lisp git)
@TheBB TheBB self-assigned this Sep 2, 2016
@TheBB
Copy link
Collaborator

TheBB commented Sep 2, 2016

#6996

Can you check that I got everything?

@duianto
Copy link
Collaborator Author

duianto commented Sep 2, 2016

I missed that ..-ms-.. also is referring to micro state.
I checked the current version of the file again:
https://github.com/syl20bnr/spacemacs/blob/3290c8a94f5044f66dd7be1d2bc089043d57da6a/layers/%2Bspacemacs/spacemacs-completion/packages.el

I compared every occurrence of -ms- and -micro- i found to your changes, there are 19 occurrences of ..-ms-.. and 3 of ..-micro-.., it's the same number of times you changed ..-ms-.. to ..-ts-.. and ..-micro-.. to ..-transient-.., so it seems like you got everything.

@TheBB
Copy link
Collaborator

TheBB commented Sep 2, 2016

That's good but I was more interested in you trying it out and see that it's still working as it used to.

@duianto
Copy link
Collaborator Author

duianto commented Sep 2, 2016

I haven't used ido navigation, i just noticed the micro/transient issue when i was looking into some other transient state issues. Someone with at least some experience with ido, probably should test it.
But i can try it later and see if there's a difference or if something breaks.

@duianto
Copy link
Collaborator Author

duianto commented Sep 3, 2016

Summary

Currently the ido micro state keybinding M-SPC doesn't work, after renaming ms and micro to ts and transient then the keybinding starts working again.

There's another issue with the ido micro/transient state, but it's present both before and after correcting the renaming issue. The ido micro/transient state doesn't show the keys that are bound, it only shows the title, an empty row and the bottom row that states if a [KEY] does or does not exit. The bound keys work so it's just an issue with the keys not being visible.

ido transient state missing keys

On line 243 the s-M-SPC keybinding probably should be renamed to an uppercase "S" since it's a modifier key, resulting in S-M-SPC.

After changing the lowercase letter to uppercase, then the PR can probably be applied. After renaming then the ido Transient State opens with both M-SPC and S-M-SPC while these ido "states/modes" are active:
C-x b (ido-switch-buffer)
C-x C-f (ido-find-file)
C-x d (ido-dired)
C-x C-d (ido-list-directory)
C-x C-v (ido-find-alternate-file)

More details

With the completion set to: Ivy, and ido-mode enabled.
When one tries to open the micro state with the keybinding M-SPC from a C-x b (ido-switch-buffer), then the minibuffer shows: Symbol's function definition is void: spacemacs/ido-navigation-micro-state.

The function name seems to already have been renamed. When one tries to search for it at the M-x prompt, then "ido micro" finds nothing, but "ido transient" finds 13 results, one of which is: spacemacs/ido-navigation-transient-state/body.

When that command is started, then only the transient state title "ido Transient State" and the last row: "[KEY] exits state [KEY] will not exit" are shown with an empty line between them. None of the keys are shown, even though they are active. When the "j" or "k" key is pressed then the minibuffer shows: (void-variable ido-cur-list), and "q" closes the TS.

After exchanging the current -ms- and -micro- version of the .../spacemacs-completion/packages.el file with PR version with the -ts- and -transient- changes, now the keybinding: M-SPC at the C-x b (ido-switch-buffer) opens the ido Transient State panel, instead of showing the "Symbol's function definition is void..." message, but the transient state keys aren't shown here either, even though they still are active.

Possible reason for the symbol's void message:
At the ido-switch-buffer, when the spacemacs root which-key popup is opened and the counsel-desbinds is opened, and the pattern: "M-SPC" is searched for, then it only finds the keybinding: C-M-SPC mark-sexp
This is the keyboard commands to perform the steps above:
C-x b M-m ? (type the following:) M-SPC

After changing ms and micro to ts and transient, then if one searches for the keybinding: "M-SPC" while the ido-switch-buffer is open, then M-SPC is is found and it runs this command:
spacemacs/ido-navigation-transient-state/body

On line 243:
(define-key ido-completion-map (kbd "s-M-SPC") 'spacemacs/ido-navigation-transient-state/body)
the "s" is lowercase, but modifier keys seem to be written with uppercase letters, so maybe the "s" should be changed to an uppercase "S".

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!

@github-actions github-actions bot added the stale marked as a stale issue/pr (usually by a bot) label Feb 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- Mailling list - Fixed in develop stale marked as a stale issue/pr (usually by a bot)
Projects
Mailing list
  
Pending merge
Development

No branches or pull requests

2 participants