mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	* misc/ruby-style.el (ruby-style-label-indent): fix for function top
level labels. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13478 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
		
							parent
							
								
									9c6ff18f6c
								
							
						
					
					
						commit
						ac907e669a
					
				
					 2 changed files with 28 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -1,5 +1,22 @@
 | 
			
		|||
;;; -*- emacs-lisp -*-
 | 
			
		||||
;;;
 | 
			
		||||
;;; ruby-style.el -
 | 
			
		||||
;;;
 | 
			
		||||
;;; C/C++ mode style for Ruby.
 | 
			
		||||
;;;
 | 
			
		||||
;;;  $Author$
 | 
			
		||||
;;;  $Date$
 | 
			
		||||
;;;  created at: Thu Apr 26 13:54:01 JST 2007
 | 
			
		||||
;;;
 | 
			
		||||
 | 
			
		||||
(defconst ruby-style-revision "$Revision$"
 | 
			
		||||
  "Ruby style revision string.")
 | 
			
		||||
 | 
			
		||||
(defconst ruby-style-version
 | 
			
		||||
  (progn
 | 
			
		||||
   (string-match "[0-9.]+" ruby-style-revision)
 | 
			
		||||
   (substring ruby-style-revision (match-beginning 0) (match-end 0)))
 | 
			
		||||
  "Ruby style version number.")
 | 
			
		||||
 | 
			
		||||
(defun ruby-style-case-indent (x)
 | 
			
		||||
  (save-excursion
 | 
			
		||||
| 
						 | 
				
			
			@ -9,9 +26,12 @@
 | 
			
		|||
(defun ruby-style-label-indent (x)
 | 
			
		||||
  (save-excursion
 | 
			
		||||
    (goto-char (cdr x))
 | 
			
		||||
    (backward-up-list)
 | 
			
		||||
    (backward-sexp 2)
 | 
			
		||||
    (if (looking-at "\\<switch\\>") '/)))
 | 
			
		||||
    (condition-case ()
 | 
			
		||||
	(progn
 | 
			
		||||
	  (backward-up-list)
 | 
			
		||||
	  (backward-sexp 2)
 | 
			
		||||
	  (if (looking-at "\\<switch\\>") '/))
 | 
			
		||||
      (error))))
 | 
			
		||||
 | 
			
		||||
(require 'cc-styles)
 | 
			
		||||
(c-add-style
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue