jiacai2050 / ideas

Think more
https://github.com/jiacai2050/ideas/issues
29 stars 2 forks source link

An Interview with Mickey Petersen, author of Mastering Emacs #50

Open jiacai2050 opened 1 year ago

jiacai2050 commented 1 year ago

https://syntopikon.substack.com/p/an-interview-with-mickey-petersen

An interview with Mickey Petersen, author of Mastering Emacs

Who are you, and what do you do?

I'm Mickey Petersen. I live in London, UK.

I'm a professional software developer, and I have been programming since I was around 10 years old.  I did not have friends or family who knew much about computing, so I had to learn everything myself, from scratch.

How did you get interested in that in the first place?

I cut my teeth programming C in Turbo C for DOS and moved on to Delphi for Windows some years later, whilst at the same time trying to get a grip on this fairly new-fangled thing called Linux. Back then you had to go through all manner of hoops to even get it: I think I got mine from a CD that a friend of a family member had. It would've been far too large for my meagre 33.6k dialup modem connection to even attempt to download it from the web.

It was a Red Hat distro and I distinctly remember spending an eternity printing out the manual – as I would otherwise not be able to even *install* Linux, as I knew nothing about it – and then a long time figuring out how to install and use it. FVWM95 was the window manager, meant to look like Windows 95, and it was a great experience "running Linux" and using tools that would never work on DOS or Windows at the time. Back then Linux was the 'cool' thing and Windows and DOS.... not so much!

I tried programming C on Linux, and I remember trying Emacs back then. It had this funky green colour scheme; pretty sure it was a Red Hat X Resources thing at the time. But I could be wrong. Nevertheless, my flirtation with Emacs did not last. At the time it was just another tool in a succession of editors I experimented with. I probably settled on a graphical one that shipped with Red Hat as it had, you know, things like region selection and syntax highlighting enabled by default. Emacs could of course *do* both, but they weren't enabled by default back then.

Along the way I experimented with all manner of packages, window managers, and more. They took ages to compile, but back then – as a kid/teen – you had oodles of time, so it didn't really matter. But it laid the foundation for my interest in Linux and much more.

Many years later I would, during my time in uni, pick up Emacs. That time it stuck. I was a member of my university's computer science society, and the Dewey decimal tribunes who held court and sway in that society, were keen to let all and sundry know that Real Hackers Used Vim. Not Emacs; not ed(1), kate, or any other editor; just Vim. I never did buy into groupthink – and certainly not from someone scarcely older than myself – so I went with Emacs, as I'd at least played around with it many years before.

At the time I did not really know what you could, or could not, do with Emacs. I mostly navigated with arrow keys, a handful of key bindings, and the menu bar. I went with XEmacs, as it was generally ahead of GNU Emacs in the early noughties.  As my coursework in uni involved a never-ending succession of LaTeX and various common and obscure programming languages, Emacs was a great choice. It had syntax highlighting for almost any language you could think of, and although I did not know about some of the more obvious features (comint, shells, etc.) I at least had a tool capable of running on all major platforms and with a consistent experience.

XEmacs had its downsides, though. It was falling behind and had its own way of doing things that was not entirely compatible with GNU Emacs. I eventually moved to GNU Emacs when, I think, Emacs 22 came out.

At some point during my time with Emacs back then, a light bulb went on in my mind – something that I know now, having written and taught people Emacs for many years, is a frequent occurrence – that I finally understood enough about Emacs to not feel lost. I could look up commands and keys; install and edit code; and even write some elisp!

I'd begun experimenting with Org mode, so I started a file called blogideas.org (blogs were all the rage back then!)  to capture all the things I knew and I wish others did too. That would then morph into Mastering Emacs.

Since graduating uni, I've been a professional developer. I build bespoke software for clients around the world — with Emacs as my trusty editor, of course!

What resources would you recommend for people that are interested in what you do?

For programming? Gosh, there's too much. Back in the day it was actually really hard to learn programming as you'd need books, the web/internet, or know someone who knows a bit about it. Today, it's infinitely easier to get started — though I think it's equally hard sticking to it, and becoming proficient!

I found your work through Mastering Emacs, a phenomenal site – and book (written in Emacs, of course) – that helped me design my Emacs workflow (more so as a writer than a developer). Emacs can be intimidating for first-time users. Why should they choose it over another text editor?

Thank you! I'm glad you like both. That was exactly why I started the site.

Well, you're a writer using Emacs, and I think that is interesting.

I firmly believe that a significant proportion of Mastering Emacs readers are not professional "techies" (be it system administrators, developers, testers, etc.) but either tech-adjacent or work in fields where they are expected to have some technical proficiency in their field – a dab of Fortran or Python here, a pinch of LaTeX there – and use Emacs primarily as a tool to connect disparate areas of their work that other, non-Emacs users cannot easily mimic. Editing code is easy; there's myriad editors, including Emacs of course, that can do this. But there aren't many tools to track bibliography, your agenda, email, notes, and writing. But Emacs can easily do all of that, and much more.

Some Emacs users learn it because it's a "tax" they have to pay to work in certain academic circles or commercial environments where it's the only one available, or widely used. Something my cohort in University discovered when our lecturers would hand-wave away questions like "What should we use for editing Prolog?" with "Emacs."

So I think that people should learn Emacs if they want greater control – or freedom (also in the FOSS sense) – to mould their environment and tools to their liking. Not everyone does; if you dislike tinkering and tweaking, then Emacs is harder to sell. But to those of us who have had to use an application only to find that its keyboard shortcuts get in the way (or are missing altogether); or that one key that you use that does not work in some modal dialogues; or the frustration when you have to multi-task between umpteen tools – we find comfort in Emacs, because we are imbued with a tool capable of adapting itself to our needs. Emacs is a crucible.

What are some areas where Emacs could improve, either for longtime users or for newcomers?

Hm, this is a good question.

Emacs is written and designed for people who already know Emacs. That's not so great if you don't know Emacs; but it sure is if you do. Emacs opts to replace a low skill-ceiling (and anaemic key bindings and features) with a very high one (exceptionally powerful key bindings, programmability, etc.), because if you persevere then you'll eventually learn enough to benefit from an editor that does not hamstring its users.

But that simile applies to a range of things: no matter how many books, videos or power tools you buy, you won't become a master cabinet maker overnight. It takes skill and practice. It's just that we associate "text editor" with, well... notepad. Emacs is much more than just that.

Emacs is already much friendlier than it used to be. Better defaults; more sensible inclusions that ship with Emacs. Emacs 29 adds tree-sitter and Eglot, two tools of great import to coders, that should further reduce the friction for someone keen to experiment with Emacs without having to spend a weekend learning how to set it up.

The hardest thing for newcomers – and I say this as someone who did not think to do this myself as a newbie – is to read the manual. It's right there on the splash screen, or conveniently located in the help menu. But all too many "experts" recommend you hide the splash screen, and turn off the tool and menu bar. I fell victim to that advice when I was new also. It was terrible advice. Why hide something that helps you learn and explore?

Many suggest changing the key bindings or Emacs's unique vocabulary, but I think it's window dressing, and it won't alter the learning curve much, if at all.

So my suggestion is this: alter the tutorial (C-h t) so it's interactive, prettier, and more detailed. It should neatly segue into other areas important parts of Emacs. There's a wide range of users: prose writers; note takers; coders; command line hackers; etc. Emacs is more than capable of this interactivity, and yet the tutorial makes no use of it. Emacs should be a bit more firm in its advice to newbies.

What are some of the Emacs specific workflows that help you get your work done (packages, changes from defaults, etc.)?

For me it's the ability to program Emacs when I need to. I had to write some e-mail filters – sieves, as they're known – for an e-mail server. That was tedious as I had to test that they worked; what emails they'd affect (lest I screw up badly and ransack my emails); and then against particular e-mails to make sure the filter works properly for that particular e-mail.

I wrote a handful of lines of code that glues various parts of Emacs together to do this. I press a button and Emacs connects to the remote server with TRAMP and calls the program it needs to call, and then displays the result in an Emacs buffer.

So that's the most important one: adaptation to changing requirements.

I use mostly stock Emacs key bindings, with a handful of changes to make certain things more bearable. M-o instead of C-x o; C-x C-k to kill the current buffer; F1 opens M-x shell; and a handful of other minor things.

For productivity-related stuff I use Helm a lot for specific tasks. I can call up a Mastering Emacs customer using Helm and find their sales details. Great for when people forget their email or need to change something. It's a great completion framework. I also use IDO for files and buffers and Selectrum for general-purpose completion.

Besides Emacs, what tools & gear do you use (hardware, software, or anything else that comes to mind)?

I use a ZSA Moonlander Mark 1. It's one of those fancy 'mechanical' keyboards. It's quite nice. It's programmable and extensible, and it's more comfortable than normal keyboards. I used a MS Ergonomic keyboard for about 20 years and I'd literally wear them out in about 2 years.

