help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Weird behaviour of my emacs when setting fonts based on platform specifi


From: Rami A
Subject: Weird behaviour of my emacs when setting fonts based on platform specific
Date: Fri, 29 Mar 2013 11:48:03 -0700 (PDT)
User-agent: G2/1.0

I have configured my dotemacs to recognize different environments and set the 
font type accordingly. Everything was working great on my solaris system "unix 
platform" up until yesterday when the system admin decided to upgrade the 
ranches or something. After that when starting emacs it would always default to 
the default font.
This is the code I have in dotemacs:

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;Platform Specific - start;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; Get current system's name
(defun insert-system-name()
(interactive)
"Get current system's name"
(insert (format "%s" system-name)))

;; Get current system type
(defun insert-system-type()
(interactive)
"Get current system type"
(insert (format "%s" system-type)))

;; Check if system is Darwin/Mac OS X
(defun system-type-is-darwin ()
(interactive)
"Return true if system is darwin-based (Mac OS X)"
(string-equal system-type "darwin"))

;; Check if system is GNU/Linux
(defun system-type-is-gnu ()
(interactive)
"Return true if system is GNU/Linux-based"
(string-equal system-type "gnu/linux"))

;; Check if system is Unix
(defun system-type-is-unix ()
(interactive)
"Return true if system is Unix-based"
(string-equal system-type "usg-unix-v"))

;; Unix specific ;;
(if (system-type-is-unix)
    (progn
      ;;Fonts
      (set-face-font 'default "-*-Interface 
User-Medium-R-*-*-*-120-*-*-*-*-*-*")
      ;; Set default height/width
      (add-to-list 'default-frame-alist '(height . 70))
      (add-to-list 'default-frame-alist '(width . 180))
      ;; Start emacs with split window
      (split-window-horizontally)
      )
  )
;; MAC specific ;;
(if (system-type-is-darwin)
    (progn
      ;;Fonts
      (set-face-font 'default "-*-Interface 
User-Medium-R-*-*-15-120-*-*-*-*-*-*")
      ;; Set default height/width
      (add-to-list 'default-frame-alist '(height . 70))
      (add-to-list 'default-frame-alist '(width . 90))
      (setq auto-save-default nil)   ;; For MAC
      (global-set-key [kp-delete] 'delete-char) ; sets fn-delete to be 
right-delete
      ;(setq mac-option-modifier 'alt) ;serves as Meta
      ;(setq mac-command-modifier 'meta) ;I keep meta for top/bottom page
      ;(setq mac-command-key-is-meta nil)
      )
  )


;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;Platform Specific - end;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;



If you notice I have this part:
;; Unix specific ;;
(if (system-type-is-unix)
    (progn
      ;;Fonts
      (set-face-font 'default "-*-Interface 
User-Medium-R-*-*-*-120-*-*-*-*-*-*")

Which should set the font type when detecting it was on unix machine.
I have changed the font line to :

      (set-default-font "Monospace-11")

And found that it does pick it up. Meaning that it does actually match on 
(if (system-type-is-unix) ) and it gets to inside the loop.
However, if I dont include any other font type but move the part:
      (set-face-font 'default "-*-Interface 
User-Medium-R-*-*-*-120-*-*-*-*-*-*")

to out side the if statement on a line on it's own. The font type does get set.

So I am wondering if there is something special about the "progn" not being 
able to set this special font type "-*-Interface 
User-Medium-R-*-*-15-120-*-*-*-*-*-*"

This same code was working fine as I mentioned. It is just after the upgrade I 
am having this issue.

Thanks for any input on this.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;My colors/fonts - Start ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; Nice font-Unix
;(set-face-font 'default "-*-Interface User-Medium-R-*-*-*-120-*-*-*-*-*-*")


reply via email to

[Prev in Thread] Current Thread [Next in Thread]