Mercurial > emacs
comparison lisp/progmodes/cperl-mode.el @ 59103:9c9d41548660
(cperl-find-bad-style): Use with-no-warnings.
(cperl-font-lock-unfontify-region-function): No need to save and
restore info, since font-lock.el does it for us.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Mon, 27 Dec 2004 15:39:42 +0000 |
parents | 4edc8e8a8ed6 |
children | 520077017d32 |
comparison
equal
deleted
inserted
replaced
59102:0096c58ce34a | 59103:9c9d41548660 |
---|---|
6024 Prompts user for insertion of spaces. | 6024 Prompts user for insertion of spaces. |
6025 Currently it is tuned to C and Perl syntax." | 6025 Currently it is tuned to C and Perl syntax." |
6026 (interactive) | 6026 (interactive) |
6027 (let (found-bad (p (point))) | 6027 (let (found-bad (p (point))) |
6028 (setq last-nonmenu-event 13) ; To disable popup | 6028 (setq last-nonmenu-event 13) ; To disable popup |
6029 (beginning-of-buffer) | 6029 (with-no-warnings ; It is useful to push the mark here. |
6030 (beginning-of-buffer)) | |
6030 (map-y-or-n-p "Insert space here? " | 6031 (map-y-or-n-p "Insert space here? " |
6031 (lambda (arg) (insert " ")) | 6032 (lambda (arg) (insert " ")) |
6032 'cperl-next-bad-style | 6033 'cperl-next-bad-style |
6033 '("location" "locations" "insert a space into") | 6034 '("location" "locations" "insert a space into") |
6034 '((?\C-r (lambda (arg) | 6035 '((?\C-r (lambda (arg) |
7181 | 7182 |
7182 | 7183 |
7183 ;;; Plug for wrong font-lock: | 7184 ;;; Plug for wrong font-lock: |
7184 | 7185 |
7185 (defun cperl-font-lock-unfontify-region-function (beg end) | 7186 (defun cperl-font-lock-unfontify-region-function (beg end) |
7186 (let* ((modified (buffer-modified-p)) (buffer-undo-list t) | 7187 ;; Simplified now that font-lock-unfontify-region uses save-buffer-state. |
7187 (inhibit-read-only t) (inhibit-point-motion-hooks t) | 7188 (let (before-change-functions after-change-functions) |
7188 before-change-functions after-change-functions | 7189 (remove-text-properties beg end '(face nil)))) |
7189 deactivate-mark buffer-file-name buffer-file-truename) | |
7190 (remove-text-properties beg end '(face nil)) | |
7191 (when (and (not modified) (buffer-modified-p)) | |
7192 (set-buffer-modified-p nil)))) | |
7193 | 7190 |
7194 (defvar cperl-d-l nil) | 7191 (defvar cperl-d-l nil) |
7195 (defun cperl-fontify-syntaxically (end) | 7192 (defun cperl-fontify-syntaxically (end) |
7196 ;; Some vars for debugging only | 7193 ;; Some vars for debugging only |
7197 ;; (message "Syntaxifying...") | 7194 ;; (message "Syntaxifying...") |