X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/bde2ab6f5bd2be6769f36e17fc99352382ffcc0a..7cef3569a3d872ea5be07a529b68910bf1d8b790:/lisp/progmodes/cperl-mode.el diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index 2c258fb446..e1430b67e9 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -1838,7 +1838,13 @@ or as help on variables `cperl-tips', `cperl-problems', (set (make-local-variable 'cperl-syntax-done-to) nil) (set (make-local-variable 'syntax-propertize-function) (lambda (start end) - (goto-char start) (cperl-fontify-syntaxically end)))) + (goto-char start) + ;; Even if cperl-fontify-syntaxically has already gone + ;; beyond `start', syntax-propertize has just removed + ;; syntax-table properties between start and end, so we have + ;; to re-apply them. + (setq cperl-syntax-done-to start) + (cperl-fontify-syntaxically end)))) (make-local-variable 'parse-sexp-lookup-properties) ;; Do not introduce variable if not needed, we check it! (set 'parse-sexp-lookup-properties t) @@ -2322,8 +2328,7 @@ to nil." nil t)))) ; Only one (progn (forward-word 1) - (setq name (file-name-sans-extension - (file-name-nondirectory (buffer-file-name))) + (setq name (file-name-base) p (point)) (insert " NAME\n\n" name " - \n\n=head1 SYNOPSIS\n\n\n\n" @@ -3498,7 +3503,8 @@ Works before syntax recognition is done." (if end ;; Do the same for end, going small steps (save-excursion - (while (and end (get-text-property end 'syntax-type)) + (while (and end (< end (point-max)) + (get-text-property end 'syntax-type)) (setq pos end end (next-single-property-change end 'syntax-type nil (point-max))) (if end (progn (goto-char end)