pkgsrc/devel/ruby-rd-mode/patches/patch-aa
taca 07e3e24dc0 Some improvement to ruby-rd-mode:
- Support indentation support for EnumList.
- Make rd-intelligent-newline work if previous line isn't ItemList and
  MethodList.

Bump to ruby-rd-mode-0.6.11nb1.
2002-10-06 15:25:21 +00:00

51 lines
1.3 KiB
Text

$NetBSD: patch-aa,v 1.1 2002/10/06 15:25:23 taca Exp $
--- rd-mode.el.orig Sat Feb 2 02:58:16 2002
+++ rd-mode.el
@@ -321,7 +321,7 @@
""
(save-excursion
(beginning-of-line)
- (looking-at "--- +\\| *\\(\\* +\\)?")
+ (looking-at "--- +\\| *\\(\\* +\\|([0-9]+) +\\)?")
(length (buffer-substring (match-beginning 0)(match-end 0)))))
(defun rd-cite-region (beg end)
@@ -379,15 +379,32 @@
(rd-insert-reftourl url)
(rd-insert-ref (concat label "|URL:" url))))
+(defun rd-search-last-listitem ()
+ (beginning-of-line)
+ (if (looking-at "[ \t]*\\(\\*\\|([0-9])\\|:\\|---\\)[ \t]*")
+ (match-string 0)
+ (and (and (eq
+ (rd-current-indentation)
+ (progn (forward-line -1) (rd-current-indentation))
+ )
+ (not (eq (point) (point-min)) )
+ )
+ (rd-search-last-listitem)
+ )
+ )
+ )
+
(defun rd-intelligent-newline ()
(interactive)
- (beginning-of-line)
- (let ((item
- (and (looking-at "[ \t]*\\(\\*\\|([0-9])\\|:\\|---\\)[ \t]*")
- (match-string 0))))
+ (let (item)
+ (setq item
+ (save-excursion (rd-search-last-listitem) )
+ )
(end-of-line)
(newline)
- (if item (insert-string item))))
+ (if item (insert-string item) )
+ )
+ )
(provide 'rd-mode)
;;; rd-mode.el ends here