From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.help Subject: Re: Emacs Book Vs Emacs Manuals Date: Sat, 27 Jun 2015 19:42:58 +0200 Message-ID: <87lhf53v4t.fsf@nl106-137-147.student.uu.se> References: <554C9356.5000204@gmail.com> <20150508125314086261755@bob.proulx.com> <87bnhuc177.fsf@mbork.pl> <55561B9E.4070101@arlsoft.com> <87y4kpfvct.fsf@debian.uxu> <87mvzmv7ef.fsf@nl106-137-147.student.uu.se> <871tgycjae.fsf@mbork.pl> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1435427094 11565 80.91.229.3 (27 Jun 2015 17:44:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 27 Jun 2015 17:44:54 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Jun 27 19:44:45 2015 Return-path: Envelope-to: geh-help-gnu-emacs@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 1Z8u9k-0007u3-PA for geh-help-gnu-emacs@m.gmane.org; Sat, 27 Jun 2015 19:44:44 +0200 Original-Received: from localhost ([::1]:36264 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8u9k-0000AP-1C for geh-help-gnu-emacs@m.gmane.org; Sat, 27 Jun 2015 13:44:44 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51289) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8u9a-00009S-2z for help-gnu-emacs@gnu.org; Sat, 27 Jun 2015 13:44:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z8u9V-0007Ns-VT for help-gnu-emacs@gnu.org; Sat, 27 Jun 2015 13:44:33 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:58133) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8u9V-0007Nm-Oi for help-gnu-emacs@gnu.org; Sat, 27 Jun 2015 13:44:29 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Z8u9U-0007gR-8X for help-gnu-emacs@gnu.org; Sat, 27 Jun 2015 19:44:28 +0200 Original-Received: from nl106-137-246.student.uu.se ([130.243.137.246]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 27 Jun 2015 19:44:28 +0200 Original-Received: from embe8573 by nl106-137-246.student.uu.se with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 27 Jun 2015 19:44:28 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: help-gnu-emacs@gnu.org Original-Lines: 49 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: nl106-137-246.student.uu.se Mail-Copies-To: never User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) Cancel-Lock: sha1:XUY66uyGWfL3QQyYUnC7aMINBSk= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:105227 Archived-At: Rusi writes: >> %% (replace-regexp "^\\(.*&.*&\\).*&\\(.*\\)" >> "\\1\\2") > > 51 chars (ignoring that things like ^& are shift > chords) > > F3 C-s & RET C-SPC C-s C-s RET C-w C-a C-n F4 > > 16 keystrokes counting each chord as 1 1/2 keys Elisp is by definition better because everything you can do with keyboard macros, you can do with Elisp - but not even remotely so the other way around. When you have done something with Elisp, you can save that for future use. What it is is clearly defined and easy to read and edit. Not only that, if it is modular, as it should, you can use it for other, unexpected things in the future. In the past, people wrote extremely long programs that were macro-ish with a lot of repetition and patterns in the code, and if you did that all day I suppose a macro to do the same thing over and over would come in handy. I don't know why people wrote code like that then, probably it was their programming languages that weren't as powerful as Lisp. With all with have with Lisp there isn't any reason to do that. Instead of having page up, page down with SOME_VARIABLE_1 = 1 SOME_VARIABLE_2 = 2 ... SOME_FUNCTION_1 = f1 SOME_FUNCTION_2 = f2 and then use macros to keep track of it all should you want to change it you put all that in data structures and have a function do the mapping. Whenever you want to change something, you'd change the function, not use macros to change the code. -- underground experts united http://user.it.uu.se/~embe8573