From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Luc Teirlinck Newsgroups: gmane.emacs.devel Subject: Re: Another bug with the macro counter Date: Sat, 30 Oct 2004 09:19:53 -0500 (CDT) Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Message-ID: <200410301419.i9UEJr002854@raven.dms.auburn.edu> References: <200410210107.i9L176B10842@raven.dms.auburn.edu> <200410300238.i9U2cOD02290@raven.dms.auburn.edu> <200410300327.i9U3RWW02355@raven.dms.auburn.edu> NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1099146096 17284 80.91.229.6 (30 Oct 2004 14:21:36 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 30 Oct 2004 14:21:36 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Oct 30 16:21:25 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CNu6f-0005rI-00 for ; Sat, 30 Oct 2004 16:21:25 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CNuEZ-0006gz-Gi for ged-emacs-devel@m.gmane.org; Sat, 30 Oct 2004 10:29:35 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CNuDh-0006E5-N7 for emacs-devel@gnu.org; Sat, 30 Oct 2004 10:28:41 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CNuDg-0006Dd-RU for emacs-devel@gnu.org; Sat, 30 Oct 2004 10:28:41 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CNuDg-0006DL-Mq for emacs-devel@gnu.org; Sat, 30 Oct 2004 10:28:40 -0400 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CNu5O-0006nY-4A for emacs-devel@gnu.org; Sat, 30 Oct 2004 10:20:06 -0400 Original-Received: from raven.dms.auburn.edu (raven.dms.auburn.edu [131.204.53.29]) by manatee.dms.auburn.edu (8.12.10/8.12.10) with ESMTP id i9UEK5Fu028547; Sat, 30 Oct 2004 09:20:05 -0500 (CDT) Original-Received: (from teirllm@localhost) by raven.dms.auburn.edu (8.11.7p1+Sun/8.11.7) id i9UEJr002854; Sat, 30 Oct 2004 09:19:53 -0500 (CDT) X-Authentication-Warning: raven.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: monnier@iro.umontreal.ca In-reply-to: (message from Stefan on Sat, 30 Oct 2004 00:06:11 -0400) 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: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:29169 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:29169 Stefan Monnier wrote: I believe replacing (and (boundp 'foo) foo) with (if (boundp 'foo) foo) is a better choice because it removes the warning wihtout cluttering the code and without introducing compatibility problems with older Emacsen. Actually, on second thought, it is probably better to solve the two original problems the "classical" way, with a defvar. However, I need a `with-no-warnings' at two other places. Yesterday, I forgot that one has to compile as the very first thing after `emacs -q', to get all warnings. Revised patch: ===File ~/simple-diff-3===================================== *** simple.el 25 Oct 2004 07:40:49 -0500 1.664 --- simple.el 30 Oct 2004 08:41:38 -0500 *************** *** 857,862 **** --- 857,865 ---- :type 'boolean :version "21.1") + ;; Quiet the compiler. + (defvar edebug-active) + (defun eval-expression-print-format (value) "Format VALUE as a result of evaluated expression. Return a formatted string which is displayed in the echo area *************** *** 3907,3912 **** --- 3910,3918 ---- ;Turned off because it makes dbx bomb out. (setq blink-paren-function 'blink-matching-open) + ;; Quit the compiler. + (defvar appending-to-kbd-macro) + ;; This executes C-g typed while Emacs is waiting for a command. ;; Quitting out of a program does not go through here; ;; that happens in the QUIT macro at the C code level. *************** *** 3916,3921 **** --- 3922,3933 ---- At top-level, as an editor command, this simply beeps." (interactive) (deactivate-mark) + (or (not (featurep 'kmacro)) + appending-to-kbd-macro + ;; never exits the or. + (setq appending-to-kbd-macro nil) + (with-no-warnings (kmacro-ring-empty-p)) + (with-no-warnings (kmacro-pop-ring))) (setq defining-kbd-macro nil) (signal 'quit nil)) ============================================================