]> code.delx.au - gnu-emacs/commitdiff
lisp/textmodes/rst.el: Silence byte-compiler warnings.
authorJuanma Barranquero <lekktu@gmail.com>
Wed, 9 May 2012 00:57:18 +0000 (02:57 +0200)
committerJuanma Barranquero <lekktu@gmail.com>
Wed, 9 May 2012 00:57:18 +0000 (02:57 +0200)
(rst-re-alist, rst-reset-section-caches): Move around.
(rst-re): Use `characterp', not `char-valid-p'.
(font-lock-beg, font-lock-end): Declare.

lisp/ChangeLog
lisp/textmodes/rst.el

index 30e5ac3c7eb8a3851bd3576518dc955cd22f6be6..e2bc561941959b50138961cb8d3ee120a4aca8bd 100644 (file)
@@ -1,5 +1,10 @@
 2012-05-09  Juanma Barranquero  <lekktu@gmail.com>
 
+       * textmodes/rst.el: Silence byte-compiler warnings.
+       (rst-re-alist, rst-reset-section-caches): Move around.
+       (rst-re): Use `characterp', not `char-valid-p'.
+       (font-lock-beg, font-lock-end): Declare.
+
        * progmodes/idlw-shell.el (specs): Remove reference to deleted
        variable `idlwave-shell-activate-alt-keybindings' and simplify.
 
index a9f280be1db725d6cf01d5c7fd4ab499db26d1b4..1fefe6e2e28c8725bc0c1c83d66fd62cbf87f179 100644 (file)
@@ -422,6 +422,17 @@ in parentheses follows the development revision and the timestamp.")
 Each entry consists of the symbol naming the regex and an
 argument list for `rst-re'.")
 
+(defconst rst-re-alist
+  ;; Shadow global value we are just defining so we can construct it step by
+  ;; step
+  (let (rst-re-alist)
+    (dolist (re rst-re-alist-def)
+      (setq rst-re-alist
+           (nconc rst-re-alist
+                  (list (list (car re) (apply 'rst-re (cdr re)))))))
+    rst-re-alist)
+  "Alist mapping symbols from `rst-re-alist-def' to regex strings.")
+
 ;; FIXME: Use `sregex` or `rx` instead of re-inventing the wheel
 (defun rst-re (&rest args)
   "Interpret ARGS as regular expressions and return a regex string.
@@ -459,7 +470,7 @@ After interpretation of ARGS the results are concatenated as for
              re)
             ((symbolp re)
              (cadr (assoc re rst-re-alist)))
-            ((char-valid-p re)
+            ((characterp re)
              (regexp-quote (char-to-string re)))
             ((listp re)
              (let ((nested
@@ -481,17 +492,6 @@ After interpretation of ARGS the results are concatenated as for
              (error "Unknown object type for building regex: %s" re))))
          args)))
 
-(defconst rst-re-alist
-  ;; Shadow global value we are just defining so we can construct it step by
-  ;; step
-  (let (rst-re-alist)
-    (dolist (re rst-re-alist-def)
-      (setq rst-re-alist
-           (nconc rst-re-alist
-                  (list (list (car re) (apply 'rst-re (cdr re)))))))
-    rst-re-alist)
-  "Alist mapping symbols from `rst-re-alist-def' to regex strings.")
-
 \f
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Mode definition.
@@ -1186,7 +1186,7 @@ are nil."
        ((looking-at (rst-re 'ttl-beg))
        ;; Try to use the underline
        (let ((r (rst-classify-adornment
-                 (buffer-substring-no-properties 
+                 (buffer-substring-no-properties
                   (line-beginning-position 2) (line-end-position 2))
                  (line-end-position 2))))
          (if r
@@ -1199,12 +1199,6 @@ are nil."
 ;; current section adornment in a buffer local cache. Thus they can be used for
 ;; font-locking and manipulation commands.
 
-(defun rst-reset-section-caches ()
-  "Reset all section cache variables.
-Should be called by interactive functions which deal with sections."
-  (setq rst-all-sections nil
-       rst-section-hierarchy nil))
-
 (defvar rst-all-sections nil
   "All section adornments in the buffer as found by `rst-find-all-adornments'.
 t when no section adornments were found.")
@@ -1218,6 +1212,12 @@ t when no section adornments were found. Value depends on
 `rst-all-sections'.")
 (make-variable-buffer-local 'rst-section-hierarchy)
 
+(defun rst-reset-section-caches ()
+  "Reset all section cache variables.
+Should be called by interactive functions which deal with sections."
+  (setq rst-all-sections nil
+       rst-section-hierarchy nil))
+
 (defun rst-find-all-adornments ()
   "Return all the section adornments in the current buffer.
 Return a list of (LINE . ADORNMENT) with ascending LINE where
@@ -3571,6 +3571,9 @@ details check the Rst Faces Defaults group."
     )
   "Keywords to highlight in rst mode.")
 
+(defvar font-lock-beg)
+(defvar font-lock-end)
+
 (defun rst-font-lock-extend-region ()
   "Extend the region `font-lock-beg' / `font-lock-end' iff it may
 be in the middle of a multiline construct and return non-nil if so."