Commit graph

355 commits

Author SHA1 Message Date
Daniel Colascione
bad7308e0c Fix previous commit (again) 2015-03-23 01:54:42 -07:00
Daniel Colascione
b8d7d7e8e6 Fix previous commit 2015-03-23 01:42:56 -07:00
Daniel Colascione
d235b1d261 Try to avoid fontifying macros in funcall position
* lisp/emacs-lisp/lisp-mode.el
(lisp--el-non-funcall-position-p): New function.
(lisp--el-match-keyword): Use it.
2015-03-23 01:38:20 -07:00
Tassilo Horn
fa734d07ab Handle setf methods in elisp font-locking.
* emacs-lisp/lisp-mode.el (lisp-el-font-lock-keywords-1): Also
recognize (cl-)defmethod with (setf method) name.
2015-03-21 08:52:34 +01:00
Tassilo Horn
73b8237c19 Fix CL function name font-lock bug.
* emacs-lisp/lisp-mode.el (lisp-cl-font-lock-keywords-1): Fix
false positive in function name font-locking.
2015-03-20 23:35:22 +01:00
Tassilo Horn
c9998fcbf4 Fix elisp function name font-lock bug.
* emacs-lisp/lisp-mode.el (lisp-el-font-lock-keywords-1): Fix
false positive in function name font-locking.
2015-03-20 23:09:06 +01:00
Tassilo Horn
9fdc166ee0 Improve dynamic elisp keyword font-locking
* emacs-lisp/byte-run.el (macro-declarations-alist): New
declaration no-font-lock-keyword.
(defmacro): Flush font-lock in existing elisp buffers.

* emacs-lisp/lisp-mode.el (lisp--el-update-after-load)
(lisp--el-update-macro-regexp, lisp--el-macro-regexp): Delete
functions and defconst.
(lisp--el-match-keyword): Rename from lisp--el-match-macro.
(lisp--el-font-lock-flush-elisp-buffers): New function.
(lisp-mode-variables): Remove code for updating
lisp--el-macro-regexp, and add
lisp--el-font-lock-flush-elisp-buffers to after-load-functions.
2015-03-18 07:44:01 +01:00
Tassilo Horn
51e7e463e9 Font-lock elisp macros/special forms dynamically
* emacs-lisp/lisp-mode.el (lisp--el-macro-regexp): New defconst.
(lisp--el-update-macro-regexp, lisp--el-update-after-load)
(lisp--el-match-macro): New functions.
(lisp-mode-variables): Update lisp--el-macro-regexp and add
lisp--el-update-after-load to after-load-functions.
2015-03-15 09:20:13 +01:00
Leo Liu
751adc4b96 Add macro pcase-lambda
Fixes: debbugs:19814

