unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Extending 'emacs-lisp-mode' Disables 'auto-complete' for It
@ 2013-06-15 17:26 Haroogan
  2013-06-23 17:43 ` Haroogan
  0 siblings, 1 reply; 9+ messages in thread
From: Haroogan @ 2013-06-15 17:26 UTC (permalink / raw)
  To: help-gnu-emacs

Hello,

I've extended emacs-lisp-mode with my elisp-mode in order to provide 
more syntax highlighting. Relevant excerpt:

...

(define-derived-mode elisp-mode
   emacs-lisp-mode
   "?L"
   "A major mode for Emacs Lisp.
\\{elisp-mode-keymap}"
   (set 'font-lock-defaults '((elisp-mode-font-lock-keywords)))
   (set-syntax-table elisp-mode-syntax-table)
   (use-local-map elisp-mode-keymap)
   (run-hooks 'emacs-lisp-mode-hook); Tried `run-mode-hooks` as well...
   (run-mode-hooks 'elisp-mode-hook))

(provide 'elisp)

Then I have:

(add-hook 'emacs-lisp-mode-hook 'ac-emacs-lisp-mode-setup)

And of course:

(require 'elisp)

(add-to-list
  'auto-mode-alist
  '("\\.el" . elisp-mode))

Now the problem is that auto-completion doesn't work in elisp-mode.
I have no clue why.
As soon as I disable elisp-mode and return to the emacs-lisp-mode it 
works just fine.
I've also tried:

(add-hook 'elisp-mode-hook 'ac-emacs-lisp-mode-setup)

and without luck...

Any help is appreciated.
Thanks.




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Extending 'emacs-lisp-mode' Disables 'auto-complete' for It
  2013-06-15 17:26 Extending 'emacs-lisp-mode' Disables 'auto-complete' for It Haroogan
@ 2013-06-23 17:43 ` Haroogan
  2013-06-23 18:29   ` Michael Heerdegen
  0 siblings, 1 reply; 9+ messages in thread
From: Haroogan @ 2013-06-23 17:43 UTC (permalink / raw)
  To: help-gnu-emacs

Hello? Am I in the list? If yes, then could anyone experienced please 
look into my issue? Thanks.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Extending 'emacs-lisp-mode' Disables 'auto-complete' for It
  2013-06-23 17:43 ` Haroogan
@ 2013-06-23 18:29   ` Michael Heerdegen
  2013-06-23 21:26     ` Dmitry Gutov
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Heerdegen @ 2013-06-23 18:29 UTC (permalink / raw)
  To: help-gnu-emacs

Haroogan <haroogan@gmail.com> writes:

> Hello? Am I in the list? If yes, then could anyone experienced please
> look into my issue? Thanks.

Ok, I just installed `auto-complete' from Melpa and had a quick look.

Here, there is no function named `ac-emacs-lisp-mode-setup'.  If I just
call `auto-complete-mode', like this:

| (require 'auto-complete)
| 
| (add-hook 'emacs-lisp-mode-hook 'auto-complete-mode)

it seems to work.  Does this work for you?


Michael.




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Extending 'emacs-lisp-mode' Disables 'auto-complete' for It
  2013-06-23 18:29   ` Michael Heerdegen
@ 2013-06-23 21:26     ` Dmitry Gutov
  2013-06-23 22:10       ` Michael Heerdegen
  0 siblings, 1 reply; 9+ messages in thread
From: Dmitry Gutov @ 2013-06-23 21:26 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: help-gnu-emacs

Michael Heerdegen <michael_heerdegen@web.de> writes:

> Haroogan <haroogan@gmail.com> writes:
>
>> Hello? Am I in the list? If yes, then could anyone experienced please
>> look into my issue? Thanks.
>
> Ok, I just installed `auto-complete' from Melpa and had a quick look.
>
> Here, there is no function named `ac-emacs-lisp-mode-setup'.

This function is defined in `auto-complete-config.el`. It sets up
completion sources.

