LINUX.ORG.RU

настройка (X)Emacs для работы с C/C++ (просьба о помощи)


0

0

Доброе время суток Дамы и Господа!
Обращаюсь к вам с просьбой о помощи... Приступил на днях к освоению
(X)Emacs и сразу же столкнулся с маленькой проблемой √ огромный объём
информации и как обычно нехватка времени на начальном этапе. Вопрос
состоит в том есть ли где-нибудь уже готовые ╚.emacs╩ файлы. Которые
люди уже однажды создавали под конкретные нужды... Чтобы было с чего
начать, и уже с этой базы настраивать под себя, по мере прочтения
документации и приобретения навыков.
Что хотелось бы иметь
1. подсветку синтаксиса включая собственные типы в полном объеме
(например я так и не нашел почему например ╚size_t╩ не подсвечивается)
2. Автозаполнение как ключевых слов (class, template, using┘), так
и переменных, методов, членов-функций, системных вызовов...
3. ╚Класс броузер╩ хотя это вроде я нашел на speedbar┘ но скорее
всего тоже требуется настройка...
4. возможность перейти от вызова функции/метода к его определению по ╚шорткату╩ ...
5. Все что сверх этого и о чем я возможно просто не догадываюсь...

Возможно, кто-то поделится своими конфигами, ссылками на пакеты которые считает полезными.

Заранее спасибо за помощь.
Александр. (alex321345 at hotmail dot com)

anonymous

вот пожалуйста .. по названиям можно догадаться какой пакет нужен
возможно тебе еще понадобиться ECB - Emacs Code Browser