* emacs-lisp/lisp-mode.el (el-kws-re): Include `pcase-lambda'.

* emacs-lisp/macroexp.el (macroexp-parse-body): New function.

* emacs-lisp/pcase.el (pcase-lambda): New Macro.
2015-02-09 10:05:44 +08:00
Paul Eggert
7e09ef09a4 Update copyright year to 2015
Run admin/update-copyright.
2015-01-01 14:26:41 -08:00
Leo Liu
1148d37589 New macro define-advice
* doc/lispref/functions.texi (Advising Named Functions): Document
define-advice.

* lisp/emacs-lisp/nadvice.el (define-advice): New macro.
* lisp/emacs-lisp/lisp-mode.el (lisp-imenu-generic-expression): Add
define-advice.
(lisp-font-lock-keywords-1): Add define-advice.
2014-11-18 23:57:01 +08:00
Thien-Thi Nguyen
3ff1c9a8ea Font-lock `cl-flet*', too.
* lisp/emacs-lisp/lisp-mode.el (lisp-cl-font-lock-keywords-2):
Add "flet*" to intermediate var `cl-lib-kw'.
2014-09-28 10:03:48 +02:00
Stefan Monnier
e6cfa098ae Introduce global-eldoc-mode. Move Elisp-specific code to elisp-mode.el.
* lisp/emacs-lisp/eldoc.el (global-eldoc-mode): New minor mode.
(eldoc-schedule-timer): Obey it.
(eldoc-documentation-function): Default to nil.
(eldoc-mode): Don't enable if eldoc-documentation-function is not set.
(eldoc-documentation-function-default, eldoc-get-fnsym-args-string)
(eldoc-highlight-function-argument, eldoc-get-var-docstring)
(eldoc-last-data-store, eldoc-docstring-first-line)
(eldoc-docstring-format-sym-doc, eldoc-fnsym-in-current-sexp)
(eldoc-beginning-of-sexp, eldoc-current-symbol)
(eldoc-function-argstring): Move to elisp-mode.el.
(eldoc-symbol-function): Remove, unused.
* lisp/progmodes/elisp-mode.el: New file.  Rename all "eldoc-*" to "elisp--*".
(elisp-completion-at-point): Rename from lisp-completion-at-point.
(elisp--preceding-sexp): Rename from preceding-sexp.
* lisp/loadup.el: Load new file progmodes/elisp-mode.
* lisp/ielm.el (inferior-emacs-lisp-mode): Set eldoc-documentation-function.
* lisp/emacs-lisp/lisp.el (lisp--local-variables-1, lisp--local-variables)
(lisp--local-variables-completion-table, lisp--expect-function-p)
(lisp--form-quoted-p, lisp--company-doc-buffer)
(lisp--company-doc-string, lisp--company-location)
(lisp-completion-at-point): Move to elisp-mode.el.
* lisp/emacs-lisp/lisp-mode.el (lisp--mode-syntax-table): New syntax-table,
extracted from emacs-lisp-mode-syntax-table.
(emacs-lisp-mode-abbrev-table, emacs-lisp-mode-syntax-table): Move to
elisp-mode.el.
(lisp-imenu-generic-expression): Add comments to document what comes
from which Lisp dialect.
(emacs-lisp-mode-map, emacs-lisp-byte-compile)
(emacs-lisp-byte-compile-and-load, emacs-lisp-mode-hook)
(emacs-lisp-mode, emacs-list-byte-code-comment-re)
(emacs-lisp-byte-code-comment)
(emacs-lisp-byte-code-syntax-propertize, emacs-lisp-byte-code-mode)
(lisp-interaction-mode-map, lisp-interaction-mode)
(eval-print-last-sexp, last-sexp-setup-props)
(last-sexp-toggle-display, prin1-char, preceding-sexp)
(eval-last-sexp-1, eval-last-sexp-print-value)
(eval-last-sexp-fake-value, eval-sexp-add-defvars, eval-last-sexp)
(eval-defun-1, eval-defun-2, eval-defun): Move to elisp-mode.el.
* src/lisp.mk (lisp): Add elisp-mode.elc.
2014-09-26 23:57:41 -04:00
Leo Liu
85b3d352c7 * emacs-lisp/lisp-mode.el (lisp-el-font-lock-keywords-2): Add
pcase-exhaustive.

* emacs-lisp/pcase.el (pcase--dontwarn-upats): New var.
(pcase--expand): Use it.
(pcase-exhaustive): New macro.

Fixes: debbugs:16567
2014-09-14 00:30:21 +08:00
Robert Brown (tiny change)
96db005527 * etc/NEWS: New Tramp method "nc".
* lisp/emacs-lisp/lisp-mode.el (lisp-string-after-doc-keyword-p): New fun.
(lisp-string-in-doc-position-p): New function, extracted from
lisp-font-lock-syntactic-face-function.
(lisp-font-lock-syntactic-face-function): Use them.

Fixes: debbugs:9130
2014-06-19 10:03:45 -04:00
Glenn Morris
d63d883a97 Add with-file-modes macro, and use it
* lisp/subr.el (with-file-modes): New macro.

* lisp/printing.el (pr-save-file-modes):
* lisp/eshell/esh-util.el (eshell-with-file-modes): Make obsolete.

* lisp/emacs-lisp/lisp-mode.el (lisp-el-font-lock-keywords-2):
Add with-file-modes.

* lisp/doc-view.el (doc-view-make-safe-dir):
* lisp/epg.el (epg--start):
* lisp/files.el (locate-user-emacs-file, make-temp-file)
(backup-buffer-copy, move-file-to-trash):
* printing.el (pr-despool-print, pr-call-process, pr-text2ps):
* eshell/esh-util.el (eshell-with-private-file-modes)
(eshell-make-private-directory):
* lisp/net/browse-url.el (browse-url-mosaic):
* lisp/obsolete/mailpost.el (post-mail-send-it):
* lisp/obsolete/pgg-pgp.el (pgg-pgp-verify-region):
* lisp/obsolete/pgg-pgp5.el (pgg-pgp5-verify-region):
* lisp/url/url-util.el (url-make-private-file):
Use with-file-modes.

* doc/lispref/files.texi (Changing Files): Mention with-file-modes.

* etc/NEWS: Mention this.
2014-05-14 10:15:15 -07:00
Stefan Monnier
4eb436826b * lisp/emacs-lisp/lisp-mode.el (preceding-sexp): Exclude leading "," which
are a hindrance for C-x C-e.
2014-05-10 23:48:15 -04:00
Stefan Monnier
17a873c585 * lisp/emacs-lisp/lisp-mode.el (lisp--match-hidden-arg): Only highlight past
the last consecutive closing paren.

Fixes: debbugs:17345
2014-05-01 12:14:03 -04:00
Juanma Barranquero
dff4a9f6a4 Merge from emacs-24; up to 2014-04-25T10:35:01Z!michael.albinus@gmx.de 2014-04-25 18:11:07 +02:00
Leo Liu
00104e5923 * emacs-lisp/lisp-mode.el (emacs-lisp-mode-syntax-table):
Fix syntax for @.

Fixes: debbugs:17325
2014-04-24 08:55:18 +08:00
Stefan Monnier
4f96579371 * lisp/emacs-lisp/lisp-mode.el (lisp--match-hidden-arg): New function.
(lisp-el-font-lock-keywords-2, lisp-cl-font-lock-keywords-2): Use it.
(lisp-mode-variables): Set font-lock-extra-managed-props.
2014-04-22 13:45:43 -04:00
Leo Liu
722237d55e * emacs-lisp/lisp-mode.el (lisp-imenu-generic-expression): Add
define-compilation-mode.
2014-04-05 10:33:36 +08:00
Dmitry Gutov
4f8aeb84b6 Fix debbugs#16971
* lisp/emacs-lisp/lisp-mode.el (lisp-mode-variables): Set
`comment-use-syntax' to t to avoid the unnecessary runtime check.
Set `comment-start-skip' to a simpler value that doesn't try to
check if the semicolon is escaped (this is handled by
`syntax-ppss' now). 