Maybe the OP should (require 'auto-complete-config).



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Extending 'emacs-lisp-mode' Disables 'auto-complete' for It
  2013-06-23 21:26     ` Dmitry Gutov
@ 2013-06-23 22:10       ` Michael Heerdegen
  2013-06-23 22:31         ` Haroogan
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Heerdegen @ 2013-06-23 22:10 UTC (permalink / raw)
  To: help-gnu-emacs

Dmitry Gutov <dgutov@yandex.ru> writes:

> This function is defined in `auto-complete-config.el`. It sets up
> completion sources.
>
> Maybe the OP should (require 'auto-complete-config).

Good hint.  If I do that, and create a new buffer, enter `elisp-mode'
(with the parts of code referencing to variables that the OP didn't send
along skipped), I see that the function `ac-emacs-lisp-mode-setup' has
been called, i.e., `ac-sources' has been set.

If I then turn on auto-complete-mode, it seems to work as intended.


Michael.



Michael.




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Extending 'emacs-lisp-mode' Disables 'auto-complete' for It
  2013-06-23 22:10       ` Michael Heerdegen
@ 2013-06-23 22:31         ` Haroogan
  2013-06-23 22:55           ` Michael Heerdegen
  0 siblings, 1 reply; 9+ messages in thread
From: Haroogan @ 2013-06-23 22:31 UTC (permalink / raw)
  To: help-gnu-emacs

> Good hint.  If I do that, and create a new buffer, enter `elisp-mode'
> (with the parts of code referencing to variables that the OP didn't send
> along skipped), I see that the function `ac-emacs-lisp-mode-setup' has
> been called, i.e., `ac-sources' has been set.
>
> If I then turn on auto-complete-mode, it seems to work as intended.
If I open some *.el file, I automatically enter my elisp-mode as shown 
in my first mail. But as I said auto-completion does not work even 
though the hook should turn it on. However, I've just tried your 
suggestion, i.e. after opening some *.el file, I type:

[M-x] auto-complete-mode

then auto-completion starts to work. Why is that? I mean in the 
configurations I already have:

(global-auto-complete-mode t)

Why should I turn on auto-completion manually like that for my 
elisp-mode, but I don't have to do anything for the standard 
emacs-lisp-mode?

Thanks,
Haroogan



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Extending 'emacs-lisp-mode' Disables 'auto-complete' for It
  2013-06-23 22:31         ` Haroogan
@ 2013-06-23 22:55           ` Michael Heerdegen
  2013-06-23 23:13             ` Haroogan
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Heerdegen @ 2013-06-23 22:55 UTC (permalink / raw)
  To: help-gnu-emacs

Haroogan <haroogan@gmail.com> writes:

> > Good hint.  If I do that, and create a new buffer, enter `elisp-mode'
> > (with the parts of code referencing to variables that the OP didn't send
> > along skipped), I see that the function `ac-emacs-lisp-mode-setup' has
> > been called, i.e., `ac-sources' has been set.
> >
> > If I then turn on auto-complete-mode, it seems to work as intended.
> If I open some *.el file, I automatically enter my elisp-mode as shown
> in my first mail. But as I said auto-completion does not work even
> though the hook should turn it on. However, I've just tried your
> suggestion, i.e. after opening some *.el file, I type:
>
> [M-x] auto-complete-mode
>
> then auto-completion starts to work.

So we are making some progress!

> Why is that? I mean in the
> configurations I already have:
>
> (global-auto-complete-mode t)
>
> Why should I turn on auto-completion manually like that for my
> elisp-mode, but I don't have to do anything for the standard
> emacs-lisp-mode?

Have a look at the definitions of `global-auto-complete-mode' and
`auto-complete-mode-maybe'.  Summary: you have to push your mode
variable into the variable `ac-modes' to make
`global-auto-complete-mode' turn on the thingy for your mode.

BTW, I wonder why you decided to derive an own mode, instead of simply
customize emacs-lisp-mode.  I mean, there is `font-lock-add-keywords'
and such stuff, which allows to modify the existing mode.  Using an own
mode sometimes has inconveniences - like the problem you described.


Michael.




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Extending 'emacs-lisp-mode' Disables 'auto-complete' for It
  2013-06-23 22:55           ` Michael Heerdegen
@ 2013-06-23 23:13             ` Haroogan
  2013-06-24  1:13               ` Michael Heerdegen
  0 siblings, 1 reply; 9+ messages in thread
From: Haroogan @ 2013-06-23 23:13 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 644 bytes --]

> BTW, I wonder why you decided to derive an own mode, instead of simply 
> customize emacs-lisp-mode. I mean, there is `font-lock-add-keywords' 
> and such stuff, which allows to modify the existing mode. Using an own 
> mode sometimes has inconveniences - like the problem you described. 
> Michael. 
Good point. Didn't know that I can do it. I'm not that pro in Emacs yet, 
so I'm not sure whether it is possible to extend all those features that 
I've added through derivation. I'm adding my elisp-mode as attachment, 
please, take a look if you have time. Can I, for example, extend 
emacs-lisp-mode with some keywords without derivation?

[-- Attachment #2: elisp.el --]
[-- Type: text/plain, Size: 32184 bytes --]

;; Copyright (C) 2013, Alexander Shukaev. All rights reserved.

;; This program is free software: you can redistribute it and/or modify it
;; under the terms of the GNU General Public License as published by the Free
;; Software Foundation, either version 3 of the License, or (at your option)
;; any later version.

;; This program is distributed in the hope that it will be useful, but WITHOUT
;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
;; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
;; more details.

;; You should have received a copy of the GNU General Public License along with
;; this program. If not, see <http://www.gnu.org/licenses/>.

(defvar elisp-mode-hook
  nil
  "Common hook for `elisp-mode'")

(defvar elisp-mode-emacs-keywords
  nil
  "A list of keywords related to Emacs")

