• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/emacs-93/emacs/lisp/

Lines Matching +defs:tab +defs:to +defs:tab +defs:stop

1 ;;; align.el --- align text to a specific column, by regexp
23 ;; along with GNU Emacs; see the file COPYING. If not, write to the
29 ;; This mode allows you to align regions in a context-sensitive fashion.
30 ;; The classic use is to align assignments:
45 ;; of syntax are to be treated. These variables go by the name
47 ;; There are several rules which apply to c++, but since several other
48 ;; languages have a syntax similar to c++ (e.g., c, java, etc), these
49 ;; modes are treated as belonging to the same category.
51 ;; If you want to add a new mode under a certain category, just
52 ;; customize that list, or add the new mode manually. For example, to
58 ;; In some programming modes, it's useful to have the aligner run only
60 ;; the variable `align-indent-before-aligning' to t.
64 ;; In order to incorporate align's functionality into your own
65 ;; modules, there are only a few steps you have to follow.
74 ;; to your own rules lists.
76 ;; If there is any need to add your mode name to one of the
78 ;; `add-to-list', or some similar function which checks first to see
81 ;; causing the symbol already to be present the next time they load
96 ;; (add-to-list 'align-dq-string-modes 'my-package-mode)
97 ;; (add-to-list 'align-open-comment-modes 'my-package-mode)
103 ;; Note that if you need to install your own exclusion rules, then you
104 ;; will also need to reproduce any double-quoted string, or open
107 ;; way to mix both mode-local and global rules lists.
114 ;; around this time. After several comments from users, and a need to
116 ;; 1998. Many different approaches were taken (mostly due to the
125 "Align text to a specific column, by regexp."
142 "*An integer that represents the default amount of padding to use.
143 If `align-to-tab-stop' is non-nil, this will represent the number of
144 tab stops to use for alignment, rather than the number of spaces.
150 (defcustom align-to-tab-stop 'indent-tabs-mode
151 "*If non-nil, alignments will always fall on a tab boundary.
160 string), this heuristic is used to determine how far before and after
168 "*The face to highlight with if changes are necessary."
173 "*The face to highlight with if no changes are necessary."
179 If nil,then no messages will ever be printed to the minibuffer."
189 "*A list of modes where perl syntax is to be seen."
237 will be referred to in the descriptions below.
251 being aligned to a particular column, the example would
287 NOTE: This option is not supported yet, due to algorithmic
289 are ways to do it, but they're both ugly and resource
294 between sections, the behavior will be very similar to
301 locations of the region in which to look for the section
302 separator. At the very beginning of the attempt to align,
304 function should return non-nil if it wants each rule to
306 section found to be used as the common section for all rules
310 the section dividers lie. Be certain to use markers! For
333 (const :tag "(Regular expression to match)" regexp)
343 (const :tag "(Parenthesis group to use)" group)
354 (const :tag "(Should rule align to tab stops)"
355 tab-stop)
366 (const :tag "(Column to fix alignment at)" column)
370 (const :tag "(Amount of spacing to use)" spacing)
376 ;; make sure this stays up-to-date with any changes
379 (const :tag "(Separation to use for this rule)"
441 (tab-stop . nil))
448 (tab-stop . nil))
455 (tab-stop . nil))
461 (tab-stop . nil))
478 ;; don't do our own parsing yet), this rule is too destructive to
598 expression matches, the given rule will be applied to that
601 identified whitespace group to be contracted/expanded such
618 should return nil if nothing is found to match the rule,
620 to the end of the match, and return the value of point.
634 major modes -- or evaluate to such a value -- in which the
635 rule is valid. If not set, the rule will apply to all
640 the search to proceed case-insensitively (for languages
642 case, set `case-fold' to a non-nil value, and the regular
643 expression search will ignore case. If `regexp' is set to
647 `tab-stop' If the `tab-stop' attribute is set, and non-nil, the
648 alignment character will always fall on a tab stop
649 (whether it uses tabs to get there or not depends on the
650 value of `indent-tabs-mode'). If the `tab-stop' attribute
651 is set to nil, tab stops will never be used. Otherwise,
652 the value of `align-to-tab-stop' determines whether or not
653 to align to a tab stop. The `tab-stop' attribute may also
654 be a list of t or nil values, corresponding to the number
658 rule will be applied to the line continuously until no
661 `valid' If the `valid' attribute is set, it will be used to
664 performed, so that it is possible to use the results of
665 that match to determine whether the alignment should be
671 done to determine if the rule applies to the alignment
678 integer -- it will be used as the column in which to align
680 happens to overrun that column, a single space character,
681 or tab stop (see `align-to-tab-stop') will be added
688 corresponding to the number of parenthesis groups matched
692 for more details on spacing, tab stops, and how to
694 present, it will override the value of `align-to-tab-stop'
697 `justify' It is possible with `regexp' and `group' to identify a
702 is set to a non-nil value, only the initial whitespace
709 describes how to identify the separation of \"sections\"
710 within the region to be aligned. Setting the `separate'
713 values), and any separation argument passed to `align'."
726 (const :tag "(Regular expression to match)" regexp)
736 (const :tag "(Parenthesis group to use)" group)
794 "Alignment rules specific to the current major mode.
800 "Alignment exclusion rules specific to the current major mode.
854 (add-to-list 'align-dq-string-modes 'vhdl-mode)
855 (add-to-list 'align-open-comment-modes 'vhdl-mode)
861 "Attempt to align a region based on a set of alignment rules.
862 BEG and END mark the region. If BEG and END are specifically set to
913 for the REGEXP to align with. If no prefix arg was specified, you
914 only need to supply the characters to be lined up and any preceding
917 prompt for which parenthesis GROUP within REGEXP to modify, the amount
918 of SPACING to use, and whether or not to REPEAT the rule throughout
922 For example, let's say you had a list of phone numbers, and wanted to
930 There is no predefined rule to handle this, but you could easily do it
931 using a REGEXP like \"(\". All you would have to do is to mark the
939 (string-to-number
941 "Parenthesis group to modify (justify if negative): " "1"))
942 (string-to-number
944 (number-to-string align-default-spacing)))
965 is set to a list of rules (see `align-rules-list'), it can be used to
966 override the default alignment rules that would have been used to
974 This function assumes you want to align only the current section, and
975 so saves you from having to specify the region. If RULES or
976 EXCLUDE-RULES is set to a list of rules (see `align-rules-list'), it
977 can be used to override the default alignment rules that would have
978 been used to align that section."
986 that should be highlighted. If RULES or EXCLUDE-RULES is set to a
987 list of rules (see `align-rules-list'), it can be used to override the
988 default alignment rules that would have been used to identify the text
989 to be colored."
993 "Title of rule to highlight: "
1061 END denotes the end of the region to be searched, while REVERSE, if
1083 SEPARATOR specifies how to look for the section divider. See the
1110 (defun align-adjust-col-for-rule (column rule spacing tab-stop)
1111 "Adjust COLUMN according to the given RULE.
1112 SPACING specifies how much spacing to use.
1113 TAB-STOP specifies whether SPACING refers to tab-stop boundaries."
1118 (if (not tab-stop)
1120 (let ((stops tab-stop-list))
1138 PROPS describes formatting features specific to the given regions.
1139 RULE specifies exactly how to perform the alignments.
1149 "Given a list of AREAS and formatting PROPS, align according to RULE.
1157 have been aligned. No changes will be made to the buffer."
1192 ;; Make all ending positions to occur in the goal column. Since
1193 ;; the whitespace to be modified was already deleted by
1194 ;; `align-region', all we have to do here is indent.
1215 ((= cur gocol) t) ; don't need to
1218 ;; whitespace to be modified was already
1220 ;; to do here is indent." However, this
1221 ;; doesn't seem to be true, so we first
1222 ;; delete the whitespace to avoid tabs
1225 (indent-to gocol))
1228 ;; FORCE argument of `move-to-column', which
1229 ;; tends to screw up markers if there is any
1240 (move-to-column gocol t))
1242 (move-to-column endcol t)
1245 (indent-to (align-adjust-col-for-rule
1253 BEG and END specify the region to be aligned. Either may be nil, in
1254 which case the range will stop at the nearest section division (see
1261 RULES and EXCLUDE-RULES are a pair of lists describing how to align
1267 will do with the rules is to search for the alignment areas, as it
1269 first with the beginning and ending of the region to be aligned
1270 according to that rule (this can be different for each rule, if BEG
1272 text region that the rule would have applied to.
1277 \"If MODE is a rule (a list), return t if BEG to END are to be searched.
1278 Otherwise BEG to END will be a region of text that matches the rule's
1281 (message \"Would have aligned from %d to %d...\" beg end)))
1283 This feature (of passing a FUNC) is used internally to locate the
1285 purpose where you might want to know where the regions that the
1300 ;; unless the `run-if' form tells us not to, look for the
1314 tab-stop tab-stop-c
1327 ;; each rule to have its own definition of what that
1378 ;; If we have a region to align, and `func' is set and
1389 ;; the call to `align-region' below will
1409 ;; set `case-fold-search' according to the
1439 ;; the next line, move back to the end of the
1457 (unless tab-stop-c
1458 (setq tab-stop
1459 (let ((rule-ts (assq 'tab-stop rule)))
1462 (if (symbolp align-to-tab-stop)
1463 (symbol-value align-to-tab-stop)
1464 align-to-tab-stop)))
1465 tab-stop-c t))
1497 ;; look to see if this match begins a new
1515 ;; check whether the region to be aligned
1529 ;; matching whitespace text to be
1537 ;; we have to use markers, since
1550 (if (listp tab-stop)
1551 (car tab-stop)
1552 tab-stop))))
1573 (if (listp tab-stop)
1574 (setq tab-stop (cdr tab-stop)))
1577 ;; if `repeat' has not been set, move to