emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Another bug with the macro counter


From: Luc Teirlinck
Subject: Re: Another bug with the macro counter
Date: Sat, 30 Oct 2004 09:19:53 -0500 (CDT)

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))
  
============================================================




reply via email to

[Prev in Thread] Current Thread [Next in Thread]