|
(defun s-minibuffer-complete ()
"A shell around minibuffer-complete which removes the name of the current buffer from the buffer completion list. The default behaviour doesn't make sense since there is no reason to ask to switch to the buffer you are already in!"
(interactive)
(if s-remove-first-completion
(progn (setq s-remove-first-completion nil)
(if (consp minibuffer-completion-table)
(setq minibuffer-completion-table
(cdr minibuffer-completion-table)) ()))
())
(minibuffer-complete))
(defun s-minibuffer-complete-word ()
"A shell around minibuffer-complete-word which removes the name of the current buffer from the buffer completion list. The default behaviour doesn't make sense since there is no reason to ask to switch to the buffer you are already in!"
(interactive)
(if s-remove-first-completion
(progn (setq s-remove-first-completion nil)
(if (consp minibuffer-completion-table)
(setq minibuffer-completion-table
(cdr minibuffer-completion-table)) ()))
())
(minibuffer-complete-word)
)
(defun s-minibuffer-complete-and-exit ()
"A shell around minibuffer-complete-and-exit which removes the name of the current buffer from the buffer completion list. The default behaviour doesn't make sense since there is no reason to ask to switch to the buffer you are already in!"
(interactive)
(if s-remove-first-completion
(progn (setq s-remove-first-completion nil)
(if (consp minibuffer-completion-table)
(setq minibuffer-completion-table
(cdr minibuffer-completion-table)) ()))
())
(minibuffer-complete-and-exit))
(defun s-switch-to-buffer ()
"A shell around switch-to-buffer which removes the name of the current buffer from the buffer completion list. The default behaviour doesn't make sense since there is no reason to ask to switch to the buffer you are already in!"
(interactive)
(setq s-remove-first-completion 't)
(switch-to-buffer (read-buffer "Switch to buffer: " (other-buffer))))
(setq s-remove-first-completion 'nil)
(defvar ask-for-mwheel nil)
(defvar do-require-mwheel t)
(add-hook 'gnus-select-group-hook 'gnus-group-set-timestamp)
(add-hook 'gnus-group-mode-hook 'gnus-topic-mode)
(if option-package-load-CUA
(option-load-package option-package-CUA))
(mapcar (lambda (x)
(let* ((item (eval x))
(load (eval (cadr (cdr item)))))
(if load
(option-load-package item))))
option-package-available-alist)
(if (emacs-type-is-regular)
(require 'scroll-in-place nil t)
(require 'scroll-in-place))
(defun scroll-down-one-line (arg)
"Scroll down one line, or number of lines specified by prefix arg."
(interactive "P")
(let ((old-scroll-lines scroll-default-lines)
(scroll-default-lines 1))
(scroll-down-in-place arg)
(setq scroll-default-lines old-scroll-lines)))
(defun scroll-up-one-line (arg)
"Scroll down one line, or number of lines specified by prefix arg."
(interactive "P")
(let ((old-scroll-lines scroll-default-lines)
(scroll-default-lines 1))
(scroll-up-in-place arg)
(setq scroll-default-lines old-scroll-lines)))
(if (emacs-type-is-regular)
(require 'tmake-mode nil t)
(require 'tmake-mode))
(setq completion-ignored-extensions (append completion-ignored-extensions
'(".CKP" ".u" ".press" ".imp" ".BAK")))
(if default-font-name
(set-default-font default-font-name))
(standard-display-european t)
(set-input-mode (car (current-input-mode))
(nth 1 (current-input-mode))
0)
(setq widget-push-button-gui t)
(setq resize-minibuffer-mode t)
(setq resize-minibuffer-window-max-height 3)
(setq widget-editable-list-gui t)
(setq custom-file "~/.emacs.gnu.custom")
(setq-default inhibit-startup-message t)
(setq mouse-yank-at-point 't)
(global-set-key [vertical-scroll-bar down-mouse-1] 'scroll-bar-drag)
(if (emacs-type-is-regular)
(progn
(set-language-environment "Latin-1")
(set-terminal-coding-system 'iso-latin-1)
(setq unibyte-display-via-language-environment t)))
(setq browse-url-generic-program "konqueror") (setq browse-url-browser-function 'browse-url-w3)
(auto-compression-mode t)
(fset 'yes-or-no-p 'y-or-n-p)
(put 'downcase-region 'disabled nil)
(custom-set-variables
'(kill-whole-line t)
'(compilation-window-height 10)
'(compilation-read-command nil)
'(compilation-ask-about-save nil)
'(compile-command "make")
'(Man-notify-method (quote bully))
'(scroll-bar-mode nil)
'(c++-font-lock-extra-types (quote ("JBF[a-zA-Z0-9]*" "eZ[a-zA-Z0-9]*" "Q[a-zA-Z]*" "uint" "ulong" "string"))))
(require 'paren)
(if (emacs-type-is-regular)
(show-paren-mode t))
(setq blink-matching-paren-on-screen t)
(setq-default font-lock-maximum-decoration t)
(if (emacs-type-is-regular)
(global-font-lock-mode t))
font-lock-use-default-*font-lock
(setq font-lock-use-default-fonts nil)
(setq font-lock-use-default-colors nil)
(require 'font-lock)
(setq scroll-margin 2)
(setq scroll-margin 0)
(setq hscroll-step 1)
(setq scroll-step 1)
(setq line-number-mode t)
(setq column-number-mode t)
(setq display-time-day-and-date t)
(display-time)
(if (emacs-type-is-regular)
(pc-selection-mode))
(cond (window-system
(progn
(if (emacs-type-is-regular)
(scroll-bar-mode -1)))
(setq frame-title-format '("emacs: %b - %f"))))
(setq time-stamp-active t)
(setq time-stamp-format "%02d-%3b-%:y %02H:%02M:%02S %u")
(setq next-line-add-newlines nil
kill-whole-line t)
(setq auto-insert-directory (project-select-autoinsert))
(setq auto-insert-query nil)
(setq auto-insert-alist (project-create-autoinsert-alist))
(defconst my-c-style
'((c-tab-always-indent . t)
(c-basic-offset . 4)
(c-comment-only-line-offset . 0)
(c-hanging-braces-alist . ((substatement-open after)
(brace-list-open)))
(c-hanging-colons-alist . ((member-init-intro before)
(inher-intro)
(case-label after)
(label after)
(access-label after)))
(c-cleanup-list . (scope-operator
empty-defun-braces
defun-close-semi))
(c-offsets-alist . ((arglist-close . c-lineup-arglist)
(substatement-open . 0)
(case-label . +)
(block-open . 0)
(access-label . -)
(label . 0)
(knr-argdecl-intro . -)))
)
"My C/C++ Programming Style")
(defconst ezsystems-c-style
'((c-tab-always-indent . t)
(c-basic-offset . 4)
(c-comment-only-line-offset . 0)
(c-hanging-braces-alist . ((substatement-open after)
(brace-list-open)))
(c-hanging-colons-alist . ((member-init-intro before)
(inher-intro)
(case-label after)
(label after)
(access-label after)))
(c-cleanup-list . (scope-operator
empty-defun-braces
defun-close-semi))
(c-offsets-alist . (
(arglist-close . c-lineup-arglist)
(substatement-open . 0)
(case-label . +)
(block-open . 0)
(access-label . -)
(label . 0)
(knr-argdecl-intro . -)))
)
"eZ systems Programming Style")
(require 'php-mode)
(defconst ezsystems-php-style
'((c-tab-always-indent . t)
(c-basic-offset . 4)
(c-comment-only-line-offset . 0)
(c-hanging-braces-alist . ((substatement-open after)
(brace-list-open)))
(c-hanging-colons-alist . ((member-init-intro before)
(inher-intro)
(case-label after)
(label after)
(access-label after)))
(c-cleanup-list . (scope-operator
empty-defun-braces
defun-close-semi))
(c-offsets-alist . (
(arglist-close . c-lineup-arglist)
(substatement-open . 0)
(case-label . +)
(block-open . 0)
(access-label . -)
(label . 0)
(knr-argdecl-intro . -)
(inline-open . 0)))
)
"eZ systems PHP Programming Style")
(c-add-style "personal" my-c-style)
(c-add-style "eZSystems" ezsystems-c-style)
(c-add-style "eZPHP" ezsystems-php-style)
(defun my-c-mode-common-hook()
(interactive)
(c-set-offset 'member-init-intro '++)
(setq outline-regexp (concat
"^" "\\(template[ \t]*<[^>]+>[ \t]*\\)?" "\\([a-zA-Z0-9_:]+[ \t]+\\)?" "\\([a-zA-Z0-9_:]+[ \t]+\\)?"
"\\(" "[a-zA-Z0-9_:]+"
"\\([ \t]*[*&]+[ \t]*\\|[ \t]+\\)" "\\)?" "\\(" "[a-zA-Z0-9_:~]+" "\\|"
"\\([a-zA-Z0-9_:~]*::\\)?operator"
"[^a-zA-Z1-9_][^(]*" " \\)"
"[ \t]*([^)]*)[ \t\n]*[^ ;]" ))
(setq indent-tabs-mode nil)
(make-local-variable 'font-lock-defaults)
(if (emacs-type-is-regular)
(setq font-lock-defaults '(c++-new-font-lock-keywords)))
(make-local-variable 'buffer-include-regexp)
(if c++-buffers-only
(setq buffer-include-regexp '()))
(setq buffer-include-regexp (cons c++-buffer-include-regexp buffer-include-regexp))
(setq buffer-include-regexp (cons project-buffer-include-regexp buffer-include-regexp))
(setq tab-width 4)
(c-toggle-hungry-state t)
(define-key c-mode-base-map "\C-m" 'newline-and-indent)
(local-set-key [RET] 'newline-and-indent)
(local-set-key [f5] '(lambda ()
(interactive)
(project-compile "")))
(local-set-key [M-f5] '(lambda ()
(interactive)
(project-compile "clean")))
(local-set-key [C-M-f5] 'make-makefile)
(local-set-key [S-f4] 'align)
(local-set-key [f8] 'next-error)
(outline-minor-mode)
(define-key esc-map "\t" 'project-expand-symbol)
(global-set-key [M-return] 'project-expand-symbol)
(make-local-variable 'option-local-config-dir-func)
(setq option-local-config-dir-func '(project-local-config-dir))
(option-load-from-file-locally)
)
(add-hook 'c-mode-common-hook 'my-c-mode-common-hook)
(defun my-php-mode-hook()
(interactive)
(c-set-offset 'member-init-intro '+)
(setq outline-regexp "^[ \t\n\r\f]*function[ \t\n\r\f]+[a-zA-Z_0-9]+([^)]*)")
(setq indent-tabs-mode nil)
(make-local-variable 'font-lock-defaults)
(if (emacs-type-is-regular)
(setq font-lock-defaults '(c++-new-font-lock-keywords)))
(make-local-variable 'buffer-include-regexp)
(if c++-buffers-only
(setq buffer-include-regexp '()))
(setq buffer-include-regexp (cons php-buffer-include-regexp buffer-include-regexp))
(setq tab-width 4)
(c-toggle-hungry-state t)
(define-key c-mode-base-map "\C-m" 'newline-and-indent)
(local-set-key [RET] 'newline-and-indent)
(c-set-style "ezphp")
)
(add-hook 'php-mode-hook 'my-php-mode-hook)
(c-set-style "eZSystems")
(add-hook 'c++-mode-hook
'(lambda ()
(easy-menu-define c-c++-menu c++-mode-map "C++ Project Commands"
(c-project-menu "Project"))
(easy-menu-add (c-project-menu mode-name))
(easy-menu-define c-c++-menu c++-mode-map "General options"
(config-menu "Option"))
(easy-menu-add (config-menu mode-name))
(setq c-access-key c-qt-C++-access-key)
(c-set-style "ezsystems")
))
(add-hook 'message-mode-hook 'flyspell-mode)
(add-hook 'message-mode-hook 'turn-on-auto-fill)
(add-hook 'text-mode-hook
'(lambda ()
(easy-menu-define text-menu text-mode-map "C++ Project Commands"
(c-project-menu "Project"))
(easy-menu-add (c-project-menu mode-name))
))
(add-hook 'emacs-lisp-mode-hook
'(lambda ()
(easy-menu-define text-menu emacs-lisp-mode-map "C++ Project Commands"
(c-project-menu "Project"))
(easy-menu-add (c-project-menu mode-name))
))
(add-hook 'tmake-mode-hook
'(lambda ()
(easy-menu-define text-menu tmake-mode-map "C++ Project Commands"
(c-project-menu "Project"))
(easy-menu-add (c-project-menu mode-name))
))
(add-hook 'lisp-mode-hook
'(lambda ()
(easy-menu-define text-menu lisp-mode-map "C++ Project Commands"
(c-project-menu "Project"))
(easy-menu-add (c-project-menu mode-name))
))
|
|
|
All content copyright by the contributors. |
Website maintained with
Emacs ,
wsmake and
html-helper-mode |
Emacs community logo by Daniel Lundin |
Last updated on Sat Jan 22 14:57:06 2005
by Ingo Koch |
|
|
|
|