From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Luc Teirlinck Newsgroups: gmane.emacs.devel Subject: Re: 3 dots vanish at end of filled line Date: Mon, 10 Oct 2005 22:31:46 -0500 (CDT) Message-ID: <200510110331.j9B3Vk829941@raven.dms.auburn.edu> References: <200510091717.j99HHc614879@f7.net> <200510091916.j99JGNV20182@raven.dms.auburn.edu> <8764s5pgmg.fsf-monnier+emacs@gnu.org> NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1129001611 14356 80.91.229.2 (11 Oct 2005 03:33:31 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 11 Oct 2005 03:33:31 +0000 (UTC) Cc: juri@jurta.org, bob@rattlesnake.com, karl@freefriends.org, rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Oct 11 05:33:29 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EPAsd-0007ms-R4 for ged-emacs-devel@m.gmane.org; Tue, 11 Oct 2005 05:32:44 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EPAsd-0001SO-5f for ged-emacs-devel@m.gmane.org; Mon, 10 Oct 2005 23:32:43 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EPAsV-0001SJ-QD for emacs-devel@gnu.org; Mon, 10 Oct 2005 23:32:35 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EPAsV-0001S7-7Q for emacs-devel@gnu.org; Mon, 10 Oct 2005 23:32:35 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EPAsV-0001S4-3N for emacs-devel@gnu.org; Mon, 10 Oct 2005 23:32:35 -0400 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EPAsU-0001bx-6D; Mon, 10 Oct 2005 23:32:34 -0400 Original-Received: from raven.dms.auburn.edu (raven.dms.auburn.edu [131.204.53.29]) by manatee.dms.auburn.edu (8.13.3+Sun/8.13.3) with ESMTP id j9B3WWOR014108; Mon, 10 Oct 2005 22:32:33 -0500 (CDT) Original-Received: (from teirllm@localhost) by raven.dms.auburn.edu (8.11.7p1+Sun/8.11.7) id j9B3Vk829941; Mon, 10 Oct 2005 22:31:46 -0500 (CDT) X-Authentication-Warning: raven.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: monnier@iro.umontreal.ca In-reply-to: <8764s5pgmg.fsf-monnier+emacs@gnu.org> (message from Stefan Monnier on Mon, 10 Oct 2005 11:00:02 -0400) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:43851 Archived-At: 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)) ============================================================