========== BEGIN =============
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; load inf-lisp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(if (string-match "XEmacs" emacs-version) 
    (add-to-list 'load-path "/home/lg/.xemacs/lisp") nil)

(setq c-type-bonus-types "\\|\\sw+_t\\|va_list\\|jmp_buf")

(put 'narrow-to-region 'disabled nil)

;;(autoload 'text-modes "text-modes")
;;(autoload 'prog-modes "prog-modes")
;;(autoload 'apel "apel")
;;(require 'edict)
(require 'debug)
;;(require 'ispell)
;;(require 'w3)
(require 'dired)
(require 'pcl-cvs)
;;(require 'efs)
;;(require 'gnus)
(require 'sgml-mode)
;;(require 'overlay)
(load-library "inf-lisp")
;; what to run when M-x run-lisp
(setq inferior-lisp-program "clisp -I -q")

;; evaluation lisp expration
(defun lisp-eval-sexp (&optional and-go)
  "send next sexp to the inferior lisp proccess"
  (interactive "P")
  (lisp-eval-region (point)
                    (save-excursion (forward-sexp) (point))
                    and-go))

(defun lisp-macroexpand-region (start end &optional and-go)
  "macroexpand"
  (interactive "r\nP")
  (comint-send-string
   (inferior-lisp-proc)
   (format "(macroexpand-1 (quote %s))\n" (buffer-substring start end))
  )
   (if and-go (switch-to-lisp t))
)
(defun lisp-macroexpand-sexp (&optional and-go)
  "macroexpand next sexp to inferior lisp proc"
  (interactive "P")
  (lisp-macroexpand-region (point)
                           (save-excursion (forward-sexp) (point))
                           and-go))

;; some powerfull binds
(inferior-lisp-install-letter-bindings)
(define-key lisp-mode-map             "\C-x\C-e" 'lisp-eval-sexp)
(define-key inferior-lisp-mode-map    "\C-x\C-e" 'lisp-eval-sexp)
(define-key lisp-mode-map             "\C-x\C-m" 'lisp-macroexpand-sexp)
(define-key inferior-lisp-mode-map    "\C-x\C-m" 'lisp-macroexpand-sexp)

(require 'cc-mode)
;;(autoload 'c-support "c-support")
(defun my-c-compile (x)
  (interactive "p")
  (compile compile-command))

(define-key c-mode-map "\C-cl" 'my-c-compile)

;;(require 'cc-langs)
(define-key c-mode-map                [(meta tab)]   'tag-complete-symbol)
(define-key c-mode-map                [(meta s)]   'tags-search)
(define-key c-mode-map                '(shift button1) 'c-c-menu)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; bids
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; (== C-h Backspace) so help system moved to C-x h 
;(global-set-key "\C-h" 'delete-backward-char)
;(global-set-key "\C-xh" 'help-command)
;(global-set-key "\C-x\C-m" 'manual-entry)
(if (string-match "XEmacs" emacs-version)
  (progn (define-key global-map '(button4) 'scroll-down)
         (define-key global-map '(button5) 'scroll-up)))
;; end here


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; - php mode -
;; как опору возъмем html-mode
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(require 'mmm-mode)
(setq mmm-global-mode 'maybe)
(mmm-add-mode-ext-class nil "\\.php3?\\'" 'html-php)
(mmm-add-classes
 '((html-php
    :submode php-mode
    :front "<\\?\\(php\\)?"
    :back "\\?>"
    ) nil))
(autoload 'php-mode "php-mode" "PHP editing mode" t)
(add-to-list 'auto-mode-alist '("\\.php.?\\'" . html-mode))
;; apache root directory
(defvar php-bin "/home/lg/bin/php" "Where php binary is.")
(defvar php-apache-root-dir '("www" "data") "Окуда делать truncate пути к файлу")
(defvar php-apache-hostname "http://www" "Что писать в начало перед трункатнутым пути к файлу (NOTE: / в конце не неужен)")
;; evaluate region with external process
(defun php-eval-region (begin end)
   "Прогнать данный регион через php.bin и вывести что получилось в другом окне"
   (interactive "r")
   (shell-command-on-region begin end php-bin))
(defun php-eval-buffer ()
   "Тоже самое что и php-eval-region тока полностью для buffera"
   (interactive)
   (shell-command-on-region (point-min) (point-max) php-bin))

(defun php-make-url (list &optional dir)
"Если dir нету то (\"test\" \"test1\" \"test.php\") -> \"/test/test1/test.php\"
 иначе исключить начало которое в dir.
 Например list = '(\"www\" \"data\" \"test.php\"), dir = '(\"www\" \"data\")
 то вернеться \"/test.php\""

  (cond ((null list) nil)
         ((equal (car list) (car dir)) (php-make-url (cdr list) (cdr dir)))
         (t (concat "/" (car list) (php-make-url (cdr list))))))
;; start netscape with buffer-file argument
(defun php-eval-buffer-file ()
  "Записать current buffer в файл и запустить netscape с ним"
  (interactive)
  (require 'browse-url)
  (let* ((ofil (reverse (cdr (split-string (buffer-file-name (current-buffer)) "/"))))
         (b (cdr ofil))
         (fn (split-string (car ofil) "\\."))
         (temp-file (reverse (cons (concat (car fn) "_" (user-login-name) "_netscape." (cadr fn)) b))))
    (write-region (point-min) (point-max) (php-make-url temp-file))
    (browse-url-netscape 
     (concat php-apache-hostname (php-make-url temp-file php-apache-root-dir)) t)))

;; key-maps .. we use html-mode чтоб едитать php и ети бинды свободны в c-mode
(defvar html-mode-map nil) 
(if html-mode-map
  ()
  (setq html-mode-map (make-sparse-keymap))
  (define-key html-mode-map "\C-cr" 'php-eval-buffer-file)
  (define-key html-mode-map "\C-c|"    'php-eval-region)
  (define-key html-mode-map "\C-c\C-l" 'php-eval-string)
  (define-key html-mode-map "\C-cb" 'php-eval-buffer))
;;
;; -- end --

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; use sml-mode
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(require 'sml-mode)
(add-to-list 'auto-mode-alist '("\\.sml$" . sml-mode))
(add-to-list 'auto-mode-alist '("\\.sig$" . sml-mode))
(add-to-list 'auto-mode-alist '("\\.ML$" . sml-mode))
;; end here

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; use AUC-Tex
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(require 'tex-site)
(require 'tex-buf)
(load "tex")      ; for (define-key TeX-mode-map .. 

(defun TeX-LaTeX-buffer-file ()
  (interactive)
  (let* ((name "LaTeX")
        (filen (file-name-nondirectory (buffer-file-name (current-buffer))))
        (comm (concat "latex '\\nonstopmode\\input{" filen "}'")))
  (TeX-run-LaTeX name comm (TeX-master-file))))

(defun TeX-view () 
  (interactive)
  (let* ((osnov (car (split-string (buffer-file-name (current-buffer)) "\\.")))
       (sf (concat osnov ".dvi"))
       (df (concat osnov ".ps")))
    (let ((buff (TeX-active-buffer)))
      (if buff
         (let ((oldbuff (current-buffer)))
            (start-process-shell-command "dvips" buff "xdvi" sf)
            (message "Type 'C-c C-l' to view log"))
         (message "Run LaTeX first."))
    )))
    ;;(delete-other-windows)))

(define-key TeX-mode-map "\C-cv" 'TeX-view)
(define-key TeX-mode-map "\C-cl" 'TeX-LaTeX-buffer-file)
;; end here

;; preview-LaTeX
;(add-to-list 'load-path "~/.xemacs/lisp/preview-latex-0.6")
;(autoload 'LaTeX-preview-setup "preview")
;(add-hook 'LaTeX-mode-hook #'LaTeX-preview-setup)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; load css-mode
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(autoload 'css-mode "css-mode")
(add-to-list 'auto-mode-alist '("\\.css\\'" . css-mode))
;; end

;; w3m
;;
(add-to-list 'load-path "~/.xemacs/lisp/w3m_el-1.2.6")
(autoload 'w3m "w3m" "Interface for w3m in XEmacs." t)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; load flex-mode
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(autoload 'flex-mode "flex-mode")
(add-to-list 'auto-mode-alist '("\\.lex\\'" . flex-mode))
;; end

;;; Make Text mode the default for new buffers
(setq default-major-mode 'text-mode)
;;  Turn on Auto Fill mode automatically in Text mode
(add-hook 'text-mode-hook 'turn-on-auto-fill)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; header
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;(load "header")
;;(defconst header-copyright-notice "\
;;Copyright 2000 Zajcev Evgeny <lg@deny.ru>.")

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; html-mode
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;(autoload 'html-helper-mode "html-helper-mode" "Yay HTML" t) ; alternativ til html-mode
;;(setq html-helper-mode-uses-visual-basic nil) ;
;; automatically on .html files, do this:
(setq auto-mode-alist (cons '("\\.html$" . html-mode) auto-mode-alist))
(setq browse-url-browser-function 'browse-url-netscape) ;Netscape default browser
;; ends here

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; compilation
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(setq compile-command "make -k")
(setq compilation-scroll-output t)

(add-to-list 'auto-mode-alist '("\\.py$" . python-mode))
(add-to-list 'interpreter-mode-alist '("python" . python-mode))
(autoload 'python-mode "python-mode" "Python editing mode." t)
;; ends here

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; misc
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(icomplete-mode)
(setq minibuffer-max-depth nil)
(mouse-avoidance-mode 'animate)
(setq next-line-add-newlines nil)
(lisp-interaction-mode) ;; for *scratch*

(setq mail-sources '((file :path "/var/mail/lg")))
(setq gnus-secondary-select-methods '((nnml "private")))

(setq scroll-step 1)
;; - start calendar -
;;(calendar)         ;; for paranoid managers only :)
;;(mark-diary-entries)
;;(other-window 1)
;; - end -
;; - load virt -
(if (string-match "XEmacs" (emacs-version))
   (progn (load-file (concat (getenv "HOME") "/.xemacs/lisp/virt/virt1.el"))
          (add-menu-button '("Apps" "Games") ["Virtuoso" virt t]))
)
;; - end load virt -
(put 'downcase-region 'disabled nil)
(put 'upcase-region 'disabled nil)
(if (string-match "XEmacs" emacs-version) nil (set-language-environment "Cyrillic-KOI8")) ;; set it for Emacs
(custom-set-variables
 '(w3-user-fonts-take-precedence t)
 '(paren-mode (quote sexp) nil (paren))
 '(delete-key-deletes-forward t)
 '(gnus-use-cross-reference nil)
 '(gnus-read-newsrc-file nil)
 '(toolbar-mail-reader (quote relm))
 '(gnus-save-newsrc-file nil)
 '(gnus-nntpserver-file "nil")
 '(gnus-always-read-dribble-file nil)
 '(speedbar-supported-extension-expressions (quote (".[ch]\\(\\+\\+\\|pp\\|c\\|h\\|xx\\)?" ".tex\\(i\\(nfo\\)?\\)?" ".el" ".emacs" ".l" ".lsp" ".p" ".java" ".f\\(90\\|77\\|or\\)?" ".ada" ".p[lm]" ".tcl" ".m" ".scm" ".pm" ".py" ".s?html" "[Mm]akefile\\(\\.in\\|\\.am\\)?" "configure\\.in?")))
 '(user-mail-address "lg@deny.ru" t)
 '(query-user-mail-address nil)
 '(gnus-save-killed-list nil))
(custom-set-faces
 '(default ((t nil)) t))
(line-number-mode 1)
(column-number-mode 1)

;; yank text to the cursor position instead of mouse clicked point
(setq mouse-yank-at-point t)

;; Not nesessary unless you set different values.
;;(setq russian-font-name "alt")
;;(setq russian-buffer-name "8koi")
;;(setq russian-keyboard-name "ascii")
;;(setq russian-mode-name "8koi")
(require 'russian)   
;;(russian-display)


(setq display-warning-suppressed-classes (cons 'key-mapping nil))
;; -end-
;; - display date-and-time
(setq display-time-day-and-date t)
(display-time)
;; - end -
;; - gnus mail reader conf -
(autoload 'rfc-view "rfc-view" "RFC mode" t)

;; always use font-lock-mode because it looks nicer
(font-lock-mode)

(if (string-match "XEmacs" emacs-version) 
    nil (add-to-list 'load-path "/home/lg/.xemacs/lisp/elib-1.0"))
(require 'auto-save)
(setq auto-save-directory (expand-file-name "~/.autosave/")
      auto-save-directory-fallback auto-save-directory
      auto-save-hash-p nil
      auto-save-interval 2000)

(defun cw-build-buffers ()
  "Popup buffer menu."
  (interactive "@")
  (run-hooks 'activate-menubar-hook)
  (popup-menu (car (find-menu-item current-menubar '("Buffers")))))

(global-set-key [(control button3)] 'cw-build-buffers)
(require 'func-menu)
(define-key global-map '(shift button3) 'mouse-function-menu)

;;(setq visible-bell 1)
(setq compilation-window-height 10)

;;mics
;; Xemacs doesnt have 'thing-at-point
;; XEmacs doesn't have `thing-at-point'.
(eval-and-compile
  (unless (fboundp 'thing-at-point)
    (defun thing-at-point (thing)
      nil)))

;;
;; rdict
(defcustom rdict-program "rdict" "\
Name of the program to invoke in order to fetch from dictionary."
  :type 'string
  :group 'rdict)

(defun rdict (rw)
  (interactive
   (list (let* ((word (current-word))
                (thing (read-string (if (equal word "")
                                        "Search in dict: "
                                      (concat "Search in dict:(default: " word " )")))))
           (if (equal thing "") word thing))))

  (let* ((bufname "rdict-mode-buffer"))
    (cond ((get-buffer-create bufname)
           (save-excursion
             (set-buffer (get-buffer bufname))
             (setq buffer (current-buffer))
             (display-buffer bufname))
          t
           (with-output-to-temp-buffer bufname
             (buffer-disable-undo standard-output)
             (save-excursion
               (set-buffer standard-output)
               (erase-buffer)
                 (apply 'call-process rdict-program nil '(t nil) nil (list rw))
;;               (if (< (buffer-size) 200)
;;                   (progn
;;                     (kill-buffer (current-buffer))))
               (setq buffer-read-only t)
               (set-buffer-modified-p nil)
               (setq buffer (current-buffer))))))))

(define-key global-map '(shift tab) 'self-insert-command)
(global-set-key [iso-left-tab] [(shift tab)])
(setq c-default-style '((java-mode . "java") (c-mode . "bsd") (other . "gnu")))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Loading russian support for xkb
;;
(global-set-key [Cyrillic_a] [а])
(global-set-key [Cyrillic_A] [А])
(global-set-key [Cyrillic_be] [б])
(global-set-key [Cyrillic_BE] [Б])
(global-set-key [Cyrillic_che] [ч])
(global-set-key [Cyrillic_CHE] [Ч])
(global-set-key [Cyrillic_de] [д])
(global-set-key [Cyrillic_DE] [Д])
(global-set-key [Cyrillic_dzhe] [ж])
(global-set-key [Cyrillic_DZHE] [Ж])
(global-set-key [Cyrillic_e] [э])
(global-set-key [Cyrillic_E] [Э])
(global-set-key [Cyrillic_ef] [ф])
(global-set-key [Cyrillic_EF] [Ф])
(global-set-key [Cyrillic_el] [л])
(global-set-key [Cyrillic_EL] [Л])
(global-set-key [Cyrillic_em] [м])
(global-set-key [Cyrillic_EM] [М])
(global-set-key [Cyrillic_en] [н])
(global-set-key [Cyrillic_EN] [H])
(global-set-key [Cyrillic_er] [р])
(global-set-key [Cyrillic_ER] [Р])
(global-set-key [Cyrillic_es] [с])
(global-set-key [Cyrillic_ES] [С])
(global-set-key [Cyrillic_ghe] [г])
(global-set-key [Cyrillic_GHE] [Г])
(global-set-key [Cyrillic_ha] [х])
(global-set-key [Cyrillic_HA] [Х])
(global-set-key [Cyrillic_hardsign] [ъ])
(global-set-key [Cyrillic_HARDSIGN] [Ъ])
(global-set-key [Cyrillic_i] [и])
(global-set-key [Cyrillic_I] [И])
(global-set-key [Cyrillic_ie] [е])
(global-set-key [Cyrillic_IE] [Е])
(global-set-key [Cyrillic_io] [ё])
(global-set-key [Cyrillic_IO] [Ё])
(global-set-key [Cyrillic_je] [f])
(global-set-key [Cyrillic_JE] [f])
(global-set-key [Cyrillic_ka] [к])
(global-set-key [Cyrillic_KA] [К])
(global-set-key [Cyrillic_o] [о])
(global-set-key [Cyrillic_O] [О])
(global-set-key [Cyrillic_pe] [п])
(global-set-key [Cyrillic_PE] [П])
(global-set-key [Cyrillic_sha] [ш])
(global-set-key [Cyrillic_SHA] [Ш])
(global-set-key [Cyrillic_shcha] [щ])
(global-set-key [Cyrillic_SHCHA] [Щ])
(global-set-key [Cyrillic_shorti] [й])
(global-set-key [Cyrillic_SHORTI] [Й])
(global-set-key [Cyrillic_softsign] [ь])
(global-set-key [Cyrillic_SOFTSIGN] [Ь])
(global-set-key [Cyrillic_te] [т])
(global-set-key [Cyrillic_TE] [Т])
(global-set-key [Cyrillic_tse] [ц])
(global-set-key [Cyrillic_TSE] [Ц])
(global-set-key [Cyrillic_u] [у])
(global-set-key [Cyrillic_U] [У])
(global-set-key [Cyrillic_ve] [в])
(global-set-key [Cyrillic_VE] [В])
(global-set-key [Cyrillic_ya] [я])
(global-set-key [Cyrillic_YA] [Я])
(global-set-key [Cyrillic_yeru] [ы])
(global-set-key [Cyrillic_YERU] [Ы])
(global-set-key [Cyrillic_yu] [ю])
(global-set-key [Cyrillic_YU] [Ю])
(global-set-key [Cyrillic_ze] [з])
(global-set-key [Cyrillic_ZE] [З])
(global-set-key [Cyrillic_zhe] [ж])
(global-set-key [Cyrillic_ZHE] [Ж])

(global-set-key [(meta Cyrillic_a)] [(meta f)])
(global-set-key [(meta Cyrillic_A)] [(meta F)])
(global-set-key [(meta Cyrillic_be)] [(meta ,)])
(global-set-key [(meta Cyrillic_BE)] [(meta <)])
(global-set-key [(meta Cyrillic_che)] [(meta x)])
(global-set-key [(meta Cyrillic_CHE)] [(meta X)])
(global-set-key [(meta Cyrillic_de)] [(meta l)])
(global-set-key [(meta Cyrillic_DE)] [(meta L)])
(global-set-key [(meta Cyrillic_dzhe)] [(meta \;)])
(global-set-key [(meta Cyrillic_DZHE)] [(meta :)])
(global-set-key [(meta Cyrillic_zhe)] [(meta \;)])
(global-set-key [(meta Cyrillic_ZHE)] [(meta :)])
(global-set-key [(meta Cyrillic_e)] [(meta \')])
(global-set-key [(meta Cyrillic_E)] [(meta \")])
(global-set-key [(meta Cyrillic_ef)] [(meta a)])
(global-set-key [(meta Cyrillic_EF)] [(meta A)])
(global-set-key [(meta Cyrillic_el)] [(meta k)])
(global-set-key [(meta Cyrillic_EL)] [(meta K)])
(global-set-key [(meta Cyrillic_em)] [(meta v)])
(global-set-key [(meta Cyrillic_EM)] [(meta V)])
(global-set-key [(meta Cyrillic_en)] [(meta y)])
(global-set-key [(meta Cyrillic_EN)] [(meta Y)])
(global-set-key [(meta Cyrillic_er)] [(meta h)])
(global-set-key [(meta Cyrillic_ER)] [(meta H)])
(global-set-key [(meta Cyrillic_es)] [(meta c)])
(global-set-key [(meta Cyrillic_ES)] [(meta C)])
(global-set-key [(meta Cyrillic_ghe)] [(meta u)])
(global-set-key [(meta Cyrillic_GHE)] [(meta U)])
(global-set-key [(meta Cyrillic_ha)] [(meta \[)])
(global-set-key [(meta Cyrillic_HA)] [(meta \{)])
(global-set-key [(meta Cyrillic_hardsign)] [(meta \])])
(global-set-key [(meta Cyrillic_HARDSIGN)] [(meta \})])
(global-set-key [(meta Cyrillic_i)] [(meta b)])
(global-set-key [(meta Cyrillic_I)] [(meta B)])
(global-set-key [(meta Cyrillic_ie)] [(meta t)])
(global-set-key [(meta Cyrillic_IE)] [(meta T)])
(global-set-key [(meta Cyrillic_io)] [(meta \`)])
(global-set-key [(meta Cyrillic_IO)] [(meta ~)])
(global-set-key [(meta Cyrillic_je)] [(meta q)])
(global-set-key [(meta Cyrillic_JE)] [(meta Q)])
(global-set-key [(meta Cyrillic_ka)] [(meta r)])
(global-set-key [(meta Cyrillic_KA)] [(meta R)])
(global-set-key [(meta Cyrillic_o)] [(meta j)])
(global-set-key [(meta Cyrillic_O)] [(meta J)])
(global-set-key [(meta Cyrillic_pe)] [(meta g)])
(global-set-key [(meta Cyrillic_PE)] [(meta G)])
(global-set-key [(meta Cyrillic_sha)] [(meta i)])
(global-set-key [(meta Cyrillic_SHA)] [(meta I)])
(global-set-key [(meta Cyrillic_shcha)] [(meta o)])
(global-set-key [(meta Cyrillic_SHCHA)] [(meta O)])
(global-set-key [(meta Cyrillic_shorti)] [(meta q)])
(global-set-key [(meta Cyrillic_SHORTI)] [(meta Q)])
(global-set-key [(meta Cyrillic_softsign)] [(meta m)])
(global-set-key [(meta Cyrillic_SOFTSIGN)] [(meta M)])
(global-set-key [(meta Cyrillic_te)] [(meta n)])
(global-set-key [(meta Cyrillic_TE)] [(meta N)])
(global-set-key [(meta Cyrillic_tse)] [(meta w)])
(global-set-key [(meta Cyrillic_TSE)] [(meta W)])
(global-set-key [(meta Cyrillic_u)] [(meta e)])
(global-set-key [(meta Cyrillic_U)] [(meta E)])
(global-set-key [(meta Cyrillic_ve)] [(meta d)])
(global-set-key [(meta Cyrillic_VE)] [(meta D)])
(global-set-key [(meta Cyrillic_ya)] [(meta z)])
(global-set-key [(meta Cyrillic_YA)] [(meta Z)])
(global-set-key [(meta Cyrillic_yeru)] [(meta s)])
(global-set-key [(meta Cyrillic_YERU)] [(meta S)])
(global-set-key [(meta Cyrillic_yu)] [(meta \.)])
(global-set-key [(meta Cyrillic_YU)] [(meta >)])
(global-set-key [(meta Cyrillic_ze)] [(meta p)])
(global-set-key [(meta Cyrillic_ZE)] [(meta P)])

(global-set-key [iso-next-group] [])

;;
;; Preview LaTeX onfly images view
(require 'tex-site)
(load "preview-latex")

;; X-Symbol
;;(load "x-symbol");

;; Don't use images in speedbar
(setq speedbar-use-images nil)
(setq speedbar-tag-split-minimum-length 200)
(setq speedbar-sort-tags t);

;; Xrefactory configuration part ;;
;; some Xrefactory defaults can be set here
(defvar xref-current-project nil) ;; can be also "my_project_name"
(defvar xref-key-binding 'local) ;; can be also 'local or 'none
(load "xrefactory")

(define-key c-mode-map                "\C-c\C-b"   'xref-popCxrefs)
(define-key c-mode-map                "\C-c\C-f"   'xref-pushCxrefs)
;; end of Xrefactory configuration part ;;

;; whizzytex
(autoload 'whizzytex-mode "whizzytex"
  "WhizzyTeX, a minor-mode WYSIWIG environment for LaTeX" t)
;;(require 'latex-toolbar)

;; Interface to dict
(require 'dictionary)
(setq dictionary-default-dictionary "*")
(global-set-key "\C-c=" 'dictionary-search)

;; semantics
(load "eieio")
;(setq semantic-load-turn-everything-on t)
(load "semantic-load")
(require 'semantic-sb)

;;cweb-mode
;;(load-library "cweb")

;;
(message ".emacs loaded")









; -*-Emacs-Lisp-*-

; Miguel A. Carreira-Perpinan's .xemacs-options file.
; Time-stamp: <98/09/19 17:02:37 miguel>

; I don't really know what to put in this file. At the moment it contains
; settings for colours and faces

; Faces for VM
(custom-set-faces
 '(message-cited-text ((t (:italic t :foreground "OrangeRed"))))
 '(message-header-contents ((t (:italic t :foreground "darkorchid"))))
 '(message-highlighted-header-contents ((t (:bold t :italic t :foreground "darkorchid"))))
 )
(setq
 highlight-headers-highlight-citation-too t
 )

; Other faces, created from the "Options -> Save Options" menu
;(if (featurep 'scrollbar) (progn (add-spec-list-to-specifier scrollbar-width 'nil) (add-spec-list-to-specifier scrollbar-height 'nil)))
;(add-spec-list-to-specifier modeline-shadow-thickness '((global (nil . 2))))
;(if (featurep 'toolbar) (progn (set-default-toolbar-position 'top) (add-spec-list-to-specifier default-toolbar-visible-p '((global (nil)))) (add-spec-list-to-specifier toolbar-buttons-captioned-p 'nil)))
;(make-face 'paren-blink-off)
;(make-face 'italic)
;(make-face 'yellow)
;(make-face 'default)
;(make-face 'font-lock-type-face)
;(make-face 'html-helper-underline-face)
;(make-face 'modeline-mousable)
;(make-face 'zmacs-region)
;(make-face 'modeline)
;(make-face 'highlight)
;(make-face 'gui-button-face)
;(make-face 'isearch)
;(make-face 'red)
;(make-face 'font-lock-reference-face)
;(make-face 'primary-selection)
;(make-face 'right-margin)
;(make-face 'font-lock-doc-string-face)
;(make-face 'bold)
;(make-face 'paren-match)
;(make-face 'font-lock-comment-face)
;(make-face 'font-lock-preprocessor-face)
;(make-face 'blue)
;(make-face 'html-helper-bold-face)
;(make-face 'modeline-buffer-id)
;(make-face 'underline)
;(make-face 'bold-italic)
;(make-face 'paren-mismatch)
;(make-face 'font-lock-function-name-face)
;(make-face 'modeline-mousable-minor-mode)
;(make-face 'pointer)
;(make-face 'list-mode-item-selected)
;(make-face 'html-helper-italic-face)
;(make-face 'left-margin)
;(make-face 'font-lock-string-face)
;(make-face 'green)
;(make-face 'font-lock-variable-name-face)
;(make-face 'secondary-selection)
;(make-face 'font-lock-keyword-face)
;(make-face 'text-cursor)
;(add-spec-list-to-specifier (face-property 'paren-blink-off 'foreground) '((global ((x) . "white"))))
;(add-spec-list-to-specifier (face-property 'italic 'font) '((global (nil . "6x13"))))
;(add-spec-list-to-specifier (face-property 'italic 'underline) '((global ((tty) . t))))
;(add-spec-list-to-specifier (face-property 'yellow 'foreground) '((global ((color) . "yellow"))))
;(add-spec-list-to-specifier (face-property 'default 'foreground) '((global ((x) . "black"))))
;(add-spec-list-to-specifier (face-property 'default 'background) '((global ((x) . "white"))))
;(add-spec-list-to-specifier (face-property 'default 'font) '((global (nil . "6x13"))))
;(add-spec-list-to-specifier (face-property 'font-lock-type-face 'foreground) '((global (nil . "#6920ac"))))
;(add-spec-list-to-specifier (face-property 'html-helper-underline-face 'underline) '((global (nil . t))))
;(add-spec-list-to-specifier (face-property 'modeline-mousable 'foreground) '((global ((color x) . "red") (nil . [#s(face name modeline)]))))
;(add-spec-list-to-specifier (face-property 'modeline-mousable 'background) '((global (nil . [#s(face name modeline)]))))
;(add-spec-list-to-specifier (face-property 'modeline-mousable 'font) '((global ((grayscale x) . [bold]) ((mono x) . [bold]) (nil . [#s(face name modeline)]))))
;(add-spec-list-to-specifier (face-property 'modeline-mousable 'background-pixmap) '((global ((x) . [inherit :face #s(face name modeline)]) ((tty) . [inherit :face #s(face name modeline)]) ((stream) . [inherit :face #s(face name modeline)]))))
;(add-spec-list-to-specifier (face-property 'modeline-mousable 'underline) '((global (nil . [#s(face name modeline)]))))
;(add-spec-list-to-specifier (face-property 'modeline-mousable 'strikethru) '((global (nil . [#s(face name modeline)]))))
;(add-spec-list-to-specifier (face-property 'modeline-mousable 'highlight) '((global (nil . [#s(face name modeline)]))))
;(add-spec-list-to-specifier (face-property 'modeline-mousable 'dim) '((global (nil . [#s(face name modeline)]))))
;(add-spec-list-to-specifier (face-property 'modeline-mousable 'blinking) '((global (nil . [#s(face name modeline)]))))
;(add-spec-list-to-specifier (face-property 'modeline-mousable 'reverse) '((global (nil . [#s(face name modeline)]))))
;(add-spec-list-to-specifier (face-property 'zmacs-region 'background) '((global ((grayscale) . "gray80") ((color) . "gray"))))
;(add-spec-list-to-specifier (face-property 'zmacs-region 'reverse) '((global ((tty) . t))))
;(add-spec-list-to-specifier (face-property 'modeline 'foreground) '((global ((x) . "Black"))))
;(add-spec-list-to-specifier (face-property 'modeline 'background) '((global ((x) . "Gray75"))))
;(add-spec-list-to-specifier (face-property 'modeline 'background-pixmap) '((global ((x) . [nothing]) ((tty) . [nothing]) ((stream) . [nothing]))))
;(add-spec-list-to-specifier (face-property 'modeline 'reverse) '((global ((tty) . t))))
;(add-spec-list-to-specifier (face-property 'highlight 'background) '((global ((color) . "darkseagreen2") ((color) . "green") ((grayscale) . "gray53"))))
;(add-spec-list-to-specifier (face-property 'highlight 'highlight) '((global ((tty) . t))))
;(add-spec-list-to-specifier (face-property 'gui-button-face 'foreground) '((global (nil . "black"))))
;(add-spec-list-to-specifier (face-property 'gui-button-face 'background) '((global (nil . "grey75"))))
;(add-spec-list-to-specifier (face-property 'isearch 'background) '((global ((color) . "paleturquoise") ((color) . "green"))))
;(add-spec-list-to-specifier (face-property 'isearch 'reverse) '((global ((tty) . t))))
;(add-spec-list-to-specifier (face-property 'red 'foreground) '((global ((color) . "red"))))
;(add-spec-list-to-specifier (face-property 'font-lock-reference-face 'foreground) '((global (nil . "red3") (nil . "red"))))
;(add-spec-list-to-specifier (face-property 'primary-selection 'background) '((global ((grayscale) . "gray80") ((color) . "gray"))))
;(add-spec-list-to-specifier (face-property 'primary-selection 'background-pixmap) '((global ((mono x) . [autodetect :data "gray3"]) ((mono tty) . [string :data "gray3"]))))
;(add-spec-list-to-specifier (face-property 'font-lock-doc-string-face 'foreground) '((global (nil . "green4") (nil . "green"))))
;(add-spec-list-to-specifier (face-property 'bold 'font) '((global (nil . "6x13bold"))))
;(add-spec-list-to-specifier (face-property 'bold 'highlight) '((global ((tty) . t))))
;(add-spec-list-to-specifier (face-property 'paren-match 'background) '((global ((color) . "darkseagreen2") ((color) . "green") ((grayscale) . "gray53"))))
;(add-spec-list-to-specifier (face-property 'paren-match 'highlight) '((global ((tty) . t))))
;(add-spec-list-to-specifier (face-property 'font-lock-comment-face 'foreground) '((global (nil . "red"))))
;(add-spec-list-to-specifier (face-property 'font-lock-preprocessor-face 'foreground) '((global (nil . "blue3") (nil . "blue"))))
;(add-spec-list-to-specifier (face-property 'blue 'foreground) '((global ((color) . "blue"))))
;(add-spec-list-to-specifier (face-property 'html-helper-bold-face 'font) '((global (nil . "6x13bold"))))
;(add-spec-list-to-specifier (face-property 'html-helper-bold-face 'highlight) '((global ((tty) . t))))
;(add-spec-list-to-specifier (face-property 'modeline-buffer-id 'foreground) '((global ((color x) . "blue") (nil . [#s(face name modeline)]))))
;(add-spec-list-to-specifier (face-property 'modeline-buffer-id 'background) '((global (nil . [#s(face name modeline)]))))
;(add-spec-list-to-specifier (face-property 'modeline-buffer-id 'font) '((global ((tty) . [bold-italic]) ((grayscale x) . [bold-italic]) ((mono x) . [bold-italic]) (nil . [#s(face name modeline)]))))
;(add-spec-list-to-specifier (face-property 'modeline-buffer-id 'background-pixmap) '((global ((x) . [inherit :face #s(face name modeline)]) ((tty) . [inherit :face #s(face name modeline)]) ((stream) . [inherit :face #s(face name modeline)]))))
;(add-spec-list-to-specifier (face-property 'modeline-buffer-id 'underline) '((global (nil . [#s(face name modeline)]))))
;(add-spec-list-to-specifier (face-property 'modeline-buffer-id 'strikethru) '((global (nil . [#s(face name modeline)]))))
;(add-spec-list-to-specifier (face-property 'modeline-buffer-id 'highlight) '((global (nil . [#s(face name modeline)]))))
;(add-spec-list-to-specifier (face-property 'modeline-buffer-id 'dim) '((global (nil . [#s(face name modeline)]))))
;(add-spec-list-to-specifier (face-property 'modeline-buffer-id 'blinking) '((global (nil . [#s(face name modeline)]))))
;(add-spec-list-to-specifier (face-property 'modeline-buffer-id 'reverse) '((global (nil . [#s(face name modeline)]))))
;(add-spec-list-to-specifier (face-property 'underline 'underline) '((global (nil . t))))
;(add-spec-list-to-specifier (face-property 'bold-italic 'font) '((global (nil . "6x13bold"))))
;(add-spec-list-to-specifier (face-property 'bold-italic 'underline) '((global ((tty) . t))))
;(add-spec-list-to-specifier (face-property 'bold-italic 'highlight) '((global ((tty) . t))))
;(add-spec-list-to-specifier (face-property 'paren-mismatch 'foreground) '((global ((grayscale x) . [modeline foreground]) ((mono x) . [modeline foreground]))))
;(add-spec-list-to-specifier (face-property 'paren-mismatch 'background) '((global ((grayscale x) . [modeline background]) ((mono x) . [modeline background]) ((color x) . "DeepPink"))))
;(add-spec-list-to-specifier (face-property 'paren-mismatch 'reverse) '((global ((tty) . t))))
;(add-spec-list-to-specifier (face-property 'font-lock-function-name-face 'foreground) '((global (nil . "blue3") (nil . "blue"))))
;(add-spec-list-to-specifier (face-property 'modeline-mousable-minor-mode 'foreground) '((global ((color x) . "green4") ((color x) . "green") (nil . [#s(face name modeline-mousable)]))))
;(add-spec-list-to-specifier (face-property 'modeline-mousable-minor-mode 'background) '((global (nil . [#s(face name modeline-mousable)]))))
;(add-spec-list-to-specifier (face-property 'modeline-mousable-minor-mode 'font) '((global (nil . [#s(face name modeline-mousable)]))))
;(add-spec-list-to-specifier (face-property 'modeline-mousable-minor-mode 'background-pixmap) '((global ((x) . [inherit :face #s(face name modeline-mousable)]) ((tty) . [inherit :face #s(face name modeline-mousable)]) ((stream) . [inherit :face #s(face name modeline-mousable)]))))
;(add-spec-list-to-specifier (face-property 'modeline-mousable-minor-mode 'underline) '((global (nil . [#s(face name modeline-mousable)]))))
;(add-spec-list-to-specifier (face-property 'modeline-mousable-minor-mode 'strikethru) '((global (nil . [#s(face name modeline-mousable)]))))
;(add-spec-list-to-specifier (face-property 'modeline-mousable-minor-mode 'highlight) '((global (nil . [#s(face name modeline-mousable)]))))
;(add-spec-list-to-specifier (face-property 'modeline-mousable-minor-mode 'dim) '((global (nil . [#s(face name modeline-mousable)]))))
;(add-spec-list-to-specifier (face-property 'modeline-mousable-minor-mode 'blinking) '((global (nil . [#s(face name modeline-mousable)]))))
;(add-spec-list-to-specifier (face-property 'modeline-mousable-minor-mode 'reverse) '((global (nil . [#s(face name modeline-mousable)]))))
;(add-spec-list-to-specifier (face-property 'list-mode-item-selected 'foreground) '((global ((mono x) . [default background]))))
;(add-spec-list-to-specifier (face-property 'list-mode-item-selected 'background) '((global ((mono x) . [default foreground]) ((grayscale) . "gray68") ((color) . "gray68"))))
;(add-spec-list-to-specifier (face-property 'list-mode-item-selected 'reverse) '((global ((tty) . t))))
;(add-spec-list-to-specifier (face-property 'html-helper-italic-face 'font) '((global (nil . "6x13"))))
;(add-spec-list-to-specifier (face-property 'html-helper-italic-face 'underline) '((global ((tty) . t))))
;(add-spec-list-to-specifier (face-property 'font-lock-string-face 'foreground) '((global (nil . "green4") (nil . "green"))))
;(add-spec-list-to-specifier (face-property 'green 'foreground) '((global ((color) . "green"))))
;(add-spec-list-to-specifier (face-property 'font-lock-variable-name-face 'foreground) '((global (nil . "blue3") (nil . "blue"))))
;(add-spec-list-to-specifier (face-property 'secondary-selection 'background) '((global ((grayscale) . "gray53") ((color) . "paleturquoise") ((color) . "green"))))
;(add-spec-list-to-specifier (face-property 'font-lock-keyword-face 'foreground) '((global (nil . "orange"))))
;(add-spec-list-to-specifier (face-property 'text-cursor 'foreground) '((global (nil . [default background]))))
;(add-spec-list-to-specifier (face-property 'text-cursor 'background) '((global ((x) . "Red3"))))
;(add-spec-list-to-specifier (face-property 'text-cursor 'reverse) '((global ((tty) . t))))

(defun goto-matching-paren ()
"Move cursor to matching paren."
(interactive)
(let* ((oldpos (point))
       (blinkpos))
 (condition-case ()
  (setq blinkpos (scan-sexps oldpos 1))
  (error nil))
 (if blinkpos (setq blinkpos (1- blinkpos))
  (condition-case ()
   (setq blinkpos (scan-sexps (1+ oldpos) -1))
   (error nil)))
 (condition-case ()
  (setq mismatch
   (/= (char-after oldpos)
    (logand (lsh (aref (syntax-table)
                  (char-after blinkpos))
             -8) 255)))
  (error (setq mismatch nil)))
 (if mismatch (setq blinkpos nil)
  (if blinkpos (goto-char blinkpos)))))

(global-set-key [ (control \() ] 'goto-matching-paren)

============== END ==============

lg ★★
()

забыл добавить что для
(setq c-type-bonus-types "\\|\\sw+_t\\|va_list\\|jmp_buf")

необходимо пропатчить font-lock.el
типа этого
....
(let ((c-keywords
;      ("break" "continue" "do" "else" "for" "if" "return" "switch" "while")
       "break\\|continue\\|do\\|else\\|for\\|if\\|return\\|switch\\|while")
      (c-type-types
;      ("auto" "extern" "register" "static" "typedef" "struct" "union" "enum"
;       "signed" "unsigned" "short" "long" "int" "char" "float" "double"
;       "void" "volatile" "const")
       (concat "auto\\|c\\(har\\|onst\\)\\|double\\|e\\(num\\|xtern\\)\\|"
               "float\\|int\\|long\\|register\\|"
               "s\\(hort\\|igned\\|t\\(atic\\|ruct\\)\\)\\|typedef\\|"
               "un\\(ion\\|signed\\)\\|vo\\(id\\|latile\\)" (if (boundp 'c-type-bonus-types) c-type-bonus
-types nil)))   ; 6 ()s deep.
      (c++-keywords
;      ("break" "continue" "do" "else" "for" "if" "return" "switch" "while"
.....

lg ★★
()

Спасибо ОГРОМНОЕ!!!!

Спасибо!
Пошел пробовать... :))))))

Александр.

anonymous
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.