From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: First draft of the Emacs website Date: Tue, 08 Dec 2015 17:08:20 +0100 Message-ID: <87poygrki3.fsf@fencepost.gnu.org> References: <87io4lem98.fsf@petton.fr> <56604A9C.7080508@gmail.com> <20151208130529.GA28682@HAL9000> <1c367763-4ba1-4c65-80d1-be1b365c3b35@default> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1449590929 18409 80.91.229.3 (8 Dec 2015 16:08:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 8 Dec 2015 16:08:49 +0000 (UTC) Cc: Valentijn , Emacs developers , Drew Adams , John Yates To: Spencer Boucher Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 08 17:08:48 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1a6Koq-0000DF-6h for ged-emacs-devel@m.gmane.org; Tue, 08 Dec 2015 17:08:48 +0100 Original-Received: from localhost ([::1]:60522 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a6Kop-00050t-HT for ged-emacs-devel@m.gmane.org; Tue, 08 Dec 2015 11:08:47 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60503) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a6Kol-00050a-Al for emacs-devel@gnu.org; Tue, 08 Dec 2015 11:08:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a6Koh-00005n-CG for emacs-devel@gnu.org; Tue, 08 Dec 2015 11:08:43 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:33591) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a6Koh-00005h-93; Tue, 08 Dec 2015 11:08:39 -0500 Original-Received: from localhost ([127.0.0.1]:47410 helo=lola) by fencepost.gnu.org with esmtp (Exim 4.82) (envelope-from ) id 1a6Kog-0005AI-Kr; Tue, 08 Dec 2015 11:08:38 -0500 Original-Received: by lola (Postfix, from userid 1000) id ACD5FDF577; Tue, 8 Dec 2015 17:08:20 +0100 (CET) In-Reply-To: (Spencer Boucher's message of "Tue, 08 Dec 2015 10:21:25 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:195981 Archived-At: Spencer Boucher writes: > <#multipart type=3Dalternative><#part type=3Dtext/plain> > > >> At the end of the day, we do need to refer to the language by its >> name, I think, but we could stress that it is a "Python-like" >> language, to connect with what people might be more familiar with. > > > Calling elisp "python-like" might be a bit of a stretch :) adjust-parens is an installed package. Status: Installed in =E2=80=98adjust-parens-3.0/=E2=80=99 (unsigned). = Delete Version: 3.0 Summary: Indent and dedent Lisp code, automatically adjust close parens Homepage: http://elpa.gnu.org/packages/adjust-parens.html Other versions: 3.0 (gnu). This package provides commands for indenting and dedenting Lisp code such that close parentheses and brackets are automatically adjusted to be consistent with the new level of indentation. When reading Lisp, the programmer pays attention to open parens and the close parens on the same line. But when a sexp spans more than one line, she deduces the close paren from indentation alone. Given that's how we read Lisp, this package aims to enable editing Lisp similarly: automatically adjust the close parens programmers ignore when reading. A result of this is an editing experience somewhat like python-mode, which also offers "indent" and "dedent" commands. There are differences because lisp-mode knows more due to existing parens. To use: (require 'adjust-parens) (add-hook 'emacs-lisp-mode-hook #'adjust-parens-mode) (add-hook 'clojure-mode-hook #'adjust-parens-mode) ;; etc This binds two keys in Lisp Mode: (local-set-key (kbd "TAB") 'lisp-indent-adjust-parens) (local-set-key (kbd "") 'lisp-dedent-adjust-parens) lisp-indent-adjust-parens potentially calls indent-for-tab-command (the usual binding for TAB in Lisp Mode). Thus it should not interfere with other TAB features like completion-at-point. Some examples follow. | indicates the position of point. (let ((x 10) (y (some-func 20)))) | After one TAB: (let ((x 10) (y (some-func 20))) |) After three more TAB: (let ((x 10) (y (some-func 20 |)))) After two Shift-TAB to dedent: (let ((x 10) (y (some-func 20)) |)) When dedenting, the sexp may have sibling sexps on lines below. It makes little sense for those sexps to stay at the same indentation, because they cannot keep the same parent sexp without being moved completely. Thus they are dedented too. An example of this: (defun func () (save-excursion (other-func-1) |(other-func-2) (other-func-3))) After Shift-TAB: (defun func () (save-excursion (other-func-1)) |(other-func-2) (other-func-3)) If you indent again with TAB, the sexps siblings aren't indented: (defun func () (save-excursion (other-func-1) |(other-func-2)) (other-func-3)) Thus TAB and Shift-TAB are not exact inverse operations of each other, though they often seem to be. [back] --=20 David Kastrup