Commits

youngs  committed cb5ac56

2001-08-13 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>

* cc-cmds.el (c-fill-paragraph): Use 'c-current-comment-prefix'.

2001-08-14 Stefan Kamphausen <mail@skamphausen.de>

* func-menu.el (fume-find-next-ruby-function-name): Improved.

  • Participants
  • Parent commits 80a3098

Comments (0)

Files changed (2)

+2001-08-14  Stefan Kamphausen  <mail@skamphausen.de>
+
+	* func-menu.el (fume-find-next-ruby-function-name): Improved.
+
 2001-08-06  Stefan Kamphausen  <mail@skamphausen.de>
 		
 	* func-menu.el: added ruby support

File func-menu.el

 ;; Ruby Support
 ;; Stefan Kamphausen <mail@skamphausen.de>
 ;; Albert Davidson Chou <Al_Chou@CyberDude.com>
+;; Claus Brunzema <mail@cbrunzema.de>
 ;;
 ;; Suggested mouse interface
 ;; Raymond L. Toy <toy@soho.crd.ge.com>
 ;;; Ruby
 ;;; Stefan Kamphausen <mail@skamphausen.de>
 ;;; Albert Davidson Chou <Al_Chou@CyberDude.com>
+;;; Claus Brunzema <mail@cbrunzema.de>
 (defvar fume-function-name-regexp-ruby
-  "^\\s *\\(?:class\\|def\\)+\\s *\\([^(\n ]+\\)")
+  "^\\s-*\\(class\\|def\\)+\\s-*\\([^(\n ]+\\)")
 
 ;;; Python support
 ;;; Shuichi Koga <skoga@virginia.edu>
   (fume-find-next-sexp buffer))
 
 ;;; Specialised routine to find the next Ruby function
-;;; FIXME: this should be more like the python function:
-;;; concatenating the class's name with the method's name, but
-;;; my lisp is not good enough for that.
 ;;;
 (defun fume-find-next-ruby-function-name (buffer)
   "Searches for the next ruby function in BUFFER."
-  (fume-find-next-sexp buffer))
+  (set-buffer buffer)
+  (if (re-search-forward fume-function-name-regexp nil t)
+      (save-excursion
+        (let* ((retpnt (match-beginning 2))
+               (retname (buffer-substring retpnt (match-end 2))))
+          (goto-char (match-beginning 0))
+          (cond ((looking-at "^\\s-*def")
+                 (re-search-backward
+                  "\n?\\s-*class\\s-*\\([A-Z][A-Za-z0-9_]*\\)\\s-*" nil t)
+		 (let* ((classname (buffer-substring
+				    (match-beginning 1) (match-end 1))))
+		   (if (not (string-match (concat "^" classname "\\.") retname))
+		       (setq retname (concat classname "." retname))))))
+	  (cons retname retpnt)))))
 
 ;;; Specialised routine to find the next Java function
 ;;; Bob Weiner <weiner@altrasoft.com>