I occasionally do some computer gaming. So I tend to overbuy every couple of years so I don't have to care about upgrading much for the next several years. So my primary workstation is an uber-high-specced desktop (that also doubles as a space heater) with a 39" ultrawide monitor. The monitor I love. I used to used dual monitors, but... eh. This is way better. One enormous Emacs frame that I can easily split into multiple windows.

Besides the tools, what habits & routines help you finish your work?

I rarely finish my work. Unless someone's paying me, that is!

I am a habitual starter-of-projects, finisher-of-few. Half-baked, half-inventions is how I generally term the stuff I do. I tend to build something out until I'm satisfied I've sated whatever silly intellectual curiosity I have, and then I drop it like a rock, as it's rarely perfect enough for me to release.

My projects folder is full of these things.

How do you relax or take a break?

I set my own working hours, as I generally work on my terms. For clients my work is a case of agreeing the scope of what needs doing, and then I get on with it. But it's unlikely to follow a 9-5 schedule, per se. So when I want a break, I get up and walk around. Living in London affords me the ability to do all manner of cultural stuff, if that is what I feel like.

I've realised the key to my happiness is small bouts of things that bring me joy: a cup of coffee; a nice walk; it's the little things. I also adore cooking and do it daily with my girlfriend. We both enjoy food and cooking.

Whose work inspires or motivates you, or that you admire?

Hm, you know, it's a good question. I self-motivate, I think, mostly. I know it's common for people to look upon the works of others for inspiration, and I think that is probably true of me as well. But it's more of an ethereal thing for me: it's a range of things – concepts, ideas – that drive me, and less so any particular person. So when I sit down and half-invent something, it's because of that.

Subscribe to Syntopikon

Interviews, writing, and video.

jiacai2050 commented 1 year ago

对Mastering Emacs作者 Mickey Petersen 的采访

你是谁,你做什么?

我是米奇·彼得森。我住在英国伦敦。

我是一名专业的软件开发人员,从大约 10 岁开始就开始编程。我没有朋友或家人对计算有很多了解,所以我必须自己学习一切,从头开始。

您最初是如何对此感兴趣的?

我在 DOS 的 Turbo C 中开始使用 C 编程,几年后转向 Windows 的 Delphi,同时试图掌握这个叫做 Linux 的相当新奇的东西。那时候你必须经历各种困难才能得到它:我想我是从一张家庭成员的朋友的 CD 上得到的。对于我微薄的 33.6k 拨号调制解调器连接来说,它太大了,甚至无法尝试从 Web 下载它。

这是一个 Red Hat 发行版,我清楚地记得花了很长时间打印手册——否则我什至无法*安装* Linux,因为我对它一无所知——然后花了很长时间弄清楚如何安装和用它。FVWM95 是窗口管理器,看起来像 Windows 95,它是“运行 Linux”和使用当时在 DOS 或 Windows 上永远无法使用的工具的绝佳体验。那时 Linux 是“酷”的东西,而 Windows 和 DOS……没那么酷!

我试过在 Linux 上用 C 编程,我记得试过

Emacs那时。它有这种时髦的绿色配色方案;很确定这是当时 Red Hat X Resources 的东西。但我可能是错的。尽管如此,我对 Emacs 的迷恋并没有持续多久。当时它只是我试验过的一系列编辑器中的另一个工具。我可能选择了 Red Hat 附带的图形化界面,因为它默认启用了区域选择和语法突出显示等功能。Emacs 当然可以*做*两者,但当时默认情况下并未启用它们。

在此过程中,我尝试了各种包、窗口管理器等。他们花了很长时间来编译,但那时候——作为一个孩子/青少年——你有很多时间,所以这并不重要。但它为我对 Linux 等方面的兴趣奠定了基础。

许多年后,在我上大学期间,我会选择 Emacs。那一次卡住了。我是我所在大学计算机科学协会的成员,在该协会中享有盛誉和影响力的杜威十进制论坛热衷于让所有人都知道 Real Hackers Used

Vim 。不是 Emacs;不是 ed(1)、kate 或任何其他编辑;只是维姆。我从来没有买过群体思维——当然也没有从比我年长的人那里买过——所以我选择了 Emacs,因为我至少在很多年前就用过它。

当时我真的不知道 Emacs 能做什么,不能做什么。我主要使用箭头键、一些键绑定和菜单栏进行导航。我选择了 XEmacs,因为它在 20 世纪初通常领先于 GNU Emacs。由于我在大学的课程涉及永无止境的 LaTeX 和各种常见和晦涩的编程语言,因此 Emacs 是一个不错的选择。它具有几乎所有你能想到的语言的语法高亮显示,虽然我不知道一些更明显的功能(comint、shell 等),但我至少拥有一个能够在所有主要平台上运行的工具,并且具有一致的经验。

