Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
On Emacs modes
Search
dotemacs
May 20, 2014
Programming
190
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
On Emacs modes
Presentation about Emacs modes, given at London Emacs meetup 20th May 2014
dotemacs
May 20, 2014
Other Decks in Programming
See All in Programming
パスワード再設定メールのURLについて知っておこう
uyuki234
0
160
IBM Bob でAI駆動開発『QC-Playbook』
ichirokano2
0
110
Jetpack Compose Mechanisms
skydoves
3
820
JIS keyboard support in Omarchy
lef237
0
110
コーディング自動化の次へ。人の介入をゼロにするファクトリーとサポートAIによる実践
timakin
5
3.6k
複雑なUIコンポーネントとの ⻑い付き合い⽅:波及するバグからテスト戦略を経て、安全な再設計へ
mixplace
0
410
【加筆修正版】Laravel のアプリケーションをどこにデプロイするか #phpcon_ehime
akase244
0
150
なぜCTOを降りてFDEを選んだのか?〜なぜプロダクト企業がFDEで顧客の現場に踏み込むのか〜
gonta
1
210
3回つくってわかった、 定期実行ジョブ基盤の本質情報
takai
0
460
全ての永続トークンを、生まれる前に消し去りたい!
sylph01
2
890
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Kaigi on Rails 2026, Tokyo, Japan
marcoroth
2
220
カツオ、ご期待ください
suneo3476
0
190
Featured
See All Featured
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
330
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
930
Navigating Weather and Climate Data
rabernat
0
560
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
3k
Documentation Writing (for coders)
carmenintech
77
5.6k
How GitHub (no longer) Works
holman
316
150k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
300
The Language of Interfaces
destraynor
162
27k
It's Worth the Effort
3n
188
29k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
63
46k
Transcript
M-x emacs-meetup London 20th May 2014 by @dotemacs
About modes
What are modes?
"...encapsulate a set of editing behaviours." - Bob Glickstein
Yukihiro Matz chief designer of the Ruby programming language
"I started Ruby development with influence from Emacs implementation"
"But as an Emacs addict I needed a language mode"
"auto-indent was a must"
"Back in 1993, there was no auto-indenting language mode for
a language with such syntax"
"I somehow succeeded in implementing auto-indent for a language with
'end' delimiters"
"If I couldn't make ruby-mode work the syntax of Ruby
would have changed to more C-like one, too similar to other scripting languages and as a result, Ruby would not have gained current popularity"
How was it done before?
Bob Glickstein & Scott Andrew Borton
Modes
two types
minor & major
Minor mode
Definition (define-minor-mode <name>-mode ....)
name :lighter
keymap Specific for the minor-mode :keymap
variable <name>-mode
command called <name>-mode that can toggle the mode on/off
Add it to a hook (add-hook 'some-mode 'your-mode)
Major mode
name
hooks <name>-mode-hook
syntax table
Entry function <name>-mode
Which should do the following:
syntax highlighting write optimised regexps or use regexp-opt
indentation
syntax table "behaviour" & movement
remove all buffer-local variables (kill-all-local-variable)
set the variables major-mode to <name>-mode mode-name to string "<name>"
install mode specific keymap
Options for keymap sparse-keymap define your own
bind mode to files (add-to-list 'auto-mode-alist '("\\.BAR\\'" . FOO-mode))
run user defined hooks for the mode Defined with <name>-mode-hook
provide mode (provide '<name>)
cookies ;;;###autoload
This sounds like a lot of work. Why re-invent the
wheel?
Cookie cutter sample-mode - 2001 derived-mode
checkdoc
Thank you ❤
Notes » Yukihiro Matz's notes on Ruby syntax design »
How to write a minor mode » Book "Writing GNU Emacs Extensions" by Bob Glickstein » Mode Tutorial » sample-mode » checkdoc