(set 'elisp-mode-emacs-keywords
     '("add-hook"
       "autoload"
       "backward-char"
       "beginning-of-line"
       "bounds-of-thing-at-point"
       "buffer-file-name"
       "buffer-modified-p"
       "buffer-substring"
       "buffer-substring-no-properties"
       "called-interactively-p"
       "completing-read"
       "copy-directory"
       "copy-file"
       "current-buffer"
       "custom-autoload"
       "custom-set-faces"
       "defalias"
       "defconst"
       "defcustom"
       "define-derived-mode"
       "define-key"
       "defsubst"
       "delete-char"
       "delete-directory"
       "delete-file"
       "delete-region"
       "directory-files"
       "dolist"
       "dotimes"
       "end-of-line"
       "error"
       "expand-file-name"
       "file-directory-p"
       "file-exists-p"
       "file-name-directory"
       "file-name-extension"
       "file-name-nondirectory"
       "file-name-sans-extension"
       "file-regular-p"
       "file-relative-name"
       "find-file"
       "forward-char"
       "forward-line"
       "forward-sexp"
       "generate-new-buffer"
       "global-set-key"
       "global-unset-key"
       "goto-char"
       "insert-file-contents"
       "insert"
       "interactive"
       "kbd"
       "kill-all-local-variables"
       "kill-buffer"
       "line-beginning-position"
       "line-end-position"
       "local-set-key"
       "looking-at"
       "make-directory"
       "make-local-variable"
       "mark"
       "match-beginning"
       "match-end"
       "match-string"
       "narrow-to-region"
       "point"
       "point-max"
       "point-min"
       "pop-mark"
       "prefer-coding-system"
       "prefix-numeric-value"
       "push-mark"
       "re-search-backward"
       "re-search-forward"
       "read-directory-name"
       "read-file-name"
       "read-from-minibuffer"
       "read-regexp"
       "read-string"
       "region-active-p"
       "region-beginning"
       "region-end"
       "rename-file"
       "repeat"
       "replace-match"
       "replace-regexp"
       "replace-regexp-in-string"
       "run-hooks"
       "save-buffer"
       "save-excursion"
       "save-restriction"
       "search-backward"
       "search-backward-regexp"
       "search-forward"
       "search-forward-regexp"
       "set-buffer"
       "set-file-modes"
       "set-mark"
       "shell-command"
       "skip-chars-backward"
       "skip-chars-forward"
       "substring-no-properties"
       "thing-at-point"
       "user-error"
       "widget-get"
       "with-current-buffer"
       "with-temp-buffer"
       "with-temp-file"
       "write-file"
       "write-region"
       "y-or-n-p"
       "yes-or-no-p"
       "modify-syntax-entry"
       "make-sparse-keymap"
       "standard-syntax-table"
       "run-mode-hooks"
       "set-frame-font"
       "set-syntax-table"
       "use-local-map"
       "defface"
       "shell-command-to-string"
       "start-process"
       "next-buffer"
       "previous-buffer"
       "buffer-name"
       "insert-buffer-substring-no-properties"
       "erase-buffer"
       "append-to-file"
       "buffer-string"
       "switch-to-buffer"
       "with-output-to-temp-buffer"
       "setq-default"
       "shell-command-on-region"
       "parse-time-string"))

(defvar elisp-mode-elisp-builtins
  nil
  "A list of builtins related to Emacs Lisp")

(set 'elisp-mode-elisp-builtins
     '("&optional"))

(defvar elisp-mode-elisp-keywords
  nil
  "A list of keywords related to Emacs Lisp")

(set 'elisp-mode-elisp-keywords
     '("add-to-list"
       "and"
       "append"
       "apply"
       "aref"
       "aset"
       "assoc"
       "assq"
       "boundp"
       "car"
       "catch"
       "cdr"
       "char-to-string"
       "commandp"
       "concat"
       "cond"
       "condition-case"
       "cons"
       "consp"
       "defmacro"
       "defun"
       "elt"
       "eq"
       "equal"
       "expt"
       "fboundp"
       "featurep"
       "floatp"
       "format"
       "format-time-string"
       "funcall"
       "function"
       "get"
       "gethash"
       "hash-table-count"
       "if"
       "integerp"
       "lambda"
       "last"
       "length"
       "let"
       "let*"
       "list"
       "load"
       "make-hash-table"
       "mapc"
       "mapcar"
       "mapconcat"
       "maphash"
       "max"
       "member"
       "memq"
       "message"
       "min"
       "nil"
       "not"
       "nth"
       "nthcdr"
       "null"
       "number-to-string"
       "or"
       "pop"
       "prin1"
       "princ"
       "print"
       "progn"
       "provide"
       "push"
       "put"
       "puthash"
       "quote"
       "random"
       "rassoc"
       "regexp-opt"
       "regexp-quote"
       "remhash"
       "require"
       "reverse"
       "set"
       "setq"
       "sleep-for"
       "sort"
       "split-string"
       "string"
       "string-equal"
       "string-match"
       "string-match-p"
       "string-to-number"
       "string="
       "stringp"
       "subrp"
       "substring"
       "symbol-function"
       "symbol-name"
       "symbol-plist"
       "symbol-value"
       "symbolp"
       "t"
       "throw"
       "unless"
       "vector"
       "when"
       "while"
       "defvar"
       "float"))

(defvar elisp-mode-elisp-variables-1
  nil
  "A list of variables related to Emacs Lisp")

