/[emacs]/emacs/lisp/progmodes/cc-align.el
ViewVC logotype

Diff of /emacs/lisp/progmodes/cc-align.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.22 by miles, Mon Sep 1 15:45:34 2003 UTC revision 1.23 by mast, Sun Nov 16 16:55:07 2003 UTC
# Line 1121  ACTION associated with `block-close' syn Line 1121  ACTION associated with `block-close' syn
1121          '(before after)))))          '(before after)))))
1122    
1123  (defun c-gnu-impose-minimum ()  (defun c-gnu-impose-minimum ()
1124    "Imposes a minimum indentation for lines inside a top-level construct.    "Imposes a minimum indentation for lines inside code blocks.
1125  The variable `c-label-minimum-indentation' specifies the minimum  The variable `c-label-minimum-indentation' specifies the minimum
1126  indentation amount."  indentation amount."
1127    
1128    ;; Don't adjust macro or comment-only lines.    (when (and (not
1129    (unless (or (assq 'cpp-macro c-syntactic-context)                ;; Don't adjust macro or comment-only lines.
1130                (assq 'comment-intro c-syntactic-context))                (or (assq 'cpp-macro c-syntactic-context)
1131                      (assq 'comment-intro c-syntactic-context)))
1132      (let ((paren-state (save-excursion               (c-intersect-lists c-inside-block-syms c-syntactic-context)
1133                           ;; Get the parenthesis state, but skip past               (save-excursion
1134                           ;; an initial closing paren on the line since                 (back-to-indentation)
1135                           ;; the close brace of a block shouldn't be                 (< (current-column) c-label-minimum-indentation)))
1136                           ;; considered to be inside the block.      (c-shift-line-indentation (- c-label-minimum-indentation
1137                           (back-to-indentation)                                   (current-indentation)))))
                          (when (looking-at "\\s\)")  
                            (forward-char))  
                          (c-parse-state))))  
   
       ;; Search for an enclosing brace on paren-state.  
       (while (and paren-state  
                   (not (and (integer-or-marker-p (car paren-state))  
                             (eq (char-after (car paren-state)) ?{))))  
         (setq paren-state (cdr paren-state)))  
   
       (when paren-state  
         (save-excursion  
           (back-to-indentation)  
           (if (zerop (current-column))  
               (insert-char ?\  c-label-minimum-indentation t)))))))  
1138    
1139    
1140  ;; Useful for c-hanging-semi&comma-criteria  ;; Useful for c-hanging-semi&comma-criteria

Legend:
Removed from v.1.22  
changed lines
  Added in v.1.23

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26