Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/junjiemars/.emacs.d

Nore Emacs on MacOS, Windows and Linux
https://github.com/junjiemars/.emacs.d

c cdb chez-scheme common-lisp darwin elisp gambit-c linux lldb nodejs scheme sockets virtualenv windows

Last synced: 3 months ago
JSON representation

Nore Emacs on MacOS, Windows and Linux

Awesome Lists containing this project

README

        

#+TITLE: Nore Emacs
#+AUTHOR: Junjie Mars
#+STARTUP: overview
#+OPTIONS: num:nil toc:nil
#+REVEAL_HLEVEL: 2
#+REVEAL_SLIDE_NUMBER: h
#+REVEAL_THEME: moon
#+BEGIN_COMMENT
#+REVEAL_TRANS: cube
#+REVEAL_MARGIN: 0.1
#+REVEAL_MIN_SCALE: 0.2
#+REVEAL_MAX_SCALE: 1.5
#+END_COMMENT
#+PROPERTY: header-args :exports code
#+HTML_HEAD:

@@html:Darwin, Linux and Windows@@

* Quick start
:PROPERTIES:
:CUSTOM_ID: quick-start
:END:

#+ATTR_HTML: :style text-align:left
It works on Emacs version 22.1.1+ , provides more reasonable styles:
more organized code, more consistent, more cleaner and more
faster. You can run it on any environment Emacs itself runs on: GUI or
Terminal, even you can run multiple Emacs instances with different
version on the same machine at the same time.

#+REVEAL: split

