Hacker News

两年的 Emacs Solo:35 个模块、零外部包和全面重构

评论

7 最小阅读量

Mewayz Team

Editorial Team

Hacker News

两年的 Emacs Solo:35 个模块、零外部包和全面重构

两年前,我开始了一项激进的实验:将我的 Emacs 配置剥离回其基本结构并重建它,不是使用数千个可用的外部包,而是使用我自己的代码。我们的目标是创建一个真正的个人计算环境,摆脱依赖管理、破坏性更新以及我从未使用过的臃肿功能。如今,该系统由 35 个不同的模块组成,运行在零外部包的基础上,并且刚刚经历了完整的内部重构。这次旅程并不是重新发明轮子,而是打造一套完美契合的工具。

自力更生系统的起源

最初的动机是沮丧。我以前的配置是一个脆弱的社区软件包塔,每个软件包都需要仔细更新,并且经常相互冲突。我花在维护编辑器上的时间比用它进行深度工作的时间还要多。我意识到 Emacs Lisp,Emacs 核心的强大语言,完全能够直接处理我的需求。我不需要一个包来管理我的待办事项列表;我可以写一些函数。我不需要一个复杂的项目导航框架; Emacs 提供了原语来构建我想要的东西。这种思维方式的转变——从消费者到建设者——是最关键的一步。这一理念与 Mewayz 等系统的模块化、按需构建方法产生了深刻的共鸣,该平台提供了核心组件,使您能够组装理想的商业操作系统,而不必局限于单一供应商的愿景。

构建 35 个模块:流程工具包

出现的系统被组织成 35 个模块化文件,每个文件负责特定的功能域。这种模块化是其可维护性和清晰度的关键。我没有一个单一的、整体的配置文件,而是一组专注的、专门构建的组件。

核心接口:窗口管理、主题管理和模型行配置模块。

编辑增强功能:用于文本操作、段落格式设置和代码导航的自定义功能。

项目管理:一个集成了版本控制和文件搜索的轻量级项目框架。

知识管理:一个用于笔记、日记和相互链接想法的系统,完全建立在组织模式上。

通信:电子邮件和 RSS 源的集成,根据我的特定工作流程量身定制。

💡 您知道吗?

Mewayz在一个平台内替代8+种商业工具

CRM·发票·人力资源·项目·预订·电子商务·销售点·分析。永久免费套餐可用。

免费开始 →

每个模块都被设计为尽可能独立,通过明确定义的接口进行通信。这是模块化系统的本质:用离散的、可互换的部件创建一个有凝聚力的整体。这是一种确保使用寿命的方法,因为任何模块都可以重写或替换,而不会破坏整个环境的稳定。

编写自己的工具是定制的最后领域。它将您的软件从租来的公寓转变为定制的住宅,其中每个细节都有其用途。

伟大的重构:拥抱更好的模式

经过两年的积极使用,代码库积累了一些技术债务。一开始“足够好”的功能现在感觉很笨拙。最近的重构不是为了添加功能,而是为了改进底层架构。我专注于标准化函数名称,消除全局变量以支持词法绑定,并将大型函数分解为更小、更可组合的单元。其结果是代码库不仅更加高效,而且可读性更强、更易于调试。这个过程是任何长期软件项目的必要组成部分,无论是个人 Emacs 配置还是大型商业平台。这是对质量的承诺,确保系统能够随着时间的推移优雅地发展。

任何系统构建者的经验教训

这两年的旅程强化了几项关键原则。第一的

Frequently Asked Questions

Two Years of Emacs Solo: 35 Modules, Zero External Packages, and a Full Refactor

Two years ago, I embarked on a radical experiment: strip my Emacs configuration back to its bare bones and rebuild it, not with the thousands of external packages available, but with my own code. The goal was to create a truly personal computing environment, free from dependency management, breaking updates, and the bloat of features I never used. Today, that system comprises 35 distinct modules, runs on a foundation of zero external packages, and has just undergone a complete internal refactor. This journey has been less about reinventing the wheel and more about crafting a set of perfectly fitted tools.

The Genesis of a Self-Reliant System

The initial motivation was frustration. My previous configuration was a fragile tower of community packages, each requiring careful updates and often conflicting with one another. I spent more time maintaining my editor than using it for deep work. I realized that Emacs Lisp, the powerful language at the heart of Emacs, was more than capable of handling my needs directly. I didn't need a package to manage my todo list; I could write a few functions. I didn't need a complex framework for project navigation; Emacs provided the primitives to build exactly what I wanted. This shift in mindset—from consumer to builder—was the most critical step. It's a philosophy that resonates deeply with the modular, build-what-you-need approach of systems like Mewayz, where the platform provides the core components, empowering you to assemble your ideal business OS without being locked into a single vendor's vision.

Building the 35 Modules: A Toolkit for Flow

The system that emerged is organized into 35 modular files, each responsible for a specific domain of functionality. This modularity is key to its maintainability and clarity. Instead of a single, monolithic configuration file, I have a collection of focused, purpose-built components.

The Great Refactor: Embracing Better Patterns

After two years of active use, the codebase had accumulated some technical debt. Functions that were "good enough" at the start now felt clunky. The recent refactor wasn't about adding features, but about improving the underlying architecture. I focused on standardizing function names, eliminating global variables in favor of lexical binding, and breaking down large functions into smaller, more composable units. The result is a codebase that is not only more efficient but also far more readable and easier to debug. This process is a necessary part of any long-term software project, whether it's a personal Emacs configuration or a large-scale business platform. It’s a commitment to quality that ensures the system can evolve gracefully over time.

Lessons for Any System Builder

This two-year journey has reinforced several key principles. First, understanding your tools at a fundamental level is immensely empowering. Second, modularity is not just a technical pattern but a philosophical one—it forces clarity of thought and purpose. And finally, the initial investment in building your own system pays compounding dividends in productivity and satisfaction. You are no longer adapting your workflow to a tool; the tool is an extension of your mind. This is the ultimate goal of any customizable system, from a text editor to a comprehensive business operating system like Mewayz. By providing a modular core, it allows businesses to achieve a similar level of fit and ownership, building an operational environment that truly works for them, not the other way around.

Streamline Your Business with Mewayz

Mewayz brings 208 business modules into one platform — CRM, invoicing, project management, and more. Join 138,000+ users who simplified their workflow.

Start Free Today →

免费试用 Mewayz

集 CRM、发票、项目、人力资源等功能于一体的平台。无需信用卡。

立即开始更智能地管理您的业务

加入 30,000+ 家企业使用 Mewayz 专业开具发票、更快收款并减少追款时间。无需信用卡。

觉得这有用吗?分享一下。

准备好付诸实践了吗?

加入30,000+家使用Mewayz的企业。永久免费计划——无需信用卡。

开始免费试用 →

准备好采取行动了吗?

立即开始您的免费Mewayz试用

一体化商业平台。无需信用卡。

免费开始 →

14 天免费试用 · 无需信用卡 · 随时取消