From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Aaron S. Hawley" Newsgroups: gmane.emacs.bugs Subject: bug#11127: 24.0.94; [PATCH] Tutorial breaks with modified key bindings Date: Thu, 29 Mar 2012 14:49:33 -0400 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: dough.gmane.org 1333047048 27873 80.91.229.3 (29 Mar 2012 18:50:48 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 29 Mar 2012 18:50:48 +0000 (UTC) To: 11127@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Mar 29 20:50:48 2012 Return-path: Envelope-to: geb-bug-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 1SDKQp-0005oH-4I for geb-bug-gnu-emacs@m.gmane.org; Thu, 29 Mar 2012 20:50:47 +0200 Original-Received: from localhost ([::1]:57527 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SDKQo-00048T-J0 for geb-bug-gnu-emacs@m.gmane.org; Thu, 29 Mar 2012 14:50:46 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:51988) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SDKQk-00047D-Kq for bug-gnu-emacs@gnu.org; Thu, 29 Mar 2012 14:50:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SDKQi-0001xn-OY for bug-gnu-emacs@gnu.org; Thu, 29 Mar 2012 14:50:42 -0400 Original-Received: from [140.186.70.43] (port=38414 helo=debbugs.gnu.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SDKQi-0001wE-IE for bug-gnu-emacs@gnu.org; Thu, 29 Mar 2012 14:50:40 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SDKv4-0003qV-9Q for bug-gnu-emacs@gnu.org; Thu, 29 Mar 2012 15:22:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Aaron S. Hawley" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 29 Mar 2012 19:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 11127 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.133304890114748 (code B ref -1); Thu, 29 Mar 2012 19:22:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 29 Mar 2012 19:21:41 +0000 Original-Received: from localhost ([127.0.0.1]:45246 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SDKui-0003pp-HH for submit@debbugs.gnu.org; Thu, 29 Mar 2012 15:21:40 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:52065) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SDKuF-0003p5-BR for submit@debbugs.gnu.org; Thu, 29 Mar 2012 15:21:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SDKPl-0001Rm-LH for submit@debbugs.gnu.org; Thu, 29 Mar 2012 14:49:43 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:53202) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SDKPl-0001Rb-Fm for submit@debbugs.gnu.org; Thu, 29 Mar 2012 14:49:41 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:51594) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SDKPj-0003vN-MF for bug-gnu-emacs@gnu.org; Thu, 29 Mar 2012 14:49:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SDKPh-0001QZ-1B for bug-gnu-emacs@gnu.org; Thu, 29 Mar 2012 14:49:39 -0400 Original-Received: from mail-bk0-f41.google.com ([209.85.214.41]:44428) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SDKPg-0001Pv-Nk for bug-gnu-emacs@gnu.org; Thu, 29 Mar 2012 14:49:36 -0400 Original-Received: by bkwq16 with SMTP id q16so2759467bkw.0 for ; Thu, 29 Mar 2012 11:49:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=tvu1jIsipulq4vGGYlFDc96h+17xFtLh9CX1fHZQqzI=; b=f30qu3vq/83KyVmamHT8vxZEVr+xUkC91vaJ9u31rVmBXKFq0LkFpGKnmA6XBU1gk8 loVYg78Db0DZJ16aZGlNoYa4FrZQC5oWHbAmRFBrxRSq8OaUOOraVHFdnBEmJvFXKOwr /fINwiKEK/tPX55uLFrVa0mM7wuQZ9L36UwC5FjvPz4duKPk9B4V6HdpZMookUnXadsq BH23bGG1o5ZAlw/cHytjXs1pCIAqS1ctJXo0Lsth4Z1u+APCBlT1ZQdO7F3ylkDN6uq0 EqJdNy4CWPVgXmXvABltktH7d5euxPTF49jJCRQotuCtBsV/7FVkMeBO6AAVNP/lPZPv FqGA== Original-Received: by 10.204.150.75 with SMTP id x11mr14204494bkv.62.1333046973989; Thu, 29 Mar 2012 11:49:33 -0700 (PDT) Original-Received: by 10.205.35.78 with HTTP; Thu, 29 Mar 2012 11:49:33 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:58294 Archived-At: 2012-03-29 Aaron S. Hawley * tutorial.el (help-with-tutorial, tutorial--display-changes): If user has modified default key bindings then Emacs complains "Buffer is read-only: #" rather than adding the notice about "the most important standard Emacs commands". --- tutorial.el 2012-02-13 11:13:25.000000000 -0500 +++ tutorial.el 2012-03-29 14:25:01.667926700 -0400 @@ -538,7 +538,8 @@ If some of the default key bindings that the tutorial depends on have been changed then display the changes in the tutorial buffer with some explanatory links." - (let* ((changed-keys (tutorial--find-changed-keys + (let* ((inhibit-read-only t) + (changed-keys (tutorial--find-changed-keys tutorial--default-keys)) ;; Alist of element (DESC . CK) where DESC is the ;; key-description of a changed key and CK is the @@ -828,7 +829,7 @@ (setq old-tut-file (y-or-n-p "Resume your last saved tutorial? "))) (if old-tut-file - (progn + (let ((inhibit-read-only t)) (insert-file-contents (tutorial--saved-file)) (let ((enable-local-variables :safe)) (hack-local-variables)) @@ -846,7 +847,8 @@ (delete-region (point-min) (point)) (goto-char tutorial--point-before-chkeys) (setq tutorial--point-before-chkeys (point-marker))) - (insert-file-contents (expand-file-name filename tutorial-directory)) + (let ((inhibit-read-only t)) + (insert-file-contents (expand-file-name filename tutorial-directory))) (let ((enable-local-variables :safe)) (hack-local-variables)) (forward-line) @@ -871,12 +873,14 @@ ;; Delete the arch-tag line, so as not to confuse readers. (goto-char (point-max)) (if (search-backward ";;; arch-tag: " nil t) - (delete-region (point) (point-max))) + (let ((inhibit-read-only t)) + (delete-region (point) (point-max)))) (goto-char (point-min)) (search-forward "\n<<") (beginning-of-line) ;; Convert the <<...>> line to the proper [...] line, ;; or just delete the <<...>> line if a [...] line follows. + (let ((inhibit-read-only t)) (cond ((save-excursion (forward-line 1) (looking-at "\\[")) @@ -887,18 +891,19 @@ (looking-at "<<") (replace-match "[") (search-forward ">>") - (replace-match "]"))) + (replace-match "]")))) (beginning-of-line) ;; FIXME: if the window is not tall, and especially if the ;; big red "NOTICE: The main purpose..." text has been ;; inserted at the start of the buffer, the "type C-v to ;; move to the next screen" might not be visible on the ;; first screen (n < 0). How will the novice know what to do? - (let ((n (- (window-height (selected-window)) + (let ((inhibit-read-only t) + (n (- (window-height (selected-window)) (count-lines (point-min) (point)) 6))) (if (< n 8) - (progn + (let ((inhibit-read-only t)) ;; For a short gap, we don't need the [...] line, ;; so delete it. (delete-region (point) (progn (end-of-line) (point))) Thanks for Emacs, aaron -- In general, we reserve the right to have a poor memory--the computer, however, is supposed to remember! Poor computer. -- Guy Lewis Steele Jr.