]> code.delx.au - gnu-emacs/commitdiff
(cperl-find-bad-style): Use with-no-warnings.
authorRichard M. Stallman <rms@gnu.org>
Mon, 27 Dec 2004 15:39:42 +0000 (15:39 +0000)
committerRichard M. Stallman <rms@gnu.org>
Mon, 27 Dec 2004 15:39:42 +0000 (15:39 +0000)
(cperl-font-lock-unfontify-region-function): No need to save and
restore info, since font-lock.el does it for us.

lisp/progmodes/cperl-mode.el

index accdad515f230b473cda4f639df9c0f348b90d21..00bd1af4da9f6c965ee0d3efc353c0e75aca511f 100644 (file)
@@ -6026,7 +6026,8 @@ Currently it is tuned to C and Perl syntax."
   (interactive)
   (let (found-bad (p (point)))
     (setq last-nonmenu-event 13)       ; To disable popup
-    (beginning-of-buffer)
+    (with-no-warnings  ; It is useful to push the mark here.
+     (beginning-of-buffer))
     (map-y-or-n-p "Insert space here? "
                  (lambda (arg) (insert " "))
                  'cperl-next-bad-style
@@ -7183,13 +7184,9 @@ Delay of auto-help controlled by `cperl-lazy-help-time'."
 ;;; Plug for wrong font-lock:
 
 (defun cperl-font-lock-unfontify-region-function (beg end)
-  (let* ((modified (buffer-modified-p)) (buffer-undo-list t)
-        (inhibit-read-only t) (inhibit-point-motion-hooks t)
-        before-change-functions after-change-functions
-        deactivate-mark buffer-file-name buffer-file-truename)
-    (remove-text-properties beg end '(face nil))
-    (when (and (not modified) (buffer-modified-p))
-      (set-buffer-modified-p nil))))
+  ;; Simplified now that font-lock-unfontify-region uses save-buffer-state.
+  (let (before-change-functions after-change-functions)
+    (remove-text-properties beg end '(face nil))))
 
 (defvar cperl-d-l nil)
 (defun cperl-fontify-syntaxically (end)