1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-16 17:19:41 +00:00
Commit Graph

134 Commits

Author SHA1 Message Date
Stefan Monnier
66ae3cff96 * src/lread.c (intern_1): Make sure we'd find the symbol we add
Fixes: debbugs:20334

* src/xfaces.c (resolve_face_name): Don't use `intern' with Lisp_Strings.
2015-04-15 12:15:14 -04:00
Stefan Monnier
6083965958 css-mode.el (css-smie-rules): Fix indentation after complex selectors
Fixes: debbugs:20282

* lisp/textmodes/css-mode.el (css-smie-rules): Don't get confused by
inner structure of selectors.
2015-04-09 10:51:23 -04:00
Dmitry Gutov
f2fbd4b712 js-mode: Don't indent inside a multiline string literal
* lisp/progmodes/js.el (js-indent-line): Do nothing when bol is inside
a string (https://github.com/mooz/js2-mode/issues/227).
2015-04-03 06:37:31 +03:00
Jackson Ray Hamilton
f4c23f4583 Have `sgml-attribute-offset' control SGML attribute indentation
Fixes: debbugs:20161

* textmodes/sgml-mode.el (sgml-attribute-offset): New defcustom.
(sgml-calculate-indent): Use `sgml-attribute-offset' for attribute
indentation.
2015-03-22 20:47:43 -07:00
Jackson Ray Hamilton
f0e8673a9e * indent/js-indent-init-dynamic.js: Fix spelling error. 2015-03-10 22:07:10 -07:00
Paul Eggert
2a1be9eb23 Prefer "initialize" to "initialise"
* lisp/progmodes/js.el (js-indent-first-init):
Rename from js-indent-first-initialiser, to avoid worrying about
American vs British spelling.  All uses changed.
* test/indent/js-indent-init-t.js: Rename from
indent/js-indent-first-initialiser-t.js.
* test/indent/js-indent-init-dynamic.js: Rename from
test/indent/js-indent-first-initialiser-dynamic.js.
2015-03-10 16:29:59 -07:00
Jackson Ray Hamilton
933e0ab4b0 New indentation option for js-mode
* lisp/progmodes/js.el (js--proper-indentation): Add new custom option
`js-indent-first-initialiser' and a function to utilize it,
`js--maybe-goto-declaration-keyword-end'.

* test/indent/js.js: Add local variables.

* test/indent/js-indent-first-initialiser-t.js: New test for
`js-indent-first-initialiser'.

* test/indent/js-indent-first-initialiser-dynamic.js: New test for
`js-indent-first-initialiser'.
2015-03-10 10:19:07 -07:00
Dmitry Gutov
b20113f0f7 Automate 'make all' in test/indent 2015-03-10 02:39:01 +02:00
Dmitry Gutov
d15317cc17 Add an indent test example for bug#20026
* test/indent/ruby.rb: Add an example for bug#20026.
2015-03-08 20:57:47 +02:00
Dmitry Gutov
d03ec1cf16 Fix test/indent/js.js
* test/indent/js.js: Set `js-indent-level' to 2. Fix indentation in an
example.
2015-03-08 20:30:23 +02:00
Dmitry Gutov
77ab7f8455 Teach js-mode about ES6 template strings
* lisp/progmodes/js.el (js-mode-syntax-table): Add an entry for `.
2015-03-05 04:33:36 +02:00
Paul Eggert
407e6beeb3 * indent/shell.sh (bar): Use '[ $# -eq 0 ]', not '[ $# == 0 ]'.
This is more portable in shell scripts.
Fixes: bug#19658
2015-01-24 19:02:07 -08:00
Paul Eggert
7e09ef09a4 Update copyright year to 2015
Run admin/update-copyright.
2015-01-01 14:26:41 -08:00
Stefan Monnier
29c5e2cea2 (js-syntax-propertize-regexp): Recognize "slash in a character class"
Fixes: debbugs:19397

* lisp/progmodes/js.el (js--syntax-propertize-regexp-syntax-table): New var.
(js-syntax-propertize-regexp): Use it to recognize "slash in
a character class".
2014-12-23 11:17:55 -05:00
Stefan Monnier
4fda400e58 Merge from emacs-24 2014-12-05 15:30:09 -05:00
Stefan Monnier
e3c24b171b * lisp/progmodes/sh-script.el: Fix indentation rule of "| while".
Fixes: debbugs:18031

* lisp/progmodes/sh-script.el (sh-smie-sh-rules): Go back to the beginning
of the whole pipe when indenting an opening keyword after a |.
Generalize this treatment to opening keywords like "while".
2014-12-04 10:09:08 -05:00
Ted Zlatanov
ba4502fe14 Merge branch 'emacs-24'
Conflicts:
	nt/addsection.c
	nt/inc/ms-w32.h
	src/w32.c
2014-11-26 21:31:11 -05:00
Dmitry Gutov
c613f4d6c1 Fix indentation before !=' and after +='
Originally reported in https://github.com/mooz/js2-mode/issues/174.
* lisp/progmodes/js.el (js--indent-operator-re): Make assignments and
(in)equality operator a separate case.
(js--continued-expression-p): Escape the second `+' in the regexp.
2014-11-16 14:19:16 +02:00
Stefan Monnier
bc0e9e47b6 * lisp/textmodes/css-mode.el (scss-mode): New major-mode.
(css-mode-syntax-table): Use d style comment, to ease the scss case.
(css-ident-re): Allow things like @-moz-keyframes.
(scss--hash-re): New const.
(css--font-lock-keywords): New function, extracted from
css-font-lock-keywords.
(css-font-lock-keywords): Use it.
(scss-mode-syntax-table, scss-font-lock-keywords): New vars.
(scss-smie--not-interpolation-p): New function.
(css-smie--forward-token, css-smie--backward-token): Use it.
(css-mode): Remove left-over code.
* test/indent/scss-mode.scss: New file.
* test/indent/css-mode.css: Add a few uneventful examples.
2014-10-20 12:36:34 -04:00
Stefan Monnier
40aef37804 * lisp/progmodes/perl-mode.el (perl-syntax-propertize-function):
Accept underscores in identifiers after "sub".

Fixes: debbugs:18502
2014-09-21 18:00:28 -04:00
Paul Eggert
9bc6bb24e5 Remove stray semicolons. 2014-09-04 09:14:05 -07:00
Glenn Morris
62fca47221 Merge from emacs-24; up to 2014-07-04T02:28:54Z!dmantipov@yandex.ru 2014-09-02 21:21:40 -07:00
Stefan Monnier
af86b05fd4 test/indent/scheme.scm: New file. 2014-09-02 16:47:44 -04:00
Glenn Morris
5613a6f6d5 Merge from emacs-24; up to 2014-06-19T14:03:45Z!monnier@iro.umontreal.ca 2014-07-08 19:04:12 -07:00
Stefan Monnier
d8899d09b9 * lisp/progmodes/sh-script.el (sh-smie-sh-rules): Don't align with a && in
the middle of a line.

Fixes: debbugs:17896
2014-07-08 14:38:07 -04:00
Stefan Monnier
5e799349fd * lisp/progmodes/perl-mode.el: Use syntax-ppss; fix one indentation case.
(perl-indent-line): Use syntax-ppss to detect we're in a doc-section.
(perl-continuation-line-p): Don't skip over anything else than labels.
Return the previous char.
(perl-calculate-indent): Use syntax-ppss instead of parse-start
and update callers accordingly.  For continuation lines, check the
the case of array hashes.
(perl-backward-to-noncomment): Make it non-interactive.
(perl-backward-to-start-of-continued-exp): Rewrite.
* test/indent/perl.perl: Add indentation pattern for hash-table entries.
2014-07-08 12:51:35 -04:00
Glenn Morris
9ac6d28ab8 Merge from emacs-24; up to 2014-06-11T19:33:14Z!rgm@gnu.org 2014-06-25 23:55:15 -07:00
Stefan Monnier
370ceb2210 Fix some indentation problem with \; and pipes.
* lisp/progmodes/sh-script.el (sh-mode-syntax-table): Set syntax of ;|&.
(sh-smie--default-forward-token, sh-smie--default-backward-token):
New functions.
(sh-smie-sh-forward-token, sh-smie-sh-backward-token)
(sh-smie-rc-forward-token, sh-smie-rc-backward-token): Use them.
(sh-smie-sh-rules): Fix indentation of a pipe at BOL.

Fixes: debbugs:17842
2014-06-24 16:16:10 -04:00
Glenn Morris
c400516ab1 Merge from emacs-24; up to 2014-06-06T02:22:40Z!monnier@iro.umontreal.ca 2014-06-21 12:45:59 -07:00
Stefan Monnier
9e248ebdc7 * lisp/progmodes/sh-script.el (sh-smie-sh-rules): For { after &&, don't
align with the surrounding parent.

Fixes: debbugs:17721
2014-06-20 10:23:30 -04:00
Stefan Monnier
500dce5f4d * lisp/emacs-lisp/smie.el (smie--hanging-eolp-function): New var.
(smie-indent--hanging-p): Use it.
* lisp/progmodes/sh-script.el (sh-set-shell): Set it.

Fixes: debbugs:17621
2014-06-19 21:05:40 -04:00
Stefan Monnier
e9638b49e5 * lisp/progmodes/sh-script.el (sh-smie-sh-rules): Use same rule for && as
for |.

Fixes: debbugs:17621
2014-06-19 18:52:12 -04:00
Stefan Monnier
c435f506a1 * test/indent/ps-mode.ps: New file.
* test/automated/core-elisp-tests.el
(core-elisp-test-window-configurations): New test.
* test/indent/octave.m: Add a few more tests.
* test/indent/ruby.rb: Add one more test.
2014-05-27 10:28:07 -04:00
Glenn Morris
bbbabffe06 Merge from emacs-24; up to 2014-05-12T06:15:47Z!rgm@gnu.org 2014-05-11 23:59:30 -07:00
Stefan Monnier
5d03fb436f * lisp/emacs-lisp/nadvice.el: Support adding a given function multiple times.
(advice--member-p): If name is given, only compare the name.
(advice--remove-function): Don't stop at the first match.
(advice--normalize-place): New function.
(add-function, remove-function): Use it.
(advice--add-function): Pass the name, if any, to
advice--remove-function.
2014-05-10 16:07:01 -04:00
Stefan Monnier
5ba339c7f4 * lisp/progmodes/perl-mode.el (perl--syntax-exp-intro-regexp): New var.
(perl-syntax-propertize-function): Use it.  Extend handling of
here-docs to the unquoted case.
2014-04-25 15:22:26 -04:00
Stefan Monnier
c08684513a * lisp/progmodes/perl-mode.el (perl-syntax-propertize-function): Slash after
&, |, +, - and * can't be a division.

Fixes: debbugs:17317
2014-04-22 21:56:18 -04:00
Stefan Monnier
b262bde327 * lisp/nxml/nxml-mode.el (nxml-fontify-matcher): Make sure propertization
was done.
* lisp/nxml/xmltok.el (xmltok-scan-after-comment-open): Extend unclosed
comment to EOB.

Fixes: debbugs:17264
2014-04-16 11:28:26 -04:00
Feng Li
39764caa7f * lisp/progmodes/pascal.el (pascal-font-lock-keywords): Fix incorrect format
entry; use symbol boundaries to avoid mis-matches.
2014-04-10 09:56:28 -04:00
Stefan Monnier
062e286b7c * lisp/progmodes/perl-mode.el (perl-syntax-propertize-function): Handle $'
used as a variable.

Fixes: debbugs:17174
2014-04-02 20:41:09 -04:00
Dmitry Gutov
42ebc34ea8 Fix bug#17097
* lisp/progmodes/ruby-mode.el (ruby-syntax-propertize-function):
Don't propertize `?' or `!' as symbol constituent when after
colon.
2014-03-27 08:53:13 +02:00
Dmitry Gutov
1fc8f6559a Fix bug#17050
* lisp/progmodes/ruby-mode.el (ruby-smie-rules):
Add indentation rule for ` @ '.
2014-03-21 06:26:39 +02:00
Dmitry Gutov
1850913d96 * lisp/progmodes/ruby-mode.el (ruby-font-lock-keywords): Highlight
regexp options.

Fixes: debbugs:16914
2014-03-02 00:04:59 +02:00
Paul Eggert
9a89cfa29d Spelling fix. 2014-02-25 10:40:54 -08:00
Dmitry Gutov
dfdb365c4c * lisp/progmodes/ruby-mode.el (ruby-smie-rules): Handle the
inconsistent second element of the list returned by
`smie-indent--parent'.
(ruby-font-lock-keywords): Disqualify any identifier before `=' as
method call.
2014-02-23 10:26:40 +02:00
Dmitry Gutov
62f9502226 * lisp/progmodes/ruby-mode.el (ruby-smie-rules): Don't indent specially
after `=>'.

Fixes: debbugs:16811
2014-02-23 07:53:53 +02:00
Dmitry Gutov
a09beb3df2 Fix bug#16609
* lisp/progmodes/ruby-mode.el (ruby-smie--implicit-semi-p): Check for
`:' before binary operators.  Don't check for `:'
before `[' and `(', or their syntax status.  A percent literal
can't end with either.
2014-02-01 16:54:58 +02:00
Dmitry Gutov
e2a67bd08e Implement user option ruby-align-chained-calls
* lisp/progmodes/ruby-mode.el (ruby-align-chained-calls): New option.
(ruby-smie-grammar): Make "." right-associative.  Make its priority
lower than the ternary and all binary operators.
(ruby-smie-rules): Indent "(" relative to the first non-"."
parent, or the first "." parent at indentation.  Use
`ruby-align-chained-calls' for indentation of "." tokens.

* test/automated/ruby-mode-tests.el (ruby-align-chained-calls):
New test.

Fixes: debbugs:16593
2014-01-31 19:13:49 +02:00
Dmitry Gutov
fb3d479c91 ruby-mode: Align def...end to the beginning of statement
* lisp/progmodes/ruby-mode.el (ruby-alignable-keywords): New constant.
(ruby-align-to-stmt-keywords): Change the default value.  Use
`ruby-alignable-keywords' to generate the possible customization
choices.
(ruby-smie-rules): Instead of using a hardcoded list of alignable
keywords, check against the value of `ruby-alignable-keywords'
(http://lists.gnu.org/archive/html/emacs-devel/2014-01/msg01439.html).
2014-01-17 05:15:02 +02:00
Paul Eggert
06827ec842 Spelling fixes.
* mail/unrmail.el (unrmail-mbox-format): Choice is mboxo, not mboxro.
* woman.el (woman-mark-horizontal-position):
Rename from woman-mark-horizonal-position.  Use changed.
2014-01-09 23:10:37 -08:00