unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Luc Teirlinck <teirllm@dms.auburn.edu>
Cc: juri@jurta.org, bob@rattlesnake.com, karl@freefriends.org,
	rms@gnu.org, emacs-devel@gnu.org
Subject: Re: 3 dots vanish at end of filled line
Date: Mon, 10 Oct 2005 22:31:46 -0500 (CDT)	[thread overview]
Message-ID: <200510110331.j9B3Vk829941@raven.dms.auburn.edu> (raw)
In-Reply-To: <8764s5pgmg.fsf-monnier+emacs@gnu.org> (message from Stefan Monnier on Mon, 10 Oct 2005 11:00:02 -0400)

   Indeed.  And we've been through this discussion already.  And since Emacs's
   Info mode does even more of those "dangerous" guessing games now than
   before, I think it's pretty clear that we've decided it's worth the risk.

For other types of abuse of the Info format by info.el, at least
customizable variables were provided to get around them.  The patch
below provides such a variable.

   If those risks are too high for you, then I'd suggest you turn off font-lock
   in your info buffers.

I do not want to turn off font-lock entirely, only the part of it that
I consider reckless and senseless: the games played with the titles.
There is for example nothing wrong with Font Lock fontifying links
because if Font Lock gets confused about them, then probably info.el
is confused and will incorrectly try to follow them or fail to follow
then and hence there is a bug to be fixed.

I still believe that it would be a lot better not to mess with mode
titles in the middle of a node.  If I would not be able to convince
people of that then I believe that we need a customizable variable
allowing people to turn the processing of titles off without having to
give up on fontification of links and menus.

If fontification of titles in the body of a node would not be disabled
by default then I believe that it makes more sense to make the new
variable turn off fontification for all titles, even the node titles,
as people who explicitly customize it probably are not going to worry
about the fact that this constitutes a change from previous Emacs
versions.  They are more typically going to worry about uniformity of
style between the different ways of reading Info: Emacs under X,
emacs -nw and the standalone Info reader.

The patch below would provide a customizable variable allowing to turn
the processing of titles off entirely or partially (only the hiding
part).  The present situation would remain the default, although I
personally still believe that this is a mistake. 

If I could convince people that it is better not to process titles in
the middle of a node, then I would provide a fourth option disabling
processing of titles only in the body of a node and make that the default.

As usual, I can install if desired.

===File ~/info.el-diff======================================
*** info.el	04 Oct 2005 09:11:27 -0500	1.448
--- info.el	10 Oct 2005 20:05:52 -0500	
***************
*** 3626,3631 ****
--- 3626,3647 ----
      keymap)
    "Keymap to put on the Up link in the text or the header line.")
  
+ (defcustom Info-fontify-titles t
+   "If non-nil fontify titles in Info nodes.
+ This uses the faces `info-title-1' through `info-title-4'.
+ If the value is t, also hide the underlining.
+ If nil, leave the titles exactly as in the .info files.  This makes
+ the titles look like they do in the standalone Info reader.
+ If neither nil not t, fontify the titles, but do not hide the underlining,
+ The latter option looks bad with the default values of `info-title-1'
+ and friends, so if you choose it, you will probably also want to customize
+ those faces."
+   :type '(choice (const :tag "Fontify and hide underlining" t)
+ 		 (const :tag "Fontify but do not hide underlining" 'no-hiding)
+ 		 (const :tag "Neither fontify nor hide" nil))
+   :group 'info
+   :version "22.1")
+ 
  (defun Info-fontify-node ()
    "Fontify the node."
    (save-excursion
***************
*** 3700,3723 ****
                (put-text-property (point) header-end 'invisible t)))))
  
        ;; Fontify titles
!       (goto-char (point-min))
!       (when not-fontified-p
!         (while (re-search-forward "\n\\([^ \t\n].+\\)\n\\(\\*\\*+\\|==+\\|--+\\|\\.\\.+\\)$"
!                                   nil t)
!           (let* ((c (preceding-char))
!                  (face
!                   (cond ((= c ?*) 'info-title-1)
!                         ((= c ?=) 'info-title-2)
!                         ((= c ?-) 'info-title-3)
!                         (t        'info-title-4))))
!             (put-text-property (match-beginning 1) (match-end 1)
!                                'font-lock-face face))
!           ;; This is a serious problem for trying to handle multiple
!           ;; frame types at once.  We want this text to be invisible
!           ;; on frames that can display the font above.
!           (when (memq (framep (selected-frame)) '(x pc w32 mac))
!             (add-text-properties (1- (match-beginning 2)) (match-end 2)
!                                  '(invisible t front-sticky nil rear-nonsticky t)))))
  
        ;; Fontify cross references
        (goto-char (point-min))
--- 3716,3741 ----
                (put-text-property (point) header-end 'invisible t)))))
  
        ;; Fontify titles
!       (when Info-fontify-titles
! 	(goto-char (point-min))
! 	(when not-fontified-p
! 	  (while (re-search-forward "\n\\([^ \t\n].+\\)\n\\(\\*\\*+\\|==+\\|--+\\|\\.\\.+\\)$"
! 				    nil t)
! 	    (let* ((c (preceding-char))
! 		   (face
! 		    (cond ((= c ?*) 'info-title-1)
! 			  ((= c ?=) 'info-title-2)
! 			  ((= c ?-) 'info-title-3)
! 			  (t        'info-title-4))))
! 	      (put-text-property (match-beginning 1) (match-end 1)
! 				 'font-lock-face face))
! 	    ;; This is a serious problem for trying to handle multiple
! 	    ;; frame types at once.  We want this text to be invisible
! 	    ;; on frames that can display the font above.
! 	    (and (memq (framep (selected-frame)) '(x pc w32 mac))
! 		 (eq Info-fontify-titles t)
! 		 (add-text-properties (1- (match-beginning 2)) (match-end 2)
! 				      '(invisible t front-sticky nil rear-nonsticky t))))))
  
        ;; Fontify cross references
        (goto-char (point-min))
============================================================

  parent reply	other threads:[~2005-10-11  3:31 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-07 20:32 3 dots vanish at end of filled line Karl Berry
2005-10-07 21:12 ` Juri Linkov
2005-10-07 21:21   ` Karl Berry
2005-10-07 21:47     ` Juri Linkov
2005-10-07 23:12       ` Karl Berry
2005-10-07 23:56       ` Luc Teirlinck
2005-10-08  2:54       ` Luc Teirlinck
2005-10-08 22:57     ` Richard M. Stallman
2005-10-09  0:14       ` Karl Berry
2005-10-09  0:57       ` Luc Teirlinck
2005-10-09  6:11         ` Juri Linkov
2005-10-09 17:17           ` Karl Berry
2005-10-09 19:16             ` Luc Teirlinck
2005-10-10 15:00               ` Stefan Monnier
2005-10-10 17:07                 ` Karl Berry
2005-10-10 18:01                   ` Stefan Monnier
2005-10-11 14:46                     ` Richard M. Stallman
2005-10-11 17:06                       ` Stefan Monnier
2005-10-10 23:48                   ` Richard M. Stallman
2005-10-10 23:48                   ` Richard M. Stallman
2005-10-11  2:18                 ` Luc Teirlinck
2005-10-11  3:31                 ` Luc Teirlinck [this message]
2005-10-11 22:42                   ` Richard M. Stallman
2005-10-12  0:21                     ` Luc Teirlinck
2005-10-12 19:47                     ` Stefan Monnier
2005-10-13 20:10                       ` Richard M. Stallman
2005-10-28  4:41                       ` KOBAYASHI Yasuhiro
2005-10-10  6:18             ` Juri Linkov
2005-10-09 19:54           ` Luc Teirlinck
2005-10-10  4:14         ` Richard M. Stallman
2005-10-10 15:02           ` Stefan Monnier
2005-10-10 23:47             ` Richard M. Stallman
2005-10-09 11:09       ` Robert J. Chassell
2005-10-10  4:14         ` Richard M. Stallman
2005-10-10 12:21           ` Robert J. Chassell
2005-10-10 23:47             ` Richard M. Stallman
2005-10-11 12:57               ` Robert J. Chassell
2005-10-20 11:11           ` Juri Linkov
2005-10-20 23:38             ` Richard M. Stallman
2005-10-21 11:55               ` Juri Linkov
2005-10-21 22:19                 ` Richard M. Stallman

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=200510110331.j9B3Vk829941@raven.dms.auburn.edu \
    --to=teirllm@dms.auburn.edu \
    --cc=bob@rattlesnake.com \
    --cc=emacs-devel@gnu.org \
    --cc=juri@jurta.org \
    --cc=karl@freefriends.org \
    --cc=rms@gnu.org \
    /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).