aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/emacs-lisp/smie.el
Commit message (Collapse)AuthorAgeFilesLines
* * lisp/emacs-lisp/smie.el (smie-config--guess): Fix typo.Stefan Monnier2014-06-201-6/+5
| | | | | | (smie-config-guess): Use smie-config-local so the rules are obeyed. Fixes: debbugs:17818
* * lisp/emacs-lisp/smie.el (smie--hanging-eolp-function): New var.Stefan Monnier2014-06-191-4/+10
| | | | | | | (smie-indent--hanging-p): Use it. * lisp/progmodes/sh-script.el (sh-set-shell): Set it. Fixes: debbugs:17621
* * lisp/emacs-lisp/smie.el (smie-next-sexp): Fix up "other-end" info whenStefan Monnier2014-06-131-1/+4
| | | | | | bumping forward into a closing paren. Fixes: debbugs:17761
* Small smie.el doc and fixGlenn Morris2014-03-041-3/+7
| | | | | | | | * lisp/emacs-lisp/smie.el (smie-config-guess): Doc fix. Explicit error if no grammar. (smie-config-save): Doc fix. Fix quote typo. * etc/NEWS: Related edit.
* Update copyright year to 2014 by running admin/update-copyright.Paul Eggert2014-01-011-1/+1
|
* Add missing custom :versions, plus small fixesGlenn Morris2013-12-271-0/+5
| | | | | | | | | | | | | | | | | | | | | | * emacs-lisp/smie.el (smie-config): Add type, version, initialize. * bookmark.el (bookmark-bmenu-use-header-line): * doc-view.el (doc-view-scale-internally): * pcmpl-x.el (pcmpl-x-tlmgr-program, pcmpl-x-ack-program): * register.el (register-preview-delay): * net/shr.el (shr-bullet): * progmodes/cfengine.el (cfengine-cf-promises) (cfengine-parameters-indent): * progmodes/octave.el (inferior-octave-error-regexp-alist): * textmodes/reftex-vars.el (reftex-label-regexps): * vc/log-edit.el (log-edit-setup-add-author): Add version. * cedet/ede/linux.el (project-linux-build-directory-default) (project-linux-architecture-default): Fix custom types. Add version. * gnus/gnus-icalendar.el (gnus-icalendar-org, gnus-icalendar): * gnus/gnus-sum.el (gnus-subthread-sort-functions): Add version. * gnus/gnus-sync.el (gnus-sync-file-encrypt-to): Add type and version.
* Fix bug#16116Dmitry Gutov2013-12-171-9/+20
| | | | | | | | | | * lisp/emacs-lisp/smie.el (smie-indent--rule): Extract `smie-indent--rule-1'. (smie-indent-close): Call `smie-indent--rule-1' with METHOD :close-all, to see which indentation method to use. (smie-rules-function): Document the method :close-all. * test/indent/ruby.rb: Update examples according to the change in `smie-indent-close'.
* * lisp/emacs-lisp/smie.el (smie-indent--hanging-p): Don't bother matchingStefan Monnier2013-12-111-1/+1
| | | | | | comment-start-skip, since it fails when that uses submatch 1. Fixes: debbugs:16041
* * lisp/rect.el (rectangle--highlight-for-redisplay):Stefan Monnier2013-11-041-2/+2
| | | | | * lisp/emacs-lisp/smie.el (smie--next-indent-change): Use buffer-chars-modified-tick.
* * lisp/emacs-lisp/smie.el (smie-rule-parent): Always callStefan Monnier2013-11-031-9/+10
| | | | | | | smie-indent-virtual rather than only for hanging tokens. (smie--next-indent-change): New helper command. * lisp/progmodes/ruby-mode.el (ruby-smie--rule-parent-skip-assign): Remove. (ruby-smie-rules): Use smie-rule-parent instead.
* * lisp/emacs-lisp/smie.el: New smie-config system.Stefan Monnier2013-10-241-4/+350
| | | | | | | | | | | | | | | | | | | | | | (smie-config): New defcustom. (smie-edebug, smie-config-show-indent, smie-config-set-indent) (smie-config-guess, smie-config-save): New commands. (smie-config--mode-local, smie-config--buffer-local) (smie-config--trace, smie-config--modefuns): New vars. (smie-config--advice, smie-config--mode-hook) (smie-config--setter, smie-config-local, smie-config--get-trace) (smie-config--guess-value, smie-config--guess): New functions. (smie-indent-forward-token, smie-indent-backward-token): Don't copy text properties. Treat "string fence" syntax like string syntax. * lisp/progmodes/sh-script.el (sh-use-smie): Change default. (sh-smie-sh-rules, sh-smie-rc-rules): Obey legacy sh-indent-* vars. (sh-var-value): Simplify by CSE. (sh-show-indent, sh-set-indent, sh-learn-line-indent) (sh-learn-buffer-indent): Redirect to their SMIE equivalent when SMIE is used. (sh-guess-basic-offset): Use cl-incf. (sh-guess-basic-offset): Use push+nreverse to avoid O(n^2).
* * lisp/emacs-lisp/smie.el (smie-rule-parent): Fix opener-test.Stefan Monnier2013-10-221-1/+2
| | | | | | * lisp/progmodes/ruby-mode.el (ruby-smie-rules): Remove corresponding workaround. Fix indentation rule of ";" so it also applies when ";" is the parent.
* * lisp/emacs-lisp/smie.el (smie--matching-block-data): Invalidate theDmitry Gutov2013-10-111-3/+5
| | | | | cache also after commands that modify the buffer but don't move point.
* * lisp/emacs-lisp/smie.el (smie-next-sexp): Refine last fix.Stefan Monnier2013-10-071-3/+5
| | | | | * lisp/progmodes/ruby-mode.el (ruby-smie-rules): Tweak handling of open braces.
* Get Ruby's SMIE code to pass the test suite.Stefan Monnier2013-10-051-1/+1
| | | | | | | | | | | | | | | | | | | | | * lisp/progmodes/ruby-mode.el (ruby-use-smie): Change default. (ruby-comment-column): Follow the global default, by default. (ruby-smie-grammar): Add assignment syntax. (ruby-smie--implicit-semi-p): No implicit semi-colon after an open-paren, a comma, or a \. (ruby-smie--forward-token, ruby-smie--backward-token): Handle heredocs, and line continuations. (ruby-smie-rules): Adjust handling of open-paren, now that it's never followed by implicit semi-colons. Add rule for string concatenation and for indentation at BOB. (ruby-forward-sexp, ruby-backward-sexp): Adjust for when smie is in use. * lisp/emacs-lisp/smie.el (smie-next-sexp): Don't go back to pos before calling next-sexp, since next-token may have skipped chars which next-sexp doesn't know should be skipped! * test/indent/ruby.rb: Port a few cases from automated/ruby-mode-tests.el. Adjust indentation of continued line to the new SMIE behavior.
* * lisp/emacs-lisp/smie.el: Improve show-paren-mode behavior.Stefan Monnier2013-06-071-54/+84
| | | | | | | (smie--opener/closer-at-point): New function. (smie--matching-block-data): Use it. Don't match from right after an opener or right before a closer. Obey smie-blink-matching-inners. Don't signal a mismatch for repeated inners like "switch..case..case".
* * newcomment.el (comment-search-backward): Revert last change.Leo Liu2013-06-071-17/+17
| | | | | | | | | * emacs-lisp/smie.el (smie--matching-block-data): Minor simplification. * progmodes/octave.el (octave-mode): Set comment-use-global-state to t. (Bug#14303) Fixes: debbugs:14434 debbugs:14303
* Re-implement smie matching block highlight using show-paren-data-function. Leo Liu2013-06-051-83/+60
| | | | | | | | | | | | | | | | | * emacs-lisp/smie.el (smie-matching-block-highlight) (smie--highlight-matching-block-overlay) (smie--highlight-matching-block-lastpos) (smie-highlight-matching-block) (smie-highlight-matching-block-mode): Remove. (smie--matching-block-data-cache): New variable. (smie--matching-block-data): New function. (smie-setup): Use smie--matching-block-data for show-paren-data-function. * progmodes/octave.el (octave-mode-menu): Fix. (octave-find-definition): Skip garbage lines. Fixes: debbugs:14395
* * lisp/emacs-lisp/smie.el (smie-highlight-matching-block): Always turnLeo Liu2013-05-291-9/+6
| | | | | | | | | off the highlight first. * lisp/progmodes/octave.el (octave-indent-comment): Tweak regexps. (octave-help): Small simplification. * test/indent/octave.m: Tweak.
* * lisp/emacs-lisp/smie.el (smie-auto-fill): Rework to be more robust.Stefan Monnier2013-05-241-55/+58
| | | | | | | | | | | (smie-setup): Use add-function to set it. * lisp/progmodes/octave.el (octave-smie-rules): Return nil rather than 0 after a semi-colon; it works better for smie-auto-fill. (octave--indent-new-comment-line): New function. (octave-indent-new-comment-line): Use it (indirectly). (octave-mode): Don't disable smie-auto-fill. Use add-function to modify comment-line-break-function.
* * lisp/emacs-lisp/smie.el (smie-indent-forward-token)Stefan Monnier2013-05-231-2/+12
| | | | | | (smie-indent-backward-token): Handle string tokens. Fixes: debbugs:14381
* * emacs-lisp/smie.el (smie-highlight-matching-block-mode): CleanLeo Liu2013-05-171-6/+12
| | | | | | | | up when turned off. (smie--highlight-matching-block-overlay): No longer buffer-local. (smie-highlight-matching-block): Adjust. Fixes: debbugs:14395
* * emacs-lisp/smie.el (smie-matching-block-highlight): New face.Leo Liu2013-05-171-2/+82
| | | | | | | | | | | (smie--highlight-matching-block-overlay) (smie--highlight-matching-block-lastpos) (smie--highlight-matching-block-timer): New variables. (smie-highlight-matching-block): New function. (smie-highlight-matching-block-mode): New minor mode. (smie-setup): Conditionally enable smie-blink-matching-open. Fixes: debbugs:14395
* * lisp/progmodes/octave-mod.el (octave-smie-forward-token): Only emitStefan Monnier2013-04-241-12/+24
| | | | | | | | | | semi-colons if the line is not otherwise empty. * lisp/emacs-lisp/smie.el (smie-indent--hanging-p): Don't burp at EOB. (smie-indent-keyword): Improve the check to ensure that the next comment is really on the same line. (smie-indent-comment): Don't align with a subsequent closer (or eob). Fixes: debbugs:14218
* * lisp/emacs-lisp/smie.el (smie-auto-fill): Don't inf-loop if there's noStefan Monnier2013-03-141-25/+28
| | | | | | token before point. Fixes: debbugs:13942
* Update copyright notices for 2013.Paul Eggert2013-01-011-1/+1
|
* Miscellaneous minor cleanups and simplifications.Stefan Monnier2012-06-231-7/+6
| | | | | | | | | | | * lisp/help-fns.el (describe-variable): Don't croak when doc is not found. * lisp/vc/pcvs.el (cvs-retrieve-revision): Avoid toggle-read-only. * lisp/menu-bar.el (menu-bar-line-wrapping-menu): Purecopy a tiny bit more. * lisp/emacs-lisp/syntax.el (syntax-ppss): Simplify with new `if' place. * lisp/emacs-lisp/smie.el (smie-next-sexp): CSE. * lisp/emacs-lisp/macroexp.el (macroexp-let2): Fix edebug spec and avoid ((lambda ..) ..). * lisp/emacs-lisp/eieio.el (eieio-oref, slot-value): Use simpler defsetf.
* Provide generalized variables in core Elisp.Stefan Monnier2012-06-221-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/gv.el: New file. * lisp/subr.el (push, pop): Extend to generalized variables. * lisp/loadup.el (macroexp): Unload if preloaded and uncompiled. * lisp/emacs-lisp/cl-lib.el (cl-pop, cl-push, cl--set-nthcdr): Remove. * lisp/emacs-lisp/cl-macs.el: Require gv. Use gv-define-setter, gv-define-simple-setter, and gv-define-expander. Remove setf-methods defined in gv. Rename cl-setf -> setf. (cl-setf, cl-do-pop, cl-get-setf-method): Remove. (cl-letf, cl-letf*, cl-define-modify-macro, cl-defsetf) (cl-define-setf-expander, cl-struct-setf-expander): Move to cl.el. (cl-remf, cl-shiftf, cl-rotatef, cl-callf, cl-callf2): Rewrite with gv-letplace. (cl-defstruct): Don't define setf-method any more. * lisp/emacs-lisp/cl.el (flet): Don't autoload. (cl--letf, letf, cl--letf*, letf*, cl--gv-adapt) (define-setf-expander, defsetf, define-modify-macro) (cl-struct-setf-expander): Move from cl-lib.el. * lisp/emacs-lisp/syntax.el: * lisp/emacs-lisp/ewoc.el: * lisp/emacs-lisp/smie.el: * lisp/emacs-lisp/cconv.el: * lisp/emacs-lisp/timer.el: Rename cl-setf -> setf, cl-push -> push. (timer--time): Use gv-define-simple-setter. * lisp/emacs-lisp/macroexp.el (macroexp-let2): Rename from macroexp-let² to avoid coding-system problems in subr.el. Adjust all users. (macroexp--maxsize, macroexp-small-p): New functions. * lisp/emacs-lisp/bytecomp.el (byte-compile-file): Don't use cl-letf. * lisp/scroll-bar.el (scroll-bar-mode): * lisp/simple.el (auto-fill-mode, overwrite-mode, binary-overwrite-mode) (normal-erase-is-backspace-mode): Don't use the `eq' place. * lisp/winner.el (winner-configuration, winner-make-point-alist) (winner-set-conf, winner-get-point, winner-set): Don't abuse letf. * lisp/files.el (locate-file-completion-table): Avoid list*. Fixes: debbugs:11657
* Reduce use of cl in lisp/emacs-lisp/.Stefan Monnier2012-06-101-54/+57
| | | | | | | | | * lisp/emacs-lisp/timer.el, lisp/emacs-lisp/syntax.el, lisp/emacs-lisp/smie.el: * lisp/emacs-lisp/ewoc.el, lisp/emacs-lisp/cconv.el,lisp/emacs-lisp/derived.el: * lisp/emacs-lisp/byte-opt.el, lisp/emacs-lisp/autoload.el: Convert to cl-lib. * lisp/emacs-lisp/easymenu.el, lisp/emacs-lisp/easy-mmode.el: * lisp/emacs-lisp/bytecomp.el: Use pcase instead of `cl'. * lisp/emacs-lisp/cl-lib.el: Get rid of special cl-macs auto load.
* * lisp/emacs-lisp/smie.el (smie-indent--bolp-1): New function.Stefan Monnier2012-05-151-2/+24
| | | | (smie-indent-keyword): Use it.
* *** empty log message ***Stefan Monnier2012-05-131-2/+4
|
* lisp/*: Add declarations, remove unused bindings, mark unused args.Juanma Barranquero2012-04-191-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/avoid.el (mouse-avoidance-mode): Mark unused arg. (mouse-avoidance-nudge-mouse): Remove unused binding. * lisp/imenu.el (imenu-default-goto-function): Mark unused args. (imenu-progress-message): Remove obsolete macro; all callers changed. * lisp/mouse.el (mouse-menu-major-mode-map): * lisp/emacs-lisp/authors.el (authors-scan-change-log) (authors-add-to-author-list): * lisp/emacs-lisp/avl-tree.el (avl-tree--enter-balance): * lisp/emacs-lisp/smie.el (smie-auto-fill): * lisp/mail/sendmail.el (mail-bury): * lisp/mail/unrmail.el (unrmail): * lisp/net/tls.el (open-tls-stream): * lisp/textmodes/picture.el (picture-mouse-set-point): Remove unused bindings. * lisp/subr.el (keymap-canonicalize): Remove unused binding. (read-passwd): Mark unused arg. * lisp/tutorial.el (tutorial--display-changes): Remove unused binding. (tutorial--save-tutorial-to): Remove unused variable. * lisp/emacs-lisp/package.el (define-package, package-menu-mark-delete) (package-menu-mark-install, package-menu-mark-unmark): Mark unused args. (package-generate-autoloads, package-menu--generate) (package-menu--find-upgrades): Remove unused bindings. * lisp/emulation/cua-rect.el (cua-restrict-regexp-rectangle) (cua-restrict-prefix-rectangle): Doc fixes. Remove unused bindings. (cua--mouse-ignore, cua--delete-rectangle, cua--extract-rectangle) (cua--indent-rectangle, cua-open-rectangle, cua-close-rectangle) (cua-blank-rectangle, cua-string-rectangle, cua-replace-in-rectangle) (cua-incr-rectangle, cua-sequence-rectangle, cua--convert-rectangle-as) (cua--rectangle-aux-replace, cua--left-fill-rectangle) (cua-scroll-rectangle-up, cua-scroll-rectangle-down) (cua-delete-char-rectangle): Mark unused args. (cua-align-rectangle): Remove unused binding. * lisp/mail/rmail.el (compilation--message->loc) (epa--find-coding-system-for-mime-charset): Declare. * lisp/net/dbus.el (dbus-register-service): Declare. (dbus-name-owner-changed-handler): Remove unused binding. * lisp/nxml/nxml-mode.el (nxml-electric-slash, nxml-in-mixed-content-p) (nxml-compute-indent-from-matching-start-tag): Remove unused variables. (nxml-scan-backward-within): Mark unused arg. (nxml-dynamic-markup-word): Remove unused binding.
* Merge from trunkStefan Monnier2012-03-251-53/+117
|\
| * Fix dead link in smie.elLeo Liu2012-02-041-1/+1
| | | | | | | | http://debbugs.gnu.org/10711
| * Add 2012 to FSF copyright years for Emacs filesGlenn Morris2012-01-051-1/+1
| |
| * Spelling fixes.Paul Eggert2011-11-261-1/+1
| |
| * * lisp/emacs-lisp/smie.el: Improve warnings and conflict detection.Stefan Monnier2011-11-181-46/+109
| | | | | | | | | | | | | | | | | | | | (smie-warning-count): New var. (smie-set-prec2tab): Use it. (smie-bnf->prec2): Improve warnings. Add docstring. (smie-bnf--closer-alist): Rename from smie-bnf-closer-alist. (smie-bnf--set-class): New function. (smie-bnf--classify): Rename from smie-bnf-classify. Rewrite to fix corner case.
| * Spelling fixes.Paul Eggert2011-11-171-2/+3
| |
| * Fix typos.Juanma Barranquero2011-11-161-1/+1
| |
| * Spelling fixes.Paul Eggert2011-11-131-1/+1
| |
* | * lisp/emacs-lisp/smie.el: Provide smarter auto-filling.Stefan Monnier2012-02-151-0/+33
|/ | | | | (smie-auto-fill): New function. (smie-setup): Use it.
* * lisp/emacs-lisp/smie.el (smie-bnf->prec2): Fix last change.Andreas Schwab2011-06-261-2/+2
| | | | (Bug#8934)
* * lisp/emacs-lisp/smie.el (smie-bnf->prec2): Give more understandable errorStefan Monnier2011-06-231-2/+6
| | | | messages for adjacent non-terminals.
* * src/eval.c (Fdefvaralias): Also mark the target as variable-special-p.Stefan Monnier2011-06-151-0/+20
|
* Misc fixes, and use lexical-binding in more files.Stefan Monnier2011-03-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/subr.el (letrec): New macro. (with-wrapper-hook): Move from lisp/simple.el and don't use CL. * simple.el (with-wrapper-hook): Move with-wrapper-hook to subr.el. * lisp/help-fns.el (help-function-arglist): Handle subroutines as well. (describe-variable): Use special-variable-p to filter completions. * lisp/emacs-lisp/macroexp.el (macroexpand-all-1): Don't expand `declare' in defmacros. * lisp/emacs-lisp/cconv.el (cconv-convert, cconv-analyse-form): Handle `declare'. * lisp/emacs-lisp/cl.el (pushnew): Silence unfixable warning. * lisp/emacs-lisp/cl-macs.el (defstruct, define-compiler-macro): Mark unused arg as unused. * lisp/emacs-lisp/byte-opt.el (byte-optimize-lapcode): Use memq. * lisp/emacs-lisp/autoload.el (make-autoload): Don't assume the macro's first sexp is a list. (autoload-generate-file-autoloads): Improve error message. * lisp/emacs-lisp/advice.el (ad-arglist): Use help-function-arglist to understand the new byte-code arg format. * lisp/vc/smerge-mode.el: * lisp/vc/log-view.el: * lisp/vc/log-edit.el: * lisp/vc/cvs-status.el: * lisp/uniquify.el: * lisp/textmodes/css-mode.el: * lisp/textmodes/bibtex-style.el: * lisp/reveal.el: * lisp/newcomment.el: * lisp/emacs-lisp/smie.el: * lisp/abbrev.el: Use lexical-binding. * src/eval.c (Fprog1, Fprog2): Simplify and use XCDR/XCAR. (Fdefvar): Remove redundant SYMBOLP check. (Ffunctionp): Don't signal an error for undefined aliases. * doc/lispref/variables.texi (Converting to Lexical Binding): New node.
* * lisp/emacs-lisp/smie.el (smie-blink-matching-open): Don't use `pos' in twoStefan Monnier2011-02-101-4/+12
| | | | | | | conflicting ways. (smie-indent--parent): Extend to "parent of arg". (smie-indent-inside-string): New function. (smie-indent-functions): Use it.
* Convert consecutive FSF copyright years to ranges.Glenn Morris2011-01-241-1/+1
|
* Add 2011 to FSF/AIST copyright years.Glenn Morris2011-01-021-1/+1
|
* * emacs-lisp/smie.el (smie-prec2->grammar): Simplify handlingStefan Monnier2010-11-261-54/+66
| | | | | | | of :smie-open/close-alist. (smie-next-sexp): Make it accept a "start token" as argument. (smie-indent-keyword): Be careful not to misidentify tokens that span more than one line, as empty lines. Add argument `token'.
* * emacs-lisp/smie.el (smie-bnf-classify): Signal errors for tokensStefan Monnier2010-11-171-41/+55
| | | | | | | | | that are both openers (resp. closers) and something else. (smie-grammar): Loosen definition of valid values. (smie-next-sexp, smie-down-list, smie-blink-matching-open) (smie-indent--parent, smie-rule-parent, smie-indent-keyword) (smie-indent-after-keyword): Adjust users. (smie-indent-keyword): Don't indent empty lines.