(set 'elisp-mode-elisp-variables-1
     '("Buffer-menu-buffer+size-width"
       "Buffer-menu-mode-width"
       "Buffer-menu-name-width"
       "Buffer-menu-size-width"
       "Buffer-menu-use-frame-buffer-list"
       "Buffer-menu-use-header-line"
       "Info-default-directory-list"
       "Info-split-threshold"
       "abbrev-all-caps"
       "abbrev-file-name"
       "ad-default-compilation-action"
       "ad-redefinition-action"
       "adaptive-fill-first-line-regexp"
       "adaptive-fill-function"
       "adaptive-fill-mode"
       "adaptive-fill-regexp"
       "add-log-current-defun-function"
       "add-log-full-name"
       "add-log-mailing-address"
       "after-save-hook"
       "allout-auto-activation"
       "allout-widgets-auto-activation"
       "apropos-compact-layout"
       "apropos-do-all"
       "apropos-documentation-sort-by-scores"
       "apropos-match-face"
       "apropos-sort-by-scores"
       "async-shell-command-buffer"
       "auth-source-cache-expiry"
       "auto-coding-alist"
       "auto-coding-functions"
       "auto-coding-regexp-alist"
       "auto-compression-mode"
       "auto-encryption-mode"
       "auto-fill-inhibit-regexp"
       "auto-hscroll-mode"
       "auto-image-file-mode"
       "auto-insert-mode"
       "auto-mode-alist"
       "auto-mode-case-fold"
       "auto-save-default"
       "auto-save-file-name-transforms"
       "auto-save-interval"
       "auto-save-list-file-prefix"
       "auto-save-timeout"
       "auto-save-visited-file-name"
       "autoarg-kp-mode"
       "autoarg-mode"
       "automatic-hscrolling"
       "automount-dir-prefix"
       "backup-by-copying"
       "backup-by-copying-when-linked"
       "backup-by-copying-when-mismatch"
       "backup-by-copying-when-privileged-mismatch"
       "backup-directory-alist"
       "backward-delete-char-untabify-method"
       "bahai-holidays"
       "baud-rate"
       "bdf-directory-list"
       "before-save-hook"
       "bidi-paragraph-direction"
       "blink-cursor"
       "blink-cursor-alist"
       "blink-cursor-delay"
       "blink-cursor-interval"
       "blink-cursor-mode"
       "blink-matching-delay"
       "blink-matching-paren"
       "blink-matching-paren-distance"
       "blink-matching-paren-dont-ignore-comments"
       "blink-matching-paren-on-screen"
       "break-hardlink-on-save"
       "browse-url-browser-function"
       "buffer-offer-save"
       "buffers-menu-buffer-name-length"
       "buffers-menu-max-size"
       "buffers-menu-show-directories"
       "buffers-menu-show-status"
       "case-fold-search"
       "case-replace"
       "change-major-mode-with-file-name"
       "charset-map-path"
       "christian-holidays"
       "colon-double-space"
       "column-number-mode"
       "comment-auto-fill-only-comments"
       "comment-column"
       "comment-empty-lines"
       "comment-fill-column"
       "comment-inline-offset"
       "comment-multi-line"
       "comment-padding"
       "comment-style"
       "compilation-ask-about-save"
       "compilation-disable-input"
       "compilation-mode-hook"
       "compilation-search-path"
       "compilation-start-hook"
       "compilation-window-height"
       "compile-command"
       "completion-auto-help"
       "completion-category-overrides"
       "completion-cycle-threshold"
       "completion-ignored-extensions"
       "completion-in-region-mode"
       "completion-pcm-complete-word-inserts-delimiters"
       "completion-pcm-word-delimiters"
       "completion-show-help"
       "completion-styles"
       "completions-format"
       "compose-mail-user-agent-warnings"
       "confirm-kill-emacs"
       "confirm-nonexistent-file-or-buffer"
       "create-lockfiles"
       "crisp-mode"
       "ctl-arrow"
       "cua-mode"
       "current-language-environment"
       "cursor-in-non-selected-windows"
       "custom-browse-sort-alphabetically"
       "custom-buffer-sort-alphabetically"
       "custom-enabled-themes"
       "custom-file"
       "custom-menu-sort-alphabetically"
       "custom-safe-themes"
       "custom-theme-directory"
       "custom-theme-load-path"
       "cvs-dired-action"
       "cvs-dired-use-hook"
       "debug-ignored-errors"
       "debug-on-error"
       "debug-on-event"
       "debug-on-quit"
       "debug-on-signal"
       "default-directory"
       "default-frame-alist"
       "default-input-method"
       "default-justification"
       "defun-prompt-regexp"
       "delete-active-region"
       "delete-auto-save-files"
       "delete-by-moving-to-trash"
       "delete-exited-processes"
       "delete-old-versions"
       "delete-selection-mode"
       "delete-trailing-lines"
       "desktop-locals-to-save"
       "desktop-save-mode"
       "diff-command"
       "diff-switches"
       "directory-abbrev-alist"
       "directory-free-space-args"
       "directory-free-space-program"
       "dired-kept-versions"
       "dired-listing-switches"
       "display-battery-mode"
       "display-buffer-alist"
       "display-buffer-base-action"
       "display-buffer-function"
       "display-buffer-reuse-frames"
       "display-hourglass"
       "display-mm-dimensions-alist"
       "display-time-day-and-date"
       "display-time-mode"
       "dnd-open-file-other-window"
       "dnd-open-remote-file-function"
       "dnd-protocol-alist"
       "double-click-fuzz"
       "double-click-time"
       "dynamic-completion-mode"
       "echo-keystrokes"
       "edebug-all-defs"
       "edebug-all-forms"
       "eldoc-minor-mode-string"
       "electric-indent-mode"
       "electric-layout-mode"
       "electric-pair-mode"
       "emacs-lisp-docstring-fill-column"
       "emacs-lisp-mode-hook"
       "emacs-major-version"
       "emacs-minor-version"
       "enable-kinsoku"
       "enable-local-eval"
       "enable-local-variables"
       "enable-recursive-minibuffers"
       "enable-remote-dir-locals"
       "eol-mnemonic-dos"
       "eol-mnemonic-mac"
       "eol-mnemonic-undecided"
       "eol-mnemonic-unix"
       "epa-file-inhibit-auto-save"
       "epa-file-name-regexp"
       "epa-global-mail-mode"
       "erc-track-minor-mode"
       "eval-expression-debug-on-error"
       "eval-expression-print-length"
       "eval-expression-print-level"
       "even-window-heights"
       "exec-path"
       "exec-suffixes"
       "exit-language-environment-hook"
       "face-font-family-alternatives"
       "face-font-registry-alternatives"
       "face-font-selection-order"
       "face-x-resources"
       "facemenu-add-face-function"
       "facemenu-end-add-face"
       "facemenu-keybindings"
       "facemenu-listed-faces"
       "facemenu-new-faces-at-end"
       "facemenu-remove-face-function"
       "fancy-splash-image"
       "ff-special-constructs"
       "file-coding-system-alist"
       "file-name-at-point-functions"
       "file-name-shadow-mode"
       "file-name-shadow-properties"
       "file-name-shadow-tty-properties"
       "file-precious-flag"
       "fill-column"
       "fill-individual-varying-indent"
       "fill-nobreak-invisible"
       "fill-nobreak-predicate"
       "fill-prefix"
       "find-directory-functions"
       "find-file-existing-other-name"
       "find-file-hook"
       "find-file-hooks"
       "find-file-run-dired"
       "find-file-suppress-same-file-warnings"
       "find-file-visit-truename"
       "find-file-wildcards"
       "find-tag-default-function"
       "find-tag-hook"
       "fit-frame-to-buffer"
       "fit-frame-to-buffer-bottom-margin"
       "focus-follows-mouse"
       "font-list-limit"
       "font-lock-defaults"
       "font-lock-global-modes"
       "font-lock-maximum-decoration"
       "font-lock-maximum-size"
       "font-lock-support-mode"
       "font-lock-verbose"
       "font-use-system-font"
       "frame-auto-hide-function"
       "frame-background-mode"
       "fringe-mode"
       "garbage-collection-messages"
       "gc-cons-percentage"
       "gc-cons-threshold"
       "gdb-enable-debug"
       "general-holidays"
       "global-auto-revert-mode"
       "global-cwarn-mode"
       "global-ede-mode"
       "global-font-lock-mode"
       "global-hi-lock-mode"
       "global-highlight-changes-mode"
       "global-hl-line-mode"
       "global-linum-mode"
       "global-mark-ring-max"
       "global-reveal-mode"
       "global-subword-mode"
       "global-visual-line-mode"
       "global-whitespace-mode"
       "global-whitespace-newline-mode"
       "glyphless-char-display-control"
       "gnus-select-method"
       "gnutls-min-prime-bits"
       "goal-column"
       "gpm-mouse-mode"
       "grep-command"
       "grep-find-command"
       "grep-setup-hook"
       "grep-window-height"
       "gud-tooltip-mode"
       "hebrew-holidays"
       "help-at-pt-display-when-idle"
       "help-char"
       "help-enable-auto-load"
       "help-event-list"
       "help-mode-hook"
       "help-window-select"
       "highlight-nonselected-windows"
       "hippie-expand-try-functions-list"
       "history-delete-duplicates"
       "history-length"
       "holiday-bahai-holidays"
       "holiday-christian-holidays"
       "holiday-general-holidays"
       "holiday-hebrew-holidays"
       "holiday-islamic-holidays"
       "holiday-local-holidays"
       "holiday-oriental-holidays"
       "holiday-other-holidays"
       "holiday-solar-holidays"
       "hourglass-delay"
       "hscroll-margin"
       "hscroll-step"
       "icomplete-mode"
       "icon-map-list"
       "idle-update-delay"
       "ido-mode"
       "image-file-name-extensions"
       "image-file-name-regexps"
       "image-load-path"
       "imagemagick-enabled-types"
       "imagemagick-types-inhibit"
       "imenu-sort-function"
       "indent-tabs-mode"
       "indicate-buffer-boundaries"
       "indicate-empty-lines"
       "indicate-unused-lines"
       "inhibit-default-init"
       "inhibit-eol-conversion"
       "inhibit-local-menu-bar-menus"
       "inhibit-splash-screen"
       "inhibit-startup-buffer-menu"
       "inhibit-startup-echo-area-message"
       "inhibit-startup-message"
       "inhibit-startup-screen"
       "initial-buffer-choice"
       "initial-frame-alist"
       "initial-major-mode"
       "initial-scratch-message"
       "input-method-activate-hook"
       "input-method-after-insert-chunk-hook"
       "input-method-deactivate-hook"
       "input-method-highlight-flag"
       "input-method-inactivate-hook"
       "input-method-use-echo-area"
       "input-method-verbose-flag"
       "insert-default-directory"
       "inverse-video"
       "isearch-allow-scroll"
       "isearch-hide-immediately"
       "isearch-lazy-highlight"
       "isearch-lazy-highlight-cleanup"
       "isearch-lazy-highlight-initial-delay"
       "isearch-lazy-highlight-interval"
       "isearch-lazy-highlight-max-at-a-time"
       "isearch-resume-in-command-history"
       "islamic-holidays"
       "ispell-personal-dictionary"
       "iswitchb-mode"
       "jit-lock-chunk-size"
       "jit-lock-context-time"
       "jit-lock-contextually"
       "jit-lock-defer-contextually"
       "jit-lock-defer-time"
       "jit-lock-stealth-load"
       "jit-lock-stealth-nice"
       "jit-lock-stealth-time"
       "jit-lock-stealth-verbose"
       "jka-compr-compression-info-list"
       "jka-compr-load-suffixes"
       "jka-compr-mode-alist-additions"
       "jka-compr-verbose"
       "kept-new-versions"
       "kept-old-versions"
       "keyboard-coding-system"
       "keypad-numlock-setup"
       "keypad-numlock-shifted-setup"
       "keypad-setup"
       "keypad-shifted-setup"
       "kill-do-not-save-duplicates"
       "kill-read-only-ok"
       "kill-ring-max"
       "kill-whole-line"
       "language-info-custom-alist"
       "large-file-warning-threshold"
       "last-command"
       "latex-block-names"
       "latex-inputenc-coding-alist"
       "latex-run-command"
       "latin1-display"
       "latin1-display-ucs-per-lynx"
       "lazy-highlight-cleanup"
       "lazy-highlight-initial-delay"
       "lazy-highlight-interval"
       "lazy-highlight-max-at-a-time"
       "left-margin"
       "line-move-ignore-invisible"
       "line-move-visual"
       "line-number-display-limit"
       "line-number-display-limit-width"
       "line-number-mode"
       "line-spacing"
       "lisp-body-indent"
       "lisp-indent-function"
       "lisp-indent-offset"
       "lisp-interaction-mode-hook"
       "lisp-mode-hook"
       "list-colors-sort"
       "list-directory-brief-switches"
       "list-directory-verbose-switches"
       "list-matching-lines-buffer-name-face"
       "list-matching-lines-default-context-lines"
       "list-matching-lines-face"))

