emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] elpa d6b107e 33/51: Improve style/doc.el


From: Tassilo Horn
Subject: [elpa] elpa d6b107e 33/51: Improve style/doc.el
Date: Sun, 22 May 2016 07:22:49 +0000 (UTC)

branch: elpa
commit d6b107e74ecbe532016bbbbf93be18790a9688c5
Author: Arash Esbati <address@hidden>
Commit: Mosè Giordano <address@hidden>

    Improve style/doc.el
    
    * style/doc.el ("doc"): Do not indent the content inside the "macro"
    environment.
    Insert a pair of braces after "DoNotIndex", "StopEventually",
    "MacroFont", "AltMacroFont".
    Prefix the string read with TeX-esc when inserting
    "DescribeMacro", "cmd".
    Ask for an argument ("parg", "oarg", "marg", "meta").
    Add missing macro "cs".
    Delete dups ("MacroFont", "AltMacroFont", "theCodelineNo").
    Ask for .fdd and .dtx files to input or include ("DocInput",
    "DocInclude").
    Add lengths "MacrocodeTopsep", "MacroTopsep", "MacroIndent".
    
    Signed-off-by: Mosè Giordano <address@hidden>
---
 style/doc.el |   63 ++++++++++++++++++++++++++++++++++++++++++----------------
 1 file changed, 46 insertions(+), 17 deletions(-)

diff --git a/style/doc.el b/style/doc.el
index 3176368..abd248d 100644
--- a/style/doc.el
+++ b/style/doc.el
@@ -1,6 +1,6 @@
 ;;; doc.el --- AUCTeX style for `doc.sty'
 
-;; Copyright (C) 2004, 2008 Free Software Foundation, Inc.
+;; Copyright (C) 2004, 2008, 2016 Free Software Foundation, Inc.
 
 ;; Author: Frank K�ster <address@hidden>
 ;; Maintainer: address@hidden
@@ -62,6 +62,8 @@
                '("macrocode" current-indentation))
    (add-to-list 'LaTeX-indent-environment-list
                '("macrocode*" current-indentation))
+   (add-to-list 'LaTeX-indent-environment-list
+               '("macro" current-indentation))
    (add-hook 'LaTeX-after-insert-env-hooks 'LaTeX-doc-after-insert-macrocode
             nil t)
    (LaTeX-add-environments
@@ -72,24 +74,33 @@
    (TeX-add-symbols
     "EnableCrossrefs"
     "DisableCrossrefs"
-    "DoNotIndex"
+    '("DoNotIndex" t)
     "DontCheckModules"
     "CheckModules"
     "Module"
-    '("DescribeMacro" "Macro")
+    '("DescribeMacro" (TeX-arg-eval
+                      (lambda ()
+                        (let ((name (TeX-read-string
+                                     (TeX-argument-prompt optional nil "Macro")
+                                     TeX-esc)))
+                          (format "%s" name)))))
     '("DescribeEnv" "Environment")
     "verbatim"
     "verb"
-    "parg"
-    "oarg"
-    "marg"
-    "meta"
-    "cmd"
+    '("parg" "Argument")
+    '("oarg" "Argument")
+    '("marg" "Argument")
+    '("meta" "Text")
+    '("cs" "Name")
+    '("cmd" (TeX-arg-eval
+            (lambda ()
+              (let ((name (TeX-read-string
+                           (TeX-argument-prompt optional nil "Name")
+                           TeX-esc)))
+                (format "%s" name)))))
     "makelabel"
-    "MacroFont"
-    "MacroFont"
-    "AltMacroFont"
-    "AltMacroFont"
+    '("MacroFont" t)
+    '("AltMacroFont" t)
     "PrintMacroName"
     "PrintDescribeMacro"
     "PrintDescribeEnv"
@@ -126,7 +137,7 @@
     "GlossaryParms"
     "PrintChanges"
     "AlsoImplementation"
-    "StopEventually"
+    '("StopEventually" t)
     "OnlyDescription"
     "Finale"
     "IndexInput"
@@ -142,16 +153,34 @@
     "CodelineIndex"
     "PageIndex"
     "theCodelineNo"
-    "theCodelineNo"
     "DocstyleParms"
     "MakePercentIgnore"
     "MakePercentComment"
-    "DocInput"
-    "DocInclude"
+    '("DocInput"
+      (TeX-arg-eval
+       (lambda ()
+        (let ((file (file-relative-name
+                     (read-file-name
+                      "File to input: " nil nil nil nil
+                      (lambda (x)
+                        (string-match "\\.fdd$\\|\\.dtx$" x)))
+                     (TeX-master-directory))))
+          (format "%s" file)))))
+    '("DocInclude"
+      (TeX-arg-eval
+       (lambda ()
+        (let ((file (file-relative-name
+                     (read-file-name
+                      "File to include: " nil nil nil nil
+                      (lambda (x)
+                        (string-match "\\.fdd$\\|\\.dtx$" x)))
+                     (TeX-master-directory))))
+          (format "%s" file)))))
     "GetFileInfo"
     "filename"
     "fileinfo")
-   (TeX-run-style-hooks "shortvrb"))
+   (TeX-run-style-hooks "shortvrb")
+   (LaTeX-add-lengths "MacrocodeTopsep" "MacroTopsep" "MacroIndent"))
  LaTeX-dialect)
 
 ;; Local Variables:



reply via email to

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