all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Weird behaviour of my emacs when setting fonts based on platform specific
@ 2013-03-29 18:48 Rami A
  2013-03-29 21:56 ` Rami A
  0 siblings, 1 reply; 2+ messages in thread
From: Rami A @ 2013-03-29 18:48 UTC (permalink / raw
  To: help-gnu-emacs

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-*-*-*-*-*-*")


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Weird behaviour of my emacs when setting fonts based on platform specific
  2013-03-29 18:48 Weird behaviour of my emacs when setting fonts based on platform specific Rami A
@ 2013-03-29 21:56 ` Rami A
  0 siblings, 0 replies; 2+ messages in thread
From: Rami A @ 2013-03-29 21:56 UTC (permalink / raw
  To: help-gnu-emacs

I found out that replacing:
      (set-face-font 'default "-*-Interface User-Medium-R-*-*-*-120-*-*-*-*-*-*") 
with
      (set-face-font 'default "-*-Interface User-Medium-R-*-*-13-120-*-*-*-*-*-*") 

worked for some reason!


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-03-29 21:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-29 18:48 Weird behaviour of my emacs when setting fonts based on platform specific Rami A
2013-03-29 21:56 ` Rami A

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.