(defvar elisp-mode-elisp-variables-2
  nil
  "A list of variables related to Emacs Lisp")

(set 'elisp-mode-elisp-variables-2
     '("expression"
       "font-lock-builtin-face"
       "font-lock-comment-delimiter-face"
       "font-lock-comment-face"
       "font-lock-constant-face"
       "font-lock-doc-face"
       "font-lock-function-name-face"
       "font-lock-keyword-face"
       "font-lock-negation-char-face"
       "font-lock-preprocessor-face"
       "font-lock-reference-face"
       "font-lock-string-face"
       "font-lock-type-face"
       "font-lock-variable-name-face"
       "font-lock-warning-face"
       "load-path"
       "local-holidays"
       "locate-ls-subdir-switches"
       "lpr-command"
       "lpr-switches"
       "ls-lisp-support-shell-wildcards"
       "mail-abbrevs-mode"
       "mail-archive-file-name"
       "mail-citation-hook"
       "mail-citation-prefix-regexp"
       "mail-complete-style"
       "mail-default-directory"
       "mail-default-headers"
       "mail-default-reply-to"
       "mail-dont-reply-to-names"
       "mail-from-style"
       "mail-header-separator"
       "mail-hist-keep-history"
       "mail-host-address"
       "mail-indentation-spaces"
       "mail-interactive"
       "mail-mailing-lists"
       "mail-personal-alias-file"
       "mail-self-blind"
       "mail-setup-hook"
       "mail-signature"
       "mail-signature-file"
       "mail-specify-envelope-from"
       "mail-use-rfc822"
       "mail-user-agent"
       "mail-yank-prefix"
       "major-mode"
       "make-backup-file-name-function"
       "make-backup-files"
       "make-cursor-line-fully-visible"
       "make-pointer-invisible"
       "mark-active"
       "mark-even-if-inactive"
       "mark-ring-max"
       "max-lisp-eval-depth"
       "max-mini-window-height"
       "max-specpdl-size"
       "menu-bar-mode"
       "menu-prompting"
       "message-log-max"
       "messages-buffer-max-lines"
       "meta-prefix-char"
       "minibuffer-auto-raise"
       "minibuffer-depth-indicate-mode"
       "minibuffer-electric-default-mode"
       "minibuffer-frame-alist"
       "minibuffer-history-case-insensitive-variables"
       "minibuffer-prompt-properties"
       "mode-line-default-help-echo"
       "mode-line-format"
       "mode-line-in-non-selected-windows"
       "mode-name"
       "mode-require-final-newline"
       "mouse-1-click-follows-link"
       "mouse-1-click-in-non-selected-windows"
       "mouse-autoselect-window"
       "mouse-avoidance-mode"
       "mouse-buffer-menu-maxlen"
       "mouse-buffer-menu-mode-mult"
       "mouse-drag-copy-region"
       "mouse-highlight"
       "mouse-scroll-delay"
       "mouse-scroll-min-lines"
       "mouse-wheel-click-event"
       "mouse-wheel-down-event"
       "mouse-wheel-follow-mouse"
       "mouse-wheel-inhibit-click-time"
       "mouse-wheel-mode"
       "mouse-wheel-progressive-speed"
       "mouse-wheel-scroll-amount"
       "mouse-wheel-up-event"
       "mouse-yank-at-point"
       "msb-mode"
       "next-error-highlight"
       "next-error-highlight-no-select"
       "next-error-hook"
       "next-error-recenter"
       "next-line-add-newlines"
       "next-screen-context-lines"
       "no-redraw-on-reenter"
       "normal-erase-is-backspace"
       "occur-excluded-properties"
       "occur-hook"
       "occur-mode-find-occurrence-hook"
       "occur-mode-hook"
       "only-global-abbrevs"
       "open-paren-in-column-0-is-defun-start"
       "oriental-holidays"
       "other-holidays"
       "overflow-newline-into-fringe"
       "overline-margin"
       "package-enable-at-startup"
       "page-delimiter"
       "paragraph-ignore-fill-prefix"
       "paragraph-separate"
       "paragraph-start"
       "parens-require-spaces"
       "parse-sexp-ignore-comments"
       "password-cache"
       "password-cache-expiry"
       "polling-period"
       "pop-up-frame-alist"
       "pop-up-frame-function"
       "pop-up-frames"
       "pop-up-windows"
       "pre-abbrev-expand-hook"
       "printer-name"
       "process-connection-type"
       "ps-page-dimensions-database"
       "ps-paper-type"
       "ps-print-color-p"
       "query-replace-from-history-variable"
       "query-replace-highlight"
       "query-replace-lazy-highlight"
       "query-replace-show-replacement"
       "query-replace-skip-read-only"
       "query-replace-to-history-variable"
       "rcirc-track-minor-mode"
       "read-buffer-completion-ignore-case"
       "read-buffer-function"
       "read-file-name-completion-ignore-case"
       "read-mail-command"
       "read-quoted-char-radix"
       "recenter-positions"
       "recenter-redisplay"
       "recentf-mode"
       "regexp-search-ring-max"
       "register-separator"
       "remote-file-name-inhibit-cache"
       "remote-shell-program"
       "replace-lax-whitespace"
       "replace-regexp-lax-whitespace"
       "require-final-newline"
       "revert-without-query"
       "rmail-displayed-headers"
       "rmail-dont-reply-to-names"
       "rmail-file-name"
       "rmail-highlighted-headers"
       "rmail-ignored-headers"
       "rmail-primary-inbox-list"
       "rmail-retry-ignored-headers"
       "rmail-secondary-file-directory"
       "rmail-secondary-file-regexp"
       "rmail-show-message-hook"
       "rmail-spool-directory"
       "rmail-user-mail-address-regexp"
       "safe-local-eval-forms"
       "safe-local-variable-values"
       "same-window-buffer-names"
       "same-window-regexps"
       "save-abbrevs"
       "save-interprogram-paste-before-kill"
       "savehist-mode"
       "scalable-fonts-allowed"
       "scroll-all-mode"
       "scroll-bar-mode"
       "scroll-conservatively"
       "scroll-down-aggressively"
       "scroll-error-top-bottom"
       "scroll-margin"
       "scroll-preserve-screen-position"
       "scroll-step"
       "scroll-up-aggressively"
       "search-exit-option"
       "search-highlight"
       "search-invisible"
       "search-nonincremental-instead"
       "search-ring-max"
       "search-ring-update"
       "search-slow-speed"
       "search-slow-window-lines"
       "search-upper-case"
       "search-whitespace-regexp"
       "select-active-regions"
       "selection-coding-system"
       "selective-display-ellipses"
       "semantic-default-submodes"
       "semantic-mode"
       "send-mail-function"
       "sentence-end"
       "sentence-end-base"
       "sentence-end-double-space"
       "sentence-end-without-period"
       "sentence-end-without-space"
       "server-mode"
       "set-language-environment-hook"
       "set-mark-command-repeat-pop"
       "set-mark-default-inactive"
       "shell-dumb-shell-regexp"
       "shell-file-name"
       "shift-select-mode"
       "show-paren-mode"
       "show-paren-style"
       "show-trailing-whitespace"
       "site-run-file"
       "size-indication-mode"
       "slitex-run-command"
       "small-temporary-file-directory"
       "solar-holidays"
       "special-display-buffer-names"
       "special-display-frame-alist"
       "special-display-function"
       "special-display-regexps"
       "split-height-threshold"
       "split-width-threshold"
       "split-window-keep-point"
       "split-window-preferred-function"
       "standard-indent"
       "strokes-mode"
       "suggest-key-bindings"
       "switch-to-buffer-preserve-window-point"
       "switch-to-visible-buffer"
       "system-type"
       "tab-always-indent"
       "tab-stop-list"
       "tab-width"
       "table-cell-map-hook"
       "table-load-hook"
       "table-point-entered-cell-hook"
       "table-point-left-cell-hook"
       "tags-add-tables"
       "tags-case-fold-search"
       "tags-compression-info-list"
       "tags-table-list"
       "temp-buffer-max-height"
       "temp-buffer-resize-mode"
       "temp-buffer-show-function"
       "temporary-file-directory"
       "term-file-prefix"
       "tex-alt-dvi-print-command"
       "tex-bibtex-command"
       "tex-close-quote"
       "tex-default-mode"
       "tex-directory"
       "tex-dvi-print-command"
       "tex-dvi-view-command"
       "tex-first-line-header-regexp"
       "tex-main-file"
       "tex-offer-save"
       "tex-open-quote"
       "tex-run-command"
       "tex-shell-file-name"
       "tex-show-queue-command"
       "tex-start-commands"
       "tex-start-options"
       "texinfo-close-quote"
       "texinfo-open-quote"
       "text-mode-hook"
       "this-command"
       "three-step-help"
       "timer-max-repeats"
       "tool-bar-max-label-size"
       "tool-bar-mode"
       "tool-bar-position"
       "tool-bar-style"
       "tooltip-delay"
       "tooltip-frame-parameters"
       "tooltip-hide-delay"
       "tooltip-mode"
       "tooltip-recent-seconds"
       "tooltip-short-delay"
       "tooltip-use-echo-area"
       "tooltip-x-offset"
       "tooltip-y-offset"
       "tpu-edt-mode"
       "trace-buffer"
       "track-eol"
       "tramp-mode"
       "tramp-syntax"
       "transient-mark-mode"
       "trash-directory"
       "truncate-lines"
       "truncate-partial-width-windows"
       "tutorial-directory"
       "type-break-mode"
       "underline-minimum-offset"
       "undo-ask-before-discard"
       "undo-limit"
       "undo-outer-limit"
       "undo-strong-limit"
       "unibyte-display-via-language-environment"
       "unify-8859-on-decoding-mode"
       "unify-8859-on-encoding-mode"
       "url-debug"
       "url-handler-mode"
       "use-dialog-box"
       "use-empty-active-region"
       "use-file-dialog"
       "user-full-name"
       "user-mail-address"
       "vc-before-checkin-hook"
       "vc-checkin-hook"
       "vc-checkout-hook"
       "vc-consult-headers"
       "vc-directory-exclusion-list"
       "vc-display-status"
       "vc-follow-symlinks"
       "vc-handled-backends"
       "vc-ignore-dir-regexp"
       "vc-keep-workfiles"
       "vc-make-backup-files"
       "vc-mistrust-permissions"
       "vc-rcs-master-templates"
       "vc-sccs-master-templates"
       "vc-stay-local"
       "version-control"
       "vertical-centering-font-regexp"
       "view-read-only"
       "view-remove-frame-by-deleting"
       "visible-bell"
       "visible-cursor"
       "visual-line-fringe-indicators"
       "void-text-area-pointer"
       "which-function-mode"
       "window-combination-limit"
       "window-combination-resize"
       "window-min-height"
       "window-min-width"
       "window-sides-slots"
       "window-sides-vertical"
       "window-system"
       "winner-mode"
       "woman-locale"
       "word-wrap"
       "words-include-escapes"
       "x-bitmap-file-path"
       "x-dnd-known-types"
       "x-dnd-test-function"
       "x-dnd-types-alist"
       "x-gtk-file-dialog-help-text"
       "x-gtk-show-hidden-files"
       "x-gtk-stock-map"
       "x-gtk-use-old-file-dialog"
       "x-gtk-use-system-tooltips"
       "x-gtk-whole-detached-tool-bar"
       "x-select-enable-clipboard"
       "x-select-enable-clipboard-manager"
       "x-select-enable-primary"
       "x-select-request-type"
       "x-stretch-cursor"
       "x-underline-at-descent-line"
       "x-use-underline-position-properties"
       "xterm-mouse-mode"
       "yank-excluded-properties"
       "yank-handled-properties"
       "yank-menu-length"
       "yank-pop-change-selection"
       "user-emacs-directory"))

