From 9edd6ee65ad831591a6d63fbf9e66230dd2254a1 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 23 Aug 2007 21:04:51 +0000 Subject: [PATCH] (defcustom, x-color-defined-p, cperl-is-face) (cperl-is-face, cperl-force-face, cperl-etags-snarf-tag, cperl-mode) (cperl-etags-snarf-tag, cperl-etags-goto-tag-location, cperl-init-faces) (cperl-etags-goto-tag-location): Use new style backquotes. --- lisp/ChangeLog | 5 +++ lisp/progmodes/cperl-mode.el | 80 ++++++++++++++++++------------------ 2 files changed, 45 insertions(+), 40 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 24639e84d79..c0642c476ba 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,10 @@ 2007-08-23 Stefan Monnier + * progmodes/cperl-mode.el (defcustom, x-color-defined-p, cperl-is-face) + (cperl-is-face, cperl-force-face, cperl-etags-snarf-tag, cperl-mode) + (cperl-etags-snarf-tag, cperl-etags-goto-tag-location, cperl-init-faces) + (cperl-etags-goto-tag-location): Use new style backquotes. + * subr.el (complete-with-action): Backport from trunk (for vc-arch.el). (dynamic-completion-table): Use it it. diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index 5a91141db6c..7995c9e02e3 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -96,7 +96,7 @@ nil)) (or (fboundp 'custom-declare-variable) (defmacro defcustom (name val doc &rest arr) - (` (defvar (, name) (, val) (, doc))))) + `(defvar ,name ,val ,doc))) (or (and (fboundp 'custom-declare-variable) (string< "19.31" emacs-version)) ; Checked with 19.30: defface does not work (defmacro defface (&rest arr) @@ -104,52 +104,52 @@ ;; Avoid warning (tmp definitions) (or (fboundp 'x-color-defined-p) (defmacro x-color-defined-p (col) - (cond ((fboundp 'color-defined-p) (` (color-defined-p (, col)))) + (cond ((fboundp 'color-defined-p) `(color-defined-p ,col)) ;; XEmacs >= 19.12 - ((fboundp 'valid-color-name-p) (` (valid-color-name-p (, col)))) + ((fboundp 'valid-color-name-p) `(valid-color-name-p ,col)) ;; XEmacs 19.11 - ((fboundp 'x-valid-color-name-p) (` (x-valid-color-name-p (, col)))) + ((fboundp 'x-valid-color-name-p) `(x-valid-color-name-p ,col)) (t '(error "Cannot implement color-defined-p"))))) (defmacro cperl-is-face (arg) ; Takes quoted arg (cond ((fboundp 'find-face) - (` (find-face (, arg)))) + `(find-face ,arg)) (;;(and (fboundp 'face-list) ;; (face-list)) (fboundp 'face-list) - (` (member (, arg) (and (fboundp 'face-list) - (face-list))))) + `(member ,arg (and (fboundp 'face-list) + (face-list)))) (t - (` (boundp (, arg)))))) + `(boundp ,arg)))) (defmacro cperl-make-face (arg descr) ; Takes unquoted arg (cond ((fboundp 'make-face) - (` (make-face (quote (, arg))))) + `(make-face (quote ,arg))) (t - (` (defvar (, arg) (quote (, arg)) (, descr)))))) + `(defvar ,arg (quote ,arg) ,descr)))) (defmacro cperl-force-face (arg descr) ; Takes unquoted arg - (` (progn - (or (cperl-is-face (quote (, arg))) - (cperl-make-face (, arg) (, descr))) - (or (boundp (quote (, arg))) ; We use unquoted variants too - (defvar (, arg) (quote (, arg)) (, descr)))))) + `(progn + (or (cperl-is-face (quote ,arg)) + (cperl-make-face ,arg ,descr)) + (or (boundp (quote ,arg)) ; We use unquoted variants too + (defvar ,arg (quote ,arg) ,descr)))) (if cperl-xemacs-p (defmacro cperl-etags-snarf-tag (file line) - (` (progn - (beginning-of-line 2) - (list (, file) (, line))))) + `(progn + (beginning-of-line 2) + (list ,file ,line))) (defmacro cperl-etags-snarf-tag (file line) - (` (etags-snarf-tag)))) + `(etags-snarf-tag))) (if cperl-xemacs-p (defmacro cperl-etags-goto-tag-location (elt) - (`;;(progn - ;; (switch-to-buffer (get-file-buffer (elt (, elt) 0))) - ;; (set-buffer (get-file-buffer (elt (, elt) 0))) - ;; Probably will not work due to some save-excursion??? - ;; Or save-file-position? - ;; (message "Did I get to line %s?" (elt (, elt) 1)) - (goto-line (string-to-int (elt (, elt) 1))))) + ;;(progn + ;; (switch-to-buffer (get-file-buffer (elt ,elt 0))) + ;; (set-buffer (get-file-buffer (elt ,elt 0))) + ;; Probably will not work due to some save-excursion??? + ;; Or save-file-position? + ;; (message "Did I get to line %s?" (elt ,elt 1)) + `(goto-line (string-to-int (elt ,elt 1)))) ;;) (defmacro cperl-etags-goto-tag-location (elt) - (` (etags-goto-tag-location (, elt)))))) + `(etags-goto-tag-location ,elt)))) (defconst cperl-xemacs-p (string-match "XEmacs\\|Lucid" emacs-version)) @@ -1788,8 +1788,8 @@ or as help on variables `cperl-tips', `cperl-problems', ;; 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))))))) + `((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 @@ -5951,25 +5951,25 @@ indentation and initial hashes. Behaves usually outside of comment." nil t))) ; local variables, multiple (font-lock-anchored ;; 1=my_etc, 2=white? 3=(+white? 4=white? 5=var - (` ((, (concat "\\<\\(my\\|local\\|our\\)" + `(,(concat "\\<\\(my\\|local\\|our\\)" cperl-maybe-white-and-comment-rex "\\((" cperl-maybe-white-and-comment-rex - "\\)?\\([$@%*]\\([a-zA-Z0-9_:]+\\|[^a-zA-Z0-9_]\\)\\)")) - (5 (, (if cperl-font-lock-multiline + "\\)?\\([$@%*]\\([a-zA-Z0-9_:]+\\|[^a-zA-Z0-9_]\\)\\)") + (5 ,(if cperl-font-lock-multiline 'font-lock-variable-name-face '(progn (setq cperl-font-lock-multiline-start (match-beginning 0)) - 'font-lock-variable-name-face)))) - ((, (concat "\\=" + 'font-lock-variable-name-face))) + (,(concat "\\=" cperl-maybe-white-and-comment-rex "," cperl-maybe-white-and-comment-rex - "\\([$@%*]\\([a-zA-Z0-9_:]+\\|[^a-zA-Z0-9_]\\)\\)")) + "\\([$@%*]\\([a-zA-Z0-9_:]+\\|[^a-zA-Z0-9_]\\)\\)") ;; Bug in font-lock: limit is used not only to limit ;; searches, but to set the "extend window for ;; facification" property. Thus we need to minimize. - (, (if cperl-font-lock-multiline + ,(if cperl-font-lock-multiline '(if (match-beginning 3) (save-excursion (goto-char (match-beginning 3)) @@ -5983,8 +5983,8 @@ indentation and initial hashes. Behaves usually outside of comment." (forward-char -2)) ; disable continued expr '(if (match-beginning 3) (point-max) ; No limit for continuation - (forward-char -2)))) ; disable continued expr - (, (if cperl-font-lock-multiline + (forward-char -2))) ; disable continued expr + ,(if cperl-font-lock-multiline nil '(progn ; Do at end ;; "my" may be already fontified (POD), @@ -5997,8 +5997,8 @@ indentation and initial hashes. Behaves usually outside of comment." (put-text-property (1+ cperl-font-lock-multiline-start) (point) 'syntax-type 'multiline)) - (setq cperl-font-lock-multiline-start nil)))) - (3 font-lock-variable-name-face))))) + (setq cperl-font-lock-multiline-start nil))) + (3 font-lock-variable-name-face)))) (t '("^[ \t{}]*\\(my\\|local\\|our\\)[ \t]*\\(([ \t]*\\)?\\([$@%*][a-zA-Z0-9_:]+\\)" 3 font-lock-variable-name-face))) '("\\