branch: elpa/adoc-mode
commit a650c708c6ebaef25387647e19d17afc503308a8
Author: Bozhidar Batsov <[email protected]>
Commit: Bozhidar Batsov <[email protected]>

    Fix typo and clean up minor code issues
    
    - Rename adoc-re-two-line-title-undlerline to
      adoc-re-two-line-title-underline (typo)
    - Remove duplicate adoc-help-local-doc-link constant
    - Clarify comment explaining why face defvars are needed
---
 adoc-mode.el | 24 +++++++++++-------------
 1 file changed, 11 insertions(+), 13 deletions(-)

diff --git a/adoc-mode.el b/adoc-mode.el
index 389142fc07..390ba2424f 100644
--- a/adoc-mode.el
+++ b/adoc-mode.el
@@ -338,12 +338,13 @@ aligned.
   :group 'adoc-faces)
 (defvar adoc-align-face 'adoc-align-face)
 
-;; Despite the comment in font-lock.el near 'defvar font-lock-comment-face', it
-;; seems I still need variables to refer to faces in adoc-font-lock-keywords.
-;; Not having variables and only referring to face names in
-;; adoc-font-lock-keywords does not work.
-(defvar adoc-delimiter 'adoc-meta-face)
-(defvar adoc-hide-delimiter 'adoc-meta-hide-face)
+;; Font-lock evaluates FACEFORM in keyword specs as a variable, so face
+;; symbols used as bare (unquoted) FACEFORM values need a corresponding
+;; defvar.  The self-referencing defvars after each defface serve this purpose.
+(defvar adoc-delimiter 'adoc-meta-face
+  "Face used for delimiters.")
+(defvar adoc-hide-delimiter 'adoc-meta-hide-face
+  "Face used for delimiters that should be nearly invisible.")
 
 
 ;;;; misc
@@ -547,9 +548,6 @@ customizable.")
 (defconst adoc-help-local-doc-link
   "Hypertext links to files on the local file system are
   specified using the link inline macro.")
-(defconst adoc-help-local-doc-link
-  "Hypertext links to files on the local file system are
-  specified using the link inline macro.")
 (defconst adoc-help-comment
   "Single lines starting with two forward slashes hard up against
   the left margin are treated as comments. Comment lines do not
@@ -983,7 +981,7 @@ match-data has these sub groups:
 
 ;; AsciiDoc handles that by source code, there is no regexp in AsciiDoc.  See
 ;; also adoc-re-one-line-title.
-(defun adoc-re-two-line-title-undlerline (&optional del)
+(defun adoc-re-two-line-title-underline (&optional del)
   "Returns a regexp matching the underline of a two line title.
 
 DEL is an element of `adoc-two-line-title-del' or nil. If nil,
@@ -1014,7 +1012,7 @@ Note that even if this regexp matches it still doesn't 
mean it is
 a two line title. You additionally have to test if the underline
 has the correct length.
 
-DEL is described in `adoc-re-two-line-title-undlerline'.
+DEL is described in `adoc-re-two-line-title-underline'.
 
 match-data has these sub groups:
 
@@ -1030,7 +1028,7 @@ match-data has these sub groups:
    ;; asciidoc src, Title.parse,
    "\\(\\)\\(^.*?[a-zA-Z0-9_].*?\\)[ \t]*\n"
    ;; 2nd line: underline
-   (adoc-re-two-line-title-undlerline del)))
+   (adoc-re-two-line-title-underline del)))
 
 (defun adoc-make-two-line-title (level text)
   "Returns a two line title of given LEVEL containing given TEXT.
@@ -3379,7 +3377,7 @@ and title's text are not preserved, afterwards its always 
one space."
       ;; replace old title by new
       (let ((end-char (char-before end)))
         (beginning-of-line)
-        (when (and (eq type 2) (looking-at 
(adoc-re-two-line-title-undlerline)))
+        (when (and (eq type 2) (looking-at (adoc-re-two-line-title-underline)))
           (forward-line -1)
           (beginning-of-line))
         (delete-region start end)

Reply via email to