From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.bugs Subject: bug#1779: 23.0.60; proced with variable-pitch header line Date: Mon, 06 Dec 2010 00:30:17 +0100 Message-ID: <877hfnajcm.fsf@escher.home> References: <873afzcwdi.fsf@cyd.mit.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1291592737 27138 80.91.229.12 (5 Dec 2010 23:45:37 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 5 Dec 2010 23:45:37 +0000 (UTC) Cc: 1779@debbugs.gnu.org, 1779@emacsbugs.donarmstrong.com To: Chong Yidong Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Dec 06 00:45:32 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PPOGm-0003Gt-CZ for geb-bug-gnu-emacs@m.gmane.org; Mon, 06 Dec 2010 00:45:28 +0100 Original-Received: from localhost ([127.0.0.1]:55965 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PPOGl-0003Ey-3L for geb-bug-gnu-emacs@m.gmane.org; Sun, 05 Dec 2010 18:45:27 -0500 Original-Received: from [140.186.70.92] (port=58324 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PPOGf-0003Em-Rh for bug-gnu-emacs@gnu.org; Sun, 05 Dec 2010 18:45:22 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PPOGe-00029m-CF for bug-gnu-emacs@gnu.org; Sun, 05 Dec 2010 18:45:21 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:38277) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PPOGe-00029c-AI for bug-gnu-emacs@gnu.org; Sun, 05 Dec 2010 18:45:20 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1PPNx0-0004IQ-ET; Sun, 05 Dec 2010 18:25:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stephen Berman Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 05 Dec 2010 23:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 1779 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 1779-submit@debbugs.gnu.org id=B1779.129159146616467 (code B ref 1779); Sun, 05 Dec 2010 23:25:02 +0000 Original-Received: (at 1779) by debbugs.gnu.org; 5 Dec 2010 23:24:26 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PPNwP-0004HX-Mt for submit@debbugs.gnu.org; Sun, 05 Dec 2010 18:24:25 -0500 Original-Received: from mailout-de.gmx.net ([213.165.64.22] helo=mail.gmx.net) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1PPNwK-0004H4-VM for 1779@emacsbugs.donarmstrong.com; Sun, 05 Dec 2010 18:24:23 -0500 Original-Received: (qmail invoked by alias); 05 Dec 2010 23:30:10 -0000 Original-Received: from i59F5BF8B.versanet.de (EHLO escher.home) [89.245.191.139] by mail.gmx.net (mp036) with SMTP; 06 Dec 2010 00:30:10 +0100 X-Authenticated: #20778731 X-Provags-ID: V01U2FsdGVkX1+gXNR8yZugHFoZgw+kqSru3Av5wvwK6Mpz/o7UNi qFAYWe7jRGfkYE Original-Received: by escher.home (Postfix, from userid 1000) id D9B07104BB; Mon, 6 Dec 2010 00:30:17 +0100 (CET) In-Reply-To: <873afzcwdi.fsf@cyd.mit.edu> (Chong Yidong's message of "Sun, 04 Jan 2009 03:23:53 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-Y-GMX-Trusted: 0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sun, 05 Dec 2010 18:25:02 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:42189 Archived-At: On Sun, 04 Jan 2009 03:23:53 -0500 Chong Yidong wrote: >> Proced does not align the attribute names in the header line with the >> corresponding columns when header-line face has variable pitch. >> >> I know of two approaches to dealing with this situation in Emacs, namely >> that of buff-menu.el and that of ibuffer.el. The latter imposes a >> fixed-pitch face in the header line, overriding the >> user customization. The former uses the display property with an >> :align-to specification to get proper alignment. Maybe one of these >> will work with proced.el too. > > We can't use :align-to because proced justifies some headers to the > right hand side of the column. I (finally) took a look at this again and it appears that :align-to as used in buff-menu.el with some additional tweaking pretty much DTRT after all. With my variable-pitch font (Dejavu Sans) I find the spacing between "%CPU" and "%Mem" too crowded; using fixed-pitch looks better, and that's what the attached patch does. Alternatively, I think it looks fine to let the header line font be variable-pitch as long as the let-bound variable whitespace is set to two spaces. I actually think this makes the proced listings also more legible, though it does leave less space for the process invocation listing and is also a departure from the Dired display that Proced is modelled on. Anyway, I'd be happy with either approach; both are better than the current display when the header-line face is variable-pitch. Steve Berman *** /data/steve/bzr/emacs/trunk/lisp/proced.el 2010-09-08 10:12:09.000000000 +0200 --- /data/steve/bzr/emacs/quickfixes/lisp/proced.el 2010-12-06 00:02:20.000000000 +0100 *************** *** 400,406 **** :group 'proced-faces) (defface proced-sort-header ! '((t (:inherit font-lock-keyword-face))) "Face used for header of attribute used for sorting." :group 'proced-faces) --- 400,406 ---- :group 'proced-faces) (defface proced-sort-header ! '((t (:family "Monospace" :inherit font-lock-keyword-face))) "Face used for header of attribute used for sorting." :group 'proced-faces) *************** *** 1427,1433 **** (hprops (if (nth 4 grammar) (let ((descend (if (eq key sort-key) proced-descend (nth 5 grammar)))) ! `(proced-key ,key mouse-face highlight help-echo ,(format proced-header-help-echo (if descend "-" "+") (nth 1 grammar) --- 1427,1433 ---- (hprops (if (nth 4 grammar) (let ((descend (if (eq key sort-key) proced-descend (nth 5 grammar)))) ! `(proced-key ,key face fixed-pitch mouse-face highlight help-echo ,(format proced-header-help-echo (if descend "-" "+") (nth 1 grammar) *************** *** 1509,1514 **** --- 1509,1525 ---- (if (string-match "[ \t]+$" proced-header-line) (setq proced-header-line (substring proced-header-line 0 (match-beginning 0)))) + (setq proced-header-line (concat " " proced-header-line)) + ;; From buff-menu.el: Turn whitespace chars in the header into stretch + ;; specs so they work regardless of the header-line face. + (let ((pos 0) + (header proced-header-line)) + (while (string-match "[ \t\n]+" header pos) + (setq pos (match-end 0)) + (put-text-property (match-beginning 0) pos 'display + ;; Assume fixed-size chars in the buffer. + (list 'space :align-to pos) + header))) ;; (delete-trailing-whitespace) (goto-char (point-min)) (while (re-search-forward "[ \t\r]+$" nil t)