📜 ⬆️ ⬇️

ErgoEmacs - a way to Lisp

If you enjoy programming, then surely you are permanently able to search for the best tools, the best ideas, the best solutions. And you know, Emacs was the final stop for me personally. Or rather - its assembly called ErgoEmacs. Under the cut, there will be an attempt at a logical and consistent story about using this text editor in the context of exploring it for the first time in life (without going into strong specifics, but rather trying to catch the general idea); ideological propaganda (emaks in general and lispa in particular); small criticism of the last of the articles on Habré on this topic, as well as a small philosophical conclusion. If you want to expand your horizons, please under the cat.

Foreword


I decided to write this article after reading this , because if I hadn’t used Emacs, I wouldn’t have understood (from the article to which the link is given), and if I had, I would have understood that if I hadn’t, I didn’t would not understand. This article is written haphazardly using a simple compilation (of factual material, links to resources and its own .emacs [settings file]), which clearly does not contribute to attracting new adepts to our ranks. Let's try to correct the situation.

1. Preliminary information


So, initially it is assumed that you:


')

2. Why Emacs?


The question is as rhetorical for any emakser as it is senseless for any person who opens this editor for the first time. The formal answer is the following - when working with Emacs, you get the option:


Generally speaking, these are all from truly objective indicators of utility (cross-platform, undemanding to hardware resources, etc. I do not take into account, since this is of little use, given some difficulty in studying the program). But, from my point of view, and based on my experience using the editor, the two points described are quite enough to start getting maximum pleasure and convenience in the process of work (even if after some time spent on learning Emacs features).

Additional bonuses appear if you program in Common Lisp . By installing Emacs, SBCL , Slime and quicklisp, you essentially get a “native” development environment. For Emacs, a huge number of add-ons of varying degrees of utility and quality have been written, but in general, for Web-development, this is enough for you. There is also an excellent package manager and library manager that will make your life a lot easier. There are many beautiful themes for comfortable work.

But the most important thing, in the context of the issue we are discussing, is that there are smart Chinese. And one of them, by the name of Xah Lee (an old, burnt emakser), created the Emacs assembly, “rebinding” almost all of the actively used keyboard shortcuts (and in the basic emaks, they are, to put it mildly, not comfortable or obvious), added some points menu and set the sea necessary (in each farm) plug-ins and a dozen themes. He called the whole thing ErgoEmacs ?, subtly suggesting to future users that his build is "somewhat more convenient" than the basic editor. I believe that the initial acquaintance (and all the subsequent, in principle, too), you need to start with this assembly. And the main reason for this is the simplicity of mastering (and using) the program, compared to installing the basic version (this is in keyboard shortcuts, and in the saved time for installing and configuring plug-ins, and in the excellent tutorial for this build). It is also highly likely that the young adept will not spit on the monitor screen and close this complex and incomprehensible editor, as is usually the case when an unprepared person installs Emacs morally (mentally, ideologically).

3. Pitfalls when installing ErgoEmacs on Windows



On this basic setup emax, in principle, is completed. You can start experimenting and creating. I highly recommend reading the tutorial on the project website, learning the basic keyboard shortcuts (to move the cursor, for example, hold down Alt and press J, K, L, I). In the assembly, by default, instead of the “Mx” key combination, the “Ma” key combination is provided (where M is Alt). Look at least the first three (most basic) lectures of the podcast Dmitry Bushenko . You can also get acquainted with the creation of the same Dmitry Bushenko in collaboration with A. Ott “Programming Emacs for Editting and Refactoring Code”, in which the programming base emacs lisp is given. You decide to create a Common Lisp development environment from Emacs - the following video to help . Buy an ergonomic keyboard. And you will be happy.

4. ErgoEmacs - a way to Lisp


Actually this article is not about ErgoEmacs (although most of it was about him). It is about Lisp (more precisely, about the modern dialect of this language - Common Lisp). Because, in my opinion, getting a person to use even ErgoEmacs (not to mention the basic version of this editor) is extremely difficult without a good reason. And the main reason was and always will be Lisp. If you love Lisp, you program in Emacs. And this statement does not need proof.
In the end, the ultimate authority determining the choice of an idea (language, concept, theory, faith) is the concept of “beauty”. There is no more terrible insult for a physicist, for example, than to tell him that his theory is not beautiful. The reflexivity of our thinking and not the possibility of an absolute justification for something else (the basis of any method is some axiomatic part, which is taken for granted [without proof]) “forces us to see beauty” in symmetry and / or in self-similarity (for example) . Lisp in this regard is, in my opinion, the most beautiful and expressive language. It reflects the way and principle of our thinking (which, actually, is not surprising, because this language was created for the study of artificial intelligence).

