emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r103716: lisp/simple.el: Avoid warnin


From: Juanma Barranquero
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r103716: lisp/simple.el: Avoid warning about `delete-backward-char'.
Date: Tue, 22 Mar 2011 16:15:21 +0100
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 103716
committer: Juanma Barranquero <address@hidden>
branch nick: trunk
timestamp: Tue 2011-03-22 16:15:21 +0100
message:
  lisp/simple.el: Avoid warning about `delete-backward-char'.
modified:
  lisp/ChangeLog
  lisp/simple.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-03-22 13:10:43 +0000
+++ b/lisp/ChangeLog    2011-03-22 15:15:21 +0000
@@ -1,5 +1,8 @@
 2011-03-22  Juanma Barranquero  <address@hidden>
 
+       * simple.el (backward-delete-char-untabify):
+       Avoid warning about using `delete-backward-char'.
+
        * image.el (image-type-file-name-regexps): Make it variable.
        `imagemagick-register-types' modifies it, and the user may want
        to add new extensions for known image types.

=== modified file 'lisp/simple.el'
--- a/lisp/simple.el    2011-03-10 11:28:33 +0000
+++ b/lisp/simple.el    2011-03-22 15:15:21 +0000
@@ -3392,16 +3392,16 @@
                (delete-char 1)))
          (forward-char -1)
          (setq count (1- count))))))
-  (delete-backward-char
-   (let ((skip (cond ((eq backward-delete-char-untabify-method 'hungry) " \t")
+  (let* ((skip (cond ((eq backward-delete-char-untabify-method 'hungry) " \t")
                      ((eq backward-delete-char-untabify-method 'all)
-                      " \t\n\r"))))
-     (if skip
-         (let ((wh (- (point) (save-excursion (skip-chars-backward skip)
-                                           (point)))))
-        (+ arg (if (zerop wh) 0 (1- wh))))
-         arg))
-   killp))
+                      " \t\n\r")))
+         (n (if skip
+                (let ((wh (- (point) (save-excursion (skip-chars-backward skip)
+                                                     (point)))))
+                  (+ arg (if (zerop wh) 0 (1- wh))))
+              arg)))
+    ;; Avoid warning about delete-backward-char
+    (with-no-warnings (delete-backward-char n killp))))
 
 (defun zap-to-char (arg char)
   "Kill up to and including ARGth occurrence of CHAR.


reply via email to

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