不过,XEmacs 也有它的缺点。它落后了,并且有自己的做事方式,与 GNU Emacs 不完全兼容。当我认为 Emacs 22 出来时,我最终转向了 GNU Emacs。

那时我使用 Emacs 期间的某个时刻,我的脑海里闪过一个灯泡——我现在知道,多年来我一直在编写和教人们 Emacs,这是经常发生的事情——我终于对 Emacs 有了足够的了解,以至于不再感到迷失。我可以查找命令和键;安装和编辑代码;甚至写一些 elisp!

我已经开始尝试使用

Org 模式,所以我创建了一个名为blogideas.org(当时博客风靡一时!)的文件来记录我所知道的所有事情,我希望其他人也这样做。那会变成精通 Emacs

自大学毕业以来,我一直是一名专业开发人员。我为世界各地的客户构建定制软件 — 当然,我将 Emacs 作为我可信赖的编辑器!

您会向对您的工作感兴趣的人推荐哪些资源?

为了编程?天哪,太多了。在过去,学习编程实际上非常困难,因为您需要书籍、网络/互联网,或者认识一些对此有所了解的人。_今天,开始变得非常容易 - 尽管我认为坚持_下去和变得精通同样困难!

我通过Mastering Emacs找到了您的作品,这是一个了不起的网站和书籍(当然是用 Emacs 编写的),它帮助我设计了我的 Emacs 工作流程(更像是作为一名作家而不是一名开发人员)。Emacs 可能会让初次使用的用户望而生畏。他们为什么要选择它而不是其他文本编辑器?

谢谢!我很高兴你两个都喜欢。这正是我创建该网站的原因。

好吧,您是一位使用 Emacs 的作家,我认为这很有趣。

我坚信,相当一部分精通 Emacs 的读者_并不_专业的“技术人员”(无论是系统管理员、开发人员、测试人员等),但要么与技术相关,要么在期望他们在其领域具有一定技术熟练程度的领域工作——这里有一点 Fortran 或 Python,一小撮那里有 LaTeX——并且主要将 Emacs 用作连接他们工作的不同领域的工具,其他非 Emacs 用户无法轻易模仿。编辑代码很容易;有无数的编辑器,当然包括 Emacs,可以做到这一点。但是没有很多工具可以跟踪参考书目、您的议程、电子邮件、笔记和写作。但 Emacs 可以轻松完成所有这些,甚至更多。

一些 Emacs 用户学习它是因为这是一种“税”,他们必须支付才能在某些学术界或商业环境中工作,在这些环境中,它是唯一可用或广泛使用的。当我们的讲师挥手回答诸如“我们应该用什么来编辑 Prolog?”之类的问题时,我在大学的同龄人发现了这一点。与“Emacs”。

所以我认为,如果人们想要更好的控制——或自由(在 FOSS 意义上)——按照自己的喜好塑造环境和工具,那么他们应该学习 Emacs。不是每个人都这样做;如果您不喜欢修补和调整,那么 Emacs 就更难销售。但是对于我们这些不得不使用某个应用程序却发现它的键盘快捷键妨碍(或完全缺失)的人来说;或者您使用的那个键在某些模态对话中不起作用;或者当您必须在众多工具之间执行多项任务时的挫败感——我们在 Emacs 中找到了安慰,因为我们被赋予了一种能够适应我们需求的工具。Emacs 是一个坩埚。

对于老用户还是新手,Emacs 可以改进哪些方面?

嗯,这是个好问题。

Emacs 是为已经了解 Emacs 的人编写和设计的。如果您不了解 Emacs,那就不太好了;但它肯定是如果你这样做。Emacs 选择用非常高的技能上限(异常强大的键绑定、可编程性等)替换低技能上限(以及贫乏的键绑定和功能),因为如果你坚持不懈,那么你最终会学到足够多的知识,从而从编辑器中受益这不会妨碍其用户。

但这个比喻适用于一系列事物:无论您购买多少书籍、视频或电动工具,您都不会在一夜之间成为橱柜制造大师。这需要技巧和实践。只是我们将“文本编辑器”与……记事本相关联。Emacs 远不止于此。

Emacs 已经比以前友好多了。更好的默认值;Emacs 附带的更明智的内含物。Emacs 29 添加了 tree-sitter 和 Eglot,这两个对编码人员来说非常重要的工具,对于那些热衷于尝试 Emacs 而无需花一个周末学习如何设置它的人来说,这应该会进一步减少摩擦。