* lisp/progmodes/scheme.el (scheme-mode-variables): Same.
2014-03-17 08:22:58 +02:00
Glenn Morris
34dc21db6e Replace "Maintainer: FSF" with the emacs-devel mailing address 2014-02-09 17:34:22 -08:00
Glenn Morris
ad78f43200 Replace refs to obsolete alias turn-on-eldoc-mode' with eldoc-mode'
* lisp/hexl.el (hexl-mode-hook):
* lisp/ielm.el (ielm-mode-hook):
* lisp/emacs-lisp/lisp-mode.el (emacs-lisp-mode-hook)
(lisp-interaction-mode-hook):
* lisp/progmodes/cfengine.e (cfengine3-documentation-function):
Replace obsolete alias `turn-on-eldoc-mode' with `eldoc-mode'.

* lisp/emacs-lisp/eldoc.el: Same in commentary.
2014-01-29 23:42:57 -08:00
Glenn Morris
1670e27f38 Doc fixes related to zero prefix argument of eval-expression etc
* emacs-lisp/lisp-mode.el (eval-print-last-sexp, eval-last-sexp):
* simple.el (eval-expression): Doc fixes.
2014-01-22 23:53:56 -08:00
Stefan Monnier
e18b70fc27 * lisp/emacs-lisp/lisp-mode.el (lisp-mode-variables): Don't bother with
syntax-begin-function.