- clone Nore Emacs from [[https://github.com/junjiemars/.emacs.d][github]]
#+BEGIN_SRC sh
git clone --depth=1 https://github.com/junjiemars/.emacs.d.git ~/.emacs.d
#+END_SRC

- open Emacs, after Emacs compile all elisp files, then reopen Emacs
- want more functionalities see [[#recipe][Recipe]] section

#+ATTR_HTML: :style text-align:left
Additionally, it is important to remind you to take care as it is
exceptionally fast.

#+ATTR_HTML: :style display:none
- [[#story][Story]]
- [[#recipe][Recipe]]
- [[#programming][Programming]]
- [[#troubleshoting][Troubleshoting]]
- [[#mnemonic][Mnemonic]]

* Story
:PROPERTIES:
:CUSTOM_ID: story
:END:

#+ATTR_HTML: :style text-align:left
Emacs is the most powerful editor in the world there is no *one of*.
It's programmable, elegant and /self-documenting/.

#+REVEAL: split
#+ATTR_HTML: :style text-align:left
As my daily work increasingly revolves around Emacs, I realize it's
time to integrate Emacs into my very being - not just for opening,
navigating, editing, and saving files. Inspired by Euclid's approach
to geometry, I have created Nore Emacs.

#+REVEAL: split
#+ATTR_HTML: :style text-align:left
Nore Emacs aims to provide a seamless experience with its focus on
consistency, speed, stability, and hackability. It ensures consistent
behavior across all platforms where Emacs is supported.

#+ATTR_HTML: :style display:none
- [[#principles][Principles]]
- [[#requirements][Requirements]]
- [[#where][Where]]
- [[#what][What]]
- [[#install][Install]]
- [[#organization][Organization]]

#+REVEAL: split
#+ATTR_HTML: :style text-align:left
Now, let's begin at Level Two. The key thing to remember is to
familiarize yourself with some basic Elisp. You can start by using the
Emacs built-in help system (@@html:@@C-h i m
Elisp@@html:
@@) and navigate to the Elisp documentation.

** Principles
:PROPERTIES:
:CUSTOM_ID: principles
:END:

- *Adaptive*: Nore Emacs is designed to run on any operating system,
whether it's a graphical or terminal interface. It is compatible
with both the latest Emacs versions and even older
ones. Furthermore, you can use a single Emacs configuration for
multiple coexisting Emacs instances on the same machine

- *Consistent*: Regardless of the environment or time, Nore Emacs
always maintains consistent behavior. You can rely on a seamless
experience no matter where or when you use it.

- *Minimalism*: Nore Emacs promotes a minimalist approach, both
internally and externally. It only loads the necessary components
based on your specific needs, ensuring efficiency and avoiding
unnecessary clutter.

** Requirements
:PROPERTIES:
:CUSTOM_ID: requirements
:END:

- Emacs [22.1,29.1]
- Keyboard+

** Where
:PROPERTIES:
:CUSTOM_ID: where
:END:

- Linux, whatever GUI or TUI
- Darwin, whatever GUI or TUI
- Windows, whatever GUI or TUI
- Raspberry Pi and Docker container, etc.,
- Network or without Network
- One machine, multiple Emacs instances

** What
:PROPERTIES:
:CUSTOM_ID: what
:END:

- You are the master of your Emacs, ...
- Navigating, finding, grepping in the same way wherever, ...
- Org Mode that's your new life, ...
- Amazing programming experiments, C, Lisp, ...
- It's a no-cost extension and git friendly infrastructure.

** Install
:PROPERTIES:
:CUSTOM_ID: install
:END:

#+ATTR_HTML: :style text-align:left
Just one thing you need to do, clone it (just <1024KiB) to your =HOME=
directory:

#+BEGIN_SRC sh
git clone --depth=1 https://github.com/junjiemars/.emacs.d.git ~/.emacs.d
#+END_SRC

#+REVEAL: split
#+ATTR_HTML: :style text-align:left
First run Nore Emacs, it should automatically do:
- byte/native compile elisp source files.
- install packages, if you allow it.

#+ATTR_HTML: :style text-align:left
After first run Nore Emacs, exit and then /reopen/ Emacs.

#+REVEAL: split
#+ATTR_HTML: :style text-align:left
On Windows, if you'd [[https://git-scm.com/downloads][Git-Bash]] installed but no Emacs, you are lucky, a
one line code will do it all for you and more: fix some Emacs' issue
for you, and you don't need run src_shell{git clone ...},

instead,

#+BEGIN_SRC sh
HAS_EMACS=1 bash <(curl https://raw.githubusercontent.com/junjiemars/kit/master/win/install-win-kits.sh)
#+END_SRC

#+ATTR_HTML: :style text-align:left
Now, it will works perfectly, but if you want to more control and more
features, such as themes, packages, and fonts etc., see next section:
[[#recipe][recipe]]

** Organization
:PROPERTIES:
:CUSTOM_ID: organization
:END:

#+ATTR_HTML: :style text-align:left
Signify your Emacs HOME as =(emacs-home*)=.

#+ATTR_HTML: :style text-align:left
Your private configuration directory at =(emacs-home* "private/")=.
All things under it you can rename, move, delete.

#+ATTR_HTML: :style text-align:left
All Elisp files should be compiled, if you meet some trouble, a magic
interactive function =(clean-compiled-files)= should help,
run it and reopen the Emacs.

*** Directory

#+BEGIN_EXAMPLE
(emacs-home*)
├── LICENSE
├── README.org
├── config (comment "all stuff here")
├── elpa (comment "installed packages")
├── init.el (comment "Emacs init file")
├── private (comment "your configuration can put here")
│ ├── self-env-spec.el
│ ├── self-mod-spec.el
│ ├── self-epilogue.el
└── theme (comment "themes directory")
#+END_EXAMPLE

#+REVEAL: split
#+ATTR_HTML: :style text-align:left
Locate your spec via =(*self-paths*)=.

#+BEGIN_SRC emacs-lisp
;; Run order: :env-spec -> :mod-spec -> :epilogue
;; You can point to your Gited Emacs' configuration repo.
;; Default samples `sample-self-*.el' in `(emacs-home* "config/")' directory.
;; :epilogue run in `after-init-hook'

(*self-paths* :put :mod-spec
(comment (emacs-home* "private/self-mod-spec.el")))
(*self-paths* :put :epilogue
(comment (emacs-home* "private/self-epilogue.el")))
#+END_SRC

#+REVEAL: split
#+ATTR_HTML: :style text-align:left
Directories with =.= /prefix/ are for the modules that need store
configuration or cached files.

#+BEGIN_EXAMPLE
(emacs-home*)
├── .backup
├── .bookmarks
├── .desktop
├── .dired
├── .eshell
├── .exec (comment "exec-path")
├── .ido
├── .mail
├── .save
├── .tags
├── .tramp
└── (comment "more ...")

#+END_EXAMPLE

*** Naming

#+REVAL: split
#+ATTR_HTML: :style text-align:left
Introduce the rules of naming /files/ and /functions/.

#+REVEAL: split
**** Core Files Naming: single word and simple name.

#+BEGIN_EXAMPLE
(emacs-home* "config/")
├── autoloads.el
├── boot.el
├── chez.el
├── dict.el
├── fn.el
├── gambit.el
├── graphic.el
├── gud-cdb.el
├── gud-lldb.el
├── memo.el
├── sodoku.el
└── (comment "more ...")
#+END_EXAMPLE

#+REVEAL: split
**** Extension Naming

#+REVEAL: split
- /extension/ for Emacs builtin packages: =s.el=
#+BEGIN_EXAMPLE
(emacs-home* "config/")
├── cc.el
├── guds.el
├── shells.el
├── modules.el
├── sockets.el
├── tags.el
└── (comment "more ...")
#+END_EXAMPLE

#+REVEAL: split
- /autoload extension/ for Emacs builtin packages:
=.el=
=on--autoload.el=
#+BEGIN_EXAMPLE
(emacs-home* "config/")
├── on-cc-autoload.el
├── on-compile-autoload.el
├── on-dired-autoload.el
├── on-docview-autoload.el
├── on-edit-autoload.el
├── on-eglot-autoload.el
├── on-trans-autoload.el
├── on-shell-autoload.el
├── on-eww-autoload.el
├── on-font-autoload.el
└── (comment "more ...")
#+END_EXAMPLE

#+REVEAL: split
- /extension/ for /non/ Emacs builtin packages:
=use-.el=
=use--autoload.el=
#+BEGIN_EXAMPLE
(emacs-home* "config/")
├── use-geiser-autoload.el
├── use-magit-autoload.el
├── use-slime-autoload.el
└── (comment "more ...")
#+END_EXAMPLE

#+REVEAL: split
**** Sample Files Naming: =sample-self-*.el=

#+BEGIN_EXAMPLE
(emacs-home* "config/")
├── sample-self-env-spec.el
├── sample-self-mod-spec.el
└── sample-self-epilogue.el
#+END_EXAMPLE

#+REVEAL: split
**** Functions Naming (χ denotes name)

#+REVEAL: split
- =v-χ= macro =x= for processing Versioned directories or files, such
as =v-home=
- =_χ_= macro =x= only existing at compile-time, such as
=_mark_thing@_=
- =χ​*= or =χ**= is the extension of Emacs' builtin function or macro
=x=, such as =every*= and =assoc**=
- =χ*-y= is the extension of function =y= of feature =x=, such as
=vc*-dir=
- =χ%= macro =x= will be expanded at compile time, such as =if%=
- =χ!= function or macro =x= has side-effects, such as =v-home!=
- =χ@= positional functions, such as =mark-word@= and =mark-sexp@=

* Recipe
:PROPERTIES:
:CUSTOM_ID: recipe
:END:

#+ATTR_HTML: :style display:none
- [[#theme][Theme]]
- [[#frame][Frame]]
- [[#recipe-shell][Shell]]
- [[#session][Session]]
- [[#network][Network]]
- [[#package][Package]]
- [[#indent][Indent]]
- [[#file][File]]
- [[#editing][Editing]]
- [[#keys][Keys]]

** Theme
:PROPERTIES:
:CUSTOM_ID: theme
:END:

#+ATTR_HTML: :style text-align:left
Easy to switch themes, or try a new one.

#+ATTR_HTML: :style text-align:left
The =theme='s spec locate in =(*self-env-spec* :get :theme :custom-theme-directory)=.

#+REVEAL: split
#+BEGIN_SRC emacs-lisp
(*self-env-spec*
:put :theme
(list :name nil ; 'tango-dark
:custom-theme-directory nil ; (emacs-home* "theme/")
:compile nil ; expert option
:allowed nil))
#+END_SRC

#+REVEAL: split
- =:name= name of theme, does not need /-theme.el/ suffix
- =:custom-theme-directory= where custom theme files located
- =:compile= =t= compile theme, compiled theme more smooth and more
faster if you had already confirmed the theme is secure.
- =:allowed= =t= enabled, =nil= disabled

#+ATTR_HTML: :style display:none
/screenshots/:
#+ATTR_HTML: :style display:none
- [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/default-theme-on-windows.png][default theme]]
- [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/dracula-theme-on-windows.png][dracula theme]]
- [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/tango-dark-theme-on-windows.png][tango-dark theme]]

** Frame
:PROPERTIES:
:CUSTOM_ID: frame
:END:

#+ATTR_HTML: :style text-align:left
The =frame='s spec locate in =(*self-env-spec* :get :frame)= and for
GUI mode only.

#+REVEAL: split
#+BEGIN_SRC emacs-lisp
(*self-env-spec*
:put :frame
(list :initial `((width . 80)
(height . 32)
(font . ,(if-platform% 'darwin
"Monaco-17"
(if-platform% 'windows-nt
"Consolas-13"
"Monaco-13"))))
:default nil ; `((fullscreen . fullheight))
:inhibit-splash-screen nil
:allowed t))
#+END_SRC

#+REVEAL: split
- =:initial= =initial-frame-alist=
- =:inhibit-splash-screen= =inhibit-splash-screen=
- =:allowed= =t= enabled, =nil= disabled

** Glyph
:PROPERTIES:
:CUSTOM_ID: Glyph
:END:

#+ATTR_HTML: :style text-align:left
The =glyph='s spec locate in =(*self-env-spec* :get :glyph)= and for
GUI mode only. It determines the appearance of =glyph= characters such
as [[https://en.wikipedia.org/wiki/CJK_characters][CJK]], etc., the default encoding of =glyph= is [[https://en.wikipedia.org/wiki/UTF-8][UTF-8]].

#+REVEAL: split
#+BEGIN_SRC emacs-lisp
(*self-env-spec*
:put :glyph
`((:name ,(if-platform% 'darwin
"Hack"
(if-platform% 'windows-nt
"Courier New"
"DejaVu Sans Mono"))
:size 17
:scale nil
:scripts (greek)
:allowed t)
(:name ,(if-platform% 'darwin
"PingFang"
(if-platform% 'windows-nt
"Microsoft YaHei"
"Noto Sans"))
:size 12
:scale nil
:scripts (han)
:allowed nil)))
#+END_SRC

#+REVEAL: split
- =:name= string of font name
- =:size= integer of font size
- =:scale= =t= scaled, =nil= disabled
- =:scripts= list of script symbol for character
- =:allowed= =t= enabled, =nil= disabled

#+ATTR_HTML: :style display:none
/screenshots/:
#+ATTR_HTML: :style display:none
- [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/cjk-font-on-darwin.png][glyph font: CJK]]
- [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/monaco-font-on-darwin.png][Monaco font]]
- [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/consolas-font-on-windows.png][Consolas font]]

** Shell
:PROPERTIES:
:CUSTOM_ID: recipe-shell
:END:

*** shell

#+ATTR_HTML: :style text-align:left
Suppport any =SHELL=, copying or spinning environment variables into
Emacs environment.

#+ATTR_HTML: :style text-align:left
The shell spec locate in =(*self-env-spec* :get :shell)=.

#+REVEAL: split
#+BEGIN_SRC emacs-lisp
(*self-env-spec*
:put :shell
(list :copy-vars `("PATH")
:spin-vars nil ; `(("ZZZ" . "123"))
:options '("-i" "2>/dev/null") ; '("--login")
:exec-path t
:shell-file-name (or (executable-find% "zsh")
(executable-find% "bash"))
:prompt (list :zsh "%n@%m %1~ %# "
:bash "\\u@\\h \\W \\$ ")
:allowed nil))
#+END_SRC

#+REVEAL: split
- =:copy-vars= copy environment variables from shell into Emacs
environment, that affects =eshell=, =shell= and =ansi-term=
- =:spin-vars= spin customized variables, only affects =eshell=
- =:options= a list of shell's options
- =:exec-path= copy =PATH= environment variable to =exec-path=
#+REVEAL: split
- =:shell-file-name= where the shell program located
- =:prompt= unify shell prompt in =term= mode, via @@html:@@C-c
C-j@@html:
@@ then @@html:@@M-x
term-unify-shell-prompt@@html:
@@
- =:allowed= =t= allowed, =nil= disabled

*** eshell
:PROPERTIES:
:CUSTOM_ID: eshell
:END:

#+ATTR_HTML: :style text-align:left
The =eshell= spec locate in =(*self-env-spec* :get :eshell)=. And
shared the copied environment variables =:copy-vars= with shell.

#+REVEAL: splitV
#+BEGIN_SRC emacs-lisp
(*self-env-spec*
:put :eshell
(list :visual-commands '("mtr")
:destroy-buffer-when-process-dies nil
:visual-subcommands nil ; '(("git" "log"))
:visual-options nil
:allowed t))
#+END_SRC

#+REVEAL: split
- =:visual-commands= @@html:@@C-h-v eshell-visual-commands@@html:@@
- =:destroy-buffer-when-process-dies= @@html:@@C-h-v eshell-destroy-buffer-when-process-dies@@html:@@
- =:visual-subcommands= @@html:@@C-h-v eshell-visual-subcommands@@html:@@
- =:visual-options= @@html:@@C-h-v eshell-visual-options@@html:@@
- =:allowed= =t= allowed, =nil= disabled

** Session
:PROPERTIES:
:CUSTOM_ID: session
:END:

#+ATTR_HTML: :style text-align:left
The =desktop= spec locate in =(*self-env-spec* :get :desktop)=.

#+REVEAL: split
#+BEGIN_SRC emacs-lisp
(*self-env-spec*
:put :desktop
(list :files-not-to-save
"\\.t?gz$\\|\\.zip$\\|\.desktop\\|~$\\|^/sudo:\\|^/ssh[x]?:$"
:buffers-not-to-save "^TAGS\\|\\.log"
:modes-not-to-save
'(dired-mode fundamental-mode eww-mode rmail-mode)
:allowed t))
#+END_SRC

#+REVEAL: split
- =:files-not-to-save= @@html:@@C-h-v desktop-files-not-to-save@@html:@@
- =:buffers-not-to-save= @@html:@@C-h-v desktop-buffers-not-to-save@@html:@@
- =:modes-not-to-save= @@html:@@C-h-v desktop-modes-not-to-save@@html:@@
- =:allowed= =t= enabled, =nil= disabled

** Network
:PROPERTIES:
:CUSTOM_ID: network
:END:

*** Socks

#+ATTR_HTML: :style text-align:left
Using socks proxy when installing packages or browsing web pages.

#+ATTR_HTML: :style text-align:left
The =socks= spec locate in =(*self-env-spec* :get :socks)=.

#+REVEAL: split
#+BEGIN_SRC emacs-lisp
(*self-env-spec*
:put :socks
(list :port 32000
:server "127.0.0.1"
:version 5
:allowed nil))
#+END_SRC

#+REVEAL: split
- =:port= the port of socks proxy server
- =:server= the address of socks proxy server
- =:version= socks version
- =:allowed= =t= enabled, =nil= disabled

#+ATTR_HTML: :style text-align:left
If =:allowed t=, =url-gateway-method= should be switch to =socks= when
Emacs initializing. After Emacs initialization, you can =toggle-socks!=
and no matter =:allowed= is =t= or =nil=.

*** Network Utils

#+ATTR_HTML: :style text-align:left
Emacs comes with a lots of wrappers(=net-utils.el=) around the common
network utilities. Such as @@html:@@M-x ping@@html:@@ a
host. But =net-utils.el= has some inconveniences:

#+REVEAL: split
- If you want to =ping= with options you must set
=ping-program-options= customizable variable.
- IPv6 supporting: on Unix-like OS there are individual program for
IPv6, such as =ping6=, but on Windows OS just one =ping= program and
with =-6= option.

#+ATTR_HTML: :style text-align:left I'd refined common interative
commands around =net-utils=, and named those commands with =*= prefix.
Using @@html:@@C-u M-x *@@html:@@ you can set the
options for that .

#+REVEAL: split
#+ATTR_HTML: :style text-align:left
The following interactive commands had been defined for Emacs22.1+
whatever OS you using:
- @@html:@@M-x *arp@@html:@@
- @@html:@@M-x *dig@@html:@@
- @@html:@@M-x *ifconfig@@html:@@
- @@html:@@M-x *ping@@html:@@
- @@html:@@M-x *traceroute@@html:@@

*** Browser
:PROPERTIES:
:CUSTOM_ID: browser
:END:

- toggle external or internal browser: @@html:@@M-x
toggle-browser!@@html:@@
- lookup web for symbol, word, etc.,: @@html:@@M-s
w@@html:@@
- lookup online dictionaries: @@html:@@M-s d@@html:@@

** Package
:PROPERTIES:
:CUSTOM_ID: package
:END:

#+ATTR_HTML: :style text-align:left
It's file-oriented, you can find more simpler and faster way to
implement almost functionalities that =use-pacakge= does and more.

#+REVEAL: split
#+BEGIN_SRC emacs-lisp
(*self-env-spec*
:put :module
(list :remove-unused nil
:package-check-signature 'allow-unsigned
:allowed t))
#+END_SRC

#+REVEAL: split
- =:remove-unused= whether remove the unused packages that be defined
in =def-self-package-spec=
- =:package-check-signature= =nil= does not check signature when
installing packages.
- =:allowed= =t= enabled, =nil= disabled

#+ATTR_HTML: :style text-align:left
The /user defined/ package spec locate in =(*self-mod-spec*)=.

#+REVEAL: split
#+BEGIN_SRC emacs-lisp
;;; :common-lisp
(*self-mod-spec*
:put :common-lisp
(list
:cond (comment (or (executable-find% "sbcl")
(executable-find% "ecl")
(executable-find% "acl")))
:packages '(slime)
:compile `(,(compile-unit% (emacs-home* "config/use-slime.el") t)
,(compile-unit% (emacs-home* "config/use-slime-autoload.el")))))

;;; :doc
(*self-mod-spec*
:put :doc
(list
:cond nil
:packages (list (when% (executable-find% "gnuplot")
'gnuplot-mode)
'markdown-mode
(when-version% <= 24.3 'yasnippet)
'vlf)))

;;; :erlang
(*self-mod-spec*
:put :erlang
(list
:cond (comment (executable-find% "erlc"))
:packages (list 'erlang)))

;;; :lisp
(*self-mod-spec*
:put :lisp
(list
:cond (comment t)
:packages '(paredit rainbow-delimiters)
:compile `(,(compile-unit% (emacs-home* "config/use-lisp.el") t)
,(compile-unit% (emacs-home* "config/use-lisp-autoload.el")))))

;;; :lua
(*self-mod-spec*
:put :lua
(list
:cond (comment (executable-find% "lua"))
:packages '(lua-mode)))

;;; :org
(*self-mod-spec*
:put :org
(list
:cond (comment (executable-find% "latex"))
:packages (flatten (list 'auctex 'cdlatex
(when-version% <= 25 'ox-reveal)))))

;;; :rust
(*self-mod-spec*
:put :rust
(list
:cond (comment (and (executable-find% "rustc")
(executable-find% "cargo")))
:packages '(rust-mode)
:compile `(,(compile-unit% (emacs-home* "config/use-rust.el") t)
,(compile-unit% (emacs-home* "config/use-rust-autoload.el")))))

;;; :scheme
(*self-mod-spec*
:put :scheme
(list
:cond (comment (and (when-version% <= 23.2 t)
;; Nore Emacs has builtin supports for Chez
;; scheme and gambitC scheme, and does not need to
;; install the dumb geiser.
(or (executable-find% "racket")
(executable-find% "scheme")
(executable-find% "chicken")
(executable-find% "guile"))))
:packages '(geiser)
:compile `(,(compile-unit% (emacs-home* "config/use-geiser.el") t)
,(compile-unit% (emacs-home* "config/use-geiser-autoload.el")))))

;;; :vlang
(*self-mod-spec*
:put :vlang
(list
:cond (comment (executable-find% "v"))
:packages '(v-mode)))

;;; :vcs
(*self-mod-spec*
:put :vcs
(list
:cond (comment (and (when-version% <= 24.4 t)
(executable-find% "git")))
:packages '(magit)
:compile `(,(compile-unit% (emacs-home* "config/use-magit.el") t)
,(compile-unit% (emacs-home* "config/use-magit-autoload.el")))))

;;; :web
(*self-mod-spec*
:put :web
(list
:cond nil
:packages (list 'htmlize
'js2-mode
(when-version% <= 25 'restclient)
(when-version% <= 24.3 'skewer-mode)
'web-mode
'x509-mode)))

;;; :zig
(*self-mod-spec*
:put :zig
(list
:cond (comment (executable-find% "zig"))
:packages '(zig-mode)))

;; end of sample-self-package-spec.el

#+END_SRC

#+REVEAL: split
- =:cond= decide whether to install =:packages= and compile =:compile=
- =:packages= a list of package names or tar file names
- =:compile= when installed packages, a list of files that should be
compiled only or be loaded after been compiled

#+REVEAL: split
#+ATTR_HTML: :style text-align:left
You can use any =Elisp= functions after the aboved keywords.
- =when-version%= macro checking the version of current Emacs at
compile time.
- =executable-find%= macro checking the exising of the /executable/ at
compile time.
- =compile-unit%= macro specify the compiling file to compile or
compile then load.

** Indent
:PROPERTIES:
:CUSTOM_ID: indent
:END:

#+ATTR_HTML: :style text-align:left
Avoiding a war. If /whitespace/ causes some trouble, you can swith to
@@html:@@M-x whitespace-mode@@html:@@ to find out.

#+REVEAL: split
#+BEGIN_SRC emacs-lisp
(*self-env-spec*
:put :edit
(list :tab-width 2
:narrow-to-region nil
:auto-save-default nil
:indent '((python-indent-offset . 4))
:disable-indent-tabs-mode '(c-mode
sh-mode
emacs-lisp-mode)
:delete-trailing-whitespace '(prog-mode)
:allowed t))
#+END_SRC

#+REVEAL: split
- =:tab-width= default @@html:@@C-h-v tab-width@@html:@@
- =:narrow-to-region= =t= enabled, =nil= disabled
- =:auto-save-default= @@html:@@C-h-v auto-save-default@@html:@@
- =:disable-indent-tabs-mode= disble =indent-tabs-mode= in specified
major modes
- =:delete-trailing-whitespace= delete trailing whitespace before save
- =:indent= indent width does not equal =:tab-width=
- =:allowed= =t= enabled, =nil= disabled

** File
:PROPERTIES:
:CUSTOM_ID: file
:END:

#+ATTR_HTML: :style text-align:left
Using =dired= as a File Manager is awesome, same experiences on
Windows, Darwin and Linux.

*** ls Program

#+ATTR_HTML: :style text-align:left
For Windows, there are no built-in =ls= program, but you can install
GNU's =ls= via [[https://git-scm.com/downloads][Git-Bash]].

#+ATTR_HTML: :style text-align:left
For Darwin, let =dired= don't do stupid things.

#+ATTR_HTML: :style display:none
/screenshots/:
#+ATTR_HTML: :style display:none
- [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/ido-dired-windows-gnu-ls.png][ido-dired]]

*** find Program

#+ATTR_HTML: :style text-align:left
On Windows, if GNU's =find= has already in your disk, and let Windows
stupid =find= or =findstr= program go away. Don't =setq=
=find-program= on Windows, because =dired= can not differ the cases
between local and remote.

#+ATTR_HTML: :style text-align:left
Now, on Windows you can use @@html:@@M-x find-dired@@html:@@
or @@html:@@M-x find-name-dired@@html:@@

#+ATTR_HTML: :style display:none
/screenshots/:
#+ATTR_HTML: :style display:none
- [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/find-name-dired-on-windows.png][find-name-dired]]
- [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/find-name-dired-tramp-on-windows.png][find-name-dired via tramp]]

*** compress Program

#+ATTR_HTML: :style text-align:left
On Windows, there are no builtin =zip/unzip= program, but Emacs ship
with =minizip= program. Although =minizip= without /recursive/
functionalities, but do some tricks with =minizip=, we can zip files
and directories with =minizip=, even export =org= to =odt=
[[https://en.wikipedia.org/wiki/OpenDocument][OpenDocument]]. And more [[https://www.7-zip.org/download.html][7-Zip standalone command version also be
supported]].

#+REVEAL: split
#+ATTR_HTML: :style text-align:left
On Windows, there are logical bugs in =dired-aux.el=, We can not using
=Z= key compress or uncompress file to or from =.gz= or =.7z=. The
good news: if =gunzip= or =7za= installed we can do it now.

#+ATTR_HTML: :style text-align:left
You can using @@html:@@c@@html:@@ in =dired mode= compress
to =*.gz=, =*.7z= or =*.zip=. For some ancient Emacs24-,
@@html:@@! zip x.zip ?@@html:@@ to zip.

#+REVEAL: split
#+ATTR_HTML: :style text-align:left
It's headache when =default-file-name-coding-system= not equal with
=locale-coding-system= specifically on Windows. Even view archived
file in =arc-mode=, will display wrong encoded file names.

#+REVEAL: split
#+ATTR_HTML: :style text-align:left
On Windows, there are some encoding issues when
~default-file-name-coding-system~ not equal ~locale-coding-system~.
- display non-unicode encoded directory name or file name;
- insert non-unicode encoded directory;
- compress the files with with ~locale-coding-system~ filenames;
- ~dired-do-shell-command~ or ~dired-do-async-shell-command~;

#+REVEAL: split
#+ATTR_HTML: :style text-align:left
The good news is the whole above issues had gone in this kit.

#+ATTR_HTML: :style text-align:left
For =.rar= archive, emacs really sucks.
- on Emacs 23.3.1, using =unrar-free= in =archive-rar-summarize=
function, but on Emacs 26.1 using =lsar=, and those all had been
hard coded in =arc-mode.el=.
- =7z l= output is not compatible with =lsar= and =unrar=.

#+ATTR_HTML: :style display:none
/screenshots/:
#+ATTR_HTML: :style display:none
- [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/dired-do-compress-to-zip-on-windows.png][dired-do-compress-to: zip]]
- [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/dired-do-compress-to-7z-on-windows.png][dired-do-compress-to: 7z]]
- [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/archive-summarize-files-zip-on-windows.png][archive-summarize-files: zip]]
- [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/archive-summarize-files-7z-on-windows.png][archive-summarize-files: 7z]]
- [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/org-odt-export-to-odt-on-windows.png][org-odt-export-to-odt]]
- [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/dired-compress-file-suffixes-version-24lt.png][dired-compress-file-suffixes]]

** Editing
:PROPERTIES:
:CUSTOM_ID: editing
:END:

*** Scratch
:PROPERTIES:
:CUSTOM_ID: edit-scratch
:END:

New a *scratch* buffer or switch to the existing one.

*** Mark
:PROPERTIES:
:CUSTOM_ID: edit-mark
:END:

#+ATTR_HTML: :style text-align:left
Provides the abilities to mark /symbol/, /filename/ and /line/ in
current buffer then you can @@html:@@M-w@@html:@@ the
marked part.

#+REVEAL: split
#+ATTR_HTML: :style text-align:left
Using =mark-sexp@= default mark whole Lisp /sexp/ or C /block/ at
point. If prefix N is non nil, then forward or backward to sexps
boundary, just like the builtin =mark-sexp= does.

#+REVEAL: split
#+ATTR_HTML: :style text-align:left
=mark-quoted@= mark whole quoted things at point and do not care
whatever the /mode/ is.

#+REVEAL: split
#+ATTR_HTML: :style text-align:left
=mark-word@= default mark the whole word at point. If prefix N is non
nil, then forward or backword to word boundary, just like the builtin
=mark-word= does.

#+REVEAL: split
#+ATTR_HTML: :style text-align:left
=mark-defun@= more stable in variant programming modes than
`mark-defun'.

#+REVEAL: split
- @@html:@@C-M M-h@@html:@@ [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/mark-defun.png][mark defun at point]]
- @@html:@@C-c M-f@@html:@@ [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/mark-filename.png][mark filename at point]]
- @@html:@@C-c M-l@@html:@@ [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/mark-line.png][mark line at point]]
- @@html:@@C-c M-s@@html:@@ [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/mark-symbol.png][mark symbol at point]]
- @@html:@@C-c M-@@@html:@@ [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/mark-word.png][mark word at point]]
- @@html:@@C-c C-M-@@@html:@@ [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/mark-list.png][mark sexp at point]]

*** Tags
:PROPERTIES:
:CUSTOM_ID: edit-tags
:END:

#+REVEAL: split
#+ATTR_HTML: :style text-align:left
Prefer =etags= program, because it works well on varied platforms. In
=(emacs-home* "config/tags.el")=, there are some handy functions to
create the tags for =Elisp= or =C= source code, such as
=make-emacs-source-tags=, =cc*-make-tags=, =mount-tags=, and
=unmount-tags=.

#+REVEAL: split
#+ATTR_HTML: :style text-align:left
Nore Emacs also supports [[http://ctags.sourceforge.net/][Exuberant Ctags]].

#+REVEAL: split
#+ATTR_HTML: :style text-align:left
Using =mount-tags= to mount the specified tags file at first order of
=tags-table-list=. Or @@html:@@C-u mount-tags@@html:@@ to
mount tags file at the tail of =tags-table-list=. The =unmount-tags=
is the inverse of =mount-tags=.

#+REVEAL: split
#+ATTR_HTML: :style text-align:left
- =make-emacs-source-tags=: make tags for Emacs' C and Lisp source code.
- =make-dir-tags=: make tags for specified directory.
- =cc*-make-system-tags=: make system C tags.

*** Clipboard
:PROPERTIES:
:CUSTOM_ID: edit-clipboard
:END:

#+ATTR_HTML: :style text-align:left
In terminal, Emacs can not /copy to/ or /paste from/ system clipboard
when on Darwin or Linux. For such cases, we need external programs to
help us do the job. Now, Nore Emacs integrates this
functionalities, so we can use natural keys (such as
@@html:@@C-w@@html:@@, @@html:@@C-y@@html:@@) to
/copy to/ or /paste from/ system clipboard.

*** iSearch
:PROPERTIES:
:CUSTOM_ID: edit-isearch
:END:

#+ATTR_HTML: :style text-align:left
There are no uniformed [[https://www.emacswiki.org/emacs/IncrementalSearch][isearch]] functionalites among in
=isearch-forward=, =isearch-backward= and
=isearch-forward-symbol-at-point=. Now, in Nore Emacs those
functionalites unified to two functions: =isearch-forward*= and
=isearch-backward*=.

#+REVEAL: split
#+ATTR_HTML: :style text-align:left
In Nore Emacs, by default, =isearch-forward*= and =isearch-backward*=
same with the built-in ones. Except we can search the text of
activated *region*. @@html:@@C-s@@html:@@ and
@@html:@@C-r@@html:@@ will search forward or backward just
like /vi/'s @@html:@@*@@html:@@ does. And more, searching
=word=, =quoted string=, or =filename= forward or backword.

*** Open line
:PROPERTIES:
:CUSTOM_ID: edit-open-line
:END:

#+ATTR_HTML: :style text-align:left
Emulates /vi/'s *o* and *O* command in Emacs, the built-in one
=open-line= or =split-line= do not indent accordingly the current
line. See [[https://www.emacswiki.org/emacs/OpenNextLine][Open Next Line]].

- @@html:@@C-o@@html:@@ =open-next-line=
- @@html:@@C-M-o@@html:@@ =open-previous-line=

*** Comment
:PROPERTIES:
:CUSTOM_ID: edit-comment
:END:

#+ATTR_HTML: :style text-align:left
=comment-line= has stupid behaviors, that why =toggle-comment= had
been made.

- =toggle-comment=: @@html:@@C-x C-;@@html:@@

*** Kill
:PROPERTIES:
:CUSTOM_ID: edit-kill
:END:

#+ATTR_HTML: :style text-align:left
=kill-word@= and =kill-sexp@= are frequently editing commands when
programming.

** Keys
:PROPERTIES:
:CUSTOM_ID: keys
:END:

#+ATTR_HTML: :style text-align:left
Obey the defaults of Emacs' keymap.

*** Global keys

#+ATTR_HTML: :style text-align:left
Global for all Emacs' version.

#+REVEAL: split
- @@html:@@M-/@@html:@@ =hippie-expand=
- @@html:@@C-c f f@@html:@@ =find-file-at-point=
- @@html:@@C-x x g@@html:@@ =revert-buffer= or =revert-buffer-quick=
- @@html:@@C-x x n@@html:@@ =echo-buffer-name=
#+REVEAL: split
- @@html:@@C-M-o@@html:@@ =open-previous-line=
- @@html:@@C-o@@html:@@ =open-next-line=
#+REVEAL: split
- @@html:@@C-c m d@@html:@@: =mark-symbol@=
- @@html:@@C-c m d@@html:@@: =mark-word@=
- @@html:@@C-c m d@@html:@@: =mark-sexp@=
- @@html:@@C-c m d@@html:@@: =mark-defun@=
- @@html:@@C-c m l@@html:@@: =mark-line@=
- @@html:@@C-c m f@@html:@@: =mark-filename@=
#+REVEAL: split
- @@html:@@C-s@@html:@@: =isearch-forward*=
- @@html:@@C-r@@html:@@: =isearch-backward*=
#+REVEAL: split
- @@html:@@M-s .@@html:@@: =isearch-forward-symbol*=
- @@html:@@M-s @@@html:@@: =isearch-forward-word*=
- @@html:@@M-s f@@html:@@: =isearch-forward-file*=
- @@html:@@M-s _@@html:@@: =isearch-forward-quoted*=

*** Compatible keys

#+ATTR_HTML: :style text-align:left
Compatibled for ancient Emacs versions, compatible keys may not
avaiabled on ancient Emacs.

#+REVEAL: split
- @@html:@@M-,@@html:@@ =pop-tag-mark=
- @@html:@@M-*@@html:@@ =tags-loop-continue=
- @@html:@@C-l@@html:@@ =recenter-top-bottom=
- @@html:@@C-c b l@@html:@@ =linum-mode=
- @@html:@@M-#@@html:@@ =xref-find-references=

*** Featured keys

#+ATTR_HTML: :style text-align:left
The features provided by non-Emacs's packages, featured keys may not
avaiabled on ancient Emacs.

- @@html:@@C-x v d@@html:@@ =magit-status=

* Programming
:PROPERTIES:
:CUSTOM_ID: programming
:END:

** Generic editing
:PROPERTIES:
:CUSTOM_ID: general-editing
:END:

#+ATTR_HTML: :style text-align:left
Just introduce Nore Emacs' improvements.

** Lisp programming
:PROPERTIES:
:CUSTOM_ID: lisp-programming
:END:

#+ATTR_HTML: :style text-align:left
Lisp programming in Emacs already good enough, if [[https://www.emacswiki.org/emacs/ParEdit][ParEdit]] installed
editing Lisp code more easy.

#+ATTR_HTML: :style text-align:left
[[https://github.com/slime/slime][slime]] is the best tool for Common Lisp programming.

#+ATTR_HTML: :style text-align:left
For Scheme programming, there are builtin minor modes: =gambit-mode=
for [[http://www.gambitscheme.org/wiki/index.php/Main_Page][Gambit]] Scheme system, and =chez-mode= for [[https://scheme.com][Chez]] Scheme system.

*** REPL
:PROPERTIES:
:CUSTOM_ID: list-programming-repl
:END:

- =*slime-repl*=: @@html:@@M-x slime@@html:@@
- =*gambit*=: @@html:@@M-x run-gambit@@html:@@
- =*chez*=: @@html:@@M-x run-chez@@html:@@

** C programming
:PROPERTIES:
:CUSTOM_ID: c-programming
:END:

#+ATTR_HTML: :style text-align:left
Now, we are in the cycle of editing, compiling, debugging.

#+ATTR_HTML: :style display:none
/screenshots/:
#+ATTR_HTML: :style display:none
- [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/c-programming-editing-on-darwin-gui.png][editing on Darwin]]
- [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/c-programming-debugging-via-lldb-on-darwin.png][debugging via lldb on Darwin]]
- [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/c-programming-debugging-via-lldb-on-linux.png][debugging via lldb on Ubuntu]]
- [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/c-programming-debugging-via-cdb-on-windows.png][debugging via cdb]]

*** Editing
:PROPERTIES:
:CUSTOM_ID: c-programming-editing
:END:

#+ATTR_HTML: :style text-align:left
Change C programming style using @@html:@@C-c .@@html:@@.
And there is a new elegant and practical style: =cc*-style-nginx=.

#+REVEAL: split
**** View C system include
:PROPERTIES:
:CUSTOM_ID: c-programming-view-c-system-include
:END:

#+ATTR_HTML: :style text-align:left
Like /vi/'s @@html:@@gf@@html:@@ command, you can using
@@html:@@C-c f i@@html:@@ to open C system include file on
local or remote in =view-mode= and via
@@html:@@M-,@@html:@@ to go back. It supports /gcc/,
/clang/, and /msvc/.

#+ATTR_HTML: :style text-align:left
On Darwin, you can find correct include path in =Man-mode= now.

#+REVEAL: split
**** Macro expand
:PROPERTIES:
:CUSTOM_ID: c-programming-macro-expand
:END:

#+ATTR_HTML: :style text-align:left
Mark the code that include a macro call then @@html:@@C-c
C-e@@html:
@@, you should see the expansion of the macro in
=*Macro Expanded*=, whatever you are using /gcc/, /clang/ and /msvc/,
locally or remotely.

#+ATTR_HTML: :style display:none
/screenshots/:
#+ATTR_HTML: :style display:none
- [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/c-programming-macro-expansion-on-windows.png][macro expansion for msvc]]

#+REVEAL: split
#+ATTR_HTML: :style text-align:left
**** Dump predefined macros
:PROPERTIES:
:CUSTOM_ID: c-programming-dump-predefined-macros
:END:

#+ATTR_HTML: :style text-align:left
Dump compiler predefined macros, @@html:@@C-c #@@html:@@,
you should see the predefined macros in =*Macros Predefined*=,
whatever you are using /gcc/ and /clang/ locally or remotely.

#+ATTR_HTML: :style display:none
/screenshots/:
#+ATTR_HTML: :style display:none
- [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/c-programming-dump-predefined-macros.png][dump predefined macros for clang]]

*** Compiling
:PROPERTIES:
:CUSTOM_ID: c-programming-compiling
:END:

#+ATTR_HTML: :style text-align:left
Press @@html:@@M-x compile@@html:@@ then:
- Unix-like:
- raw: ~cc c.c -oa.out~
- make: ~make~
- Windows:
- raw: ~cc-env.bat && cl c.c -Fea.exe~
- make: ~cc-env.bat && make~
to /build/.

#+ATTR_HTML: :style text-align:left
For /msvc/ there are need tricks to works with Emacs. Nore Emacs will
generate a /msvc/'s host environment =cc-env.bat= for you that make
life easy and if [[https://github.com/junjiemars/nore][Nore]] already on your machine, now life is perfect.

#+ATTR_HTML: :style display:none
/screenshots/:
#+ATTR_HTML: :style display:none
- [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/c-programming-compile-on-windows.png][compile via msvc]]

*** Debugging
:PROPERTIES:
:CUSTOM_ID: c-programming-debugging
:END:

#+ATTR_HTML: :style text-align:left
[[https://lldb.llvm.org/][lldb]] and [[https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/][cdb]] had been perfectly integrated.
- =gud-lldb=
- =gud-cdb=

#+ATTR_HTML: :style display:none
/screenshots/:
#+ATTR_HTML: :style display:none
- [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/c-programming-debugging-via-lldb-on-darwin.png][debugging via lldb on Darwin]]
- [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/c-programming-debugging-via-lldb-on-linux.png][debugging via lldb on Ubuntu]]
- [[https://raw.githubusercontent.com/junjiemars/images/master/.emacs.d/c-programming-debugging-via-cdb-on-windows.png][debugging via cdb]]

* Troubleshoting
:PROPERTIES:
:CUSTOM_ID: troubleshoting
:END:

#+REVEAL: split
- I. @@html:@@M-x clean-compiled-files@@html:@@ then exit
and reopen Emacs.
#+REVEAL: split
- II. Check Emacs configurations:
- @@html:@@M: system-configuration-options@@html:@@
- @@html:@@M: system-configuration-features@@html:@@
- @@html:@@M: features@@html:@@
- @@html:@@M: load-history@@html:@@
then do =I=.
#+REVEAL: split
- III. Check =*Compilation-Log*= buffer, then do =I=.
- IV. Check =(*self-paths*)=, then do =I=.
- V. Disable the problematic item in =(*self-env-spec*)=, then do =I=.
- VI. Disable the problematic item in =(*self-mod-spec*)=, then do =I=.

* Mnemonic
:PROPERTIES:
:CUSTOM_ID: mnemonic
:END:

#+ATTR_HTML: :style display:none
- [[#emacs-documents][Emacs Documents]]
- [[#motion][Motion]]
- [[#interaction][Interaction]]
- [[#editing][Editing]]
- [[#coding-system][Coding system]]
- [[#basic-sexp-commands][Basic sexp commands]]
- [[#frame][Frame]]
- [[#window][Window]]
- [[#register][Register]]
- [[#bookmark][Bookmark]]
- [[#rectangle][Rectangle]]
- [[#keyboard-macro][Keyboard Macro]]
- [[#dired][Dired]]
- [[#mnemonic-shell][Shell]]
- [[#remote][Remote]]
- [[#sort][Sort]]
- [[#face][Face]]
- [[#log][Log]]
- [[#latex][LaTeX]]

** Emacs Documents
:PROPERTIES:
:CUSTOM_ID: emacs-documents
:END:

#+ATTR_HTML: :style text-align:left
It's *self-documenting* and great, keep reading it frequently.

- Tutorial: @@html:@@C-h-t@@html:@@
- Emacs manual: @@html:@@C-h r@@html:@@
- Emacs news: @@html:@@C-h C-n@@html:@@
- Emacs FAQ: @@html:@@C-h C-f@@html:@@

#+REVEAL: split
- Help for Help: @@html:@@C-h C-h@@html:@@
- Apropos command: @@html:@@C-h a@@html:@@
- Mode: @@html:@@C-h-m@@html:@@ see all the key bindings and
documentation of current buffer

#+REVEAL: split
- Info: @@html:@@C-h i@@html:@@
- Info /file/: @@html:@@C-u C-h i @@html:@@
- Index of /topic/: @@html:@@C-h r i @@html:@@

#+REVEAL: split
- Function: @@html:@@C-h f@@html:@@ display documentation
of the given function
- Variable: @@html:@@C-h v@@html:@@ display documentation
of the given variable
- Keybinding: @@html:@@C-h k@@html:@@ display documentation
of the function invoked by the given keystrokes
- Keybinding briefly: @@html:@@C-h c@@html:@@, which command
for given keystroke

#+REVEAL: split
- Prefix keybindings: press prefix keys such as
@@html:@@C-c@@html:@@ then
@@html:@@C-h@@html:@@ to see all key bindings for given
prefix keystrokes

#+REVEAL: split
- Message: @@html:@@C-h e@@html:@@ see the logging of echo
area message
- Man: @@html:@@M-x man@@html:@@ view UNIX manual page
- Woman: @@html:@@M-x woman@@html:@@ view UNIX manual page
without =man= program

#+REVEAL: split
- Coding system: @@html:@@C-h C@@html:@@ describe coding
system
- Colors: @@html:@@M-x list-colors-display@@html:@@ display
names of defined colors and show what they look like
- Syntax: @@html:@@C-h s@@html:@@ describe syntax
- Where is command: @@html:@@C-h w@@html:@@ which keystrokes
binding to a given command
- Keystrokes: @@html:@@C-h l@@html:@@ display last 100
input keystrokes

** Motion
:PROPERTIES:
:CUSTOM_ID: motion
:END:

#+REVEAL: split
- goto line: @@html:@@M-g g@@html:@@
- goto nth char: @@html:@@M-g c@@html:@@
- goto next error: @@html:@@C-x `@@html:@@
- goto previous error: @@html:@@M-g p@@html:@@

#+REVEAL: split
- jump between buffers: @@html:@@C-x C-SPC@@html:@@, jumps to
the global mark acrross buffers
- jump in buffer: @@html:@@C-u C-SPC@@html:@@
- jump to definition: @@html:@@M-.@@html:@@
- pop back to where @@html:@@M-,@@html:@@

** Interaction
:PROPERTIES:
:CUSTOM_ID: interaction
:END:

- =*scratch*= buffer
- eval /Elisp/: @@html:@@M-:@@html:@@
- execute /Shell/ command: @@html:@@M-!@@html:@@
- in Dired mode: @@html:@@!@@html:@@, do shell command
- region as input to Shell command: @@html:@@M-|@@html:@@,

#+REEVAL: split
- insert from shell output: @@html:@@C-u M-!@@html:@@
- insert from elisp output: @@html:@@C-u M-:@@html:@@

#+REVEAL: split
- find file at point: @@html:@@C-c f f@@html:@@
- filename of current buffer: @@html:@@C-c b n@@html:@@

#+REVAL: split
- lookup /web/ at point: @@html:@@M-s w@@html:@@
- lookup /dict/ at point: @@html:@@M-s d@@html:@@

#+REVAL: split
- display time: @@html:@@M-x display-time@@html:@@

** Editing
:PROPERTIES:
:CUSTOM_ID: editing
:END:

- write file: @@html:@@C-x C-w@@html:@@ same as save as
- kill all spaces at point: @@html:@@M-\@@html:@@
- kill all spaces except one at point: @@html:@@M-SPC@@html:@@
- delete indentation to join line to previous line:
@@html:@@M-^@@html:@@
- join next line: @@html:@@C-u 1 M-^@@html:@@

#+REVAL: split
- kill word: @@html:@@M-d@@html:@@
- kill /whole word/: @@html:@@C-x M-d@@html:@@, include the
word that current point located.
- kill /whole symbol/: @@html:@@C-x M-s@@html:@@, include
the symbol that current point located.
- kill /line/: @@html:@@C-k@@html:@@
- kill /whole/ line: @@html:@@C-x M-@@html:@@

#+REVEAL: split
- query replace: @@html:@@M-%@@html:@@
- upcase region: @@html:@@C-x C-u@@html:@@
- downcase region: @@html:@@C-x C-l@@html:@@

#+REVEAL: split
- transpose characters: @@html:@@C-t@@html:@@
- transpose words: @@html:@@M-t@@html:@@
- transpose lines: @@html:@@C-x C-t@@html:@@

#+REVEAL: split
- toggle read-only mode: @@html:@@C-x C-q@@html:@@
- toggle input method: @@html:@@C-\@@html:@@
- set input method: @@html:@@C-x RET C-\@@html:@@
- describe current input method: @@html:@@C-h I@@html:@@

#+REVEAL: split
- insert char: @@html:@@C-x 8 RET@@html:@@ GREEK SMALL LETTER LAMBDA
- what cursor position: @@html:@@C-x =@@html:@@
- describe char: @@html:@@C-u C-x =@@html:@@
- quoted insert: @@html:@@C-q@@html:@@, such as page break
@@html:@@C-q C-l@@html:@@, use @@html:@@C-x
[@@html:
@@ to backward or @@html:@@C-x ]@@html:@@
to forward,
@@html:@@C-q C-I@@html:@@ to insert horizontal tab,
@@html:@@C-q C-J@@html:@@ to insert line feed,
@@html:@@C-q C-M@@html:@@ to insert carriage return
- check unmatched parentheses: @@html:@@M-x check-parens@@html:@@

#+REVEAL: split
- tab to space: @@html:@@M-x untabify@@html:@@
- space to tab: @@html:@@M-x tabify@@html:@@
- fill paragraph: @@html:@@M q@@html:@@
- redo: @@html:@@C-x ESC ESC@@html:@@
- redo after undo: @@html:@@C-g@@html:@@ and then
@@html:@@C-x u@@html:@@
- cancel: @@html:@@C-]@@html:@@, or @@html:@@M-x
top-level@@html:
@@

#+REVEAL: split
- open new line before current: @@html:@@C-o@@html:@@
- remove all but one empty line: @@html:@@C-x C-o@@html:@@
- delete entire line: @@html:@@C-S-DEL@@html:@@
- delete to end of sentence: @@html:@@M-k@@html:@@
- insert char: @@html:@@C-x 8 RET@@html:@@
- count lines, words or characters of select region:
@@html:@@M-=@@html:@@
- count lines on current page: @@html:@@C-x l@@html:@@

#+REVEAL: split
- toggle comment the current line or region: @@html:@@C-x
M-;@@html:
@@. =toggle-comment= more better than sucked
=comment-line=.
- insert or realign comment on current line:
@@html:@@M-;@@html:@@
- kill comment on current line: @@html:@@C-u M-;@@html:@@
- indent and continuing comment: @@html:@@C-M-j@@html:@@

#+REVEAL: split
- dynamic abbreviation expand: @@html:@@M-/@@html:@@
- add inverse global abbreviation: @@html:@@C-x a i g@@html:@@
- add inverse local abbreviation: @@html:@@C-x a i l@@html:@@
- list abbreviations: @@html:@@M-x list-abbrevs@@html:@@
- edit abbreviations: @@html:@@M-x edit-abbrevs@@html:@@
- write abbreviation file: @@html:@@M-x write-abbrev-file@@html:@@

#+REVEAL: split
- flush lines: @@html:@@M-x flush-lines@@html:@@
- insert parentheses: @@html:@@M-(@@html:@@, wrap selection
in parentheses
- align region: @@html:@@M-x align-entire@@html:@@

** Coding system
:PROPERTIES:
:CUSTOM_ID: coding-system
:END:

#+REVEAL: split
- check current buffer coding system: @@html:@@C-x RET
=@@html:
@@
- revert current buffer's coding system: @@html:@@C-x RET
r@@html:
@@
- specify coding system for the current buffer: @@html:@@C-x RET
f@@html:
@@
#+REVEAL: split
- specify coding system for terminal output: @@html:@@C-x RET
t@@html:
@@
- specify coding system for keyboard input: @@html:@@C-x RET
k@@html:
@@
- specify coding system for the immediately following command:
@@html:@@C-x RET c@@html:@@
#+REVEAL: split
- specify input and output coding systems for subprocess:
@@html:@@C-x RET p@@html:@@
- specify coding system for transferring selections to and from other
programs through the window system: @@html:@@C-x RET
x@@html:
@@
- specify coding system for transferring one selection to or from the
window system: @@html:@@C-x RET X@@html:@@

** Basic sexp commands
:PROPERTIES:
:CUSTOM_ID: basic-sexp-commands
:END:

- =forward-sexp=: @@html:@@C-M-f@@html:@@
- =backward-sexp=: @@html:@@C-M-b@@html:@@
- =kill-sexp=: @@html:@@C-M-k@@html:@@, delete forward one sexp
- =transpose-sexp=: @@html:@@C-M-t@@html:@@
- =backward-up-list=: @@html:@@C-M-u@@html:@@, move up out of an sexp
- =down-list=: @@html:@@C-M-d@@html:@@, move down into a nested sexp
- =backward-list=: @@html:@@C-M-p@@html:@@, match parentheses backward
- =pp-eval-last-sexp=: pretty print

** Frame
:PROPERTIES:
:CUSTOM_ID: frame
:END:

- find file other frame: @@html:@@C-x 5 C-f@@html:@@, or
@@html:@@C-x 5 f@@html:@@
- display buffer other frame: @@html:@@C-x 5 C-o@@html:@@,
or @@html:@@C-x 5 b@@html:@@
- find tag other frame: @@html:@@C-x 5 .@@html:@@
- delete frame: @@html:@@C-x 5 0@@html:@@
- delete other frames: @@html:@@C-x 5 1@@html:@@
- make frame command: @@html:@@C-x 5 2@@html:@@
- dired to other frame: @@html:@@C-x 5 d@@html:@@
- other frame: @@html:@@C-x 5 o@@html:@@
- find file read only other frame: @@html:@@C-x 5 r@@html:@@

** Window
:PROPERTIES:
:CUSTOM_ID: window
:END:

#+REVEAL: split
- /find/ file: @@html:@@C-x C-f@@html:@@
- /view/ file: @@html:@@C-x C-v@@html:@@
- /write/ file: @@html:@@C-x C-w@@html:@@

#+REVEAL: split
- save /current/ buffer: @@html:@@C-x s@@html:@@
- save all /modified/ buffers: @@html:@@C-u C-x s@@html:@@
- save and /backup/ current buffer: @@html:@@C-x C-s@@html:@@

#+REVEAL: split
- kill a buffer: @@html:@@C-x k@@html:@@
- other window: @@html:@@C-x o@@html:@@
- dired other window: @@html:@@C-x 4 d@@html:@@
- find file in other window: @@html:@@C-x 4 C-f@@html:@@, or
@@html:@@C-x 4 f@@html:@@

#+REVEAL: split
- display buffer: @@html:@@C-x 4 C-o@@html:@@, display the
buffer in another window
- find tag other window: @@html:@@C-x 4 .@@html:@@
- kill buffer and window: @@html:@@C-x 4 0@@html:@@, just
like @@html:@@C-x 0@@html:@@ except kill the buffer

#+REVEAL: split
- switch to buffer other window: @@html:@@C-x 4 b@@html:@@
- clone indirect buffer other window:
@@html:@@C-x 4 c@@html:@@, clone the buffer in another window
- recenter the screen at cursor: @@html:@@C-l@@html:@@
- center the screen at the top: @@html:@@C-u 0 C-l@@html:@@
- recenter the screen at the bottom: @@html:@@C-u - C-l@@html:@@

** Register
:PROPERTIES:
:CUSTOM_ID: register
:END:

#+ATTR_HTML: :style text-align:left
- store /window/ configuration to register: @@html:@@C-x r w
@@html:
@@, but the configuration cannot accross sessions.
- store /frame/ configuration to register: @@html:@@C-x r f
@@html:
@@
- store /region/ into register: @@html:@@C-x r s
@@html:
@@
- store current /point/ in register: @@html:@@C-x r SPC
@@html:
@@

#+REVEAL: split
- /jump to/ register: @@html:@@C-x r j @@html:@@
- /insert from/ register: @@html:@@C-x r i @@html:@@
- /view/ the content of register: @@html:@@M-x view-register
@@html:
@@

** Bookmark
:PROPERTIES:
:CUSTOM_ID: bookmark
:END:

#+ATTR_HTML: :style text-align:left
Unlike registers, bookmarks have long names, and they persist
automatically from one Emacs session to the next.

- set bookmark: @@html:@@C-x r m@@html:@@
- set named bookmark: @@html:@@C-x r m BOOKMARK@@html:@@
- jump to bookmark: @@html:@@C-x r b BOOKMARK@@html:@@
- list all bookmarks: @@html:@@C-x r l@@html:@@
- save bookmark to file: @@html:@@M-x bookmark-save@@html:@@

** Rectangle
:PROPERTIES:
:CUSTOM_ID: rectangle
:END:

- /kill/ rectangle: @@html:@@C-x r k@@html:@@
- /delete/ rectangle: @@html:@@C-x r d@@html:@@
- /yank/ rectangle: @@html:@@C-x r y@@html:@@
- /open/ rectangle: @@html:@@C-x r o@@html:@@, insert blank
/space/ to fill the space of the region-rectangle
- /copy/ rectangle: @@html:@@C-x r M-w@@html:@@
- /clear/ rectangle: @@html:@@C-x r c@@html:@@

#+REVEAL: split
- /replace/ rectangle: @@html:@@C-x r t@@html:@@
- /string insert/ rectangle: @@html:@@C-x r g@@html:@@
- /numbers insert/ rectangle: @@html:@@C-x r N@@html:@@

#+REVAL: split
- select entire buffer: @@html:@@C-x h@@html:@@
- select page: @@html:@@C-x C-p@@html:@@
- exchange cursor position and mark: @@html:@@C-x C-x@@html:@@

** Keyboard Macro
:PROPERTIES:
:CUSTOM_ID: keyboard-macro
:END:

- /start/ recording macro: @@html:@@C-x (@@html:@@
- /stop/ recording macro: @@html:@@C-x )@@html:@@
- /playback/ macro: @@html:@@C-x e@@html:@@
- apply macro to /region/: @@html:@@C-x C-k r@@html:@@
- /edit/ last marcro: @@html:@@C-x C-k RET@@html:@@
- /bind/ the most recent macro to a key: @@html:@@C-x C-k b
[1-9A-Z]@@html:
@@

** Dired
:PROPERTIES:
:CUSTOM_ID: dired
:END:

#+REVEAL: split
- hide details: @@html:@@(@@html:@@
- change marks: @@html:@@* c @@html:@@
- toggle readonly: @@html:@@C-x C-q@@html:@@
- finish edit: @@html:@@C-c C-c@@html:@@
- abort editing: @@html:@@C-c C-k@@html:@@

#+REVEAL: split
- echo current directory: @@html:@@W@@html:@@
- hex edit file: @html:@@b@@html:@@

#+REVEAL: split
- /find/ regexp recusive: @@html:@@A@@html:@@
- /replace/ regexp recusive: @@html:@@Q@@html:@@

** Regexp
:PROPERTIES:
:CUSTOM_ID: regexp
:END:

- regexp builder: @@html:@@M-x regexp-builder@@html:@@

** Shell
:PROPERTIES:
:CUSTOM_ID: mnemonic-shell
:END:

- EShell: @@html:@@M-x eshell@@html:@@
- Shell: @@html:@@M-x shell@@html:@@
- Ansi-Term: @@html:@@M-x ansi-term@@html:@@

#+REVAL: split
- interrupt process in =eshell=: @@html:@@C-c C-c@@html:@@
- interrupt process in =shell=: @@html:@@C-c C-c@@html:@@
- interrupt process in =ansi-term=: @@html:@@C-x C-c@@html:@@

** Remote
:PROPERTIES:
:CUSTOM_ID: remote
:END:

#+ATTR_HTML: :style text-align:left
It's the duty of [[https://www.gnu.org/software/tramp/][TRAMP]].

- non-sudo: @@html:@@C-x C-f
/ssh:user@host:/path/to/file@@html:
@@, such as =user@host= or
=user= in .ssh/config entries.
- sudo /remote/: @@html:@@C-x C-f
/ssh:user|sudo::/path/to/file@@html:
@@
- sudo /localhost/: @@html:@@C-x C-f
/sudo::/path/to/file@@html:
@@
#+REVEAL: split
- eshell remote: @@html:@@cd
/ssh:user@host:/path/to/file@@html:
@@
- on Windows use =~/.ssh/config=: use =/sshx:= instead, such as
@@html:@@/sshx:user@host:/path/to/file@@html:@@

** Sort
:PROPERTIES:
:CUSTOM_ID: sort
:END:

- sort /fields/: @@html:@@C-c s f@@html:@@ by Nth field
- sort /numeric/ fields: @@html:@@C-c s n@@html:@@ by Nth numeric field
- sort /lines/: @@html:@@C-c s l@@html:@@
- sort /regexp/ fields: @@html:@@C-c s x@@html:@@ by regexp field
- /reverse/ region: @@html:@@C-c s r@@html:@@
- delete /duplicated/ lines: @@html:@@C-c s d@@html:@@

** Face
:PROPERTIES:
:CUSTOM_ID: face
:END:

- describe the face at point: @@html:@@M-x
describe-face@@html:
@@

#+ATTR_HTML: :style text-align:left
*** Text scale
- reset face height: @@html:@@C-x C-0@@html:@@
- increase face height: @@html:@@C-x C-=@@html:@@
- decrease face height: @@html:@@C-x C--@@html:@@

** Log
:PROPERTIES:
:CUSTOM_ID: log
:END:

- =tail -f=: @@html:@@M-x auto-revert-tail-mode@@html:@@
- toggle highlighting of the current line: @@html:@@M-x
hl-line-mode@@html:
@@
- highlight all lines matching a regexp: @@html:@@M-s h
l@@html:
@@, and @@html:@@M-s h u@@html:@@ to
unhighlight.
- /narrow/ region: @@html:@@C-x n n@@html:@@
- /widen/ region: @@html:@@C-x n w@@html:@@

** LaTeX
:PROPERTIES:
:CUSTOM_ID: latex
:END:

*** Requirements
**** On Darwin
- [[https://www.imagemagick.org/][ImageMagick]]
- [[https://tug.org/texlive/][texlive]]

**** On Ubuntu
- [[https://www.imagemagick.org/][ImageMagick]]
- [[https://www.tug.org/texlive/][texlive]]
- texlive-latex-extra: additional packages.
- texlive-lang-cjk: supporting a combination of Chinese, Japanese,
Korean, including macros, fonts, documentation.
- texlive-xetex

**** On Windows
- [[https://www.imagemagick.org/][ImageMagick]]
- MiKTex

** Aspell
:PROPERTIES:
:CUSTOM_ID: aspell
:END:

*** Requirements

**** On Darwin

- aspell
- aspell-dict-en

* Issues?

If you have issues, just post it.