unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ken Manheimer" <ken.manheimer@gmail.com>
Subject: small allout patch
Date: Mon, 9 Oct 2006 12:20:00 -0400	[thread overview]
Message-ID: <2cd46e7f0610090919i38281c70ma328054704f9ba6c@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 383 bytes --]

this catches a loose end in dealing with aberrant topics, clarifying
the api layering.  allout continues to appear to be settling into
stability.
--
ken
ken.manheimer@gmail.com
http://myriadicity.net

2006-10-09  Ken Manheimer  <ken.manheimer@gmail.com>

	* allout.el (allout-back-to-current-heading): Base on lower-level
	routines to get proper disqualification of aberrant topics.

[-- Attachment #2: allout-patch.txt --]
[-- Type: text/plain, Size: 1847 bytes --]

Index: allout.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/allout.el,v
retrieving revision 1.85
diff -u -u -r1.85 allout.el
--- allout.el	1 Oct 2006 16:48:11 -0000	1.85
+++ allout.el	9 Oct 2006 05:05:57 -0000
@@ -2736,24 +2736,22 @@
     (1- allout-recent-prefix-end)))
 ;;;_   > allout-back-to-current-heading ()
 (defun allout-back-to-current-heading ()
-  "Move to heading line of current topic, or beginning if already on the line.
+  "Move to heading line of current topic, or beginning if not in a topic.
 
-Return value of point, unless we started outside of (before any) topics,
-in which case we return nil."
+If interactive, we position at the end of the prefix.
+
+Return value of resulting point, unless we started outside
+of (before any) topics, in which case we return nil."
 
   (allout-beginning-of-current-line)
-  (if (or (allout-on-current-heading-p)
-          (and (re-search-backward (concat "^\\(" allout-regexp "\\)")
-                                   nil 'move)
-               (progn (while (allout-hidden-p)
-                        (allout-beginning-of-current-line)
-                        (if (not (looking-at allout-regexp))
-                            (re-search-backward allout-regexp
-                                                nil 'move)))
-                      (allout-prefix-data))))
-      (if (interactive-p)
-          (allout-end-of-prefix)
-        (point))))
+  (let ((bol-point (point)))
+    (allout-goto-prefix-doublechecked)
+    (if (<= (point) bol-point)
+        (if (interactive-p)
+            (allout-end-of-prefix)
+          (point))
+      (goto-char (point-min))
+      nil)))
 ;;;_   > allout-back-to-heading ()
 (defalias 'allout-back-to-heading 'allout-back-to-current-heading)
 ;;;_   > allout-pre-next-prefix ()

[-- Attachment #3: ChangeLog-entry.txt --]
[-- Type: text/plain, Size: 182 bytes --]

2006-10-09  Ken Manheimer  <ken.manheimer@gmail.com>

	* allout.el (allout-back-to-current-heading): Base on lower-level
	routines to get proper disqualification of aberrant topics.

[-- Attachment #4: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

             reply	other threads:[~2006-10-09 16:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-09 16:20 Ken Manheimer [this message]
2006-10-09 21:42 ` small allout patch Richard Stallman
2006-10-09 23:34   ` Chong Yidong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2cd46e7f0610090919i38281c70ma328054704f9ba6c@mail.gmail.com \
    --to=ken.manheimer@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).