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

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

Size position of the first window


From: Sieber, Fred
Subject: Size position of the first window
Date: Fri, 2 Jul 2004 13:36:03 -0700

To: address@hidden
Subject: Size Position of First Window
--text follows this line--
This bug report will be sent to the Free Software Foundation,
not to your local site managers!
Please write in English, because the Emacs maintainers do not have
translators to read other languages for them.
 
Your bug report will be posted to the address@hidden mailing list,
and to the gnu.emacs.bug news group.
 
In GNU Emacs 21.2.1 (i686-pc-cygwin, X toolkit)
 of 2004-03-22 on cm-test
configured using `configure  --prefix=/usr --bindir=/usr/bin --sysconfdir=/etc --libexecdir=/usr/sbin --localstatedir=/var --datadir=/usr/share --infodir=/usr/share/info --mandir=/usr/share/man --without-toolkit-scroll-bars'
Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: nil
  locale-coding-system: nil
  default-enable-multibyte-characters: t
 
Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:
 
Although the below methods work for all but the first frame created, the first
frame of the program never quite turns out the way it should in size and position.
The intent is to place the frame on the right half of the screen.   The program
seems to make final adjustments so that you do not get the geometry that your
specified.  You cant even compensate for it by trying to adjust your requested
geometry to compensate for the adjustment the program makes.  There is
no control over it.
 
The intended geometry is for a 1200x1600 pixel display.
The x position should be 800 for this, the 830 was an attempt to compensate
for the adjustment the program made,  but this adjustment is unsuccessful also.
 
Please excuse by obfuscated lisp, but I do not think that is the problem.
 
 
Start up function used:

 
 
function er () {
    font='9x15bold'
#     geometry='86x76-0+0'
# adust for brain damaged emacs 21.x, add 4 to height, off center by 10 pixels
#     geometry='85x80+820+0'
    geometry='85x75+830+0'
    background=''
    foreground='white'
    cursor='yellow'
    if [ $# -gt 0  ]
    then
    emacs -g $geometry  -g.f $geometry  -fn $font -fn.f $font -bg "$background" -bg.f "$background" -fg "$foreground"  -fg.f "$foreground" -cr $cursor $1 --debug-init &
    else
    emacs -g $geometry  -g.f $geometry  -fn $font -fn.f $font -bg "$background" -bg.f "$background" -fg "$foreground"  -fg.f "$foreground" -cr $cursor --debug-init &
    fi
}
 
.emacs file:
 
; after editing load this file with the load-file command
 
;; uncommend below to deug
;; (setq debug-on-error 'a)
;; (setq debug-on-error 'a)
;; this is for xemacs  20.0,  suns, etc
;; (set-toolbar nil)
 
;; (scroll-bar-mode -1)
;; (tool-bar-mode -1)
 
 
 
;; ************* set my-font, my-height my-width
;; pickup -f smallfonts in command line to mean use a smaller font
;; (defun smallfonts () 
;; ( if  ( member "smallfonts" command-line-args )
;;      ( progn (setq my-font "6x10")  (setq my-height 76)  (setq my-width 91) )
;;      ( progn (setq my-font "6x13")  (setq my-height 64)  (setq my-width 91) )
;; ) )
;; (smallfonts)
 

;; small fonts
;; (setq my-font "6x10")  (setq my-height 76)  (setq my-width 91)
;; (setq my-font "7x15")  (setq my-height 88)  (setq my-width 84)
 

;; (setq mode-line-buffer-identification "%12b %12f")
 
 
 
;;  *******************************mode line
(setq default-mode-line-format (list "-"
 'mode-line-mule-info
 'mode-line-modified
 '(line-number-mode " >L%l<")
 'mode-line-frame-identification
  "%b %f" " " (getenv "HOST") "-" (getenv "LOGNAME")
 'global-mode-string
  "- %[("
 'mode-name
 'mode-line-process
 'minor-mode-alist
  "%n" ")%]--"
 '(which-func-mode  ("" which-func-format "--") )
 '(column-number-mode "C%c--")
 '(-3 . "%p")
  "-%-" )  )
 
(add-hook 'c-mode-hook '(lambda () {
(setq mode-line-format (list "-"
 'mode-line-mule-info
 'mode-line-modified
 'mode-line-frame-identification
  "%b-%f" "-" (getenv "HOST") "-" (getenv "LOGNAME")
 'global-mode-string
  "   %[("
 'mode-name
 'mode-line-process
 'minor-mode-alist
  "%n" ")%]--"
 '(which-func-mode  ("" which-func-format "--") )
 '(line-number-mode "-L%l--")
 '(column-number-mode "C%c--")
 '(-3 . "%p")
  "-%-" )  ) )  )
 
; (add-hook 'dired-mode-hook '(lambda () {
; (setq mode-line-format (list "-"
;   "%b %f" "   " (getenv "HOST") "  " (getenv "USER")
; 'mode-name
;  )  ) )  )
 
; (add-hook 'dired-mode-hook '(lambda () {
; (setq mode-line-format (list "-"
; 'mode-line-mule-info
; 'mode-line-modified
; 'mode-line-frame-identification
;  "%b %f" "   " (getenv "HOST") "  " (getenv "USER")
; 'global-mode-string
;  "   %[("
; 'mode-name
; 'mode-line-process
; 'minor-mode-alist
;  "%n" ")%]--"
; '(which-func-mode  ("" which-func-format "--") )
; '(-3 . "%p")
;  "-%-" )  ) )  )
 
 
 

;; **************look in ~/emacs
(add-to-list 'load-path (expand-file-name "~/emacs"))
 
 
 

;; ***************************for cmushell and multi-shell (tracking-shell)
;; this shell does a cd to the directory the shell was invoked from
; (add-to-list 'load-path (expand-file-name "~/emacs/cmushell"))
; (autoload 'tracking-shell "multi-shell" nil t)
; (autoload 'cmushell "cmushell" nil t)
; (load-file "~/emacs/cmushell/comint.el")
 
 
 
;; ********************for ange-ftp, could not get it to work for lisp-dir-apropos
;; (load-file "/home/jeffb/local/share/emacs/20.6/lisp/ange-ftp.el");
;; (setq ange-ftp-gateway-ftp-program-name "/usr/bin/rftp")
;; (setq ange-ftp-smart-gateway t)
 
 
 
;; *************************for lispdir.el
;; (autoload 'format-lisp-code-directory "~/emacs/lispdir" nil t)
;; (autoload 'lisp-dir-apropos "~/emacs/lispdir" nil t)
;; (autoload 'lisp-dir-retrieve "~/emacs/lispdir" nil t)
;; (autoload 'lisp-dir-verify "~/emacs/lispdir" nil t)
;;
 

;; ***********************************find-dired INSTALLATION
;; 19.25 dired extensions,  like F//  key to view all marked files
;; (load-file "/home/jeffb/local/share/emacs/20.6/lisp/dired-x.elc");
(load-file "/usr/share/emacs/21.2/lisp/dired-x.elc");
(load-file "/usr/share/emacs/21.2/lisp/dired-aux.elc");
 
 
 
;; ************************************for rcs check in check out
;; (load-file "~/vc.el");
(load-file "/usr/share/emacs/21.2/lisp/vc.elc");
(load-file "/usr/share/emacs/21.2/lisp/vc-rcs.elc");
 
 
 
;; ************************************ for windows follow mouse
;; (load-file "~/emacs/follow-mouse.el");
;; (turn-on-follow-mouse)
;; for wheel mouse - reflection x does not support
;; (load-file "~/emacs/mwheel.el");
 
 
 
;;  ********************************* java jde
 
;; for jde/semantic related stuff
;; (add-to-list 'load-path (expand-file-name "~/emacs/jde/jde-2.2.6/lisp"))
;; (add-to-list 'load-path (expand-file-name "~/emacs/jde/eieio-0.16"))
;; (add-to-list 'load-path (expand-file-name "~/emacs/jde/elib-1.0"))
;; (add-to-list 'load-path (expand-file-name "~/emacs/jde/speedbar-0.13a"))
;; (add-to-list 'load-path (expand-file-name "~/emacs/jde/semantic-1.3.3"))
 
;; for semantic
;;(require 'senator)
;;(require 'semantic-c) ; for C code integration
;;(require 'semantic-el) ; for Emacs Lisp code integration
;;(require 'semantic-make) ; for Makefile integration
;;(require 'semantic-imenu) ; if you use imenu or wich-function
;;(add-hook 'speedbar-load-hook (lambda () (require 'semantic-sb)))
   ; for speedbar integration
;; (autoload 'semantic-bnf-mode "semantic-bnf" "Mode for Bovine Normal Form." t)
;; (add-to-list 'auto-mode-alist '("\\.bnf$" . semantic-bnf-mode))
   ; for editing .bnf parser files.
;;(autoload 'semantic-minor-mode "semantic-mode" "Mode managing semantic parsing." t)
   ; for semantic-minor-mode
 
;; more for jde
;; (require 'jde)
 
 
 
;; ***************** auto modes ******************
 
;; auto mode .c .h to c++ mode
(setq  auto-mode-alist '(("\\.te?xt\\'" . text-mode)
                         ("\\.c\\'" . c++-mode)
                         ("\\.h\\'" . c++-mode)
                         ("\\.idl\\'" . c++-mode)
                         ("\\.tex\\'" . tex-mode)
                         ("\\.ltx\\'" . latex-mode) ("\\.el\\'" . emacs-lisp-mode)
                         ("\\.mm\\'" . nroff-mode) ("\\.me\\'" . nroff-mode)
                         ("\\.ms\\'" . nroff-mode) ("\\.man\\'" . nroff-mode)
                         ("\\.scm\\'" . scheme-mode) ("\\.l\\'" . lisp-mode)
                         ("\\.lisp\\'" . lisp-mode) ("\\.f\\'" . fortran-mode)
                         ("\\.F\\'" . fortran-mode) ("\\.for\\'" . fortran-mode)
                         ("\\.p\\'" . pascal-mode) ("\\.pas\\'" . pascal-mode)
                         ("\\.mss\\'" . scribe-mode) ("\\.ad[abs]\\'" . ada-mode)
                         ("\\.icn\\'" . icon-mode) ("\\.pl\\'" . perl-mode)
                         ("\\.pm\\'" . perl-mode) ("\\.cc\\'" . c++-mode)
                         ("\\.hh\\'" . c++-mode) ("\\.C\\'" . c++-mode)
                         ("\\.H\\'" . c++-mode) ("\\.cpp\\'" . c++-mode)
                         ("\\.cxx\\'" . c++-mode) ("\\.hxx\\'" . c++-mode)
                         ("\\.c\\+\\+\\'" . c++-mode) ("\\.h\\+\\+\\'" . c++-mode)
                         ("\\.java\\'" . java-mode) ("\\.mk\\'" . makefile-mode)
                         ("\\(M\\|m\\|GNUm\\)akefile\\(.in\\)?\\'" . makefile-mode)
                         ("\\.texinfo\\'" . texinfo-mode) ("\\.te?xi\\'" . texinfo-mode)
                         ("\\.s\\'" . asm-mode) ("\\.S\\'" . asm-mode)
                         ("\\.asm\\'" . asm-mode) ("ChangeLog\\'" . change-log-mode)
                         ("change.log\\'" . change-log-mode)
                         ("changelso\\'" . change-log-mode)
                         ("ChangeLog.[0-9]+\\'" . change-log-mode)
                         ("\\$CHANGE_LOG\\$\\.TXT" . change-log-mode)
                         ("\\.scm\\.[0-9]*\\'" . scheme-mode)
                         ("\\.[ck]?sh\\'\\|\\.shar\\'\\|/\\.z?profile\\'" . sh-mode)
                         ("/\\.\\(bash_profile\\|z?login\\|bash_login\\|z?logout\\)\\'" . sh-mode)
                         ("/\\.\\(bash_logout\\|[kz]shrc\\|bashrc\\|t?cshrc\\|esrc\\)\\'" . sh-mode)
                         ("/\\.\\([kz]shenv\\|xinitrc\\|startxrc\\|xsession\\)\\'" . sh-mode)
                         ("\\.[12345678]\\'" . sh-mode) ("\\.TeX\\'" . tex-mode)
                         ("\\.sty\\'" . latex-mode) ("\\.cls\\'" . latex-mode)
                         ("\\.bbl\\'" . latex-mode) ("\\.bib\\'" . bibtex-mode)
                         ("\\.article\\'" . text-mode) ("\\.letter\\'" . text-mode)
                         ("\\.tcl\\'" . tcl-mode) ("\\.exp\\'" . tcl-mode)
                         ("\\.itcl\\'" . tcl-mode) ("\\.itk\\'" . tcl-mode)
                         ("\\.f90\\'" . f90-mode) ("\\.lsp\\'" . lisp-mode)
                         ("\\.awk\\'" . awk-mode) ("\\.prolog\\'" . prolog-mode)
                         ("\\.tar\\'" . tar-mode)
                         ("\\.\\(arc\\|zip\\|lzh\\|zoo\\)\\'" . archive-mode)
                         ("\\.\\(ARC\\|ZIP\\|LZH\\|ZOO\\)\\'" . archive-mode)
                         ("\\`/tmp/Re" . text-mode) ("/Message[0-9]*\\'" . text-mode)
                         ("/drafts/[0-9]+\\'" . mh-letter-mode)
                         ("\\`/tmp/fol/" . text-mode) ("\\.y\\'" . c-mode)
                         ("\\.lex\\'" . c-mode) ("\\.oak\\'" . scheme-mode)
                         ("\\.sgml?\\'" . sgml-mode) ("\\.dtd\\'" . sgml-mode)
                         ("\\.s?html?\\'" . html-mode)
                         ("[]>:/]\\..*emacs\\'" . emacs-lisp-mode)
                         ("[:/]_emacs\\'" . emacs-lisp-mode) ("\\.ml\\'" . lisp-mode)) )
 
;                          ("\\.[12345678]\\'" . nroff-mode) ("\\.TeX\\'" . tex-mode)
 
 
 
;; ****************** shell tracker
;; (eval-after-load "shell" '(load "shellt"))
;; this does not seem to work
 
 
 
;; ***************html extensions
;;; need to preset auto-mode-alist here, this may be too old
 
;; (load-file "~/emacs/html32-mode.el")
;;  (autoload 'html32-mode "html32-mode" "HTML major mode." t)
;;  (or (assoc "\\.html$" auto-mode-alist)
;;    (setq auto-mode-alist (cons '("\\.html$" . html32-mode)
;;                                auto-mode-alist)))
;;  (or (assoc "\\.shtml$" auto-mode-alist)
;;   (setq auto-mode-alist (cons '("\\.shtml$" . html32-mode)
;;                               auto-mode-alist)))
;;  (or (assoc "\\.htm$" auto-mode-alist)
;;    (setq auto-mode-alist (cons '("\\.htm$" . html32-mode)
;;                                auto-mode-alist)))
 

;; add my own modifications to html32
 
(defun html32-add-blockquote ()
   "Add <br> "
   (interactive)
   (insert "<br>") )
 
;; To use this file, byte-compile it, install it somewhere in your
;; load-path, and put:
;;;; this line crashed emacs 20.3
;; (autoload 'find-dired "find-dired" nil t)
;; (autoload 'find-name-dired "find-dired" nil t)
;; (autoload 'find-grep-dired "find-dired" nil t)
;; in your ~/.emacs, or site-init.el, etc.
;; To bind it to a key, put, e.g.:
;;
;; (global-set-key "\C-cf" 'find-dired)
;; (global-set-key "\C-cn" 'find-name-dired)
;; (global-set-key "\C-cl" 'find-grep-dired)
;;
;; in your ~/.emacs.
;;; Code
;; (defun printcar (a)  (print a '"#<buffer special>"))
(setq arg0  (nth 0 command-line-args))
(setq arg1  (nth 1 command-line-args))
;; (mapcar 'printcar command-line-args)
;; defun findarg (a) ( ( cond  ( ( eq ( car a ) '1 )  (setq foundarg 1) ) ) ) )
;; (defun findarg (a)  ( cond (  (string= a "emacs" )  ( setq foundarg 1 ) )  (t (setq foundarg 0 ) ) )  )
;; (mapcar 'findarg '((1 2) (2 3) (3 4)))
;; (mapcar 'findarg command-line-args)
 
 
 
;; *********************** ksh extensions
 
;; for ksh-mode
(autoload 'ksh-mode "ksh-mode" "Major mode for editing sh Scripts." t)
 
  (setq auto-mode-alist
       (append auto-mode-alist
        (list
         '("\\\\.sh$" . ksh-mode)
         '("\\\\.ksh$" . ksh-mode)
                '("\\\\.bashrc" . ksh-mode)
                '("\\\\..*profile" . ksh-mode))))
 
  (setq ksh-mode-hook
       (function (lambda ()
          (font-lock-mode 1)             ;; font-lock the buffer
          (setq ksh-indent 4)
   (setq ksh-group-offset -4)
   (setq ksh-brace-offset -4)  
          (setq ksh-tab-always-indent t)
          (setq ksh-match-and-tell t)
    (setq ksh-case-item-offset 2)
   (setq ksh-case-indent nil)
          (setq ksh-align-to-keyword t) ;; Turn on keyword alignment
   )))
 
 
 
;; *********************** python extensions
 
;; (load-file "~/emacs/python-mode.el")
 
;; (or (assoc "\\.py$" auto-mode-alist)
;;   (setq auto-mode-alist (cons '("\\.py$" . python-mode)
;;                               auto-mode-alist)))
;;(setq interpreter-mode-alist
;;   (cons '("python" . python-mode)
;;        interpreter-mode-alist))
 
;; (autoload 'python-mode "python-mode" "Python editing mode." t)
 
 
 

;;; *************** locate any font or geometry bg arguments and use them
(setq foundgeom 'nil)
(setq foundheight 'nil)
(setq foundwidth 'nil)
(setq foundfont 'nil)
(setq foundbg 'nil)
(setq foundfg 'nil)
 
;; (setq foundgf 'nil)
;;(setq foundgfcdr 'nil)
 

(setq args command-line-args)
( while (not  (eq 'nil args))
  ( cond
   
    (  (string= (car args) "-fn.f" )
       (setq args2 (cdr args))
       (if (not (eq 'nil args2))
    (setq foundfont (car args2) )
  )
       )
   
    (  (string= (car args) "-g.f" )
       ;;         (setq foundgf "hello")
       ;;         (setq foundgfcdr (cdr args))
      
       (setq args2 (cdr args))
       (if (not (eq 'nil args2))
    (progn
      (setq foundgeom (car args2) )
      (setq index 0)
      ( while  (not ( char-equal (elt foundgeom index) ?x ) )
        (setq foundwidth  (concat foundwidth
       (char-to-string
        (elt foundgeom index))))
        (setq index(1+ index)) )
      (setq index(1+ index))
      ( while  (not (or (char-equal (elt foundgeom index) ?+ ) 
          (char-equal (elt foundgeom index) ?- ) ) )
        (setq foundheight  (concat foundheight  (char-to-string
            (elt foundgeom index))) )
        (setq index(1+ index)) )
      )
 
  )
       )
   
    (  (string= (car args) "-bg.f" )
       (setq args2 (cdr args))
       (if (not (eq 'nil args2))
    (setq foundbg (car args2) )
  )
       )
   
    (  (string= (car args) "-fg.f" )
       (setq args2 (cdr args))
       (if (not (eq 'nil args2))
    (setq foundfg (car args2) )
  )
       )
   
   
    )
  (setq args (cdr args) )
  )
 
(when (not (eq foundheight 'nil))
      (setq foundheight (string-to-int foundheight))
      (setq foundheight  (- foundheight 3)  )
  )
(if (not (eq foundwidth 'nil))
    (setq foundwidth (string-to-int foundwidth))
  )
 
 
 
 
 
;; ******************customization set by menu
 
(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.
 '(automatic-hscrolling nil)
 '(dired-free-space-program 'nil)
 '(global-hl-line-mode t nil (hl-line))
 '(ls-lisp-emulation (quote UNIX))
 '(ls-lisp-dirs-first t)
 '(ls-lisp-verbosity (quote (uid gid)))
 '(scroll-bar-mode nil)
 '(tool-bar-mode nil nil (tool-bar)))
(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 ((t (:foreground "salmon"))))
 '(highlight ((((class color) (background dark)) (:background "slate grey"))))
;;  '(highlight ((((class color) (background dark)) (:background "darkolivegreen"))))
 '(fringe ((t (:background "dark green" :foreground "grey")))))
 
(setq ls-lisp-emulation (quote UNIX)) 
 
;; after editing load this file with the load-file command
 
(setq dired-free-space-program 'nil)
 
;; this is for xemacs  20.0,  suns, etc
;; (set-toolbar nil)
 
(scroll-bar-mode -1)
(tool-bar-mode -1)
 

;; ******************after getting arguments, use them in customization
 
;;  ****************************** version stuff
;; indicate if running xemacs
(defvar running-xemacs (string-match "XEmacs\\|Lucid" emacs-version))
 
 
 
;; Pickup emacs version
; Older versions of emacs did not have these variables
; (emacs-major-version and emacs-minor-version.)
; Let's define them if they're not around, since they make
; it much easier to conditionalize on the emacs version.
(if (and (not (boundp 'emacs-major-version))
         (string-match "^[0-9]+" emacs-version))
    (setq emacs-major-version
          (string-to-int (substring emacs-version
                                    (match-beginning 0) (match-end 0)))))
(if (and (not (boundp 'emacs-minor-version))
         (string-match "^[0-9]+\\.\\([0-9]+\\)" emacs-version))
    (setq emacs-minor-version
          (string-to-int (substring emacs-version
                                    (match-beginning 1) (match-end 1)))))
 
; Define a function to make it easier to check which version we're
; running.
(defun running-emacs-version-or-newer (major minor)
  (or (> emacs-major-version major)
      (and (= emacs-major-version major)
           (>= emacs-minor-version minor))))
 
 
 

;;  ***********************frame size stuff
( cond
 
;; for versions 19.30 and later
      ( ( running-emacs-version-or-newer 19 30 )       
 
;; initial values for default-frame-plist
;; (setq default-frame-plist  '((horizontal-scroll-bar . t)
;;         (vertical-scroll-bar . t)
;;                              (minibuffer . t) (user-position . t)
;;                              (user-size . f)
;;                              (user-font . t )
;;                              (height . 60) (width . 90)
;;         (top . 0) (left - 0)
;;                              (cursor-color . "yellow") (mouse-color . "yellow")
;;                              (foreground-color . "white")
;;                              (background-color . "Dark Green")
;;                              (font . "6x10")
;;  ) )
;; ;; now modify according to font selection
;; (setcdr  (assoc 'font default-frame-plist) foundfont)
;; (setcdr  (assoc 'height default-frame-plist) foundheight)
;; (setcdr  (assoc 'width default-frame-plist) foundwidth)
;; (setcdr  (assoc 'foreground-color default-frame-plist foundfg)
;; (setcdr  (assoc 'background-color default-frame-plist foundbg)
 

;; initial values for default-frame-alist,  same as plist
(setq default-frame-alist  '((horizontal-scroll-bar . f)
                             (tool-bar . f )
        (vertical-scroll-bar . f)
        (minibuffer . t) (user-position . t)
        (user-size . f)
        (user-font . t)
        (height . 76) (width . 85) (top . 0) (left - 0)
        (cursor-color . "yellow") (mouse-color . "yellow")
        (foreground-color . "white")
        (background-color . "Dark Green")
        (font . "6x10")
                             ) )
;; now modify according to font selection
(if (not (eq foundfont 'nil))   (setcdr  (assoc 'font default-frame-alist) foundfont) )
(if (not (eq foundheight 'nil)) (setcdr  (assoc 'height default-frame-alist) foundheight) )
(if (not (eq foundwidth 'nil))  (setcdr  (assoc 'width default-frame-alist) foundwidth) )
(if (not (null foundfg))        (setcdr  (assoc 'foreground-color default-frame-alist) foundfg) )
(if (not (null foundbg))        (setcdr  (assoc 'background-color default-frame-alist) foundbg) )
 
 
 
;; defun for new frame on right,   1st do plist, then alist
(defun new-frame-right() (interactive)
;;   (setq default-frame-plist  '((horizontal-scroll-bar . f)
;;           (vertical-scroll-bar . f)
;;           (minibuffer . t) (user-position . t) (user-size . t)
;;           (height . 76) (width . 91) (top . 0) (left - 0)
;;           (cursor-color . "yellow") (mouse-color . "yellow")
;;           (foreground-color . "white")
;;           (background-color . "Dark Green") (font . "6x10"))
;;  )
;;   ;; modify for font selection
;;   (setcdr  (assoc 'font default-frame-plist) my-font)
;;   (setcdr  (assoc 'height default-frame-plist) my-height)
;;   (setcdr  (assoc 'width default-frame-plist) my-width)
 
  (setq default-frame-alist  '((horizontal-scroll-bar . f)
                             (tool-bar . f )
          (vertical-scroll-bar . f)
          (minibuffer . t) (user-position . t) (user-size . t)
          (height . 76) (width . 85) (top . 0) (left - 0)
          (cursor-color . "yellow") (mouse-color . "yellow")
          (foreground-color . "white")
          (background-color . "Dark Green") (font . "6x10")) )
  ;; modify for font selection
  (if (not (eq foundfont 'nil))   (setcdr  (assoc 'font default-frame-alist) foundfont) )
  (if (not (eq foundheight 'nil)) (setcdr  (assoc 'height default-frame-alist) foundheight) )
  (if (not (eq foundwidth 'nil))  (setcdr  (assoc 'width default-frame-alist) foundwidth) )
  (if (not (null foundfg))        (setcdr  (assoc 'foreground-color default-frame-alist) foundfg) )
  (if (not (null foundbg))        (setcdr  (assoc 'background-color default-frame-alist) foundbg) )
 
   (scroll-bar-mode -1)
   (tool-bar-mode -1)
 
  (make-frame-command)   )
 
 
 
;; defun for new frame on left 
(defun new-frame-left() (interactive)
;;   (setq default-frame-plist  '((horizontal-scroll-bar . f)
;;           (vertical-scroll-bar . f)
;;           (minibuffer . t) (user-position . t) (user-size . t)
;;           (height . 76) (width . 91) (top . 0) (left - 0)
;;           (cursor-color . "yellow") (mouse-color . "yellow")
;;           (foreground-color . "white")
;;           (background-color . "Dark Green") (font . "6x10"))
;;  )
;;   ;; modify for font selection
;;   (setcdr  (assoc 'font default-frame-plist) my-font)
;;   (setcdr  (assoc 'height default-frame-plist) my-height)
;;   (setcdr  (assoc 'width default-frame-plist) my-width)
 
  (setq default-frame-alist  '((horizontal-scroll-bar . f)
                             (tool-bar . f )
          (vertical-scroll-bar . f)
          (minibuffer . t) (user-position . t) (user-size . t)
          (height . 76) (width . 85) (top . 0) (left . 0)
          (cursor-color . "yellow") (mouse-color . "yellow")
          (foreground-color . "white")
          (background-color . "Dark Green") (font . "6x10"))
 )
  ;; modify for font selection
  (if (not (eq foundfont 'nil))   (setcdr  (assoc 'font default-frame-alist) foundfont) )
  (if (not (eq foundheight 'nil)) (setcdr  (assoc 'height default-frame-alist) foundheight) )
  (if (not (eq foundwidth 'nil))  (setcdr  (assoc 'width default-frame-alist) foundwidth) )
  (if (not (null foundfg))        (setcdr  (assoc 'foreground-color default-frame-alist) foundfg) )
  (if (not (null foundbg))        (setcdr  (assoc 'background-color default-frame-alist) foundbg) )
 
   (scroll-bar-mode -1)
   (tool-bar-mode -1)
 
  (make-frame-command)   )
 

;; defun for new frame on center
(defun new-frame-center() (interactive)
;;   (setq default-frame-plist  '((horizontal-scroll-bar . f)
;;           (vertical-scroll-bar . f)
;;           (minibuffer . t) (user-position . t) (user-size . t)
;;           (height . 76) (width . 85) (top . 0) (left . 532)
;;           (cursor-color . "yellow") (mouse-color . "yellow")
;;           (foreground-color . "white")
;;           (background-color . "Dark Green") (font . "6x10"))
;;  )
;;   ;; modify for font selection
;;   (setcdr  (assoc 'font default-frame-plist) my-font)
;;   (setcdr  (assoc 'height default-frame-plist) my-height)
;;   (setcdr  (assoc 'width default-frame-plist) my-width)
 
  (setq default-frame-alist  '((horizontal-scroll-bar . f)
                             (tool-bar . f )
          (vertical-scroll-bar . f)
          (minibuffer . t) (user-position . t) (user-size . t)
          (height . 76) (width . 85) (top . 0) (left . 600)
          (cursor-color . "yellow") (mouse-color . "yellow")
          (foreground-color . "white")
          (background-color . "Dark Green") (font . "6x10"))
 )
  ;; modify for font selection
  (if (not (eq foundfont 'nil))   (setcdr  (assoc 'font default-frame-alist) foundfont) )
  (if (not (eq foundheight 'nil)) (setcdr  (assoc 'height default-frame-alist) foundheight) )
  (if (not (eq foundwidth 'nil))  (setcdr  (assoc 'width default-frame-alist) foundwidth) )
  (if (not (null foundfg))        (setcdr  (assoc 'foreground-color default-frame-alist) foundfg) )
  (if (not (null foundbg))        (setcdr  (assoc 'background-color default-frame-alist) foundbg) )
     (scroll-bar-mode -1)
   (tool-bar-mode -1)
 
  (make-frame-command)   )
 

;; end runnin-emacs-version-or-newer
)
 
 
 
 
 
;; earlier versions
 
( t
 
  (defun new-frame-left() (interactive)
    ( make-frame  '(
      (horizontal-scroll-bar . f) (vertical-scroll-bar . f)
                             (tool-bar . f )
      (minibuffer . t)
      (user-position . t) (user-size . t)
      (height . 76)
      (width . 85)
      (top . 0) (left . 0) (cursor-color . "yellow")
      (mouse-color . "yellow") (foreground-color . "white")
      (background-color . "Dark Green") (font . "9x15bold")
      )
    ) )
 
  (defun new-frame-right() (interactive)
    ( make-frame  '(  (horizontal-scroll-bar . f) (vertical-scroll-bar . f)
                             (tool-bar . f )
        (minibuffer . t) (user-position . t) (user-size . t)
        (height . 76) (width . 85)
        (top . 0) (left . 600) (cursor-color . "yellow")
        (mouse-color . "yellow") (foreground-color . "white")
        (background-color . "Dark Green") (font . "9x15bold")  )
    ) )
 
  ) 
 
;; end cond
)
 
 
 
(defun move-frame-right() (interactive)
  ( new-frame-right) ( delete-frame ) )
(defun move-frame-left() (interactive)
    ( new-frame-left) ( delete-frame ) )
 
 
 

;; ****************************operational variables
(setq default-case-fold-search nil)
(setq scroll-step 1)
 
 
 

;; abbreviation stuff
;; (setq abbrev-all-caps 'nil)
;; (setq abbrev-mode 't)
; (quietly-read-abbrev-file "~/AirRes/AirResAbbrev")
; macro to save abbreviations
;; (fset 'save-abbrev
;; [escape ?x ?w ?r ?i ?t ?e ?- ?a ?b ?b ?r ?e ?v ?- ?f ?i ?l ?e return ?\C-a ?\C-k ?~ ?/ ?A ?i ?r ?R ?e ?s ?/ ?A ?i ?r ?R ?e ?s ?A ?b ?b ?r ?e ?v return])
;; (global-set-key [escape ?-] 'abbrev-prefix-mark)
 
 
 
;; tags stuff
;; (setq tags-file-name '/export/home/fsieber/worka/obb_vistas/TAGS)
 
 
 
;; backspace stuff
;; (keyboard-translate "\C-h" "\C-?")
;; (keyboard-translate "\C-?" "\C-h")
 

;; ************************************** vc
(setq vc-rcsdiff-knows-brief 'no)
 
;; paths
; (setq vc-path '/usr/local/rcs/bin)
;; no toolbar
;; (set-specifier top-toolbar-visible-p 'nil)
;; preferred shell
 
;; ***************************************** shell
(setq explicit-shell-file-name "/usr/bin/ksh")
 
 
 
 
 
;;   *********** indenting and colorizing   **************
 
;;  indenting  for c, c++
(setq c-basic-offset 4)
(setq c-indent-level 4)
(setq c-continued-statement-offset 4)
(setq c-brace-offset 0)
(setq c-brace-imaginary-offet 0)
(setq c-label-offset -4)
(setq c-argdecl-indent 0)
 
;; colorize
(global-font-lock-mode t)
;; set comments to salmon
(custom-set-variables)
(custom-set-faces
 '(font-lock-comment-face ((t (:foreground "salmon")))))
 
 
 

;; set tab stop at 4
(setq tab-stop-list '(4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76))
; (setq tab-width 4)
 

;; tabs, newlines, indpenting
(global-set-key "\C-h" 'delete-backward-char)
;; (define-key c-mode-map "\C-i" 'tab-to-tab-stop)
;; (define-key c++-mode-map "\C-i" 'tab-to-tab-stop)
;; should be just for c++-mode, but cant get it to work
;; (global-set-key "\C-i" 'c++-indent-line)
;; (global-set-key "\C-m" 'newline-and-indent)
;; (define-key c-mode-map "\C-m" 'newline-and-indent)
;; (define-key c++-mode-map "\C-m" 'newline-and-indent)
 

;; ^j  newline and indent it
;; ^o  move to next line and indent it
(fset 'nextline-and-indent "\C-n\C-a\C-i")
;; (fset 'nextline-and-indent-new "\C-n\C-a\C-i")
 
(defun nextline-and-indent-new() (interactive) (newline) (c-indent-line) )
(defun endline-and-indent-new() (interactive) (end-of-line) (newline-and-indent) )
(global-set-key "\C-j" 'endline-and-indent-new)
(global-set-key "\C-o" 'nextline-and-indent)
 
;; (define-key c-mode-map "\C-j" 'nextline-and-indent)
;; (global-set-key "\C-m" 'nextline-and-indent-new)
;; (define-key c-mode-map "\C-m" 'nextline-and-indent-new)
;; (define-key c++-mode-map "\C-m" 'nextline-and-indent-new)
;; (define-key c++-mode-map "\C-j" 'nextline-and-indent)
 
;; seems like default style for c-style-alist is "gnu" does indent by 2
;; ( cond ( ( running-emacs-version-or-newer 19 30 )   
;;       (c-set-style "cc-mode")
;;      )
;; )
 
 
 
;; c-mode-hook  put line line number, abbrev-mode, auto-mode
(add-hook 'c-mode-hook 'line-number-mode 1)
(add-hook 'perl-mode-hook 'line-number-mode 1)
;; (setq perl-mode-hook  '(lambda () (line-number-mode 1)(abbrev-mode 1) ) )
;; (add-hook 'c-mode-hook 'abbrev-mode)
 

;; (defun my-c-mode-common-hook()
;;  (setq c-mode-hook
;;        '(lambda ()
;;           (line-number-mode 1)(abbrev-mode 1)(c-toggle-auto-state 1)
;;           (c-toggle-hungry-state 1)
;;           (c-set-style "cc-mode")
;;         )
;;   )
;; )
;; (add-hook 'c-mode-common-hook 'my-c-mode-common-hook)
 
 
 
(setq c++-mode-hook  '(lambda () (line-number-mode 1)(abbrev-mode 1)
;;                         (define-key c-mode-map "\C-m" 'newline-and-indent)
                         (define-key c++-mode-map "\C-m" 'newline-and-indent)
                     (c-set-style "cc-mode" )
            ) )
 
 
 
;; junk
;;(defun fredsgoto(ARG) (interactive) (line-number-mode) (goto-line) )
;;(setq sun-esc-bracket t)
 

(defun reportfile ()
  "Report which file this is"
  (interactive nil)
  (setq fileName (buffer-file-name))
   (message "----%s-----" fileName)
   (sleep-for 2)
  (message "")
)
 
 
 
;; ***********************jeffs functions
 

;;-----------------------------------------------------------------------------
(defun current-line ()
  "Return the current buffer line at point.  The first line is 0."
  (save-excursion
    (beginning-of-line)
    (count-lines (point-min) (point))
    )
  )
;;-----------------------------------------------------------------------------
(defun rof ()
  "Reopen the current file anew.
   Discard the current buffer and reread file from disk.
   Good for viewing the newest error log after a new run."
  (interactive nil)
  (setq line (current-line))
  (setq column (current-column))
  (setq fileName (buffer-file-name))
  (kill-buffer (current-buffer))
  (find-file fileName)
  (goto-line (+ 1 line))
  (forward-char column)
  (message "---------- File Reopened ----------")
  (sleep-for 1)
  (message "")
  )
;;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(defun rec ()
  "Save buffer and redo the last compile command."
  (interactive nil)
  (save-buffer (current-buffer))
  (recompile)
  )
;;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(defun rmtws ()
  "Remove trailing whitespace from the current buffer."
  (interactive nil)
  (save-excursion
    (goto-char (point-min))
    (while (< (point) (point-max))
      (end-of-line)
      (delete-horizontal-space)
      (forward-line 1)
     )
   )
 )
;;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(defun rmbl ()
  "Remove blank lines from the current buffer."
  (interactive nil)
  (save-excursion
    (goto-char (point-min))
    (while (< (point) (point-max))
      (delete-blank-lines)
      (forward-line 1)
     )
   )
 )
;;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(defun utb ()
  "Untab the current buffer. Convert tabs to spaces."
  (interactive nil)
  (untabify (point-min) (point-max))
  (save-buffer (current-buffer))
  (rmws)
 )
;;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(defun jpf ()
  "Fill current paragraph, justify, and move forward."
  (interactive nil)
  (fill-paragraph 'justify)
  (forward-paragraph)
  (recenter)
 )
;;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(defun delete-line ()
  "Delete the line the cursor is on."
  (interactive nil)
  (beginning-of-line)
  (setq beg (point))
  (forward-line 1)
  (setq end (point))
  (kill-region beg end)
 )
;;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(defun dup-line ()
  "Duplicate the current line."
  (interactive nil)
  (save-excursion
    (beginning-of-line)
    (setq beg (point))
    (forward-line 1)
    (setq end (point))
    (copy-region-as-kill beg end)
    (yank)
    )
  (forward-line 1)
  )
;;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(defun insert-tab ()
  "Insert a non-interpreted TAB (do not indent)."
  (interactive nil)
  (setq   char "\t")
  (insert char)
  )
;;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(defun jpf ()
  "Fill current paragraph, justify, and move forward."
  (interactive nil)
  (fill-paragraph 'left)
  (forward-paragraph)
  (recenter)
  )
 

;; easiet to hardest
 
;; self-insert
;; ^
;; function
;; ^ function
;; esc
;; esc function
;; alt
;; alt funtion
;; shift function
;;  moderate acrobatics
;; esc ^
;; esc alt
;; esc shift
;;  finger mangling beyond this point
;; ^ alt
;; ^ shift   limited set
;; alt shift
;; alt shift function
;; esc ^ alt
;; esc ^ shift
;; esc alt shift
;; ^ alt shift
;; esc ^ alt shift
 

;;   *********** mouse   **************
 

(fset 'previous-3-lines [up up up])
(fset 'next-3-lines [down down down])
; (global-set-key [mouse-4] 'previous-3-lines)
; (global-set-key [mouse-5] 'next-3-lines)
(global-set-key [mouse-4] 'previous-line)
(global-set-key [mouse-5] 'next-line)
 
;;   *********** redefined CTRL  keys   **************
 
;; ^abcdefgknp  well known
;; ^h is backspace
;; ^i is tab
;; ^j is linefeed
;; ^l  go to line
;; ^m is RET
;; ^o is go down redoing intents
;; ^q is quoted insert
;; ^r-s  backward-forward search
;; ^t is tab
;; ^u is universal argument follow by digits, four times default
;; ^v scroll down
;; ^w yank/delete
;; ^x prefix
 
;; ^z undefined
 

;; ^,  undefined
;; ^.  undefined
;; ^/  is undo
;; ^;  undefined
;; ^'  undefined
;  ^[  is esc
;; ^]  match brackets
;; ^/  is scroll up
;; ^-  begin negative argument
;; ^`  undefined
;; ^=  undefined
 
 
 
;; ^l
(global-set-key "\C-l" 'goto-line)
 

;; ^O was overwrite mode,  ^o now used for indent control
;; ^o set to next-line-and-indent, above
;;(global-set-key "\C-z" 'overwrite-mode)
;;(global-set-key "\C-z" 'overwrite-mode)
;; (global-set-key "\C-o" 'overwrite-mode)
 

;; ^S, ^R to isearch-forward-regexp
(global-set-key "\C-s" 'isearch-forward-regexp)
(global-set-key "\C-r" 'isearch-backward-regexp)
 
;; ^t logical tab
;; the following line erros on 19.33
;; (define-key c-mode-map "\C-t" 'tab-to-tab-stop)  ;;was esc i
;; (define-key c++-mode-map "\C-t" 'tab-to-tab-stop)  ;;was esc i
(global-set-key "\C-t" 'tab-to-tab-stop)  ;;was esc i
 
;; ^Z page up   as is ^\
;; (global-set-key "\C-z" 'scroll-down)
 
;; ^z  is grab to Register z
;; esc z is put back from Register z
(fset 'save-in-reg-z
   [?\C-x ?r ?s ?z ])
(global-set-key "\C-z" 'save-in-reg-z)
 
 
 

;; ^]  blink matching pen
(global-set-key "\C-]" 'blink-matching-open) 
;; (global-set-key "\C-]" 'blink-matching-open)
 
;; ^.  dired-up-directory
;; (global-set-key "\C-\." 'dired-up-directory) 
 
;; ^;  grep
;; (global-set-key "\C-;" 'grep)
;; (global-set-key [(control ";")] 'grep)
 
;; ^\ page up,  note ^Z is also~/
(global-set-key "\C-\\" 'scroll-down)
 
;; ^'
;; (global-set-key "\C-=" 'do-shell-comment) 
;; (global-set-key "\C-=" 'do-shell-comment)
 
 
 
 
 

;;  ************** redefined  esc keys    ***************
 
;; esc q  query-replace
;; (define-key c-mode-map "\M-q" 'query-replace)
;; (define-key c++-mode-map "\M-q" 'query-replace)
;; query-replace now F3
;; (global-set-key "\M-q" 'query-replace)
;; (global-set-key "\336" 'delete-backward-char)
 
;; esc :  clean up indenting in region
(global-set-key [escape ?:] 'indent-region)
 
;; esc ;  line up comment on this line, move to next
(defun freds-indent-for-comment() (interactive) (indent-for-comment)(next-line 1))
(global-set-key [escape ?;] 'freds-indent-for-comment)
 
;; < > below
 
;; available aijnpquvz
;; available /;'[]\`-=
 
;;  esc 1 - 0 are avaialable
 

;; esc 1 or esc ! same as  shft F4
;;
(global-set-key [escape ?1] 'shell-command)
 

;; ecc a  available
;; esc b  change to *Buffer List*
(defun change-to-buffer-list() (interactive) (switch-to-buffer "*Buffer List*") (Buffer-menu-revert) )
(global-set-key [escape ?b] 'change-to-buffer-list)
 

;; esc c  change to *Compilation*
(defun change-to-compilation() (interactive) (switch-to-buffer "*compilation*"))
(global-set-key [escape ?c] 'change-to-compilation)
 

;; esc d  change to debug  -- does not work
; (fset 'goto-debug
;   [?\C-x ?b ?* ?g ?u ?d ?- ?  return])
(fset 'goto-debug
   [escape ?b escape ?< ?\C-s ?g ?u ?d ?-  ?\C-m ?f])
;; (defun change-to-debug() (interactive) (switch-to-buffer "*gud- "))
(global-set-key [escape ?d] 'goto-debug)
 
;; esc e goto .emacs
;; (fset 'goto-emacs
;;   [?\C-x ?\C-f ?\C-a ?\C-k ?~ ?/ ?. ?e ?m ?a ?c ?s return])
(defun goto-emacs() (interactive) (find-file "~/.emacs"))
(global-set-key [escape ?e] 'goto-emacs)
 
;; esc f  !rcsdiff
(fset 'rcsdiff-on-file
  [ ?! ?r ?c ?s ?d ?i ?f ?f return ] )
(global-set-key [escape ?f] 'rcsdiff-on-file)
 
;; esc g  change to *Grep*
(defun change-to-grep() (interactive) (switch-to-buffer "*grep*"))
(global-set-key [escape ?g] 'change-to-grep)
 
;; esc h   go to home directory
(defun go-home() (interactive) (dired "~") )
(global-set-key [escape ?h] 'go-home)
 
;; esc i  undefined
;; esc j  undefined
;; esc k  change to *Shell*
(fset 'do-pwd
   [?p ?w ?d return])
 
(defun change-to-shell() (interactive) (switch-to-buffer "*shell*") (shell) (execute-kbd-macro 'do-pwd))
(global-set-key [escape ?k] 'change-to-shell)
 

;; esc l  co -l
(fset 'rcs-lock-file
  [ ?! ?r ?c ?s ?   ?- ?l  return ] )
(global-set-key [escape ?l] 'rcs-lock-file)
 
 
 
;; esc m  change to *Messages*
(defun change-to-messages() (interactive) (switch-to-buffer "*Messages*"))
(global-set-key [escape ?m] 'change-to-messages)
 
;; esc n  line-number-mode
(global-set-key [escape ?n] 'line-number-mode)
 
;; esc o  change to *Occur*
(defun change-to-occur() (interactive) (switch-to-buffer "*Occur*"))
(global-set-key [escape ?o] 'change-to-occur)
 

;; esc p  undefined
;; esc q  undefined
 
;; esc r  "rename-buffer"
(fset 'rename-the-buffer
   [escape ?x ?r ?e ?n ?a ?m ?e ?- ?b ?u ?f ?f ?e ?r return ?\C-u ?\C-x ?q return])
(global-set-key [escape ?r] 'rename-the-buffer)
 
;; esc s  change to *Shell Command Output*
(defun change-to-shell-output() (interactive) (switch-to-buffer "*Shell Command Output*"))
;; (fset 'change-to-shell-output
;;   [?\C-x ?b ?* ?S ?h ?e ?l ?l ?  ?C ?o ?m ?m ?a ?n ?d ?  ?O ?u ?t ?p ?u ?t ?* return])
(global-set-key [escape ?s] 'change-to-shell-output)
 

;; esc t   go to top directory
(defun go-to-top-dir() (interactive) (dired "/master/WES") )
(global-set-key [escape ?t] 'go-to-top-dir)
 
;; esc u   !rcs -u
(fset 'rcs-unlock-file
  [ ?! ?r ?c ?s ?  ?- ?u  return ] )
(global-set-key [escape ?u] 'rcs-unlock-file)
 

;; esc v   rlog on the file
(fset 'rcs-rlog-file
  [ ?! ?r ?l ?o ?g  return ] )
(global-set-key [escape ?v] 'rcs-rlog-file)
 

;; wxy below
 
;; esc z is put back from Register z
;; ^z  is grab to Register z
(fset 'get-from-reg-z
   [?\C-x ?r ?i ?z ])
(global-set-key [escape ?z] 'get-from-reg-z)
 

;; also available    /;'[]\`-=
 

;; wxy<> below
;; these are standard but we lost the escape as prefix by using it with function
;; keys below
(global-set-key [escape ?w] 'kill-ring-save)
(global-set-key [escape ?x] 'execute-extended-command)   
(global-set-key [escape ?y] 'yank-pop)
(global-set-key [escape ?<] 'beginning-of-buffer)
(global-set-key [escape ?>] 'end-of-buffer)
 
 
 

;; ****************** redefined  CTRL-X -  **************
;; ^x p  prev window, 
;; ^x n  next window                                   
(fset 'prev-windows "\C-u-1\C-xo")
(global-set-key "\C-xp" 'prev-windows)                   
(global-set-key "\C-xn" 'other-window)
 
 
 
;; ***************** other special keys ************
;; up down     
(global-set-key [up] 'previous-line)
(global-set-key [down] 'next-line)
(global-set-key [home] 'beginning-of-buffer)
(global-set-key [end] 'end-of-buffer)
 
 
 
;; printscreen
(defun list-matching-lines-this() (interactive) (list-matching-lines   (thing-at-point 'word)  )   )
(global-set-key [print] 'list-matching-lines-this)
(defun list-matching-lines-selected() (interactive) (list-matching-lines   (buffer-substring (mark) (point))  )   )
(global-set-key [C-print] 'list-matching-lines-selected)
 
(fset 'repeat-last-shell-command
   [escape ?x ?s ?h ?e ?l ?l ?- ?c ?o ?m ?m ?a ?n ?d return up return])
(global-set-key [S-print] 'repeat-last-shell-command)
 
(fset 'do-cap-rlog
   [escape ?x ?s ?h ?e ?l ?l ?- ?c ?o ?m ?m ?a ?n ?d return ?R ?l ?o ?g return])
(global-set-key [escape print] 'do-cap-rlog)
 

;; scrolllock is key-20
(defun grep-this() (interactive) (grep ( concat "~/bin/Grep " (thing-at-point 'word) ) ) )
(global-set-key [key-20] 'grep-this)
(defun grep-selected() (interactive) (grep ( concat "~/bin/Grep " (buffer-substring (mark) (point)) ) ) )
(global-set-key [escape key-20] 'grep-selected)
 

;; pause
(global-set-key [pause] 'list-matching-lines)
 
;;(fset 'do-devcheckup
;;   [escape ?x ?s ?h ?e ?l ?l ?- ?c ?o ?m ?m ?a ?n ?d return ?d ?e ?v ?c ?h ?e ?c ?k return ])
(fset 'do-devcheckup
   [f12 ?\C-a ?\C-k ?d ?e ?v ?c ?h ?e ?c ?k return ])
(global-set-key [escape pause] 'do-devcheckup)
 
;; control-pause is kp-f1
(fset 'do-devcheckup-update
   [f12 ?\C-a ?\C-k ?d ?e ?v ?c ?h ?e ?c ?k ?  ?- ?u return ])
;;   [escape ?x ?s ?h ?e ?l ?l ?- ?c ?o ?m ?m ?a ?n ?d return ?/ ?m ?a ?s ?t ?e ?r ?/  ?W ?E ?S ?/ ?t ?o ?o ?l ?b  ?i ?n ?/ ?d ?e ?v ?c ?h ?e ?c ?k ?u ?p ?  ?- ?u  return])
(global-set-key [kp-f1] 'do-devcheckup-update)
 
 
 

;; ***************** function keys ******************
;; 19.25.1 takes [escape f1], will not take [(shift/control f2)], will not take
;;   [shift/control f2], will take [S/C-f2]
 

;; F1 ,  its hard to get to shift F1 on most pc's
;; (global-set-key [f1] 'compile)
 
;; alt-F1  is grab to Register
(fset 'save-in-reg
   [?\C-x ?r ?s  ])
(global-set-key [\M-f1] 'save-in-reg)
 
(global-set-key [f1] 'help-command)
(global-set-key [escape f1] 'save-some-buffers)
 

;; F2 next error
 
;; alt-F2  is get from Register x
(fset 'get-from-reg
   [?\C-x ?i ?s  ])
(global-set-key [\M-f2] 'get-from-reg)
 
(global-set-key [f2] 'next-error)
(global-set-key [f24] 'eval-buffer)
;; control F2 is f24 mapped by xmodmap
(global-set-key [S-f2] 'previous-error)
(global-set-key [escape f2] 'first-error)
;; (global-set-key [(meta f2)] 'first-error)
 

;; F3 execute macro
(global-set-key [f3] 'query-replace)
;; (global-set-key [f13] 'call-last-kbd-macro)
(fset 'rename-filename
   "wR\C-y")
(global-set-key [f13] 'rename-filename)
(global-set-key [S-f3] 'save-abbrev)
(fset 'my-load-file [escape ?x ?l ?o ?a ?d ?- ?f ?i ?l ?e return  ?\C-a ?\C-k ?~ ?/ ?. ?e ?m ?a ?c ?s return])
(global-set-key [escape f3] 'my-load-file)
(fset 'javacomp
   " 2>&1 | sed -e 's/\\[javac\\]//' | sed -e 's/\\(^ *\\)\\(.*\\)/\\2/'")
(global-set-key [M-f3] 'javacomp)
 
 
 
;; F4   dired/shell
;; (global-set-key [f4] 'dired-other-window)
(global-set-key [f4] 'dired)
(global-set-key [f14] 'tracking-shell)
;; (global-set-key [(shift f4)] 'grep)
(global-set-key [S-f4] 'shell-command)
;; (global-set-key [(meta f4)] 'dired-do-flagged-delete)
(global-set-key [escape f4] 'dired-do-flagged-delete)
 

;; F5 
;; (fset 'make-for   "\C-ifor ( ; ; ) {\C-m}\C-p\C-f\C-f\C-f\C-f")
;; (global-set-key [f5] 'make-for)
 
(fset 'go-to-dired  [f4 return])
(global-set-key [f5] 'go-to-dired)
 
(global-set-key [S-f5] 'speedbar)
;; (global-set-key [escape f5] 'reindent-then-newline-and-indent)
 
(defun set-mark-a() (interactive) (bookmark-set "a"))
(global-set-key [f15] 'bookmark-set)
 
;; (fset 'set-mark-at-a   "\M-xbookmark-set\C-m")
;; (global-set-key [C-f5] 'set-mark-at-a)
 
;; (fset 'switch-buffers-to "\C-x\C-b\C-xn")
;; (global-set-key [escape f5] 'switch-buffers-to)
 
(fset 'get-buffer-list
   [?\C-x ?b ?* ?B ?u ?f ?f ?e ?r ?  ?L ?i ?s ?t ?* return ?\C-x ?\C-b])
(global-set-key [escape f5] 'get-buffer-list)
 

;; F6   
;; (fset 'make-if   "\C-iif ( ) {\C-m}\C-p\C-f\C-f\C-f")
;; (fset 'make-if   "\C-iif ( ) {\C-m}\C-p\C-f\C-f\C-f")
(fset 'comment-out   "// \C-a\C-n")
(defun paste-line() (interactive)  (save-excursion (beginning-of-line)
  (let ((beg (point))) (end-of-line) (copy-region-as-kill beg (point)) ) ) )
(global-set-key [f6] 'comment-out)
(global-set-key [S-f6] 'paste-line)
(global-set-key [f16] 'bookmark-jump)
(global-set-key [escape f6] 'find-name-dired)
 

;; F7   else if () { }
(defun paste-word() (interactive)  (save-excursion (backward-word 1)
   (let ((beg (point))) (forward-word 1) (copy-region-as-kill beg (point)) ) ) )
(fset 'do-shell-comment
   "\C-a# \C-a\C-n")
;; (fset 'make-elseif
;;   " else if ( ) {\C-m}\C-p\C-f\C-f\C-f\C-f\C-f\C-f\C-f\C-f\C-f\C-f")
(global-set-key [f7] 'do-shell-comment)
;;(global-set-key [(control f7)] 'indent-for-comment)
(global-set-key [f17]  'list-matching-lines)
;; (global-set-key [escape f7] 'make-elseif)
(global-set-key [S-f7] 'paste-word)
(global-set-key [escape f7] 'reportfile)
  
 
;; F8   switch
;;(fset 'makeswitch
;;   "switch () {\C-m\C-mdefault:\C-mbreak;\C-m}\C-p\C-p\C-p\C-p\C-f\C-f\C-f\C-f\C-f\C-f\C-f \C-b")
(global-set-key [f8] 'new-frame-left)
(global-set-key [f18] 'shrink-window)
(global-set-key [S-f8] 'move-frame-left)
(global-set-key [escape f8] 'grep)
;; (global-set-key [(shift f8)] 'enlarge-window)
;; (global-set-key [(meta f8)] 'new-frame-left)
;; (global-set-key [escape f8] 'makeswitch)
 
 
 
;; F9   case
(fset 'make-case
   "case :\C-m\C-mbreak;\C-p\C-p\C-b\C-b ")
;; (global-set-key [f9] 'new-frame-right)
;; (global-set-key [f9] 'new-frame-center)
(global-set-key [f9] 'other-frame)
(global-set-key [f19] 'enlarge-window)
;; (global-set-key [control f9] 'make-case)
(global-set-key [S-f9] 'move-frame-right)
(global-set-key [escape f9] 'find-name-dired)
 

;;(fset 'apigrep
;;    [escape ?x ?g ?r ?e ?p return backspace backspace backspace backspace backspace backspace backspace backspace backspace backspace backspace ?a ?p ?i ?g ?r ?e ?p ?  \C-u \C-x q ])
;; (global-set-key [escape f9] 'apigrep)
 
 
 
 
 
;; F10  
(global-set-key [f10] 'new-frame-right)
;; (global-set-key [f10] 'grep)
;; f20 is control-f10  -- rcf is rereadfile
(global-set-key [f20] 'rof)
(fset 'make-block-body   "{\C-m}\C-p")
;; (global-set-key [escape f10] 'make-block-body)
(global-set-key [escape f10] 'not-modified)
(global-set-key [S-f10] 'delete-line)
 
 
 

;; F11
(fset 'grep-Grep
   [escape ?x ?g ?r ?e ?p return backspace backspace backspace backspace backspace backspace backspace backspace backspace backspace backspace ?/ ?h ?o ?m ?e ?/ ?f ?r ?e ?d ?s ?/ ?b ?i ?n ?/ ?G ?r ?e ?p ?  \C-u \C-x q ])
(global-set-key [f11] 'grep-Grep)
 
(global-set-key [(control f11)] 'delete-frame)
(global-set-key [S-f11] 'dup-line)
(global-set-key [escape f11] 'find-tag-other-window)
;; (global-set-key [f11]  'find-file-other-frame)
;; (global-set-key [C-f11]  'dired-other-frame)
 
;; F12  compile
(global-set-key [f12]  'compile)
;; (global-set-key [f12]  'rec)
(global-set-key [S-f12] 'call-last-kbd-macro)
;; (global-set-key [(control f12)]  'other-frame)
;; control F12 does not work due to quirk in reflection x
;; (fset 'find-next-alternative   "\C-u1\M-.")
;; (global-set-key [(control f12)] 'find-next-alternative)
(global-set-key [escape f12] 'ediff-buffers)
;; (global-set-key [(control f12)] 'compile)
;; (global-set-key [S-f12] 'compile)
 
;; F36 is F12 on sun keyboard
;; (global-set-key [f36]  'compile)
;; (global-set-key [(control f36)]  'other-frame)
 
 
 
;; old function key  stuff
 
;; F9   compile
;;(global-set-key "\C-xal" 'compile)
;; F10  locate next error
;;(global-set-key "\C-xam" 'next-error)
 
;; F8   comment
;;(fset 'new-comment "\M-;\C-a\C-i\C-f\C-f\C-f")
;;(fset 'new-comment "\C-a\C-i/*   */\C-a\C-i\C-f\C-f\C-f")
;;(global-set-key "\C-xad" 'new-comment)
 
;; F5   comment to right
;;(fset 'new-comment "\C-a\C-i/*   */\C-a\C-i\C-f\C-f\C-f")
;;(fset 'new-forward-comment "\C-t/*   */\C-b\C-b\C-b\C-b")
;;(global-set-key "\C-xaf" 'new-forward-comment)
 
 
 
 
 
 
 
 
 
;; this stuff is for xemacs
;; (custom-set-variables)
;;(custom-set-faces
;;  '(red ((t (:foreground "red" :background "white"))) t)
;;  '(blue ((t (:foreground "blue"))) t)
;; '(highlight ((t (:foreground "black"))) t))
;; ))
;; Options Menu Settings
;; =====================
;;(cond
;; (
;;    (and (string-match "XEmacs" emacs-version)
;;       (boundp 'emacs-major-version)
;;       (or (and
;;            (= emacs-major-version 19)
;;            (>= emacs-minor-version 14))
;;           (= emacs-major-version 20))
;       (fboundp 'load-options-file)
;;     )
;;  (load-options-file "/h/USERS/global/fsieber/.xemacs-options")
;;  )
;;)
;; ============================
;; End of Options Menu Settings
 
 
 
;; this is old stuff mess with frame arguments
;; (setq frame-initial-geometry-arguments '((user-position . t) (user-size . t)
;;    (height . 54) (width . 81) (top . 0) (left . -)
;;    (height . 65) (width . 90) (top . 0) (left . 0))  )
;; (setq default-frame-plist '(width 70 height 86 top  0 left  0) )
;; (setq default-x-frame-plist '(width 70 height 86 top  0 left  0) ) 
;; (setq default-frame-plist '((width.89) (height.59) (top.0) (left.-) ) 
;; (setq default-frame-alist  '((width.89) (height.59) (top.0) (left.-) ) 
 
;; this is done inside cond below, so dont do it here
; (setq default-frame-plist  '((horizontal-scroll-bar . f) (vertical-scroll-bar . f) (minibuffer . t) (user-position . t) (user-size . t) (height . 61) (width . 90) (top . 0) (left - 0) (cursor-color . "yellow") (mouse-color . "yellow") (foreground-color . "white") (background-color . "Dark Green") (font . "6x10")) )
; (setq default-frame-alist  '((horizontal-scroll-bar . f) (vertical-scroll-bar . f) (minibuffer . t) (user-position . t) (user-size . t) (height . 61) (width . 90) (top . 0) (left - 0) (cursor-color . "yellow") (mouse-color . "yellow") (foreground-color . "white") (background-color . "Dark Green") (font . "6x10")) )
 
 
 
 
 
;; (fset 'grab-struct
;;   [?\C-a ?\C-s ?} ?\C-e escape ?w ?\C-r ?{ ?\C-a])
 
;; (global-set-key [escape f6] 'grab-struct)
 
 
 
;; (fset 'delete-struct
;;   [?\C-a ?\C-s ?{ ?\C-b ?\C-  ?\C-s ?} ?\C-b ?\C-f ?\C-w ?\C-p ?\C-n ?\C-a])
 
;; (global-set-key [escape f7] 'delete-stru ct)
 
 
 
 
 
;;   dired extensions ******************************************
 
     (add-hook 'dired-mode-hook
               '(lambda ()
                  (define-key dired-mode-map
                              [f5]
                              'dired-up-directory)
 
                  ))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

reply via email to

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