ErgoEmacs — a way to Lisp

If you enjoy programming, then surely permanent are in search of the best tools, the best ideas, the best solutions. And, you know, the final stop for me was Emacs. Or rather, his Assembly of called ErgoEmacs. Under the cut is to attempt a logical and consistent story about using this text editor in the context of meeting him for the first time in my life (without going into strong specifics, but rather trying to grasp the General idea); the ideological propaganda (Emacs in General and Lisp in particular); a small criticism of the last articles on habré on this subject, as well as a small philosophical opinion. If you want to expand your horizons, ask a cat.

Preface


This article I decided to write after reading this because if I didn't use Emacs, we would not understand (from the article, which includes a link), and if used, you would understand that if not used, then nothing would have understood. Article written haphazardly, using simple compilation (factual material, links to resources and a private .emacs [file settings]), which will obviously not attract to our ranks new members. Let's try to fix the situation.

1. Preliminary data


So, initially we assume that you:

the
    the
  • Windows User (I will describe some pitfalls when you install Emacs on this OS). If you are using Linux or Mac, unfortunately, to deal with emerging issues when working with the editor (if there will be) you will have.
  • the
  • Fluent blind touch type method of typing. Under this condition, the feasibility of transition to Emacs and its use tends to zero.
  • the
  • enjoy coding. If the programming is just your job and you do not try to get her satisfaction or pleasure, then you you need to rethink life Emacs for anything
  • the
  • Know (and like) Lisp. Is more of a wish than a requirement, but it seems to me, the love of Lisp (or at least his knowledge, or the desire to learn it), in some ways, is the determining factor in selection of this editor. Although, this is purely my personal opinion and it is not dogma (unlike the previous two paragraphs)


2. Why Emacs?


Question as rhetorical for any maxera as meaningless to any person who first opens this editor. A formal answer is the following — when working with Emacs you can:

the
    the
  • to Control the cursor (the field editor) with the keyboard (keeping hands and without changing the position of fingers 8 out of 10)
  • the
  • is Relatively easy (in comparison with any IDE) to automate, to reprogram, customize and create anything (new menu items, "binding" keys, functions, macros, autocommit, extensions, etc., etc.)

Generally speaking, this is all really objective indicators of utility (cross-platform, undemanding to hardware resources, and so I not take into account, as it makes little difference, given some complexity in the study program). But from my point of view, and from my experience of use of the editor described two points is enough to begin to get maximum satisfaction and convenience in the process (even though after some time spent on mastering features of Emacs).

Additional bonuses appear when you program for Common Lisp. Installing Emacs SBCL, Slime and quicklisp you are, in fact, get a "native" development environment. For Emacs written a number of additions of varying degrees of usefulness and quality, but in General for Web development that lacks a head. There is also a wonderful package Manager and library Manager, which will greatly facilitate your life. There are many beautiful themes for comfortable work.
But most importantly, in the context of our discussion of the issue is that there are smart Chinese. And one of them named Xah Lee (old burnout amixer), has created a build of Emacs, "perebendya" almost all actively use keyboard shortcuts (as in the basic amaxa, they put it mildly, not convenient and not so obvious), added some menu items and set sea required (in each sector) plugins and ten themes. He called the whole thing ErgoEmacs?, subtly hinting to future users that build it "somewhat easier" than the basic editor. I believe that the initial meeting (and all subsequent basically the same), you need to start with this build. And the main reason is ease of development (and use) the program, compared to the basic version (the shortcuts and time saved on the installation and configuration of plugins and beautiful "tutorial" for this build). Also a high probability that the young adept did not spit at the screen and will not close this complex and not intuitive editor, as it usually happens in cases, when mentally (mentally, ideologically) is not a trained person installs Emacs.

3. Pitfalls when setting ErgoEmacs on Windows


the
    the
  • Create before you install the editor system variable HOME, whose value must be the address of the same name of the folder created beforehand in root of the system partition of the disk:

  • the
  • Go to folder in HOME the security tab and give yourself (as user, not as administrator) all rights of action with a folder and make yourself (as user, not as administrator) the owner of the folder:


  • the
  • Install ErgoEmacs
  • the
  • do Not run. Do the same thing (the rights owner) to the folder where you installed the editor
  • the
  • Create in the HOME folder file ".emacs"
  • the
  • Launch the editor, choose a theme, choose the default font, save the settings (everything can be done via menu)

In this basic setting Emacs, in principle, finished. You can start to experiment and create. It's highly recommended to read the tutorial on the project website, to learn the basic keyboard shortcuts (to move the cursor, for example, hold Alt and press J, K, L, I). In the Assembly, by default, instead of the key combinations "M-x" provides a shortcut "M-a" (where M is Alt). View at least the first three (the basics) lectures podcast Dmitry Bushenko. Also you can get acquainted with the creation of the same Dmitry, Bosenko in collaboration with A. Ott, "Programming Emacs for Editting and Refactoring Code", which provides database programming emacs lisp. You decide to create Emacs development environment for Common Lisp — the following video 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 exactly about it). It's about Lisp (or, more accurately, the modern dialect of this language — Common Lisp). Because, in my opinion, to force people to use ErgoEmacs (not to mention the basic version of this editor), it is extremely hard without good reason. And the main reason was and will always be Lisp. If you like Lisp you program in Emacs. And this statement needs no proof.
In the end, the last resort, determines the selection of an idea (language, concepts, theory, belief) is the concept of "beauty". No more terrible insult to physics, for example, than to tell him that his theory is not beautiful. The reflexivity of our thinking and not with absolute justification that was not (at the core of any method is a certain axiomatic part, which is taken "on faith" [unproven]) "compel us to see the beauty" in symmetry and/or self-similarity (for example). Lisp in this regard, in my opinion, the most beautiful and expressive language. It reflects the method and the principle of our thinking (which is actually not surprising, because you created this language for the study of artificial intelligence).
Yes, Lisp has suffered a market collapse and as systems programming language, as applied, Lisp-machine become Museum exhibits. But if the wine in this Lisp? I think not. I will not go into the history of the company Symbolics, Inc., the largest player in the market lisp machines, system and application software, written in Lisp, but one of the key engineers of this company were someone other than Richard Stahlman is the God of modern Linux users and founder of the Free Software Foundaion. Stahlman for ideological reasons hated the idea of commercial software and stole code from Symbolics, copying it into a free product of MIT. When this was revealed, he sent an e-mail to the company and threatened to blow up the dynamite. It's both funny and sad. This is one of the more or less definite reasons for the collapse of the Lisp. But it is not 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 the field of artificial intelligence and the creation of expert systems. When humankind tired to engage in the development and wanted to receive pleasure (selling and buying), and the Lisp was gone from the scene. He was not needed. It is an artifact of modern society — the subject is unique and have special properties, but almost not used for its intended purpose in consequence of its complexity (learning, playing) and lack of task appropriate scale.

However, this does not diminish the power, beauty and expressiveness of the language, as well as its homomorphity the human intellect.

PS


If someone is interested in mine .emacs 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 the 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 edit it by hand, you could mess it up, so be 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 edit it by hand, you could mess it up, so be 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)
Article based on information from habrahabr.ru

Комментарии

Популярные сообщения из этого блога

March Habrameeting in Kiev

PostgreSQL load testing using JMeter, Yandex.Tank and Overload

Monitoring PostgreSQL with Zabbix