File: latexml.perltidy

package info (click to toggle)
latexml 0.8.8-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 31,920 kB
  • sloc: xml: 109,048; perl: 30,224; sh: 179; javascript: 28; makefile: 13
file content (63 lines) | stat: -rw-r--r-- 2,899 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# /=====================================================================\ #
# |  latexml.perltidy                                                   | #
# | perltidy parameters for formatting LaTeXML perl sources             | #
# |=====================================================================| #
# | support tools for LaTeXML:                                          | #
# |  Public domain software, produced as part of work done by the       | #
# |  United States Government & not subject to copyright in the US.     | #
# |---------------------------------------------------------------------| #
# | Bruce Miller <bruce.miller@nist.gov>                        #_#     | #
# | http://dlmf.nist.gov/LaTeXML/                              (o o)    | #
# \=========================================================ooo==U==ooo=/ #
#======================================================================
# I prefer compact code, especially vertically
# indent 2 (not 4 or 8)
# open and close braces do NOT go on own lines,
# and view "cuddled else" with extreme distaste.
#
# The following settings produce relatively nice output with perltidy.
# NOTE: Need perltidy version 20121207 or later to support these options!!
#======================================================================
# 
# Code Indentation Control
--indent-columns=2
--maximum-line-length=100
--variable-maximum-line-length

# Whitespace Control
--paren-tightness=2
--square-bracket-tightness=2
## but NOT --block-brace-tightness=2

# Blank line control
--noblanks-before-comments
--blank-lines-before-subs=1

# But in the end, perltidy breaks too many lines
# so it is Coder's responsibility to linebreak!
--nodelete-old-newlines
--noadd-newlines

#====================
# shorthand equivalent:
# perltidy -i=2 -l=100 -vmll -pt=2 -sbt=2 -nbbc -blbs=1 -ndnl -nanl


#======================================================================
# I cannot find emacs settings that simulate the above,
# but the following settings are similar and a good start.
#
# ;;; Use cperl-mode, not perl-mode
# ;(add-to-list 'auto-mode-alist '("\\.\\([pP][Llm]\\|al\\|perl\\)\\'" . cperl-mode))
# ;(add-to-list 'interpreter-mode-alist '("perl" . cperl-mode))
# (defalias 'perl-mode 'cperl-mode)       ; Always use cperl
# (setq-default indent-tabs-mode nil)     ; don't use tabs when indenting
# (custom-set-variables
#  '(cperl-indent-level 2)                ; Only indent 2 spaces per step
#  '(cperl-continued-statement-offset 2)  ; indentation for continued lines
#  '(cperl-indent-parens-as-block t)      ; Indent lines after ( as normally indented block
#  '(cperl-fix-hanging-brace-when-indent nil) ; Don't force } to separate lines
#  '(cperl-merge-trailing-else nil)           ; Don't keep } in front of else
#  '(cperl-tab-always-indent t)           ; TAB char always re-indents current line
#  '(cperl-close-paren-offset -4)
# )