emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: infloop in skeleton-insert


From: Kenichi Handa
Subject: Re: infloop in skeleton-insert
Date: Tue, 10 Apr 2007 21:27:17 +0900
User-agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/22.0.95 (i686-pc-linux-gnu) MULE/5.0 (SAKAKI)

In article <address@hidden>, Nick Roberts <address@hidden> writes:

> It doesn't on Emacs 22:

> (char-or-string-p -4)
> t

> and if it does on Emacs 23 then I think that must be the bug.

Emacs 23 surely returns nil in that case.  I think the
behaviour of Emacs 22 is a bug (or at least very confusing).

Don't people think OBJ can be safely used as an argument of
a function that expects a character (e.g. insert,
char-to-string) if (char-or-string-p OBJ) is true?

I'm not claiming to change Emacs 22 now, but I think Emacs
23 should not be reverted to Emacs 22 about this.  I propose
to apply this patch to skeleton-internal-1 of Emacs 23.

*** skeleton.el 30 Jan 2007 10:30:28 +0900      1.39.2.10
--- skeleton.el 10 Apr 2007 21:24:58 +0900      
***************
*** 355,369 ****
  
  (defun skeleton-internal-1 (element &optional literal recursive)
    (cond
     ((char-or-string-p element)
!     (if (and (integerp element)               ; -num
!            (< element 0))
!       (if skeleton-untabify
!           (backward-delete-char-untabify (- element))
!         (delete-backward-char (- element)))
!       (insert (if (not literal)
!                 (funcall skeleton-transformation-function element)
!               element))))
     ((or (eq element '\n)                      ; actually (eq '\n 'n)
        ;; The sequence `> \n' is handled specially so as to indent the first
        ;; line after inserting the newline (to get the proper indentation).
--- 355,369 ----
  
  (defun skeleton-internal-1 (element &optional literal recursive)
    (cond
+    ((and (integerp element)           ; -num
+        (< element 0))
+     (if skeleton-untabify
+       (backward-delete-char-untabify (- element))
+       (delete-backward-char (- element))))
     ((char-or-string-p element)
!     (insert (if (not literal)
!               (funcall skeleton-transformation-function element)
!             element)))
     ((or (eq element '\n)                      ; actually (eq '\n 'n)
        ;; The sequence `> \n' is handled specially so as to indent the first
        ;; line after inserting the newline (to get the proper indentation).



---
Kenichi Handa
address@hidden




reply via email to

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