(set 'vc-rcs-header cperl-vc-rcs-header)
(make-local-variable 'vc-sccs-header)
(set 'vc-sccs-header cperl-vc-sccs-header)
- ;; This one is obsolete...
- (make-local-variable 'vc-header-alist)
- (with-no-warnings
- (set 'vc-header-alist (or cperl-vc-header-alist ; Avoid warning
- `((SCCS ,(car cperl-vc-sccs-header))
- (RCS ,(car cperl-vc-rcs-header)))))
- )
+ (when (featurep 'xemacs)
+ ;; This one is obsolete...
+ (make-local-variable 'vc-header-alist)
+ (set 'vc-header-alist (or cperl-vc-header-alist ; Avoid warning
+ `((SCCS ,(car cperl-vc-sccs-header))
+ (RCS ,(car cperl-vc-rcs-header))))))
(cond ((boundp 'compilation-error-regexp-alist-alist);; xemacs 20.x
(make-local-variable 'compilation-error-regexp-alist-alist)
(set 'compilation-error-regexp-alist-alist
(make-local-variable 'cperl-syntax-state)
(setq cperl-syntax-state nil) ; reset syntaxification cache
(if cperl-use-syntax-table-text-property
- (progn
+ (if (boundp 'syntax-propertize-function)
+ (progn
+ ;; Reset syntaxification cache.
+ (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))))
(make-local-variable 'parse-sexp-lookup-properties)
;; Do not introduce variable if not needed, we check it!
(set 'parse-sexp-lookup-properties t)
"Insert an opening parenthesis or a matching pair of parentheses.
See `cperl-electric-parens'."
(interactive "P")
- (let ((beg (save-excursion (beginning-of-line) (point)))
+ (let ((beg (point-at-bol))
(other-end (if (and cperl-electric-parens-mark
(cperl-mark-active)
(> (mark) (point)))
If not, or if we are not at the end of marking range, would self-insert.
Affected by `cperl-electric-parens'."
(interactive "P")
- (let ((beg (save-excursion (beginning-of-line) (point)))
+ (let ((beg (point-at-bol))
(other-end (if (and cperl-electric-parens-mark
(cperl-val 'cperl-electric-parens)
(memq last-command-event
"Insert a construction appropriate after a keyword.
Help message may be switched off by setting `cperl-message-electric-keyword'
to nil."
- (let ((beg (save-excursion (beginning-of-line) (point)))
+ (let ((beg (point-at-bol))
(dollar (and (eq last-command-event ?$)
(eq this-command 'self-insert-command)))
(delete (and (memq last-command-event '(?\s ?\n ?\t ?\f))
"Insert a construction appropriate after a keyword.
Help message may be switched off by setting `cperl-message-electric-keyword'
to nil."
- (let ((beg (save-excursion (beginning-of-line) (point))))
+ (let ((beg (point-at-bol)))
(and (save-excursion
(backward-sexp 1)
(cperl-after-expr-p nil "{;:"))
"Go to end of line, open a new line and indent appropriately.
If in POD, insert appropriate lines."
(interactive)
- (let ((beg (save-excursion (beginning-of-line) (point)))
- (end (save-excursion (end-of-line) (point)))
+ (let ((beg (point-at-bol))
+ (end (point-at-eol))
(pos (point)) start over cut res)
(if (and ; Check if we need to split:
; i.e., on a boundary and inside "{...}"
(forward-paragraph -1)
(forward-word 1)
(setq pos (point))
- (setq cut (buffer-substring (point)
- (save-excursion
- (end-of-line)
- (point))))
- (delete-char (- (save-excursion (end-of-line) (point))
- (point)))
+ (setq cut (buffer-substring (point) (point-at-eol)))
+ (delete-char (- (point-at-eol) (point)))
(setq res (expand-abbrev))
(save-excursion
(goto-char pos)
(point-max)))) ; do not loop if no syntaxification
;; label:
(t
- (save-excursion (end-of-line)
- (setq colon-line-end (point)))
+ (setq colon-line-end (point-at-eol))
(search-forward ":"))))
;; We are at beginning of code (NOT label or comment)
;; First, the following code counts
(looking-at "sub\\>")))
(setq p (nth 1 ; start of innermost containing list
(parse-partial-sexp
- (save-excursion (beginning-of-line)
- (point))
+ (point-at-bol)
(point)))))
(progn
(goto-char (1+ p)) ; enclosing block on the same line
Returns true if comment is found. In POD will not move the point."
;; If the line is inside other syntax groups (qq-style strings, HERE-docs)
;; then looks for literal # or end-of-line.
- (let (state stop-in cpoint (lim (progn (end-of-line) (point))) pr e)
+ (let (state stop-in cpoint (lim (point-at-eol)) pr e)
(or cperl-font-locking
(cperl-update-syntaxification lim lim))
(beginning-of-line)
indentable t))
;; Need to remove face as well...
(goto-char min)
- (and (eq system-type 'emx)
+ ;; 'emx not supported by Emacs since at least 21.1.
+ (and (featurep 'xemacs) (eq system-type 'emx)
(eq (point) 1)
(let ((case-fold-search t))
(looking-at "extproc[ \t]")) ; Analogue of #!
(cperl-commentify min
- (save-excursion (end-of-line) (point))
+ (point-at-eol)
nil))
(while (and
(< (point) max)
"")
tb (match-beginning 0))
(setq argument nil)
- (put-text-property (save-excursion
- (beginning-of-line)
- (point))
- b 'first-format-line 't)
+ (put-text-property (point-at-bol) b 'first-format-line 't)
(if cperl-pod-here-fontify
(while (and (eq (forward-line) 0)
(not (looking-at "^[.;]$")))
conditional/loop constructs."
(interactive)
(save-excursion
- (let ((tmp-end (progn (end-of-line) (point))) top done)
+ (let ((tmp-end (point-at-eol)) top done)
(save-excursion
(beginning-of-line)
(while (null done)
"\\<\\(else\\|elsif\|continue\\)\\>"))
(progn
(goto-char (match-end 0))
- (save-excursion
- (end-of-line)
- (setq tmp-end (point))))
+ (setq tmp-end (point-at-eol)))
(setq done t))))
- (save-excursion
- (end-of-line)
- (setq tmp-end (point))))
+ (setq tmp-end (point-at-eol)))
(goto-char tmp-end)
(setq tmp-end (point-marker)))
(if cperl-indent-region-fix-constructs
(interactive)
(or end
(setq end (point-max)))
- (let ((ee (save-excursion (end-of-line) (point)))
+ (let ((ee (point-at-eol))
(cperl-indent-region-fix-constructs
(or cperl-indent-region-fix-constructs 1))
p pp ml have-brace ret)
(if (cperl-indent-line parse-data)
(setq ret (cperl-fix-line-spacing end parse-data)))))))))))
(beginning-of-line)
- (setq p (point) pp (save-excursion (end-of-line) (point))) ; May be different from ee.
+ (setq p (point) pp (point-at-eol)) ; May be different from ee.
;; Now check whether there is a hanging `}'
;; Looking at:
;; } blah
(or topdir
(setq topdir default-directory))
(let ((tags-file-name "TAGS")
- (case-fold-search (eq system-type 'emx))
+ (case-fold-search (and (featurep 'xemacs) (eq system-type 'emx)))
xs rel tm)
(save-excursion
(cond (inbuffer nil) ; Already there
;; Get to the something meaningful
(or (eobp) (eolp) (forward-char 1))
(re-search-backward "[-a-zA-Z0-9_:!&*+,-./<=>?\\\\^|~$%@]"
- (save-excursion (beginning-of-line) (point))
+ (point-at-bol)
'to-beg)
;; (cond
;; ((or (eobp) (looking-at "[][ \t\n{}();,]")) ; Not at a symbol
(substring v (match-beginning 1) (match-end 1)))
"Version of IZ-supported CPerl package this file is based on.")
+(defun cperl-mode-unload-function ()
+ "Unload the Cperl mode library."
+ (let ((new-mode (if (eq (symbol-function 'perl-mode) 'cperl-mode)
+ 'fundamental-mode
+ 'perl-mode)))
+ (dolist (buf (buffer-list))
+ (with-current-buffer buf
+ (when (eq major-mode 'cperl-mode)
+ (funcall new-mode)))))
+ ;; continue standard unloading
+ nil)
+
(provide 'cperl-mode)
-;; arch-tag: 42e5b19b-e187-4537-929f-1a7408980ce6
;;; cperl-mode.el ends here