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

Make fcitx.el in Chinese layer work by default. #10460

Closed
wants to merge 4 commits into from
Closed

Make fcitx.el in Chinese layer work by default. #10460

wants to merge 4 commits into from

Conversation

AmaiKinono
Copy link
Contributor

  • Make fcitx.el work by default. fcitx.el was not configured properly in original chinese layer.

  • Corrected README.org. It is dbus interface (not fcitx-remote) that is needed for linux.

(fcitx-default-setup)
(fcitx-prefix-keys-add "M-m" "C-M-m")
(if (eq system-type 'gnu/linux)
(setq fcitx-use-dbus t)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This option may lead to command lag on linux:

cute-jumper/fcitx.el#30

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. I made it an option by adding a layer variable. README.org is also updated.

(setq fcitx-active-evil-states '(insert emacs hybrid))
(fcitx-default-setup)
(fcitx-prefix-keys-add "M-m" "C-M-m")
(if chinese-fcitx-use-dbus
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When there's no else clause, then if should be changed to when.

@duianto
Copy link
Contributor

duianto commented Jun 9, 2019

Update request:

@AmaiKinono
Copy link
Contributor Author

@duianto Hi, thanks for the code review. The requests were done, but since it's been so long, and I am really not familiar with git, so please see if anything goes wrong.

@duianto
Copy link
Contributor

duianto commented Jun 11, 2019

It's fine if your not familiar with git, we can fix or suggest changes and try to help.

You'll learn more as you use git, I didn't know anything about it before starting to use Spacemacs a couple of years ago. If you haven't tried Magit I suggest you try it. It comes with the Spacemacs git layer and can be accessed with SPC g s. It's great.

I made these changes:

readme.org

Removed double space between =fcitx= and on your machine.
Added the between use and dbus.

Before:

It's recommended to use dbus interface to speed up a little:

After:

It's recommended to use the dbus interface to speed up a little:

Question 1:

What's being sped up? fcitx or the dbus interface?

If it's fcitx, then the sentence could read as:

It's recommended to use the dbus interface to speed up fcitx a little:

If it's the dbus interface, then it could say:

It's recommended to use the dbus interface to speed it up a little:

packages.el

Since :init only has one command, it can be moved inline with :init.

    :init (fcitx-evil-turn-on)

When :config (or :init) has multiple commands, then it's wrapped in a progn.
And the trailing parenthesis should be joined with the line above.
(An exception is at the top of the packages.el file where the packages are listed, that has the open and closing parentheses on their own lines.)

    :config
    (progn
      (setq fcitx-active-evil-states '(insert emacs hybrid))
      (fcitx-default-setup)
      (fcitx-prefix-keys-add "M-m" "C-M-m")
      (when chinese-fcitx-use-dbus
        (setq fcitx-use-dbus t)))))

We prefer one commit per PR, so the four commits were squashed into one with this commit message:

[chinese] Fix fcitx.el. And add a variable

Make fcitx.el work by default, it was not configured properly.

Added a layer variable to decide if dbus should be used or not:
chinese-fcitx-use-dbus
(default: nil)

Corrected README.org:
It's the dbus interface (not fcitx-remote) that is needed for linux.

Question 2:

Does the commit message match the meaning you had in mind?

I have these changes ready, but feel free to mention any changes/improvements you would like.

@AmaiKinono
Copy link
Contributor Author

What's being sped up? fcitx or the dbus interface?

It's fcitx.el that's being sped up. Setting fcitx-use-dbus makes fcitx.el use the functions with -dbus suffix, which should be faster in Linux.

Does the commit message match the meaning you had in mind?

Yes they do.

We prefer one commit per PR

I found that git rebase can squash multiple commits into one.Is the contributor suggested to do so?

I have these changes ready

Thanks a lot!

@duianto
Copy link
Contributor

duianto commented Jun 11, 2019

Thank you for contributing to Spacemacs!
The PR has been cherry-picked into the develop branch, you can safely delete your branch.
Commit: 5b7b5f2

@duianto duianto closed this Jun 11, 2019
@AmaiKinono AmaiKinono deleted the fix/make-fcitx-in-chinese-layer-work branch June 11, 2019 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants