Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7929339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T20:02:22+00:00 2026-06-03T20:02:22+00:00

While trying to streamline my init.el, I decided to move some functionality out of

  • 0

While trying to streamline my init.el, I decided to move some functionality out of an ugly cond tree. In order to move some decisions out of it, I built two helper functions:

(defun abstract-screen-width ()
  (cond ((eq 'x window-system) (x-display-pixel-width))
        ((eq 'ns window-system) (display-pixel-width))
        ))

(defun perfect-font-size (pixels)
  (cond ((eq 'x window-system) (cond ((<= pixels 1024) 100)
                                     ((<= pixels 1366) 110)
                                     ((> pixels 1366) 120)))
        ((eq 'ns window-system) (cond ((<= pixels 1024) 110)
                                      ((<= pixels 1280) 120)
                                      ((> pixels 1280) 140)))))

And they combine nicely and invoking them the way they were intended to be invoked works fine.

(perfect-font-size (abstract-screen-width))
130

The custom-set-faces invocation as it was works

(custom-set-faces
        '(default ((t (:inherit nil :stipple nil :inverse-video nil :box nil
                                :strike-through nil :overline nil
                                :underline nil :slant normal :weight normal
                                :height 130 :width normal
                                :family "IBM 3270"))))
        '(linum ((t (:inherit default :foreground "#777" :height 130)))))

but my “better” version

(custom-set-faces
        '(default ((t (:inherit nil :stipple nil :inverse-video nil :box nil
                                :strike-through nil :overline nil
                                :underline nil :slant normal :weight normal
                                :height (perfect-font-size (abstract-screen-width)) :width normal
                                :family "IBM 3270"))))
        '(linum ((t (:inherit default :foreground "#777" :height 120)))))

doesn’t. It gives a “Default face height not absolute and positive” error. The source in faces.el and cus-face.el didn’t help much. Any hints?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T20:02:24+00:00Added an answer on June 3, 2026 at 8:02 pm

    The expression

    '(default ((t (:inherit nil :stipple nil :inverse-video nil :box nil
                                :strike-through nil :overline nil
                                :underline nil :slant normal :weight normal
                                :height (perfect-font-size (abstract-screen-width)) :width normal
                                :family "IBM 3270"))))
    

    is quoted in its entirety, i.e., (perfect-font-size (abstract-screen-width)) won’t be evaluated. Try backquote instead:

    `(default ((t (:inherit nil :stipple nil :inverse-video nil :box nil
                                :strike-through nil :overline nil
                                :underline nil :slant normal :weight normal
                                :height ,(perfect-font-size (abstract-screen-width)) :width normal
                                :family "IBM 3270"))))
    

    (note the backtick and the comma). The error is just emacs way of telling you, that it had preferred a number where it got the list (perfect-font-size (abstract-screen-width))

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While trying out an experimental UINavigationController-based iPhone application, I ran into a problem when
While trying to compile my project, that uses some third party headers, with mingw
While trying to port some code to compile in linux I get peculiar compilation
while trying to process some user input which contains characters such as <. I
While trying to implement some jQuery UI Tabs using AJAX I keep running into
While trying to verify to myself, that C# Equals for IEnumerables is a reference
While trying to implement an MVC file upload example on Scott Hanselman's blog. I
While trying to compile a 64 bit linux kernel using gcc, I see the
While trying to load a Bitmap onto a SWFLoader the Event.COMPLETE event is not
While trying to host the CLR, I keep getting this: error C2440: 'function' :

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.