From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ivan Kanis Newsgroups: gmane.emacs.devel Subject: Re: PATCH term optional bold Date: Sat, 12 Sep 2009 09:32:13 +0200 Message-ID: <87y6ok62ki.fsf@kanis.fr> References: <87pr9x61tk.fsf@kanis.fr> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1252763577 27591 80.91.229.12 (12 Sep 2009 13:52:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 12 Sep 2009 13:52:57 +0000 (UTC) Cc: Per Bothner , Dan Nicolaescu , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Sep 12 15:52:49 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MmT1x-0006r8-7J for ged-emacs-devel@m.gmane.org; Sat, 12 Sep 2009 15:52:46 +0200 Original-Received: from localhost ([127.0.0.1]:55537 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MmT1w-00064P-M9 for ged-emacs-devel@m.gmane.org; Sat, 12 Sep 2009 09:52:44 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MmSpW-0008ND-4K for emacs-devel@gnu.org; Sat, 12 Sep 2009 09:39:54 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MmSpS-0008JP-EL for emacs-devel@gnu.org; Sat, 12 Sep 2009 09:39:50 -0400 Original-Received: from [199.232.76.173] (port=56927 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MmSpR-0008JB-VV for emacs-devel@gnu.org; Sat, 12 Sep 2009 09:39:50 -0400 Original-Received: from mx20.gnu.org ([199.232.41.8]:18657) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MmSpR-00089A-Kz for emacs-devel@gnu.org; Sat, 12 Sep 2009 09:39:49 -0400 Original-Received: from kanis.fr ([75.127.73.245]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MmN7N-0003m0-VW for emacs-devel@gnu.org; Sat, 12 Sep 2009 03:33:58 -0400 Original-Received: from if02t2-89-83-137-164.d4.club-internet.fr ([89.83.137.164] helo=zen) by kanis.fr with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1MmN7I-0001hm-Fc; Sat, 12 Sep 2009 03:33:53 -0400 In-Reply-To: (Stefan Monnier's message of "Fri, 11 Sep 2009 13:48:31 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) X-detected-operating-system: by mx20.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Mailman-Approved-At: Sat, 12 Sep 2009 09:51:36 -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:115228 Archived-At: Hi Stefan, Stefan Monnier wrote: >> This small patch make optional the usage of bold attribute in term. > Could you give us some background explaining the motivation for this? I can't stand bold font and try to disable it whenever I can. There is a big misunderstanding about bold in terminal emulation. In a true dumb terminal like a vt220 bold was a brighter color. > I think it'd be even better to do something like > [...your patch..] >> (when term-ansi-current-bold >> (setq term-current-face >> - (append '(:weight bold) term-current-face))) >> + (append term-bold-attribute term-current-face))) > > WDYT? I think it's better it allows more customization, I have fixed up your patch a little bit and tested. I use progn for the setq and update the comment of the defvar. --- a/lisp/misc/term.el Fri Sep 11 14:36:54 2009 +0200 +++ b/lisp/misc/term.el Sat Sep 12 09:29:30 2009 +0200 @@ -476,11 +476,16 @@ (defvar term-old-mode-line-format) ;; Saves old mode-line-format while paging. (defvar term-pager-old-local-map nil) ;; Saves old keymap while paging. (defvar term-pager-old-filter) ;; Saved process-filter while paging. (defcustom explicit-shell-file-name nil "If non-nil, is file name to use for explicitly requested inferior shell." :type '(choice (const nil) file) :group 'term) + +(defvar term-enable-bold t + "Set to nil to disable bold") + +(defvar term-bold-attribute '(:weight bold) + "Set to '(:weight normal) to disable bold") (defvar term-prompt-regexp "^" "Regexp to recognize prompts in the inferior process. @@ -3228,8 +3233,9 @@ term-default-bg-color (elt ansi-term-color-vector term-ansi-current-bg-color )))) (when term-ansi-current-bold - (setq term-current-face - (append '(:weight bold) term-current-face))) + (setq term-current-face + (append '(:weight bold) term-current-face) + (append term-bold-attribute term-current-face))) (when term-ansi-current-underline (setq term-current-face (append '(:underline t) term-current-face)))) @@ -3257,7 +3263,9 @@ (elt ansi-term-color-vector term-ansi-current-bg-color)) )) (when term-ansi-current-bold (setq term-current-face - (append '(:weight bold) term-current-face))) + (progn + (append '(:weight bold) term-current-face) + (append '(:weight bold) term-current-face))) (when term-ansi-current-underline (setq term-current-face (append '(:underline t) term-current-face))))))