all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* need option so line-move-to-column ignores fields, plus patch
@ 2006-08-31 15:48 Ken Manheimer
  2006-08-31 16:25 ` Ken Manheimer
                   ` (2 more replies)
  0 siblings, 3 replies; 36+ messages in thread
From: Ken Manheimer @ 2006-08-31 15:48 UTC (permalink / raw)


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

i propose a change to the way line-move-to-column to enable
insensitivity to fields.  without this change, modes that make certain
uses of fields sacrifice column retention in line motion.  i consider
that a bug, and this a bug fix.

in my under-development allout extensions, i'm using field boundaries
to distinguish between an outline item's structural elements (the
guide lines and topic bullet area) and the item's content,
specifically the content on the item's head line:

| | | > here's the content.  the stuff before "here's" is the bullet
and guidelines.

this is working exactly as i need - cursor motion from within the
headline content stops when it first hits the start of the content,
yet will move into the structure area (for hot-spot navigation) with a
subsequent ^A.

the bug is that i can't use text fields this way without sacrificing
column retention on line moves, as far as i can tell.
line-move-to-column is hard-wired to respect fields when seeking the
prior positions column, so that moving the cursor between topics
usually leaves the cursor at column 0, which is almost always not what
the user wants.

my patch introduces a new lisp-level variable,
`line-move-ignore-fields', and a condition in line-move-to-column to
obey that variable.  the default setting of line-move-ignore-fields is
nil, so the current behavior remains.  my allout extension sets it to
get the behavior it needs.

(i made it a lisp-level rather than customization variable because i
expect that it's a modal, not user policy.  i feel the same way about
line-move-ignore-invisible, though, so i'm breaking with that
precedent, and could be persuaded to have the variable i'm introducing
be customizable.)

i would be interested to hear if i missed some better way to achieve
either the cursor motion i want in the headline, without using fields,
or have column retention without adding the field sensitivity
inhibition, as i'm doing.  barring that, i think this is a necessary
bug fix.

the patch is attached, and here's the ChangeLog entry:

2006-08-22  Ken Manheimer  <ken.manheimer@gmail.com>

	* simple.el (line-move-ignore-fields): New lisp-level variable for
	overriding line-move-to-column's sensitivity to fields when doing
	column positioning.
	(line-move-to-column): Respect line-move-ignore-fields.

-- 
ken
ken.manheimer@gmail.com
http://myriadicity.net

[-- Attachment #2: line-move-patch.txt --]
[-- Type: text/plain, Size: 790 bytes --]

--- simple.el	22 Aug 2006 17:54:52 -0400	1.812
+++ simple.el	31 Aug 2006 11:43:52 -0400	
@@ -3466,6 +3466,9 @@
   :type 'boolean
   :group 'editing-basics)
 
+(defvar line-move-ignore-fields nil
+  "*Non-nil means \\[next-line] and \\[previous-line] ignore fields.")
+
 (defun line-move-invisible-p (pos)
   "Return non-nil if the character after POS is currently invisible."
   (let ((prop
@@ -3702,7 +3705,8 @@
     (let ((opoint (point)))
       (move-to-column col)
       ;; move-to-column doesn't respect field boundaries.
-      (goto-char (constrain-to-field (point) opoint))))
+      (if (not line-move-ignore-fields)
+          (goto-char (constrain-to-field (point) opoint)))))
 
   (when (and line-move-ignore-invisible
 	     (not (bolp)) (line-move-invisible-p (1- (point))))

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

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

^ permalink raw reply	[flat|nested] 36+ messages in thread

end of thread, other threads:[~2006-10-12 22:37 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-31 15:48 need option so line-move-to-column ignores fields, plus patch Ken Manheimer
2006-08-31 16:25 ` Ken Manheimer
2006-08-31 17:11 ` David Kastrup
2006-08-31 22:57 ` Richard Stallman
2006-09-01  4:17   ` Miles Bader
2006-09-01  6:39     ` Ken Manheimer
2006-09-03 15:17       ` Richard Stallman
2006-09-04  4:43         ` Ken Manheimer
2006-09-04 17:18           ` Richard Stallman
2006-09-04 19:56             ` Ken Manheimer
2006-09-06  8:49               ` Richard Stallman
2006-09-06 16:52                 ` Ken Manheimer
2006-09-07  6:54                   ` Richard Stallman
2006-09-07 14:47                     ` Ken Manheimer
2006-09-23 23:29                       ` Ken Manheimer
2006-09-24 16:28                         ` Richard Stallman
2006-09-24 20:17                           ` Ken Manheimer
2006-09-25 20:48                             ` Richard Stallman
2006-09-24 22:04                           ` Chong Yidong
2006-09-24 22:10                             ` Chong Yidong
2006-09-25  1:53                               ` Ken Manheimer
2006-10-11  4:13                                 ` Ken Manheimer
2006-10-11 18:50                                   ` Richard Stallman
2006-10-11 19:19                                     ` Ken Manheimer
2006-10-12 22:37                                       ` Richard Stallman
2006-09-25  1:31                             ` Ken Manheimer
2006-09-25  8:36                             ` Slawomir Nowaczyk
2006-09-25 20:48                             ` Richard Stallman
2006-09-25 21:43                               ` Chong Yidong
2006-09-27 17:18                                 ` Ken Manheimer
2006-09-29 16:32                                 ` Richard Stallman
2006-09-29 18:21                                   ` Chong Yidong
2006-09-07  6:54                   ` Richard Stallman
2006-09-07 14:27                     ` Ken Manheimer
2006-09-05  4:48         ` Miles Bader
2006-09-01  6:30   ` Ken Manheimer

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.