c-mode

face font in c-mode when adding new keyword

笑着哭i 提交于 2020-01-11 13:05:15
问题 I am trying to customize some added words to be colored differently from the default face-font colors. This is what I am doing: (defconst lconfig-font-lock-faces (list '(font-lock-function-name-face ((((class color)) (:foreground "DarkBlue" :bold t)))) '(font-lock-constant-face ((((class color)) (:foreground "Black" :bold t)))) '(font-lock-builtin-face ((((class color)) (:foreground nil)))) '(font-lock-preprocessor-face ((((class color)) (:foreground nil)))) ) ) (autoload 'custom-set-faces

Emacs comment-region in C mode

China☆狼群 提交于 2019-12-12 10:36:10
问题 In GNU Emacs, is there a good way to change the comment-region command in C mode from /* This is a comment which extends */ /* over more than one line in C. */ to /* This is a comment which extends over more than one line in C. */ ? I have tried (setq comment-multi-line t) but this does not help. There is a section on multi-line comments in the Emacs manual, but it does not mention anything. 回答1: Since Emacs 21, there's been a module named 'newcomment, which has different comment styles (see

Turning on linum-mode when in python/c mode

▼魔方 西西 提交于 2019-12-05 20:42:08
问题 I want to turn on linum mode (M-x linum-mode) automatically with python and c mode. I add the following code in .emacs, but it doesn't seem to work. (defun my-c-mode-common-hook () (line-number-mode 1)) (add-hook 'c-mode-common-hook 'my-c-mode-common-hook) (defun my-python-mode-common-hook () (line-number-mode 1)) (add-hook 'python-mode-common-hook 'my-python-mode-common-hook) What might be wrong? 回答1: line-number-mode and linum-mode are not the same. Try this: (defun my-c-mode-hook () (linum

face font in c-mode when adding new keyword

不羁岁月 提交于 2019-12-02 09:26:25
I am trying to customize some added words to be colored differently from the default face-font colors. This is what I am doing: (defconst lconfig-font-lock-faces (list '(font-lock-function-name-face ((((class color)) (:foreground "DarkBlue" :bold t)))) '(font-lock-constant-face ((((class color)) (:foreground "Black" :bold t)))) '(font-lock-builtin-face ((((class color)) (:foreground nil)))) '(font-lock-preprocessor-face ((((class color)) (:foreground nil)))) ) ) (autoload 'custom-set-faces "font-lock" "Set the color scheme" t) (autoload 'font-lock-fontify-buffer "font-lock" "Fontify Buffer" t)