Emacs: A Paradigm Shift Overview This blog post explores the unique extensibility philosophy of Emacs, focusing on how it actively encourages deep customization through its design, in contrast with other editors that merely allow limited scripting. Key Insight Emacs is designed to be completely torn apart and rearranged by the user. Core editor functions are documented with detailed notes and suggest further variables or usage hints. Advanced functions like advice-add allow overriding any function, granting enormous power but requiring caution. Quote Highlight: Emacs encourages making "customization messes masterpieces" and provides "functions shaped like nuclear warheads" that can "obliterate your editor" if misused—showing you unlimited power. Extending Org-mode Example: Automatic Sorting of Entries The author demonstrates Emacs extensibility with an example: automatically sorting org-mode reading lists on save by the year property. Initial Problem Manually running org-sort-entries to sort a reading list by year property was tedious. Goal: Automate sorting on file save automatically. Simple Solution Using Hooks Create a variable org-sort-option (e.g. "year") to specify the sorting property. Define a function org-sort-run to call org-sort-entries non-interactively using org-sort-option. Add org-sort-run to before-save-hook to trigger sorting on save. Leveraging Emacs Extensibility for In-Buffer Sorting Specification Seeking further improvement, the author wants the sorting property specified inside the org file header (e.g. #+SORT: year). Challenges Org-mode reads in-buffer options like #+STARTUP via function org-set-regexps-and-options. No built-in support or variable for custom keywords like #+SORT. Org-mode’s internal org-collect-keyword call is hardcoded with predefined keywords. Emacs Solution: Function Advice Use advice-add to run a custom function after org-set-regexps-and-options. The custom function reads #+SORT: from buffer keywords, sets a buffer-local variable. Then sorting function uses this buffer-local variable automatically. The automatic sorting on save remains as before. Conclusions Emacs does not necessarily provide direct extension points; sometimes you must interpose yourself in the control flow of existing functions. Function advice with advice-add is a powerful way to extend behavior without modifying original code or maintaining a fork. This example worked without deep knowledge about org-mode internals or Emacs file-visiting hooks. Emacs "wants you to extend it" and provides all the means to do so, highlighting its paradigm shift compared to other editors. --- Additional Information The blog references a beginner’s guide to extending Emacs for newcomers. The full elisp snippets and instructions are included for readers to try themselves. The article reflects an Emacs user's practical experience,