对于新手来说最难的事情——我说这是作为一个不认为自己作为新手这样做的人——是阅读手册。它就_在_初始屏幕上,或者位于帮助菜单中的方便位置。但是太多“专家”建议您隐藏启动画面,并关闭工具和菜单栏。当我还是新人的时候,我也成了那个建议的受害者。这是个糟糕的建议。为什么要隐藏有助于您学习和探索的东西?

许多人建议更改键绑定或 Emacs 的独特词汇表,但我认为这是装点门面,它不会改变学习曲线,如果有的话。

所以我的建议是:修改教程 ( C-h t),使其更具交互性、更美观、更详细。它应该巧妙地延伸到 Emacs 的其他重要部分。用户范围广泛:散文作家;记笔记的人;编码员;命令行黑客;等等。Emacs 不仅具有这种交互性,而且本教程没有使用它。Emacs 对新手的建议应该更坚定一些。

有哪些特定于 Emacs 的工作流程可以帮助您完成工作(包、默认设置的更改等)?

对我来说,这是在需要时编写 Emacs 的能力。我不得不为电子邮件服务器编写一些电子邮件过滤器——众所周知的筛子。这很乏味,因为我必须测试它们是否有效;他们会影响哪些电子邮件(以免我搞砸并洗劫我的电子邮件);然后针对特定的电子邮件,以确保过滤器对该特定电子邮件正常工作。

为此,我编写了几行代码将 Emacs 的各个部分粘合在一起。我按下一个按钮,Emacs 使用 TRAMP 连接到远程服务器并调用它需要调用的程序,然后将结果显示在 Emacs 缓冲区中。

所以这是最重要的一个:适应不断变化的需求。

我主要使用普通的 Emacs 键绑定,并进行了一些更改以使某些事情更容易接受。M-o而不是C-x o; C-x C-k杀死当前缓冲区;F1 打开Mx外壳;和其他一些小事。

对于与生产力相关的东西,我经常使用 Helm 来完成特定任务。我可以使用 Helm 致电 Mastering Emacs 客户并找到他们的销售详细信息。非常适合人们忘记电子邮件或需要更改某些内容的情况。这是一个很棒的完成框架。我还将 IDO 用于文件和缓冲区,将 Selectrum 用于通用完成。

除了 Emacs,您还使用什么工具和装备(硬件、软件或想到的任何其他东西)?

我使用ZSA Moonlander Mark 1 。这是那些花哨的“机械”键盘之一。这很好。它是可编程和可扩展的,比普通键盘更舒适。我使用 MS Ergonomic 键盘大约 20 年,实际上我会在大约 2 年内将其磨损。

我偶尔会玩一些电脑游戏。所以我倾向于每隔几年超买,这样我就不必在意接下来几年的升级。所以我的主要工作站是一个超高规格的台式机(也兼作空间加热器),带有 39" 超宽显示器。我喜欢的显示器。我曾经使用过双显示器,但是......嗯。这更好. 一个巨大的 Emacs 框架,我可以轻松地将其拆分为多个窗口。

除了工具,还有哪些习惯和惯例可以帮助您完成工作?

我很少完成我的工作。除非有人付钱给我,否则!

我是一个习惯性的项目启动者,少数项目的完成者。半生不熟,半发明是我通常如何称呼我所做的事情。我倾向于构建一些东西,直到我满意我已经满足了我所有愚蠢的求知欲,然后我像石头一样扔掉它,因为它很少完美到足以让我释放。

我的项目文件夹中充满了这些东西。

你如何放松或休息一下?

我设定自己的工作时间,因为我通常按照自己的方式工作。对于客户来说,我的工作是就需要做的事情的范围达成一致,然后我继续做下去。但它本身不太可能遵循朝九晚五的时间表。所以当我想休息的时候,我就起身四处走走。住在伦敦让我有能力从事各种文化活动,如果我喜欢的话。

我已经意识到我幸福的关键是一些能给我带来快乐的小事:一杯咖啡;散步愉快;这是小事。我也喜欢做饭,每天都和我女朋友一起做。我们都喜欢美食和烹饪。

谁的作品启发或激励了您,或者您欣赏谁的作品?

嗯,你知道,这是个好问题。我认为主要是自我激励。我知道人们从别人的作品中寻找灵感是很常见的,我想这对我来说可能也是如此。但对我来说,它更像是一种空灵的东西:它是一系列的东西——概念、想法——驱动着我,而不是任何特定的人。所以当我坐下来半发明一些东西时,就是因为这个。