comparison lisp/progmodes/cperl-mode.el @ 49850:0bdcd08034e1

(cperl-electric-keyword, cperl-electric-pod, cperl-do-auto-fill): Fix character constants.
author Juanma Barranquero <lekktu@gmail.com>
date Tue, 18 Feb 2003 12:49:26 +0000
parents aca582e2f94c
children c5956f47d1f6
comparison
equal deleted inserted replaced
49849:bc736e4d9025 49850:0bdcd08034e1
1833 Help message may be switched off by setting `cperl-message-electric-keyword' 1833 Help message may be switched off by setting `cperl-message-electric-keyword'
1834 to nil." 1834 to nil."
1835 (let ((beg (save-excursion (beginning-of-line) (point))) 1835 (let ((beg (save-excursion (beginning-of-line) (point)))
1836 (dollar (and (eq last-command-char ?$) 1836 (dollar (and (eq last-command-char ?$)
1837 (eq this-command 'self-insert-command))) 1837 (eq this-command 'self-insert-command)))
1838 (delete (and (memq last-command-char '(?\ ?\n ?\t ?\f)) 1838 (delete (and (memq last-command-char '(?\ ?\n ?\t ?\f))
1839 (memq this-command '(self-insert-command newline)))) 1839 (memq this-command '(self-insert-command newline))))
1840 my do) 1840 my do)
1841 (and (save-excursion 1841 (and (save-excursion
1842 (condition-case nil 1842 (condition-case nil
1843 (progn 1843 (progn
1903 (cperl-ensure-newlines (1- n) pos) 1903 (cperl-ensure-newlines (1- n) pos)
1904 (goto-char pos))) 1904 (goto-char pos)))
1905 1905
1906 (defun cperl-electric-pod () 1906 (defun cperl-electric-pod ()
1907 "Insert a POD chunk appropriate after a =POD directive." 1907 "Insert a POD chunk appropriate after a =POD directive."
1908 (let ((delete (and (memq last-command-char '(?\ ?\n ?\t ?\f)) 1908 (let ((delete (and (memq last-command-char '(?\ ?\n ?\t ?\f))
1909 (memq this-command '(self-insert-command newline)))) 1909 (memq this-command '(self-insert-command newline))))
1910 head1 notlast name p really-delete over) 1910 head1 notlast name p really-delete over)
1911 (and (save-excursion 1911 (and (save-excursion
1912 (forward-word -1) 1912 (forward-word -1)
1913 (and 1913 (and
4230 (end-of-line) 4230 (end-of-line)
4231 (current-column)) 4231 (current-column))
4232 fill-column) 4232 fill-column)
4233 (let ((c (save-excursion (beginning-of-line) 4233 (let ((c (save-excursion (beginning-of-line)
4234 (cperl-to-comment-or-eol) (point))) 4234 (cperl-to-comment-or-eol) (point)))
4235 (s (memq (following-char) '(?\ ?\t))) marker) 4235 (s (memq (following-char) '(?\ ?\t))) marker)
4236 (if (>= c (point)) nil 4236 (if (>= c (point)) nil
4237 (setq marker (point-marker)) 4237 (setq marker (point-marker))
4238 (cperl-fill-paragraph) 4238 (cperl-fill-paragraph)
4239 (goto-char marker) 4239 (goto-char marker)
4240 ;; Is not enough, sometimes marker is a start of line 4240 ;; Is not enough, sometimes marker is a start of line
4241 (if (bolp) (progn (re-search-forward "#+[ \t]*") 4241 (if (bolp) (progn (re-search-forward "#+[ \t]*")
4242 (goto-char (match-end 0)))) 4242 (goto-char (match-end 0))))
4243 ;; Following space could have gone: 4243 ;; Following space could have gone:
4244 (if (or (not s) (memq (following-char) '(?\ ?\t))) nil 4244 (if (or (not s) (memq (following-char) '(?\ ?\t))) nil
4245 (insert " ") 4245 (insert " ")
4246 (backward-char 1)) 4246 (backward-char 1))
4247 ;; Previous space could have gone: 4247 ;; Previous space could have gone:
4248 (or (memq (preceding-char) '(?\ ?\t)) (insert " ")))))) 4248 (or (memq (preceding-char) '(?\ ?\t)) (insert " "))))))
4249 4249
4250 (defun cperl-imenu-addback (lst &optional isback name) 4250 (defun cperl-imenu-addback (lst &optional isback name)
4251 ;; We suppose that the lst is a DAG, unless the first element only 4251 ;; We suppose that the lst is a DAG, unless the first element only
4252 ;; loops back, and ISBACK is set. Thus this function cannot be 4252 ;; loops back, and ISBACK is set. Thus this function cannot be
4253 ;; applied twice without ISBACK set. 4253 ;; applied twice without ISBACK set.