Fixes: debbugs:16247
2014-01-03 17:38:55 -05:00
Paul Eggert
ba3189039a Update copyright year to 2014 by running admin/update-copyright. 2014-01-01 07:43:34 +00:00
Glenn Morris
f1a85e52c8 Revert unnecessary earlier change 2013-12-27 16:03:17 -08:00
Glenn Morris
b1797e3eeb * lisp/emacs-lisp/lisp-mode.el (lisp-mode-variables): Unbreak bootstrap. 2013-12-27 12:24:25 -08:00
João Távora
3b8d5131a3 Make Electric Pair mode smarter/more useful:
* lisp/electric.el: Pairing/skipping helps preserve
  balance. Autobackspacing behaviour. Opens extra newlines between
  pairs. Skip whitespace before closing delimiters.

* lisp/emacs-lisp/lisp-mode.el (lisp-mode-variables): Use new
  features.

* test/automated/electric-tests.lisp: New file.

* doc/emacs/programs.texi: Describe new features.

* lisp/simple.el: Pass non-nil interactive arg to newline call inside
  newline-and-indent.
2013-12-26 22:02:49 +00:00
Juri Linkov
b41594fd4d * lisp/simple.el (eval-expression-print-format): Don't check for
command names and the last command.  Always display additional
formats of the integer result in the echo area, and insert them
to the current buffer only with a zero prefix arg.
Display character when char-displayable-p is non-nil.
(eval-expression): With a zero prefix arg, set `print-length' and
`print-level' to nil, and insert the integer values from
`eval-expression-print-format' at the end.  Doc fix. 

* lisp/emacs-lisp/lisp-mode.el (eval-print-last-sexp): Add arg
`eval-last-sexp-arg-internal'.  Doc fix.
(eval-last-sexp-1): Pass arg `eval-last-sexp-arg-internal' to
`eval-last-sexp-print-value'.  Doc fix.
(eval-last-sexp-print-value): Add arg `eval-last-sexp-arg-internal'.
Set `print-length' and `print-level' to nil when arg is zero.
(eval-last-sexp): Doc fix.
(eval-defun-2): Print the integer values from
`eval-expression-print-format' at the end.

* lisp/emacs-lisp/edebug.el (edebug-eval-defun): Print the integer
values from `eval-expression-print-format' at the end.

