emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

invisibility in info


From: Luc Teirlinck
Subject: invisibility in info
Date: Sun, 15 Jun 2003 21:37:44 -0500 (CDT)

>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
============================================================




reply via email to

[Prev in Thread] Current Thread [Next in Thread]