diff options
| author | Chong Yidong | 2012-04-27 10:48:38 +0800 |
|---|---|---|
| committer | Chong Yidong | 2012-04-27 10:48:38 +0800 |
| commit | b360839071ef6c7a9e917fe57a4aaeb39138e8c0 (patch) | |
| tree | 63fc180450a58b158ed22a690df77609ea488661 /lisp | |
| parent | 797e6e88e9cfae3c03287ef198223e7152da7c33 (diff) | |
| download | emacs-b360839071ef6c7a9e917fe57a4aaeb39138e8c0.tar.gz emacs-b360839071ef6c7a9e917fe57a4aaeb39138e8c0.zip | |
Fix missing prefix warning in pascal.el.
* progmodes/pascal.el (pascal--extra-indent): Rename from ind, to
fix "missing prefix" warning. All callers changed.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/progmodes/pascal.el | 47 |
2 files changed, 29 insertions, 23 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9afa98fc2fe..0b0065f520e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2012-04-27 Chong Yidong <cyd@gnu.org> | ||
| 2 | |||
| 3 | * progmodes/pascal.el (pascal--extra-indent): Rename from ind, to | ||
| 4 | fix "missig prefix" warning. All callers changed. | ||
| 5 | |||
| 1 | 2012-04-27 Stefan Monnier <monnier@iro.umontreal.ca> | 6 | 2012-04-27 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 7 | ||
| 3 | * emacs-lisp/assoc.el: Move to obsolete/. | 8 | * emacs-lisp/assoc.el: Move to obsolete/. |
diff --git a/lisp/progmodes/pascal.el b/lisp/progmodes/pascal.el index 5a6f4e20fbc..62ba9418ced 100644 --- a/lisp/progmodes/pascal.el +++ b/lisp/progmodes/pascal.el | |||
| @@ -467,6 +467,8 @@ no args, if that value is non-nil." | |||
| 467 | ;;; | 467 | ;;; |
| 468 | ;;; Interactive functions | 468 | ;;; Interactive functions |
| 469 | ;;; | 469 | ;;; |
| 470 | (defvar pascal--extra-indent 0) | ||
| 471 | |||
| 470 | (defun pascal-insert-block () | 472 | (defun pascal-insert-block () |
| 471 | "Insert Pascal begin ... end; block in the code with right indentation." | 473 | "Insert Pascal begin ... end; block in the code with right indentation." |
| 472 | (interactive) | 474 | (interactive) |
| @@ -757,14 +759,14 @@ on the line which ends a function or procedure named NAME." | |||
| 757 | ;;; Indentation | 759 | ;;; Indentation |
| 758 | ;;; | 760 | ;;; |
| 759 | (defconst pascal-indent-alist | 761 | (defconst pascal-indent-alist |
| 760 | '((block . (+ ind pascal-indent-level)) | 762 | '((block . (+ pascal--extra-indent pascal-indent-level)) |
| 761 | (case . (+ ind pascal-case-indent)) | 763 | (case . (+ pascal--extra-indent pascal-case-indent)) |
| 762 | (caseblock . ind) (cpp . 0) | 764 | (caseblock . pascal--extra-indent) (cpp . 0) |
| 763 | (declaration . (+ ind pascal-indent-level)) | 765 | (declaration . (+ pascal--extra-indent pascal-indent-level)) |
| 764 | (paramlist . (pascal-indent-paramlist t)) | 766 | (paramlist . (pascal-indent-paramlist t)) |
| 765 | (comment . (pascal-indent-comment)) | 767 | (comment . (pascal-indent-comment)) |
| 766 | (defun . ind) (contexp . ind) | 768 | (defun . pascal--extra-indent) (contexp . pascal--extra-indent) |
| 767 | (unknown . ind) (string . 0) (progbeg . 0))) | 769 | (unknown . pascal--extra-indent) (string . 0) (progbeg . 0))) |
| 768 | 770 | ||
| 769 | (defun pascal-indent-command () | 771 | (defun pascal-indent-command () |
| 770 | "Indent for special part of code." | 772 | "Indent for special part of code." |
| @@ -786,12 +788,11 @@ on the line which ends a function or procedure named NAME." | |||
| 786 | (if (looking-at "[ \t]+$") | 788 | (if (looking-at "[ \t]+$") |
| 787 | (skip-chars-forward " \t")))) | 789 | (skip-chars-forward " \t")))) |
| 788 | 790 | ||
| 789 | (defvar ind) ;Used via `eval' in pascal-indent-alist. | ||
| 790 | (defun pascal-indent-line () | 791 | (defun pascal-indent-line () |
| 791 | "Indent current line as a Pascal statement." | 792 | "Indent current line as a Pascal statement." |
| 792 | (let* ((indent-str (pascal-calculate-indent)) | 793 | (let* ((indent-str (pascal-calculate-indent)) |
| 793 | (type (car indent-str)) | 794 | (type (car indent-str)) |
| 794 | (ind (car (cdr indent-str)))) | 795 | (pascal--extra-indent (car (cdr indent-str)))) |
| 795 | ;; Labels should not be indented. | 796 | ;; Labels should not be indented. |
| 796 | (if (and (looking-at "^[0-9a-zA-Z]+[ \t]*:[^=]") | 797 | (if (and (looking-at "^[0-9a-zA-Z]+[ \t]*:[^=]") |
| 797 | (not (eq type 'declaration))) | 798 | (not (eq type 'declaration))) |
| @@ -803,13 +804,13 @@ on the line which ends a function or procedure named NAME." | |||
| 803 | ()) | 804 | ()) |
| 804 | (; Other things should have no extra indent | 805 | (; Other things should have no extra indent |
| 805 | (looking-at pascal-noindent-re) | 806 | (looking-at pascal-noindent-re) |
| 806 | (indent-to ind)) | 807 | (indent-to pascal--extra-indent)) |
| 807 | (; Nested functions should be indented | 808 | (; Nested functions should be indented |
| 808 | (looking-at pascal-defun-re) | 809 | (looking-at pascal-defun-re) |
| 809 | (if (and pascal-indent-nested-functions | 810 | (if (and pascal-indent-nested-functions |
| 810 | (eq type 'defun)) | 811 | (eq type 'defun)) |
| 811 | (indent-to (+ ind pascal-indent-level)) | 812 | (indent-to (+ pascal--extra-indent pascal-indent-level)) |
| 812 | (indent-to ind))) | 813 | (indent-to pascal--extra-indent))) |
| 813 | (; But most lines are treated this way | 814 | (; But most lines are treated this way |
| 814 | (indent-to (eval (cdr (assoc type pascal-indent-alist)))) | 815 | (indent-to (eval (cdr (assoc type pascal-indent-alist)))) |
| 815 | )))) | 816 | )))) |
| @@ -949,7 +950,7 @@ Do not count labels, case-statements or records." | |||
| 949 | (point-marker) | 950 | (point-marker) |
| 950 | (re-search-backward "\\<case\\>" nil t))) | 951 | (re-search-backward "\\<case\\>" nil t))) |
| 951 | (beg (point)) | 952 | (beg (point)) |
| 952 | (ind 0)) | 953 | (pascal--extra-indent 0)) |
| 953 | ;; Get right indent | 954 | ;; Get right indent |
| 954 | (while (< (point) end) | 955 | (while (< (point) end) |
| 955 | (if (re-search-forward | 956 | (if (re-search-forward |
| @@ -959,8 +960,8 @@ Do not count labels, case-statements or records." | |||
| 959 | (if (< (point) end) | 960 | (if (< (point) end) |
| 960 | (progn | 961 | (progn |
| 961 | (delete-horizontal-space) | 962 | (delete-horizontal-space) |
| 962 | (if (> (current-column) ind) | 963 | (if (> (current-column) pascal--extra-indent) |
| 963 | (setq ind (current-column))) | 964 | (setq pascal--extra-indent (current-column))) |
| 964 | (pascal-end-of-statement)))) | 965 | (pascal-end-of-statement)))) |
| 965 | (goto-char beg) | 966 | (goto-char beg) |
| 966 | ;; Indent all case statements | 967 | ;; Indent all case statements |
| @@ -969,7 +970,7 @@ Do not count labels, case-statements or records." | |||
| 969 | "^[ \t]*[^][ \t,\\.:]+[ \t]*\\(,[ \t]*[^ \t,:]+[ \t]*\\)*:" | 970 | "^[ \t]*[^][ \t,\\.:]+[ \t]*\\(,[ \t]*[^ \t,:]+[ \t]*\\)*:" |
| 970 | (marker-position end) 'move) | 971 | (marker-position end) 'move) |
| 971 | (forward-char -1)) | 972 | (forward-char -1)) |
| 972 | (indent-to (1+ ind)) | 973 | (indent-to (1+ pascal--extra-indent)) |
| 973 | (if (/= (following-char) ?:) | 974 | (if (/= (following-char) ?:) |
| 974 | () | 975 | () |
| 975 | (forward-char 1) | 976 | (forward-char 1) |
| @@ -1017,7 +1018,7 @@ indent of the current line in parameterlist." | |||
| 1017 | (max (progn (pascal-declaration-end) | 1018 | (max (progn (pascal-declaration-end) |
| 1018 | (point)) | 1019 | (point)) |
| 1019 | pos)))) | 1020 | pos)))) |
| 1020 | ind) | 1021 | pascal--extra-indent) |
| 1021 | 1022 | ||
| 1022 | (goto-char stpos) | 1023 | (goto-char stpos) |
| 1023 | ;; Indent lines in record block | 1024 | ;; Indent lines in record block |
| @@ -1031,13 +1032,13 @@ indent of the current line in parameterlist." | |||
| 1031 | (forward-line 1))) | 1032 | (forward-line 1))) |
| 1032 | 1033 | ||
| 1033 | ;; Do lineup | 1034 | ;; Do lineup |
| 1034 | (setq ind (pascal-get-lineup-indent stpos edpos lineup)) | 1035 | (setq pascal--extra-indent (pascal-get-lineup-indent stpos edpos lineup)) |
| 1035 | (goto-char stpos) | 1036 | (goto-char stpos) |
| 1036 | (while (and (<= (point) edpos) (not (eobp))) | 1037 | (while (and (<= (point) edpos) (not (eobp))) |
| 1037 | (if (search-forward lineup (point-at-eol) 'move) | 1038 | (if (search-forward lineup (point-at-eol) 'move) |
| 1038 | (forward-char -1)) | 1039 | (forward-char -1)) |
| 1039 | (delete-horizontal-space) | 1040 | (delete-horizontal-space) |
| 1040 | (indent-to ind) | 1041 | (indent-to pascal--extra-indent) |
| 1041 | (if (not (looking-at lineup)) | 1042 | (if (not (looking-at lineup)) |
| 1042 | (forward-line 1) ; No more indent if there is no : or = | 1043 | (forward-line 1) ; No more indent if there is no : or = |
| 1043 | (forward-char 1) | 1044 | (forward-char 1) |
| @@ -1056,7 +1057,7 @@ indent of the current line in parameterlist." | |||
| 1056 | ;from b to e nicely. The lineup string is str." | 1057 | ;from b to e nicely. The lineup string is str." |
| 1057 | (defun pascal-get-lineup-indent (b e str) | 1058 | (defun pascal-get-lineup-indent (b e str) |
| 1058 | (save-excursion | 1059 | (save-excursion |
| 1059 | (let ((ind 0) | 1060 | (let ((pascal--extra-indent 0) |
| 1060 | (reg (concat str "\\|\\(\\<record\\>\\)\\|" pascal-defun-re))) | 1061 | (reg (concat str "\\|\\(\\<record\\>\\)\\|" pascal-defun-re))) |
| 1061 | (goto-char b) | 1062 | (goto-char b) |
| 1062 | ;; Get rightmost position | 1063 | ;; Get rightmost position |
| @@ -1071,14 +1072,14 @@ indent of the current line in parameterlist." | |||
| 1071 | (t | 1072 | (t |
| 1072 | (goto-char (match-beginning 0)) | 1073 | (goto-char (match-beginning 0)) |
| 1073 | (skip-chars-backward " \t") | 1074 | (skip-chars-backward " \t") |
| 1074 | (if (> (current-column) ind) | 1075 | (if (> (current-column) pascal--extra-indent) |
| 1075 | (setq ind (current-column))) | 1076 | (setq pascal--extra-indent (current-column))) |
| 1076 | (goto-char (match-end 0)) | 1077 | (goto-char (match-end 0)) |
| 1077 | (end-of-line) | 1078 | (end-of-line) |
| 1078 | )))) | 1079 | )))) |
| 1079 | ;; In case no lineup was found | 1080 | ;; In case no lineup was found |
| 1080 | (if (> ind 0) | 1081 | (if (> pascal--extra-indent 0) |
| 1081 | (1+ ind) | 1082 | (1+ pascal--extra-indent) |
| 1082 | ;; No lineup-string found | 1083 | ;; No lineup-string found |
| 1083 | (goto-char b) | 1084 | (goto-char b) |
| 1084 | (end-of-line) | 1085 | (end-of-line) |