From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xiao-Yong Jin Subject: default face org-column Date: Thu, 30 May 2013 11:43:01 +0900 Message-ID: <657A219F-8300-4EDD-98B3-6737014F5EF4@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_A6A13F52-6DAF-4910-96BF-A210636FB269" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:33228) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UhspZ-0001n3-JG for emacs-orgmode@gnu.org; Wed, 29 May 2013 22:43:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UhspU-0008JC-QJ for emacs-orgmode@gnu.org; Wed, 29 May 2013 22:43:09 -0400 Received: from mail-pb0-x229.google.com ([2607:f8b0:400e:c01::229]:46230) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UhspU-0008I0-G5 for emacs-orgmode@gnu.org; Wed, 29 May 2013 22:43:04 -0400 Received: by mail-pb0-f41.google.com with SMTP id xb12so10201165pbc.0 for ; Wed, 29 May 2013 19:43:03 -0700 (PDT) Received: from [172.19.7.224] (anet27.aics.riken.jp. [134.160.184.6]) by mx.google.com with ESMTPSA id wt5sm39639555pbc.38.2013.05.29.19.43.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 29 May 2013 19:43:01 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: "emacs-orgmode@gnu.org" --Apple-Mail=_A6A13F52-6DAF-4910-96BF-A210636FB269 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 Hi, In org-faces.el, (when (fboundp 'set-face-attribute) ;; Make sure that a fixed-width face is used when we have a column = table. (set-face-attribute 'org-column nil :height (face-attribute 'default :height) :family (face-attribute 'default :family))) I understand why you did this, but it is not quite logical, and somewhat = invasive. First, you certainly do not do this with org-table. Then why = org-column specifically? Second, it overwrites the the value I set in = the emacs theme or custom-set-faces. Third, the end result is quite = bizarre and odd-looking. The "default" height and "default" family is = some how not what I set for the frame, because the font family and size = is set when emacs starts up and loaded the org-mode. When I use = set-frame-font or text-scale-adjust, org-column will stick with the old = font family and size. In fact, because the font family for org-column = and org-column-title are different, the result is just bad. I don't think it is only my problem, but I'll describe my setup for = themes/font. I use default-frame-alist to set the font family and = size=97The above code will not pick up this setup. I use load-theme and = enable-theme to load the theme I want. Sometimes I use set-frame-font = or text-scale-adjust to get a pleasantly looking texts temporary. I = usually use fixed-width font, so the above code is not doing any good. For the time being, I commented out the above code. Best, Xiao-Yong --Apple-Mail=_A6A13F52-6DAF-4910-96BF-A210636FB269 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=windows-1252 =      :height (face-attribute 'default = :height)
    =  :family (face-attribute 'default = :family)))

I understand why you did this, = but it is not quite logical, and somewhat invasive.  First, you = certainly do not do this with org-table.  Then why org-column = specifically?  Second, it overwrites the the value I set in the = emacs theme or custom-set-faces.  Third, the end result is quite = bizarre and odd-looking.  The "default" height and "default" family = is some how not what I set for the frame, because the font family and = size is set when emacs starts up and loaded the org-mode.  When I = use set-frame-font or text-scale-adjust, org-column will stick with the = old font family and size.  In fact, because the font family for = org-column and org-column-title are different, the result is just = bad.

I don't think it is only my problem, but = I'll describe my setup for themes/font.  I use default-frame-alist = to set the font family and size Received: from eggs.gnu.org ([2001:4830:134:3::10]:35839) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uif8T-0004Zj-Ve for emacs-orgmode@gnu.org; Sat, 01 Jun 2013 02:17:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uif8R-0007R5-Ar for emacs-orgmode@gnu.org; Sat, 01 Jun 2013 02:17:53 -0400 Received: from mail-wg0-x22e.google.com ([2a00:1450:400c:c00::22e]:42370) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uif8R-0007Pl-29 for emacs-orgmode@gnu.org; Sat, 01 Jun 2013 02:17:51 -0400 Received: by mail-wg0-f46.google.com with SMTP id l18so1781006wgh.1 for ; Fri, 31 May 2013 23:17:45 -0700 (PDT) In-Reply-To: <657A219F-8300-4EDD-98B3-6737014F5EF4@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Xiao-Yong Jin Cc: "emacs-orgmode@gnu.org" --Apple-Mail=_E59A904B-99EA-48B3-9C34-4ADBA04F8AC9 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On 30.5.2013, at 04:43, Xiao-Yong Jin wrote: > Hi, >=20 > In org-faces.el, >=20 > (when (fboundp 'set-face-attribute) > ;; Make sure that a fixed-width face is used when we have a column = table. > (set-face-attribute 'org-column nil > :height (face-attribute 'default :height) > :family (face-attribute 'default :family))) Hi Xiao, I remember that I struggled with the problem that I had to make sure = that column view used a fixed-width face - and this was the solution = that worked - not a particular pretty one, admittedly. Do you have an idea on how to change this code that it will always work? = I'd be very happy to accept a good patch. - Carsten >=20 > I understand why you did this, but it is not quite logical, and = somewhat invasive. First, you certainly do not do this with org-table. = Then why org-column specifically? Second, it overwrites the the value I = set in the emacs theme or custom-set-faces. Third, the end result is = quite bizarre and odd-looking. The "default" height and "default" = family is some how not what I set for the frame, because the font family = and size is set when emacs starts up and loaded the org-mode. When I = use set-frame-font or text-scale-adjust, org-column will stick with the = old font family and size. In fact, because the font family for = org-column and org-column-title are different, the result is just bad. >=20 > I don't think it is only my problem, but I'll describe my setup for = themes/font. I use default-frame-alist to set the font family and = size=97The above code will not pick up this setup. I use load-theme and = enable-theme to load the theme I want. Sometimes I use set-frame-font = or text-scale-adjust to get a pleasantly looking texts temporary. I = usually use fixed-width font, so the above code is not doing any good. >=20 > For the time being, I commented out the above code. >=20 > Best, > Xiao-Yong >=20 --Apple-Mail=_E59A904B-99EA-48B3-9C34-4ADBA04F8AC9 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=windows-1252 jinxiaoyong@gmail.com> = wrote:

=      :height (face-attribute 'default = :height)
    =  :family (face-attribute 'default = :family)))

Hi = Xiao,

I remember that I struggled with the = problem that I had to make sure that column view used a fixed-width face = - and this was the solution that worked - not a particular pretty one, = admittedly.

Do you have an idea on how to = change this code that it will always work?  I'd be very happy to = accept a good patch.

- = Carsten


I understand why you did this, = but it is not quite logical, and somewhat invasive.  First, you = certainly do not do this with org-table.  Then why org-column = specifically?  Second, it overwrites the the value I set in the = emacs theme or custom-set-faces.  Third, the end result is quite = bizarre and odd-looking.  The "default" height and "default" family = is some how not what I set for the frame, because the font family and = size is set when emacs starts up and loaded the org-mode.  When I = use set-frame-font or text-scale-adjust, org-column will stick with the = old font family and size.  In fact, because the font family for = org-column and org-column-title are different, the result is just = bad.

I don't think it is only my problem, but = I'll describe my setup for themes/font.  I use default-frame-alist = to set the font family and size Received: from eggs.gnu.org ([2001:4830:134:3::10]:55806) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsQiY-0003Up-15 for emacs-orgmode@gnu.org; Fri, 28 Jun 2013 00:55:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UsQiV-0007tp-8v for emacs-orgmode@gnu.org; Fri, 28 Jun 2013 00:55:29 -0400 Received: from mail-pa0-x229.google.com ([2607:f8b0:400e:c03::229]:50315) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsQiU-0007tR-WA for emacs-orgmode@gnu.org; Fri, 28 Jun 2013 00:55:27 -0400 Received: by mail-pa0-f41.google.com with SMTP id bj3so1974925pad.14 for ; Thu, 27 Jun 2013 21:55:25 -0700 (PDT) In-Reply-To: <068396FB-493D-456B-922A-D4638EBE0FA3@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Carsten Dominik Cc: "emacs-orgmode@gnu.org" --Apple-Mail=_6834BB53-65EC-4F8E-9F80-AB5B5EE987E2 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Jun 1, 2013, at 3:17 PM, Carsten Dominik = wrote: > Hi Xiao, >=20 > I remember that I struggled with the problem that I had to make sure = that column view used a fixed-width face - and this was the solution = that worked - not a particular pretty one, admittedly. >=20 > Do you have an idea on how to change this code that it will always = work? I'd be very happy to accept a good patch. >=20 > - Carsten Hi Carsten, I wasn't sure what you were talking about until I tried out the theme, = leuven... and that was really fanciful and totally screwed the = column-view without your fixed-width face fix. In order to make it more flexible, instead of just set it once when = org-faces.el is loaded, I think enforcing it every time when column-view = is called is a better choice. Thus came the following little patch. diff --git a/lisp/org-colview.el b/lisp/org-colview.el index a98deec..f3b8e42 100644 --- a/lisp/org-colview.el +++ b/lisp/org-colview.el @@ -169,8 +169,10 @@ This is the compiled version of the format.") (get-text-property (point-at-bol) 'face)) 'default)) (color (list :foreground (face-attribute ref-face = :foreground))) - (face (list color 'org-column ref-face)) - (face1 (list color 'org-agenda-column-dateline ref-face)) + (font (list :height (face-attribute 'default :height) + :family (face-attribute 'default :family))) + (face (list color font 'org-column ref-face)) + (face1 (list color font 'org-agenda-column-dateline ref-face)) (cphr (get-text-property (point-at-bol) = 'org-complex-heading-regexp)) pom property ass width f string ov column val modval s2 title = calc) ;; Check if the entry is in another buffer. diff --git a/lisp/org-faces.el b/lisp/org-faces.el index 5472964..e968657 100644 --- a/lisp/org-faces.el +++ b/lisp/org-faces.el @@ -217,12 +217,6 @@ column view defines special faces for each outline = level. See the file "Face for column display of entry properties." :group 'org-faces) =20 -(when (fboundp 'set-face-attribute) - ;; Make sure that a fixed-width face is used when we have a column = table. - (set-face-attribute 'org-column nil - :height (face-attribute 'default :height) - :family (face-attribute 'default :family))) - (defface org-agenda-column-dateline (org-compatible-face 'org-column '((t nil))) In this way, the column-view face will not be bound only to the font = family and size at the time of loading org-faces.el, but anytime = column-view is called. I'm not sure if I covered all the cases, but it = seems to work well for me. I hope the patch is not broken by the mail = app, but I guess it is simple enough to read it in one sip of coffee, = though I tracked the issue and wrote the patch with one cup. Best, Xiao-Yong PS. I realized it was almost a month-old email. Org-mode is really good = at remembering it for me.= --Apple-Mail=_6834BB53-65EC-4F8E-9F80-AB5B5EE987E2 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=windows-1252 carsten.dominik@gmail.com>= ; wrote:

diff --git = a/lisp/org-colview.el b/lisp/org-colview.el
index a98deec..f3b8e42 100644
--- a/lisp/org-colview.el
+++ b/lisp/org-colview.el
@@ -169,8 +169,10 @@ This is the compiled version of = the format.")
    =                     =     (get-text-property (point-at-bol) = 'face))
      =                 =  'default))
    =      (color (list :foreground (face-attribute ref-face = :foreground)))
-     =    (face (list color 'org-column = ref-face))
-     =    (face1 (list color 'org-agenda-column-dateline = ref-face))
+     =    (font (list :height (face-attribute 'default = :height)
+       =              :family (face-attribute = 'default :family)))
+   =      (face (list color font 'org-column = ref-face))
+     =    (face1 (list color font 'org-agenda-column-dateline = ref-face))
      =    (cphr (get-text-property (point-at-bol) = 'org-complex-heading-regexp))
         pom property ass = width f string ov column val modval s2 title = calc)
     ;; = Check if the entry is in another buffer.
diff --git a/lisp/org-faces.el = b/lisp/org-faces.el
index = 5472964..e968657 100644
--- = a/lisp/org-faces.el
+++ = b/lisp/org-faces.el
@@ -217,12 = +217,6 @@ column view defines special faces for each outline level. =  See the file
  =  "Face for column display of entry = properties."
   :group = 'org-faces)
 
-(when = (fboundp 'set-face-attribute)
- =  ;; Make sure that a fixed-width face is used when we have a column = table.
- =  (set-face-attribute 'org-column nil
-               =       :height (face-attribute 'default = :height)
-       =               :family (face-attribute = 'default :family)))
-
 (defface = org-agenda-column-dateline
  =  (org-compatible-face 'org-column
     '((t = nil)))

In this way, the = column-view face will not be bound only to the font family and size at = the time of loading org-faces.el, but anytime column-view is called. =  I'm not sure if I covered all the cases, but it seems to work well = for me.  I hope the patch is not broken by the mail app, but I = guess it is simple enough to read it in one sip of coffee, though I = tracked the issue and wrote the patch with one = cup.

Best,
Xiao-Yong

PS. I realized it was almost a month-old email.  Org-mode is = really good at remembering it for me.
= --Apple-Mail=_6834BB53-65EC-4F8E-9F80-AB5B5EE987E2-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: default face org-column Date: Fri, 28 Jun 2013 13:05:35 +0200 Message-ID: <49605C84-896B-480A-8838-A231C8BB829B@gmail.com> References: <657A219F-8300-4EDD-98B3-6737014F5EF4@gmail.com> <068396FB-493D-456B-922A-D4638EBE0FA3@gmail.com> <99A2E7F8-6877-489D-A8C5-3CA51901B4F6@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_D924F9AD-BD0B-4896-AC56-0A94498148D4" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38085) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsWUq-00072L-4H for emacs-orgmode@gnu.org; Fri, 28 Jun 2013 07:05:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UsWUk-0005Bv-FK for emacs-orgmode@gnu.org; Fri, 28 Jun 2013 07:05:44 -0400 Received: from mail-ee0-x234.google.com ([2a00:1450:4013:c00::234]:55355) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsWUk-0005BU-4x for emacs-orgmode@gnu.org; Fri, 28 Jun 2013 07:05:38 -0400 Received: by mail-ee0-f52.google.com with SMTP id c50so979349eek.11 for ; Fri, 28 Jun 2013 04:05:36 -0700 (PDT) In-Reply-To: <99A2E7F8-6877-489D-A8C5-3CA51901B4F6@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Xiao-Yong Jin Cc: "emacs-orgmode@gnu.org" --Apple-Mail=_D924F9AD-BD0B-4896-AC56-0A94498148D4 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 Hi Xiao-Yong, I have applied this patch, thank you. - Carsten On 28.6.2013, at 06:55, Xiao-Yong Jin wrote: > On Jun 1, 2013, at 3:17 PM, Carsten Dominik = wrote: >=20 >> Hi Xiao, >>=20 >> I remember that I struggled with the problem that I had to make sure = that column view used a fixed-width face - and this was the solution = that worked - not a particular pretty one, admittedly. >>=20 >> Do you have an idea on how to change this code that it will always = work? I'd be very happy to accept a good patch. >>=20 >> - Carsten >=20 > Hi Carsten, >=20 > I wasn't sure what you were talking about until I tried out the theme, = leuven... and that was really fanciful and totally screwed the = column-view without your fixed-width face fix. >=20 > In order to make it more flexible, instead of just set it once when = org-faces.el is loaded, I think enforcing it every time when column-view = is called is a better choice. Thus came the following little patch. >=20 > diff --git a/lisp/org-colview.el b/lisp/org-colview.el > index a98deec..f3b8e42 100644 > --- a/lisp/org-colview.el > +++ b/lisp/org-colview.el > @@ -169,8 +169,10 @@ This is the compiled version of the format.") > (get-text-property (point-at-bol) 'face)) > 'default)) > (color (list :foreground (face-attribute ref-face = :foreground))) > - (face (list color 'org-column ref-face)) > - (face1 (list color 'org-agenda-column-dateline ref-face)) > + (font (list :height (face-attribute 'default :height) > + :family (face-attribute 'default :family))) > + (face (list color font 'org-column ref-face)) > + (face1 (list color font 'org-agenda-column-dateline = ref-face)) > (cphr (get-text-property (point-at-bol) = 'org-complex-heading-regexp)) > pom property ass width f string ov column val modval s2 title = calc) > ;; Check if the entry is in another buffer. > diff --git a/lisp/org-faces.el b/lisp/org-faces.el > index 5472964..e968657 100644 > --- a/lisp/org-faces.el > +++ b/lisp/org-faces.el > @@ -217,12 +217,6 @@ column view defines special faces for each = outline level. See the file > "Face for column display of entry properties." > :group 'org-faces) > =20 > -(when (fboundp 'set-face-attribute) > - ;; Make sure that a fixed-width face is used when we have a column = table. > - (set-face-attribute 'org-column nil > - :height (face-attribute 'default :height) > - :family (face-attribute 'default :family))) > - > (defface org-agenda-column-dateline > (org-compatible-face 'org-column > '((t nil))) >=20 > In this way, the column-view face will not be bound only to the font = family and size at the time of loading org-faces.el, but anytime = column-view is called. I'm not sure if I covered all the cases, but it = seems to work well for me. I hope the patch is not broken by the mail = app, but I guess it is simple enough to read it in one sip of coffee, = though I tracked the issue and wrote the patch with one cup. >=20 > Best, > Xiao-Yong >=20 > PS. I realized it was almost a month-old email. Org-mode is really = good at remembering it for me. --Apple-Mail=_D924F9AD-BD0B-4896-AC56-0A94498148D4 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=windows-1252 Hi = Xiao-Yong,

I have applied this patch, thank = you.

- Carsten

On = 28.6.2013, at 06:55, Xiao-Yong Jin <jinxiaoyong@gmail.com> = wrote:

carsten.dominik@gmail.com>= ; wrote:

diff --git = a/lisp/org-colview.el b/lisp/org-colview.el
index a98deec..f3b8e42 100644
--- a/lisp/org-colview.el
+++ b/lisp/org-colview.el
@@ -169,8 +169,10 @@ This is the compiled version of = the format.")
    =                     =     (get-text-property (point-at-bol) = 'face))
      =                 =  'default))
    =      (color (list :foreground (face-attribute ref-face = :foreground)))
-     =    (face (list color 'org-column = ref-face))
-     =    (face1 (list color 'org-agenda-column-dateline = ref-face))
+     =    (font (list :height (face-attribute 'default = :height)
+       =              :family (face-attribute = 'default :family)))
+   =      (face (list color font 'org-column = ref-face))
+     =    (face1 (list color font 'org-agenda-column-dateline = ref-face))
      =    (cphr (get-text-property (point-at-bol) = 'org-complex-heading-regexp))
         pom property ass = width f string ov column val modval s2 title = calc)
     ;; = Check if the entry is in another buffer.
diff --git a/lisp/org-faces.el = b/lisp/org-faces.el
index = 5472964..e968657 100644
--- = a/lisp/org-faces.el
+++ = b/lisp/org-faces.el
@@ -217,12 = +217,6 @@ column view defines special faces for each outline level. =  See the file
  =  "Face for column display of entry = properties."
   :group = 'org-faces)
 
-(when = (fboundp 'set-face-attribute)
- =  ;; Make sure that a fixed-width face is used when we have a column = table.
- =  (set-face-attribute 'org-column nil
-               =       :height (face-attribute 'default = :height)
-       =               :family (face-attribute = 'default :family)))
-
 (defface = org-agenda-column-dateline
  =  (org-compatible-face 'org-column
     '((t = nil)))

In this way, the = column-view face will not be bound only to the font family and size at = the time of loading org-faces.el, but anytime column-view is called. =  I'm not sure if I covered all the cases, but it seems to work well = for me.  I hope the patch is not broken by the mail app, but I = guess it is simple enough to read it in one sip of coffee, though I = tracked the issue and wrote the patch with one = cup.

Best,
Xiao-Yong

PS. I realized it was almost a month-old email.  Org-mode is = really good at remembering it for = me.

= --Apple-Mail=_D924F9AD-BD0B-4896-AC56-0A94498148D4--