Yes, Lisp suffered a market crash both as a system programming language and as an application , and Lisp machines became exhibits of museums. But is this the Lisp's fault? I think not. I will not delve into the history of Symbolics, Inc. , the largest player in the lisp-machine market, system and application software written in Lisp, but one of the key engineers of this company was someone other than Richard Stolman, the god of modern Linux users and the founder of Free Software Foundaion. For ideological reasons, Stolman hated the idea of ​​commercial software and stole the code from Symbolics, copying it into a free MIT product. When it came to light, he sent an e-mail to the company and threatened to blow up dynamite. And funny and sad. This is one of the more or less specific causes of the collapse of Lisp. But it is far from the key, in my opinion.

The root of the problem in the ideology of modern society. Lisp was at its peak during the boom of research in artificial intelligence and the creation of expert systems . When humankind was tired of developing, and wanted to get pleasure (selling and buying), then Lisp left the stage. He was not needed. It is an artifact of modern society - a subject unique and possessing special properties, but practically not used for its intended purpose as a result of its complexity (in study, reproduction) and the absence of tasks of an appropriate scale.

However, this does not detract from the power, beauty and expressiveness of the language, as well as its homomorphism to the human intellect.

PS


If my .emacs is interesting to someone, then here it is.
.emacs
(add-to-list 'load-path "~ / .emacs.d /")
(add-to-list 'load-path "C: / slime")
(add-to-list 'load-path "C: /sbcl/sbcl.exe")
(add-to-list 'custom-theme-load-path "~ / .emacs.d / themes")

(load (expand-file-name "~ / quicklisp / slime-helper.el"))
;; Replace "sbcl" with your path to your implementation
(setq inferior-lisp-program "C: /sbcl/sbcl.exe")

(setq show-paren-style 'expression)
(show-paren-mode 2)

(menu-bar-mode 1)
(tool-bar-mode -1)

(setq make-backup-files nil); Don't want any backup files
(setq auto-save-list-file-name nil); Don't want any .saves files
(setq auto-save-default nil); Don't want any auto saving

(set-language-environment 'UTF-8)
(setq default-buffer-file-coding-system 'utf-8-unix)

(require 'slime)

(setq slime-net-coding-system 'utf-8-unix)

(slime-setup '(slime-fancy))

(setq lisp-indent-function 'common-lisp-indent-function)

;; built-in
(require 'ido)
(ido-mode t)
(setq ido-enable-flex-matching t)


;; built-in
(require 'bs)
(setq bs-configurations
'(("Files" "^ \\ * scratch \\ *" nil nil bs-visits-non-file bs-sort-buffer-interns-are-last))))

(global-set-key (kbd "") 'bs-show)

(require 'sr-speedbar)
(global-set-key (kbd "") 'sr-speedbar-toggle)

(when (> = emacs-major-version 24)
(require 'package)
(package-initialize)
(add-to-list 'package-archives' ("melpa". " melpa.milkbox.net/packages ") t)
)

(global-set-key (kbd "") 'other-window)
(global-set-key (kbd "") 'slime-eval-defun)
(global-set-key (kbd "") 'slime-eval-last-expression)
(global-set-key (kbd "") 'slime-compile-file)

(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you’ve been so careful,
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(cua-mode t nil (cua-base))
'(custom-enabled-themes (quote (deeper-blue)))
'(show-paren-mode t)
'(tool-bar-mode nil))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you’ve been so careful,
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(default ((t (: family "Consolas": foundry "outline": slant normal: weight bold: height 158: width normal))))
'(completions-common-part ((t (: inherit default: foreground "red"))))
'(diredp-compressed-file-suffix ((t (: foreground "# 7b68ee"))))
'(diredp-ignored-file-name ((t (: foreground "#aaaaaa"))))
'(show-paren-match ((((class color) (background light))) (: background "azure2")))))

(setq TeX-auto-save t)
(setq TeX-parse-self t)
(setq TeX-save-query nil)
(setq TeX-PDF-mode t)

Source: https://habr.com/ru/post/248957/


All Articles