(set
 'elisp-mode-font-lock-keywords
 (let ((emacs-keywords    (regexp-opt elisp-mode-emacs-keywords    'symbols))
       (elisp-builtins    (regexp-opt elisp-mode-elisp-builtins    'symbols))
       (elisp-keywords    (regexp-opt elisp-mode-elisp-keywords    'symbols))
       (elisp-variables-1 (regexp-opt elisp-mode-elisp-variables-1 'symbols))
       (elisp-variables-2 (regexp-opt elisp-mode-elisp-variables-2 'symbols)))
   `((,emacs-keywords    . font-lock-function-name-face)
     (,elisp-builtins    . font-lock-type-face)
     (,elisp-keywords    . font-lock-keyword-face)
     (,elisp-variables-1 . font-lock-variable-name-face)
     (,elisp-variables-2 . font-lock-variable-name-face))))

;; font-lock-comment-delimiter-face
;; font-lock-comment-face
;; font-lock-doc-face
;; font-lock-negation-char-face
;; font-lock-preprocessor-face
;; font-lock-reference-face
;; font-lock-string-face
;; font-lock-type-face
;; font-lock-variable-name-face
;; font-lock-warning-face

(defvar elisp-mode-keymap
  nil
  "Keymap for `elisp-mode'")

(progn
  (set 'elisp-mode-keymap (make-sparse-keymap)))

(defvar elisp-mode-syntax-table
  nil
  "Syntax table for `elisp-mode'")

(set 'elisp-mode-syntax-table
     (let ((syntax-table (make-syntax-table)))
       (modify-syntax-entry ?\; "< b" syntax-table)
       (modify-syntax-entry ?\n "> b" syntax-table)
       (modify-syntax-entry ?` "'   " syntax-table)
       (modify-syntax-entry ?' "'   " syntax-table)
       (modify-syntax-entry ?, "'   " syntax-table)
       (modify-syntax-entry ?@ "'   " syntax-table)
       syntax-table))

(define-derived-mode elisp-mode
  emacs-lisp-mode
  "ξL"
  "A major mode for Emacs Lisp.
\\{elisp-mode-keymap}"
  (set 'font-lock-defaults '((elisp-mode-font-lock-keywords)))
  (set-syntax-table elisp-mode-syntax-table)
  (use-local-map elisp-mode-keymap)
  (run-hooks 'emacs-lisp-mode-hook)
  (run-mode-hooks 'elisp-mode-hook))

(provide 'elisp)

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Extending 'emacs-lisp-mode' Disables 'auto-complete' for It
  2013-06-23 23:13             ` Haroogan
@ 2013-06-24  1:13               ` Michael Heerdegen
  0 siblings, 0 replies; 9+ messages in thread
From: Michael Heerdegen @ 2013-06-24  1:13 UTC (permalink / raw)
  To: help-gnu-emacs

Haroogan <haroogan@gmail.com> writes:

> Good point. Didn't know that I can do it. I'm not that pro in Emacs
> yet, so I'm not sure whether it is possible to extend all those
> features that I've added through derivation. I'm adding my elisp-mode
> as attachment, please, take a look if you have time. Can I, for
> example, extend emacs-lisp-mode with some keywords without derivation?

Yes, I think, that's exactly what `font-lock-add-keywords' does - see
its documentation - and the elisp manual, e.g. (elisp) Customizing
Keywords.

I don't yet know the logic behind your code.  What exactly do you want
to highlight - do you want functions/variables of any special kind?  I
mean, In Lisp, the layout of the code already reveals which symbols will
be interpreted as functions.  Probably that's why functions are not
highlighted.


Regards,

Michael.




^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-06-24  1:13 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-15 17:26 Extending 'emacs-lisp-mode' Disables 'auto-complete' for It Haroogan
2013-06-23 17:43 ` Haroogan
2013-06-23 18:29   ` Michael Heerdegen
2013-06-23 21:26     ` Dmitry Gutov
2013-06-23 22:10       ` Michael Heerdegen
2013-06-23 22:31         ` Haroogan
2013-06-23 22:55           ` Michael Heerdegen
2013-06-23 23:13             ` Haroogan
2013-06-24  1:13               ` Michael Heerdegen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).