emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/emacs-24 r108051: Fix missing prefix warnin


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/emacs-24 r108051: Fix missing prefix warning in pascal.el.
Date: Fri, 02 Nov 2012 02:01:02 -0000
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 108051
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Fri 2012-04-27 10:48:38 +0800
message:
  Fix missing prefix warning in pascal.el.
  
  * progmodes/pascal.el (pascal--extra-indent): Rename from ind, to
  fix "missing prefix" warning.  All callers changed.
modified:
  lisp/ChangeLog
  lisp/progmodes/pascal.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-04-27 00:30:56 +0000
+++ b/lisp/ChangeLog    2012-04-27 02:48:38 +0000
@@ -1,3 +1,8 @@
+2012-04-27  Chong Yidong  <address@hidden>
+
+       * progmodes/pascal.el (pascal--extra-indent): Rename from ind, to
+       fix "missig prefix" warning.  All callers changed.
+
 2012-04-27  Stefan Monnier  <address@hidden>
 
        * emacs-lisp/assoc.el: Move to obsolete/.

=== modified file 'lisp/progmodes/pascal.el'
--- a/lisp/progmodes/pascal.el  2012-04-26 12:43:28 +0000
+++ b/lisp/progmodes/pascal.el  2012-04-27 02:48:38 +0000
@@ -467,6 +467,8 @@
 ;;;
 ;;; Interactive functions
 ;;;
+(defvar pascal--extra-indent 0)
+
 (defun pascal-insert-block ()
   "Insert Pascal begin ... end; block in the code with right indentation."
   (interactive)
@@ -757,14 +759,14 @@
 ;;; Indentation
 ;;;
 (defconst pascal-indent-alist
-  '((block . (+ ind pascal-indent-level))
-    (case . (+ ind pascal-case-indent))
-    (caseblock . ind) (cpp . 0)
-    (declaration . (+ ind pascal-indent-level))
+  '((block . (+ pascal--extra-indent pascal-indent-level))
+    (case . (+ pascal--extra-indent pascal-case-indent))
+    (caseblock . pascal--extra-indent) (cpp . 0)
+    (declaration . (+ pascal--extra-indent pascal-indent-level))
     (paramlist . (pascal-indent-paramlist t))
     (comment . (pascal-indent-comment))
-    (defun . ind) (contexp . ind)
-    (unknown . ind) (string . 0) (progbeg . 0)))
+    (defun . pascal--extra-indent) (contexp . pascal--extra-indent)
+    (unknown . pascal--extra-indent) (string . 0) (progbeg . 0)))
 
 (defun pascal-indent-command ()
   "Indent for special part of code."
@@ -786,12 +788,11 @@
     (if (looking-at "[ \t]+$")
        (skip-chars-forward " \t"))))
 
-(defvar ind)                          ;Used via `eval' in pascal-indent-alist.
 (defun pascal-indent-line ()
   "Indent current line as a Pascal statement."
   (let* ((indent-str (pascal-calculate-indent))
         (type (car indent-str))
-        (ind (car (cdr indent-str))))
+        (pascal--extra-indent (car (cdr indent-str))))
     ;; Labels should not be indented.
     (if (and (looking-at "^[0-9a-zA-Z]+[ \t]*:[^=]")
             (not (eq type 'declaration)))
@@ -803,13 +804,13 @@
           ())
          (; Other things should have no extra indent
           (looking-at pascal-noindent-re)
-          (indent-to ind))
+          (indent-to pascal--extra-indent))
          (; Nested functions should be indented
           (looking-at pascal-defun-re)
           (if (and pascal-indent-nested-functions
                    (eq type 'defun))
-              (indent-to (+ ind pascal-indent-level))
-            (indent-to ind)))
+              (indent-to (+ pascal--extra-indent pascal-indent-level))
+            (indent-to pascal--extra-indent)))
          (; But most lines are treated this way
           (indent-to (eval (cdr (assoc type pascal-indent-alist))))
           ))))
@@ -949,7 +950,7 @@
                 (point-marker)
               (re-search-backward "\\<case\\>" nil t)))
        (beg (point))
-       (ind 0))
+       (pascal--extra-indent 0))
     ;; Get right indent
     (while (< (point) end)
       (if (re-search-forward
@@ -959,8 +960,8 @@
       (if (< (point) end)
          (progn
            (delete-horizontal-space)
-           (if (> (current-column) ind)
-               (setq ind (current-column)))
+           (if (> (current-column) pascal--extra-indent)
+               (setq pascal--extra-indent (current-column)))
            (pascal-end-of-statement))))
     (goto-char beg)
     ;; Indent all case statements
@@ -969,7 +970,7 @@
           "^[ \t]*[^][ \t,\\.:]+[ \t]*\\(,[ \t]*[^ \t,:]+[ \t]*\\)*:"
           (marker-position end) 'move)
          (forward-char -1))
-      (indent-to (1+ ind))
+      (indent-to (1+ pascal--extra-indent))
       (if (/= (following-char) ?:)
          ()
        (forward-char 1)
@@ -1017,7 +1018,7 @@
                                 (max (progn (pascal-declaration-end)
                                             (point))
                                      pos))))
-           ind)
+           pascal--extra-indent)
 
        (goto-char stpos)
        ;; Indent lines in record block
@@ -1031,13 +1032,13 @@
              (forward-line 1)))
 
        ;; Do lineup
-       (setq ind (pascal-get-lineup-indent stpos edpos lineup))
+       (setq pascal--extra-indent (pascal-get-lineup-indent stpos edpos 
lineup))
        (goto-char stpos)
        (while (and (<= (point) edpos) (not (eobp)))
          (if (search-forward lineup (point-at-eol) 'move)
              (forward-char -1))
          (delete-horizontal-space)
-         (indent-to ind)
+         (indent-to pascal--extra-indent)
          (if (not (looking-at lineup))
              (forward-line 1) ; No more indent if there is no : or =
            (forward-char 1)
@@ -1056,7 +1057,7 @@
 ;from b to e nicely. The lineup string is str."
 (defun pascal-get-lineup-indent (b e str)
   (save-excursion
-    (let ((ind 0)
+    (let ((pascal--extra-indent 0)
          (reg (concat str "\\|\\(\\<record\\>\\)\\|" pascal-defun-re)))
       (goto-char b)
       ;; Get rightmost position
@@ -1071,14 +1072,14 @@
                   (t
                    (goto-char (match-beginning 0))
                    (skip-chars-backward " \t")
-                   (if (> (current-column) ind)
-                       (setq ind (current-column)))
+                   (if (> (current-column) pascal--extra-indent)
+                       (setq pascal--extra-indent (current-column)))
                    (goto-char (match-end 0))
                    (end-of-line)
                    ))))
       ;; In case no lineup was found
-      (if (> ind 0)
-         (1+ ind)
+      (if (> pascal--extra-indent 0)
+         (1+ pascal--extra-indent)
        ;; No lineup-string found
        (goto-char b)
        (end-of-line)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]