all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* invisibility in info
@ 2003-06-16  2:37 Luc Teirlinck
  2003-06-17  3:12 ` Richard Stallman
  0 siblings, 1 reply; 2+ messages in thread
From: Luc Teirlinck @ 2003-06-16  2:37 UTC (permalink / raw)


>From an old message of Stefan:

      I think we should solve the above as follows:
      Instead of marking lines as:

	 * CVS:(cvs).			The CVS thingy.
	      ^^^^^^^^^^^^^^^^^^^^^^^^
	      (display "             ")

      we should mark them as follows:

	 * CVS:(cvs).			The CVS thingy.
	      ^^^^^^^ ^^^^^^^^^^^^^^^^
	    invisible (display (space :align-to 24))

This concerned treatment of invisible text in Info.  Stefan
essentially implemented this, with some minor adjustments.  While
Stefan's change constituted a big improvement over the previous
situation, there are still situations where the difference in
appearance between text yanked into an Emacs buffer and text yanked
into another application can be big enough to cause confusion.  The
difference in whitespace can be huge, because all whitespace gets
handled by the display property and since that is handled by
:align-to, all whitespace often disappears when the invisible text
becomes visible.  The result can look very ugly when yanking into
another Emacs buffer or when turning on vis-mode.  The invisible
whitespace reappears when yanked into another buffer, saved to file,
printed out and so on.

I would like to commit the following patch, which does not make any
change to the normal appearance of an info buffer, except when
vis-mode is enabled or when yanked into another Emacs buffer.  It can
be off by at most one space when compared to yanking into other
application and so on, whereas right now there is no limit as to how
much it can be off.

Essentially it handles all involved text, except the very last space
by the invisibility property and gives the last space the same display
properties Stefan gave to the entire stretch of whitespace.

Is it OK if I commit this patch?

===File ~/infodiff==========================================
cd /usr/local/share/emacs/21.3.50/lisp/
diff -c /usr/local/share/emacs/21.3.50/lisp/info.old.el /usr/local/share/emacs/21.3.50/lisp/info.el
*** /usr/local/share/emacs/21.3.50/lisp/info.old.el	Mon Jun  9 22:04:07 2003
--- /usr/local/share/emacs/21.3.50/lisp/info.el	Fri Jun 13 21:30:32 2003
***************
*** 2946,2956 ****
  		      '(font-lock-face info-xref
  			mouse-face highlight))))
  	      (when (eq Info-hide-note-references t)
! 		(put-text-property (match-beginning 2) (match-beginning 4)
  				   'invisible t)
  		;; We need a stretchable space like :align-to but with
  		;; a minimum value.
! 		(put-text-property (match-beginning 4) (match-end 4) 'display
  				   (if (>= 22 (- (match-end 1)
  						 (match-beginning 0)))
  				       '(space :align-to 24)
--- 2946,2956 ----
  		      '(font-lock-face info-xref
  			mouse-face highlight))))
  	      (when (eq Info-hide-note-references t)
! 		(put-text-property (match-beginning 2) (1- (match-end 4))
  				   'invisible t)
  		;; We need a stretchable space like :align-to but with
  		;; a minimum value.
! 		(put-text-property (1- (match-end 4)) (match-end 4) 'display
  				   (if (>= 22 (- (match-end 1)
  						 (match-beginning 0)))
  				       '(space :align-to 24)
***************
*** 2958,2964 ****
  		(setq cont (looking-at "."))
  		(while (and (= (forward-line 1) 0)
  			    (looking-at "\\([ \t]+\\)[^*\n]"))
! 		  (put-text-property (match-beginning 1) (match-end 1) 'display
  				     (if cont
  					 '(space :align-to 26)
  				       '(space :align-to 24)))
--- 2958,2967 ----
  		(setq cont (looking-at "."))
  		(while (and (= (forward-line 1) 0)
  			    (looking-at "\\([ \t]+\\)[^*\n]"))
! 		  (put-text-property (match-beginning 1) (1- (match-end 1))
! 				     'invisible t)
! 		  (put-text-property (1- (match-end 1)) (match-end 1)
! 				     'display
  				     (if cont
  					 '(space :align-to 26)
  				       '(space :align-to 24)))

Diff finished at Sun Jun 15 20:52:40
============================================================

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

* Re: invisibility in info
  2003-06-16  2:37 invisibility in info Luc Teirlinck
@ 2003-06-17  3:12 ` Richard Stallman
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Stallman @ 2003-06-17  3:12 UTC (permalink / raw)
  Cc: emacs-devel

    Essentially it handles all involved text, except the very last space
    by the invisibility property and gives the last space the same display
    properties Stefan gave to the entire stretch of whitespace.

    Is it OK if I commit this patch?

Ok.

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

end of thread, other threads:[~2003-06-17  3:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-16  2:37 invisibility in info Luc Teirlinck
2003-06-17  3:12 ` Richard Stallman

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.