* default-frame-alist broken, emacs 21.2.1 RedHat 9.0
@ 2003-06-03 13:44 NotMy RealName
0 siblings, 0 replies; only message in thread
From: NotMy RealName @ 2003-06-03 13:44 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 1920 bytes --]
I have the following code in my .emacs:
(unless (featurep 'xemacs)
(set-background-color "Black")
(set-foreground-color "green1")
(set-cursor-color "Orchid")
;; (setq default-frame-alist (append default-frame-alist
;; '((foreground-color . "green1")
;; (background-color . "Black")
;; (cursor-color . "Orchid"))))
(setq default-frame-alist
(cons (assoc 'height frame-initial-geometry-arguments)
(cons (assoc 'width frame-initial-geometry-arguments)
default-frame-alist)))
)
As written, it works fine for the initial frame.
Furthermore, additional frames made with ^X5-2 have the geometry of the
first frame. So far, so good.
But if I uncomment out that block in the middle,
not only do my secondary frames not pick up the colors,
but the initial frame reverts to its default colors as well.
I've tried all kinds of variants of this, including one SETQ,
moving my font-lock stuff before the color settings,
moving the above block after my (custom-set-faces ...) directives,
etc. I've verified that the default-frames-alist looks fine with print
statements as well.
No luck.
What's interesting is that I belive the initial frame has the
green-on-black colors while my .emacs is loading, but by the time
everything is done it's reverted to black-on-white.
I don't have that much in my .emacs, I've attached the full .emacs I'm
currently using for reference. For now I've put ALL my colors in my
~/.Xdefaults, but I don't like doing that, it doesn't make for a
windows-portable .emacs.
Any help appreciated. I've grepped the web for this, and there's
certainly lots of verbiage on default-frame-alist, but I haven't seen
this particular symptom.
I'm pretty sure it's an interaction problem with something else in
.emacs, but I sure can't figure out what.
Please reply here and/or email to t1e1n1n1y1@attbi.com
(remove the 1's from the address).
[-- Attachment #2: .emacs --]
[-- Type: text/plain, Size: 10839 bytes --]
;;;
;;; Basic options/font/frame controls
;;;
(put 'eval-expression 'disabled nil) ;Normally disabled as ESC-ESC
(put 'narrow-to-region 'disabled nil)
(put 'upcase-region 'disabled nil)
(put 'downcase-region 'disabled nil)
(put 'capitalize-region 'disabled nil)
;;(setq debug-on-error t)
(setq auto-save-interval 0 ; was 15000, 0 to disable autosave
column-number-mode t ;enable column numbers as well as line numbers
abbrev-mode t
inhibit-startup-message 't ;don't display annoying emacs spash screen
search-slow-speed 2400
require-final-newline t
auto-save-default nil
blink-matching-paren-distance 50000
default-major-mode 'text-mode)
;; Let buffers have independent compile commands
(make-variable-buffer-local 'compile-command)
;; Do this to make sure new frames observe the geometry & colors of the initial frame
;; This is GNU Emacs specific, XEmacs defaults seem to be okay.
(unless (featurep 'xemacs)
;; Colors
;; LINUX: I finally gave up and put all the colors in .Xdefaults (use xrdb ~/.Xdefaults to reload)
;(set-background-color "Black")
;(set-foreground-color "green1")
;(set-cursor-color "Orchid")
;; make ^X5-2 observe colors and geometry too... colors not working for some reason,
;; screws up initial frame
; (setq default-frame-alist (append default-frame-alist
; '((foreground-color . "green1")
; (background-color . "Black")
; (cursor-color . "Orchid"))))
;; Work around above emacs21 bug...
(setq default-frame-alist
(cons (assoc 'height frame-initial-geometry-arguments)
(cons (assoc 'width frame-initial-geometry-arguments)
default-frame-alist)))
)
;; Font lock stuff
(global-font-lock-mode t)
(setq font-lock-maximum-size nil) ;font lock everything
;;;
;;; Supplemental File Mode Bindings
;;;
(setq auto-mode-alist
(append (list '("\\.xsd\\'" . sgml-mode) ;XML Schema files
'("\\.xsl\\'" . sgml-mode) ;XSLT Template files
)
auto-mode-alist))
\f
;;;
;;; Functions
;;;
(defun kill-all-buffers ()
"Kill all non-modified buffers"
(interactive)
(let ((list (buffer-list)))
(while list
(let* ((buffer (car list))
(name (buffer-name buffer)))
(and (not (string-equal name ""))
(/= (aref name 0) ? ) ; Purpose of this is unclear to me
(not (buffer-modified-p buffer))
(kill-buffer buffer)))
(setq list (cdr list)))))
;; Leading asterisk in comment makes these editable options.
(defconst *lowcase-toggling-chars* "abcdefghijklmnopqrstuvwxyz"
"*Chars which will be replaced by corresponding chars in
*upcase-toggling-chars*. Must be same length!")
(defconst *upcase-toggling-chars* "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"*Chars which will be replaced by corresponding chars in
*lowcase-toggling-chars*. Must be same length!")
(defun toggle-char-case (n) ; nchars to toggle
"Flip the case of the character at point. Prefix indicates
that N characters be flipped."
;; leading "*" means not for readonly buffers. P says N == prefix
(interactive "*p")
(let ((char 0)
(index 0)
(case-fold-search nil))
(while (> n 0)
(setq char (following-char))
(cond
((setq index (string-match (char-to-string char)
*lowcase-toggling-chars*))
(setq char (aref *upcase-toggling-chars* index))
(delete-char 1)
(insert-char char 1))
((setq index (string-match (char-to-string char)
*upcase-toggling-chars*))
(setq char (aref *lowcase-toggling-chars* index))
(delete-char 1)
(insert-char char 1))
(t (forward-char 1))
)
(setq n (1- n))
)))
(defun jdt-c-comment-indent () ;copied from c-comment-indent in CC-MODE.EL
"Custom indentation routine for java/c/c++ comments"
(if (looking-at (concat "^\\(" c-comment-start-regexp "\\)"))
0 ;Existing comment at bol stays there.
(let ((opoint (point))
placeholder)
(save-excursion
(beginning-of-line)
(cond
;; CASE 1: A comment following a solitary close-brace should
;; have only one space.
((looking-at (concat "[ \t]*}[ \t]*\\($\\|"
c-comment-start-regexp
"\\)"))
(search-forward "}")
(max (1+ (current-column)) comment-column) ;jdt's preference
;; (1+ (current-column)) ;GNU's preference
)
;; CASE 2: 2 spaces after #endif
((or (looking-at "^#[ \t]*endif[ \t]*")
(looking-at "^#[ \t]*else[ \t]*"))
7)
;; CASE 3: when comment-column is nil, calculate the offset
;; according to c-offsets-alist. E.g. identical to hitting
;; TAB.
((and c-indent-comments-syntactically-p
(save-excursion
(skip-chars-forward " \t")
(or (looking-at comment-start)
(eolp))))
(let ((syntax (c-guess-basic-syntax)))
;; BOGOSITY ALERT: if we're looking at the eol, its
;; because indent-for-comment hasn't put the comment-start
;; in the buffer yet. this will screw up the syntactic
;; analysis so we kludge in the necessary info. Another
;; kludge is that if we're at the bol, then we really want
;; to ignore any anchoring as specified by
;; c-comment-only-line-offset since it doesn't apply here.
(if (save-excursion
(beginning-of-line)
(skip-chars-forward " \t")
(eolp))
(c-add-syntax 'comment-intro))
(let ((c-comment-only-line-offset
(if (consp c-comment-only-line-offset)
c-comment-only-line-offset
(cons c-comment-only-line-offset
c-comment-only-line-offset))))
(apply '+ (mapcar 'c-get-offset syntax)))))
;; CASE 4: use comment-column if previous line is a
;; comment-only line indented to the left of comment-column
((save-excursion
(beginning-of-line)
(and (not (bobp))
(forward-line -1))
(skip-chars-forward " \t")
(prog1
(looking-at c-comment-start-regexp)
(setq placeholder (point))))
(goto-char placeholder)
(if (< (current-column) comment-column)
comment-column
(current-column)))
;; CASE 5: If comment-column is 0, and nothing but space
;; before the comment, align it at 0 rather than 1.
((progn
(goto-char opoint)
(skip-chars-backward " \t")
(and (= comment-column 0) (bolp)))
0)
;; CASE 6: indent at comment column except leave at least one
;; space.
(t (max (1+ (current-column))
comment-column))
)))))
(defun c-stuff (compile-invoke-string)
"Mode hook customization for all C programming language dialects
factored into this routine for hook use."
(if (search "windows" (emacs-version))
;; Set up compilation for windows
(progn
(setq compile-command "cd $CMROOT/cxxsrc/cm ; make")
(setq compilation-error-regexp-alist
'(
;; VC 4 C/C++ Tools:
;; file.cpp(2) : error 2024: Function foo is not referenced.
("\n\\([^^( \n\t]+\\)(\\([0-9]+\\)) : \\(error\\|warning\\) " 1 2)
)))
(setq compile-command "cd $CMROOT/cxxsrc/cm ; make"))
;;(auto-fill-mode 1)
(setq fill-column 100)
(setq c-indent-level 2)
(setq tab-width 4)
(setq c-tab-always-indent nil)
;;(setq c-label-offset 0) - untried, normally -2
(setq comment-column 40)
(if (>= emacs-major-version 19)
(defun c-comment-indent ()
(jdt-c-comment-indent))))
(defun my-next-window (&optional prefix)
"Goto next window -- same as other-window."
(interactive "P")
(setq prefix (if prefix (prefix-numeric-value prefix) 1))
(other-window prefix))
(defun my-previous-window (&optional prefix)
"Like next window, only prefix argument is multiplied by -1."
(interactive "P")
(setq prefix (if prefix (- (prefix-numeric-value prefix)) -1))
(other-window prefix))
(defun control-l-to-top ()
"Find next ^L, move it to top of window"
(interactive)
(search-forward "\f")
(recenter 0))
(if (fboundp 'region-size)
(message "REGION-SIZE is already bound, it will not be redefined in .emacs")
(defun region-size ()
"Report the size of the marked region in characters."
(interactive)
(message "Region size is %s" (abs (- (region-end) (region-beginning))))))
\f
;;;
;;; Hooks
;;;
(setq java-mode-hook
'(lambda ()
;; java-indent-command wants a function I don't have with this old emacs lib.
;; (define-key java-mode-map "\t" 'c++-indent-command) ; normally java-indent-command
;;(setq compile-command (concat "javac -g " (buffer-name)))
(setq compile-command "cd $CMROOT ; ant -emacs -Dtest.interactive=true")
(setq comment-column 40)
(setq c-basic-offset 2)
;; This is used by indent-for-comment to decide how much to indent a
;; comment in C code based on its context.
;; I couldn't figure out how to get my closing brace indentation right through
;; normal customizations, because the default behavior of this function
;; was pretty determined. Note that we really want to define this once, instead
;; of every time the mode hook is run, but I haven't taken care of that. Furthermore,
;; we do it in the mode hook because if we do it at initialization load time,
;; the loaded code overwrites the definition in the init file.
(defun c-comment-indent ()
(jdt-c-comment-indent))
;;(font-lock-mode)
))
(setq text-mode-hook
'(lambda ()
(abbrev-mode 1)
(auto-fill-mode 1)
(setq fill-column 75)
(setq compile-command "/bin/time make ")
))
(setq c++-mode-hook
'(lambda ()
(c-stuff "cl ")
))
(setq c-mode-hook
'(lambda ()
(c-stuff "/bin/time cc")
))
;;;
;;; Syntax assists
;;;
(show-paren-mode)
\f
;;;
;;; Key bindings
;;;
(define-key esc-map "G" 'goto-line)
(define-key esc-map "j" 'indent-relative)
(define-key esc-map "\C-r" 'isearch-backward-regexp)
(global-set-key "\C-\\" 'control-l-to-top)
(global-set-key "\C-ct" 'toggle-char-case)
(global-set-key "\C-Xn" 'my-next-window)
(global-set-key "\C-Xp" 'my-previous-window)
(global-set-key (quote [M-down]) (quote scroll-up))
(global-set-key (quote [M-up]) (quote scroll-down))
(global-set-key [f3] 'compile)
;;;
;;; Restore buffer/desktop state
;;;
(desktop-load-default)
(desktop-read)
;;;
;;; Emacs customizations done through customization interfaces.
;;;
;; (mouse-wheel-mode t nil (mwheel)) => enable mouse scrolling with MS scroll button
;; (mouse-wheel-scroll-amount (quote (nil . 5))) => scroll by full screen unshifted, 5 lines shifted
(custom-set-variables
;; custom-set-variables was added by Custom -- don't edit or cut/paste it!
;; Your init file should contain only one such instance.
'(mouse-wheel-mode t nil (mwheel))
'(mouse-wheel-scroll-amount (quote (nil . 5)))
'(rmail-summary-scroll-between-messages t t)
'(scroll-bar-mode (quote right))
'(track-mouse nil t))
(custom-set-faces
;; custom-set-faces was added by Custom -- don't edit or cut/paste it!
;; Your init file should contain only one such instance.
'(font-lock-comment-face ((((class color) (background dark)) (:foreground "LightBlue1")))))
[-- Attachment #3: Type: text/plain, Size: 151 bytes --]
_______________________________________________
Help-gnu-emacs mailing list
Help-gnu-emacs@gnu.org
http://mail.gnu.org/mailman/listinfo/help-gnu-emacs
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2003-06-03 13:44 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-03 13:44 default-frame-alist broken, emacs 21.2.1 RedHat 9.0 NotMy RealName
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.