Skip to content

Commit f2d0087

Browse files
committed
Fix: Emoji support
1 parent 9331731 commit f2d0087

File tree

2 files changed

+40
-25
lines changed

2 files changed

+40
-25
lines changed

Diff for: init.el

+16-1
Original file line numberDiff line numberDiff line change
@@ -902,6 +902,7 @@ The heading remains in view, and so appears in the TOC."
902902
;; and whether the local file is modified or not.
903903
(use-package magit
904904
:bind (("C-c M-g" . magit-file-dispatch))
905+
:config (global-set-key (kbd "C-x g") 'magit-status)
905906
:custom ;; Do not ask about this variable when cloning.
906907
(magit-clone-set-remote.pushDefault t))
907908
;; Intro:1 ends here
@@ -1144,6 +1145,20 @@ if REMOTE is https://github.com/X/Y then LOCAL becomes ∼/Y."
11441145
:defer nil
11451146
:hook (org-mode . org-bullets-mode))
11461147

1148+
(if (member "Apple Color Emoji" (font-family-list))
1149+
(set-fontset-font t 'unicode "Apple Color Emoji" nil 'prepend)
1150+
(message-box "Musa: Install the font!"))
1151+
;; E.g., Download font such as https://fonts.google.com/noto/specimen/Noto+Color+Emoji
1152+
;; Double-click on the ttf file then select “install” to have it installed on your system
1153+
;; (Note: Noto does not work on my personal machine.)
1154+
1155+
1156+
;; Render ASCII such as “ :-) ” as emoji 🙂.
1157+
(use-package emojify)
1158+
(setq emojify-display-style 'unicode) ;; unicode is the way to go!
1159+
(setq emojify-emoji-styles '(unicode))
1160+
(global-emojify-mode 1) ;; Will install missing images, if need be.
1161+
11471162
;; Silence the usual message: Get more info using the about page via C-h C-a.
11481163
(setq inhibit-startup-message t)
11491164

@@ -1167,7 +1182,7 @@ if REMOTE is https://github.com/X/Y then LOCAL becomes ∼/Y."
11671182
;; and cosmetics, then open my notes files.
11681183
(add-hook 'emacs-startup-hook
11691184
(lambda ()
1170-
(load "~/my-life.el")
1185+
(load-file "~/my-life.el")
11711186
(find-file "~/my-life.org")))
11721187

11731188
;; The modeline looks really nice with doom-themes, e.g., doom-solarised-light.

Diff for: init.org

+24-24
Original file line numberDiff line numberDiff line change
@@ -2928,28 +2928,8 @@ The libraries ~emojify~ and ~emojify-logos~ provides cool items like =:haskell:
29282928
:emacs: :org: :ruby: :python:=. Unfortunately they do not easily export to html
29292929
with org-mode, so I'm not using them.
29302930
:Alternatives:
2931-
#+BEGIN_SRC emacs-lisp
2932-
(use-package emojify)
29332931

29342932

2935-
2936-
(-let [font-for-emojis "Noto Color Emoji"]
2937-
(if (member font-for-emojis (font-family-list))
2938-
(set-fontset-font
2939-
t 'symbol (font-spec :family font-for-emojis) nil 'prepend)
2940-
(message-box "Musa: Install the font!")
2941-
;; Download font @ https://fonts.google.com/noto/specimen/Noto+Color+Emoji
2942-
;; Double-click on the ttf file then select “install” to have it installed on your system
2943-
))
2944-
(setq emojify-display-style 'unicode) ;; unicode is the way to go!
2945-
2946-
2947-
(setq emojify-emoji-styles '(unicode))
2948-
2949-
(global-emojify-mode 1) ;; Will install missing images, if need be.
2950-
2951-
#+END_SRC
2952-
29532933
(use-package emojify-logos
29542934
:after emojify)
29552935

@@ -4107,15 +4087,15 @@ git operations, such as ~git push~, [[https://webkul.com/blog/github-push-with-t
41074087
/instead/ of your password! Also: Install [[https://github.com/sindresorhus/refined-github][refined-github: Browser extension that
41084088
simplifies the GitHub interface and adds useful features]]!)
41094089

4110-
#+BEGIN_SRC emacs-lisp
4090+
#+begin_src emacs-lisp
41114091
;; Bottom of Emacs will show what branch you're on
41124092
;; and whether the local file is modified or not.
41134093
(use-package magit
41144094
:bind (("C-c M-g" . magit-file-dispatch))
4095+
:config (global-set-key (kbd "C-x g") 'magit-status)
41154096
:custom ;; Do not ask about this variable when cloning.
41164097
(magit-clone-set-remote.pushDefault t))
4117-
#+END_SRC
4118-
# :config (global-set-key (kbd "C-x g") 'magit-status)
4098+
#+end_src
41194099

41204100
Why use ~magit~ as the interface to the git version control system? In a ~magit~
41214101
buffer nearly everything can be acted upon: Press =return=, or =space=, to see
@@ -4912,6 +4892,26 @@ is found with ~M-x dired~ ---doc:dired.
49124892
:defer nil
49134893
:hook (org-mode . org-bullets-mode))
49144894
#+END_SRC
4895+
** Emojis
4896+
:PROPERTIES:
4897+
:CREATED: [2024-11-08 Fri 18:16]
4898+
:END:
4899+
4900+
#+begin_src emacs-lisp
4901+
(if (member "Apple Color Emoji" (font-family-list))
4902+
(set-fontset-font t 'unicode "Apple Color Emoji" nil 'prepend)
4903+
(message-box "Musa: Install the font!"))
4904+
;; E.g., Download font such as https://fonts.google.com/noto/specimen/Noto+Color+Emoji
4905+
;; Double-click on the ttf file then select “install” to have it installed on your system
4906+
;; (Note: Noto does not work on my personal machine.)
4907+
4908+
4909+
;; Render ASCII such as “ :-) ” as emoji 🙂.
4910+
(use-package emojify)
4911+
(setq emojify-display-style 'unicode) ;; unicode is the way to go!
4912+
(setq emojify-emoji-styles '(unicode))
4913+
(global-emojify-mode 1) ;; Will install missing images, if need be.
4914+
#+end_SRC
49154915

49164916
** Startup message: Emacs & Org versions
49174917
:PROPERTIES:
@@ -4968,7 +4968,7 @@ my to-do list and my init file, side-by-side.
49684968
;; and cosmetics, then open my notes files.
49694969
(add-hook 'emacs-startup-hook
49704970
(lambda ()
4971-
(load "~/my-life.el")
4971+
(load-file "~/my-life.el")
49724972
(find-file "~/my-life.org")))
49734973
#+END_SRC
49744974

0 commit comments

Comments
 (0)