unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* current-column and display (space :align-to) properties
@ 2006-01-10  1:24 Michael Mauger
  2006-01-10 15:33 ` Stefan Monnier
  2006-01-11  0:49 ` Richard M. Stallman
  0 siblings, 2 replies; 6+ messages in thread
From: Michael Mauger @ 2006-01-10  1:24 UTC (permalink / raw)


I'm not sure if this is a bug or a feature...

Along the lines of a question that arose a couple of weeks ago re: counting 
before and after properties when calculating current-column, should the 
space :align-to and :width properties be reflected in current-column?

For example, in *scratch*, try the following:

  (progn
  (insert "["
	  (propertize "01" 
		      'display '(space :align-to 10))
	  "]XX\n")
  (insert "[" 
	  (propertize "0123456789012"
		      'display '(space :align-to 5)) 
	  "]YY\n")
  ) `C-j'

You should see something like the following in *scratch*:

  [         ]XX
  [    ]YY
  nil

If you place the cursor on the second of the two XXs (actually point is between 
the two XXs), the current-column is 5 (the two square brackets, the two 
characters in the propertized string and the first X.)

If you place the cursor on the second of the two YYs, the current-column is 16 
(the two square brackets, the twelve characters in the propertized string and 
the first Y.)

Even stranger, if you again place the cursor between the two XXs and hit `C-n', 
the cursor will go to before the closing bracket on the second line in an 
effort to preserve the column position.

Is this desired behavior?  Should current-column look at the display property 
to determine how to calculate the column position?

-- Michael

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

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

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-10  1:24 current-column and display (space :align-to) properties Michael Mauger
2006-01-10 15:33 ` Stefan Monnier
2006-01-11  0:49 ` Richard M. Stallman
2006-01-11 16:57   ` Michael Mauger
2006-01-12  8:41     ` Kim F. Storm
2006-01-12 15:10     ` Richard M. Stallman

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).