* lisp/ielm.el (ielm-eval-input): Print the integer
values from `eval-expression-print-format' at the end.

Fixes: debbugs:12985
2013-12-19 23:02:46 +02:00
Bozhidar Batsov
ae1f1ce1e2 * lisp/progmodes/python.el (python-mode): Remove incorrect text from docstring.
* lisp/progmodes/scheme.el (scheme-mode): Remove incorrect text from docstring.
* lisp/progmodes/prolog.el (prolog-mode): Remove incorrect text from docstring.
* lisp/emacs-lisp/lisp-mode.el (lisp-mode, lisp-interaction-mode, emacs-lisp-mode):
Remove incorrect text from docstring.
2013-11-05 11:47:47 +02:00
Helmut Eller
60db713e4d * lisp/emacs-lisp/lisp-mode.el (lisp-cl-font-lock-keywords-2): Fix cut&paste.
Fixes: debbugs:15699
2013-10-24 13:49:12 -04:00
Stefan Monnier
0628651373 * lisp/emacs-lisp/lisp-mode.el: Font-lock cl-lib constructs.
(lisp-el-font-lock-keywords, lisp-el-font-lock-keywords-1)
(lisp-el-font-lock-keywords-2, lisp-cl-font-lock-keywords)
(lisp-cl-font-lock-keywords-1, lisp-cl-font-lock-keywords-2): New constants.
(lisp-mode-variables): New `elisp' argument.
(emacs-lisp-mode): Use it.
* lisp/font-lock.el (lisp-font-lock-keywords, lisp-font-lock-keywords-1)
(lisp-font-lock-keywords-2): Move to lisp-mode.el.
2013-10-08 10:57:18 -04:00
Stefan Monnier
a58332802b * lisp/emacs-lisp/lisp-mode.el (eval-defun-2): Simplify, using lexical-binding. 2013-10-07 01:11:50 -04:00
Juanma Barranquero
9d3aa82cf9 lisp/*.el: Silence lexical-binding warnings. 2013-08-09 01:59:14 +02:00
Juanma Barranquero
185e3b5a2f lisp/emacs-lisp/lisp-mode.el: Support cl-def* expressions in imenu. 2013-08-02 18:29:16 +02:00
Juanma Barranquero
14dd22d2ce Convert symbol prettification into minor mode and global minor mode.
* etc/NEWS: Document new Prettify Symbols mode.

* lisp/progmodes/prog-mode.el (prettify-symbols-alist): Rename from
  `prog-prettify-symbols', and make a local defvar instead of defcustom.
  (prettify-symbols--keywords): Rename from `prog-prettify-symbols-alist'
  and make a local defvar.
  (prettify-symbols--compose-symbol): Rename from
  `prog--prettify-font-lock-compose-symbol'.
  (prettify-symbols--make-keywords): Rename from
  `prog-prettify-font-lock-symbols-keywords' and simplify.
  (prog-prettify-install): Remove.
  (prettify-symbols-mode): New minor mode, based on `prog-prettify-install'.
  (turn-on-prettify-symbols-mode): New function.
  (global-prettify-symbols-mode): New globalized minor mode.

* lisp/emacs-lisp/lisp-mode.el (lisp-mode-variables):
* lisp/progmodes/cfengine.el (cfengine3-mode):
* lisp/progmodes/perl-mode.el (perl-mode): Don't call `prog-prettify-install';
  set `prettify-symbols-alist' instead.
2013-06-19 00:13:25 +02:00
Eli Zaretskii
d1ad37b23f Add coding cookie to lisp/emacs-lisp/lisp-mode.el. 2013-06-15 12:16:49 +03:00
Glenn Morris
7de135d06f lisp-mode font-lock fox for bug#14574
* lisp/emacs-lisp/lisp-mode.el (lisp-mode-variables):
Prettify after setting font-lock-defaults.
2013-06-11 14:00:27 -04:00
Ted Zlatanov
8fc57765e8 Introduce and use prog-prettify-install. 2013-06-05 13:48:50 -04:00
Ted Zlatanov
3ca0d0b437 Symbol prettify in prog-mode; added to perl-mode, cfengine3-mode, and emacs-lisp-mode. 2013-06-05 10:26:50 -04:00
Stefan Monnier
1f8fdd5391 * lisp/emacs-lisp/lisp-mode.el (eval-sexp-add-defvars): Expand macros
eagerly.

Fixes: debbugs:14422
2013-06-03 11:28:10 -04:00
Stefan Monnier
33e249a259 * lisp/emacs-lisp/lisp-mode.el (lisp-mode-shared-map): Inherit from
prog-mode-map.
2013-05-29 10:14:16 -04:00
Juri Linkov
32985194f2 * lisp/emacs-lisp/lisp-mode.el (eval-defun-2): Doc fix.
(eval-defun-2, eval-defun, eval-last-sexp, eval-last-sexp-1): Doc fix.
(emacs-lisp-mode-map): Replace "minibuffer" with "echo area"
in the help string.  (Bug#12985)

Fixes: debbugs:14344
2013-05-06 23:23:40 +03:00
Dmitry Gutov
bde73d2720 * lisp/emacs-lisp/lisp-mode.el (emacs-lisp-docstring-fill-column): Make
it safe-local.
2013-03-24 02:04:40 +04:00
Stefan Monnier
913274cbdc Don't use font-lock-syntax-table in lisp modes.
* lisp/font-lock.el (lisp-font-lock-keywords-1, lisp-font-lock-keywords-2):
Don't assume all identifier chars have syntax word.
* lisp/emacs-lisp/lisp-mode.el (lisp-mode-variables):
Remove bar-not-symbol.  Adjust callers.
(lisp-mode-variables): Don't set a font-lock-syntax-table.
2013-02-17 11:58:12 -05:00
Andreas Schwab
cc17363fc3 Fixes: debbugs:13556
* emacs-lisp/lisp-mode.el (lisp-mode-variables): Add optional
parameter BAR-NOT-SYMBOL to control syntax of | for font-lock.
(lisp-mode): Pass t for it.
2013-01-26 16:13:09 +01:00
Glenn Morris
a576cc76c8 * lisp-mode.el (emacs-lisp-mode-map): Add native profiler menu entries. 2013-01-19 18:40:49 -08:00