aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2007-04-13 01:17:51 +0000
committerChong Yidong2007-04-13 01:17:51 +0000
commit29779b2d7bb3d3810ec36754ea9a6856f29744b2 (patch)
treeff33209c20a12fc8e1451860cfb3ee6a721b833d
parentcb2ec9315ee1fdb2ffcb527fff76f217a3006177 (diff)
downloademacs-29779b2d7bb3d3810ec36754ea9a6856f29744b2.tar.gz
emacs-29779b2d7bb3d3810ec36754ea9a6856f29744b2.zip
* outline.el (outline-get-next-sibling): Clarify docstring.
(outline-get-last-sibling): Handle case where we are at the first heading. Clarify docstring.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/outline.el22
2 files changed, 19 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 29e8c5b3c99..e5ecd6e0817 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12007-04-12 Chong Yidong <cyd@stupidchicken.com>
2
3 * outline.el (outline-get-next-sibling): Clarify docstring.
4 (outline-get-last-sibling): Handle case where we are at the first
5 heading. Clarify docstring.
6
12007-04-12 Nick Roberts <nickrob@snap.net.nz> 72007-04-12 Nick Roberts <nickrob@snap.net.nz>
2 8
3 * progmodes/gud.el (gud-minor-mode-map): Make go button same same 9 * progmodes/gud.el (gud-minor-mode-map): Make go button same same
diff --git a/lisp/outline.el b/lisp/outline.el
index 579997754f2..d0c121a12c4 100644
--- a/lisp/outline.el
+++ b/lisp/outline.el
@@ -1000,7 +1000,8 @@ Stop at the first and last subheadings of a superior heading."
1000 (error "No following same-level heading")))))) 1000 (error "No following same-level heading"))))))
1001 1001
1002(defun outline-get-next-sibling () 1002(defun outline-get-next-sibling ()
1003 "Move to next heading of the same level, and return point or nil if none." 1003 "Move to next heading of the same level, and return point.
1004If there is no such heading, return nil."
1004 (let ((level (funcall outline-level))) 1005 (let ((level (funcall outline-level)))
1005 (outline-next-visible-heading 1) 1006 (outline-next-visible-heading 1)
1006 (while (and (not (eobp)) (> (funcall outline-level) level)) 1007 (while (and (not (eobp)) (> (funcall outline-level) level))
@@ -1026,15 +1027,18 @@ Stop at the first and last subheadings of a superior heading."
1026 (error "No previous same-level heading")))))) 1027 (error "No previous same-level heading"))))))
1027 1028
1028(defun outline-get-last-sibling () 1029(defun outline-get-last-sibling ()
1029 "Move to previous heading of the same level, and return point or nil if none." 1030 "Move to previous heading of the same level, and return point.
1030 (let ((level (funcall outline-level))) 1031If there is no such heading, return nil."
1032 (let ((opoint (point))
1033 (level (funcall outline-level)))
1031 (outline-previous-visible-heading 1) 1034 (outline-previous-visible-heading 1)
1032 (while (and (> (funcall outline-level) level) 1035 (when (and (/= (point) opoint) (outline-on-heading-p))
1033 (not (bobp))) 1036 (while (and (> (funcall outline-level) level)
1034 (outline-previous-visible-heading 1)) 1037 (not (bobp)))
1035 (if (< (funcall outline-level) level) 1038 (outline-previous-visible-heading 1))
1036 nil 1039 (if (< (funcall outline-level) level)
1037 (point)))) 1040 nil
1041 (point)))))
1038 1042
1039(defun outline-headers-as-kill (beg end) 1043(defun outline-headers-as-kill (beg end)
1040 "Save the visible outline headers in region at the start of the kill ring. 1044 "Save the visible outline headers in region at the start of the kill ring.