Skip to content

Commit

Permalink
emacs: termux fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
SqrtMinusOne committed Jun 11, 2024
1 parent 409f378 commit 5a15695
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
12 changes: 9 additions & 3 deletions .emacs.d/init.el
Original file line number Diff line number Diff line change
Expand Up @@ -542,9 +542,11 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(interactive)
(if (derived-mode-p 'exwm-mode)
(my/run-in-background "xkb-switch -n")
(if (equal (string-trim
(shell-command-to-string "xkb-switch -p"))
"us")
(if (or
(not (executable-find "xkb-switch"))
(equal (string-trim
(shell-command-to-string "xkb-switch -p"))
"us"))
(toggle-input-method)
(my/run-in-background "xkb-switch -s us"))))

Expand Down Expand Up @@ -7192,6 +7194,10 @@ ENTRY is an instance of `elfeed-entry'."
:straight t
:defer t)

(unless (display-graphic-p)
(defun image-transforms-p () nil)
(setq image-types '(svg png gif tiff jpeg xpm xbm pbm)))

(defun my/mastodon-configure ()
(display-line-numbers-mode -1))

Expand Down
16 changes: 13 additions & 3 deletions Emacs.org
Original file line number Diff line number Diff line change
Expand Up @@ -978,9 +978,11 @@ I also want to call =xkb-switch= in EXWM buffers with the same keybindig.
(interactive)
(if (derived-mode-p 'exwm-mode)
(my/run-in-background "xkb-switch -n")
(if (equal (string-trim
(shell-command-to-string "xkb-switch -p"))
"us")
(if (or
(not (executable-find "xkb-switch"))
(equal (string-trim
(shell-command-to-string "xkb-switch -p"))
"us"))
(toggle-input-method)
(my/run-in-background "xkb-switch -s us"))))
#+end_src
Expand Down Expand Up @@ -9981,6 +9983,14 @@ The default UI is rather rough, but Nicolas Rougier's [[https://github.com/rougi
:straight t
:defer t)
#+end_src

Compatibility with termux.
#+begin_src emacs-lisp
(unless (display-graphic-p)
(defun image-transforms-p () nil)
(setq image-types '(svg png gif tiff jpeg xpm xbm pbm)))
#+end_src

**** UI and keymaps
=display-line-numbers-mode= screws the UI for some reason.

Expand Down

0 comments on commit 5a15695

Please sign in to comment.