For a long time I'd been using patches applied.
Emacs mac port formulae for the Homebrew package manager
Why I Switched to the NS Build
Over the past few years, though, I'd been feeling the following pain points.
- The Mac port hasn't kept up with the latest Emacs
- The current latest Emacs is 30.2, but the Mac port only supports 29.4
- With the latest railwaycat/homebrew-emacsmacport release, on my setup, so I'd been sticking with the previous .
As long as I could reproduce this behavior, I'd be able to switch to the standard NS build. This time, that finally happened.
By the way, NS stands for NeXTSTEP, which on macOS refers to the GUI build that uses Cocoa (AppKit).
I Found That sis Could Solve It
After looking into it, I found that / as the backend for switching input sources. It's by / via Homebrew.
CODE$ brew install --cask emacs-app
Configuring sis Solved It
Installing macism
I installed macism via Homebrew.
CODE$ brew install laishulu/homebrew/macism
macism can switch input sources from the command line on its own, like this.
CODE# Set the input source to "ABC"
$ macism com.apple.keylayout.ABC
# Set the input source to Google Japanese Input's "あ"
$ macism com.google.inputmethod.Japanese.base
Configuring sis
This is all I configured.
CODE;; When moving the cursor to the minibuffer, automatically switch to English mode,
;; and restore the Japanese input state after returning to the original buffer.
(sis-ism-lazyman-config
"com.apple.keylayout.ABC" ;; ABC
"com.google.inputmethod.Japanese.base") ;; Google Japanese Input
(sis-global-respect-mode 1)
;; Switch the cursor color to match the input mode.
(sis-global-cursor-color-mode 1)
sis-global-respect-modeswitches to English input when you move to the minibuffer withM-xand the like, and restores the Japanese input state when you return to the original buffer. This is exactly what I'd been doing with the Mac port build.
With that, sis solved it without any issues, and I successfully switched to the standard NS build.
Conclusion
I was able to switch from the Mac port build I'd used for years to the standard NS build. I'm glad I could solve the input source switching on
M-x, which was my one and biggest pain point.
Compared to the Mac port build, there's nothing in particular that feels inconvenient.
I can now keep up with the latest Emacs. Emacs 30 feels faster when it comes to networking. You can really tell when using
- . If you don't use evil, this hook never gets called and it won't work, so you'll need to add hooks that match your own workflow.
If
sis-global-respect-mode(switching to English onM-xand back) is enough for you, I don't think you need to force this one on.
Mixing English Words into Japanese with sis-global-inline-mode
sis also has
sis-global-inline-mode, which is handy when you want to mix English words into the middle of Japanese text.
CODE(sis-global-inline-mode 1)
For example, when you want to write
日本語 some english text 日本語, you just type日本語<space>some english text<space><RET>日本語. The moment you put a space right after the Japanese, it automatically switches to English input just for that spot (highlighted with an overlay), and a trailing space,RET, or moving the cursor outside the region returns you to Japanese input. There's no need to switch the IME manually.
By default, only "English within Japanese" is handled (
sis-inline-with-english). If you also want "Japanese within English," add(setq sis-inline-with-other t).
Whereas
sis-global-respect-mode/sis-global-context-modehandle "switching" the input source, this one creates a temporary English region on the spot — that's the difference.
I tried it for a day, but of course this behavior only applies inside Emacs, so character input behaves differently between Emacs and everything else. That subtle inconsistency was disorienting, so I stopped using it. Another reason is that even within Emacs, it didn't turn out to be all that intuitive.
↗ Original-Artikel auf dev.to lesenVollständiger Original-BerichtAusführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
SOCIAL SHARE CARD GENERATOR