From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: Patch to remove minor modes in tutorial Date: Sat, 08 Jul 2006 16:57:40 -0400 Message-ID: References: <449D4787.6030809@student.lu.se> <449EFFBB.80508@student.lu.se> <449FE5AB.1080906@student.lu.se> <44A00F46.3010000@student.lu.se> <44A5C419.5090908@student.lu.se> <44A789AE.8040104@student.lu.se> <44ADA45D.8080406@student.lu.se> Reply-To: rms@gnu.org NNTP-Posting-Host: main.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: sea.gmane.org 1152392473 15774 80.91.229.2 (8 Jul 2006 21:01:13 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 8 Jul 2006 21:01:13 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jul 08 23:01:12 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FzJvL-0002vC-PJ for ged-emacs-devel@m.gmane.org; Sat, 08 Jul 2006 23:01:12 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FzJvL-0000Oh-Ee for ged-emacs-devel@m.gmane.org; Sat, 08 Jul 2006 17:01:11 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FzJry-00070K-5f for emacs-devel@gnu.org; Sat, 08 Jul 2006 16:57:42 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FzJrx-0006zj-L0 for emacs-devel@gnu.org; Sat, 08 Jul 2006 16:57:41 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FzJrx-0006zf-Ap for emacs-devel@gnu.org; Sat, 08 Jul 2006 16:57:41 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FzJsf-0008VT-Kc for emacs-devel@gnu.org; Sat, 08 Jul 2006 16:58:25 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1FzJrw-0001nc-7w; Sat, 08 Jul 2006 16:57:40 -0400 Original-To: Lennart Borgman In-reply-to: <44ADA45D.8080406@student.lu.se> (message from Lennart Borgman on Fri, 07 Jul 2006 02:01:33 +0200) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:56819 Archived-At: ((eq (car value) 'cua-mode) (insert "You are using `cua-mode'." "You have enabled CUA mode" would be clearer. " If the region is not active then C-c will" " work as it normally does in Emacs.")) Please stick to present tense except when present tense is incorrect. Please understand that it is ok to change key bindings, but the tutorial may not work correctly. (See also " ) Change that to It is legitimate to change key bindings, but changed bindings do not correspond to what the tutorial says. (See also " ) This code (let (initial-bad-keys) (with-temp-buffer (insert-file (locate-library "bindings.el")) (let (expr key def-fun def-fun-txt rem-fun key-fun where remark ) (while (condition-case err (setq expr (read (current-buffer))) (error nil)) (cond ((and (eq (nth 0 expr) 'define-key) (eq (nth 1 expr) 'global-map)) (setq key (nth 2 expr)) (setq def-fun (nth 3 expr))) ((eq (nth 0 expr) 'global-set-key) (setq key (nth 1 expr)) (setq def-fun (nth 2 expr))) (t (setq key nil))) (when key (assert (eq (nth 0 def-fun) 'quote)) (setq def-fun (nth 1 def-fun)) (setq def-fun-txt (format "%s" def-fun)) (setq rem-fun (command-remapping def-fun)) (setq key-fun (key-binding key)) (setq where (where-is-internal (if rem-fun rem-fun def-fun))) (if where (setq where (key-description (car where))) (setq where "")) (setq remark nil) (unless (cond ( (eq key-fun def-fun) ... is awfully complex, and most of the job it does is irrelevant. The tutorial describes a small set of keys, perhaps 40. I think this code should not concern itself with keys that the tutorial does not teach. It should simply have a list of those keys and their standard bindings. That way it would not need to read bindings.el. (Not all the default bindings are in bindings.el, so this code won't get them all.)