Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
into maint
* puzza007/emacs_iodata_nonempty_string_builtin_types/OTP-11394:
Add iodata, nonempty_string to built-in type highlighting for emacs
|
|
These built-in types were missing from emacs highlighting
|
|
files as delimiters.
While working on a tool that processes Erlang code and testing it against this repo,
I found out about those little sneaky 0xff. I thought it may be of help to other
people build such tools to remove non-conforming-to-standard characters.
|
|
In Emacs it is possible to remotely edit a file, by opening for
example /ssh:somehost.com:/path/to/file.erl. In Emacs, the feature
that makes this possible, is called TRAMP. When compiling such a file,
by typing C-c C-k, an inferior Erlang shell is opened on the remote
host, but the compilation expression that was evaluated in the remote
Erlang shell was:
c("/ssh:somehost.com:/path/to/file", [...]).
which resulted in a "no such file or directory" error.
This commit changes the compilation expression into:
c("/path/to/file", [...]).
for files opened remotely via TRAMP. The file name is adjusted
similarly when compiling .yrl and .xrl files.
In a buffer opened remotely, the Elisp function buffer-file-name
returns the full path with TRAMP syntax. In this example it would
be "/ssh:somehost.com:/path/to/file.erl". A new function,
erlang-local-buffer-file-name, has been introduced, which peels off
the TRAMP syntax on remotely opened files, while for locally opened
files, it just calls buffer-file-name.
|
|
For example:
[ one
, two
, three
]
This does not affect coding styles that don't put commas at the
beginning of lines.
|
|
|
|
|
|
Added: binary_to_integer/1,2, integer_to_binary/1,2
|
|
|
|
* lukas/tools/emacs_add_error_bif/OTP-10774:
Update all bif highlighting for emacs
|
|
The single quote in $\' does not begin an atom. Change the regexp to
treat it just like $\". Previously this code would be incorrectly
highlighted:
foo() ->
Quote = $\',
%% This gets coloured as an atom, not as a comment
...
|
|
All bifs should now be highlighted correctly. Also added
a testcase which will check for any future bif additions
and deletions.
|
|
Add a separate face for exported functions to erlang mode so that they
are distiguishable at a glance. By default, the face is identical to
that of normal functions and there is also a configuration variable to
inhibit the face in case running this on a low-performance machine is
too slow.
|
|
* gp/make_erlang_mode_elpa_friendly:
Make erlang-mode more compatible with package.el
OTP-10465
|
|
Conflicts:
lib/diameter/autoconf/vxworks/sed.general
xcomp/README.md
|
|
|
|
|
|
Like this: 'atom$'. In that example, the last single quote should be
recognised as ending the atom. This needs a font-lock workaround
similar to the one for strings.
|
|
* mh/remove-compilation-error-regexp:
Remove Erlang-specific compilation error regexp
OTP-10168
|
|
In some situations, the indentation of record fields in Emacs was
strange. This example below shows how Emacs previously would indent
two similar pieces of code very differently:
some_function_with_a_very_long_name() ->
#'a-long-record-name-like-it-sometimes-is-with-asn.1-records'{
field1=a,
field2=b}.
x() ->
#some_record_name{
field1=a,
field2=b}.
This changes the indentation to be like below for both cases:
some_function() ->
#some_record{
field1=a,
field2=b}.
|
|
The purpose of this regexp is to ensure that, when invoking the Erlang
compiler inside Emacs through M-x compile, any error messages be
turned into links jumping to the right line in the right source file.
However, it seems like this works out of the box in modern Emacsen,
and furthermore, using a non-standard regexp inhibits jumping to a
certain column when this is provided by the compiler.
|
|
Package.el and Emacs package repositories (like ELPA or Marmalade
place some requirements onto packages which are uploaded to them. This
commit does minor cosmetic changes which makes it easier to create
appropriate package file for those repositories.
|
|
|
|
If visiting a .yrl or .xrl file in emacs with erlang-mode,
then the `erlang-compile' function (normally bound to C-c C-k),
now knows how to compile yecc and leex files, and then, if that
compilation succeeds, also compiles the resulting .erl files.
Also introduce a `erlang-compile-command-function-alist'
to make it possible to hook in other functions for computing
compilation commands/expressions, depending on file name.
|
|
The Erlang mode for Emacs inserts a newline after every "->", which
saves you one keystroke when writing a function, but that is
inappropriate when writing a type spec, as you'd normally keep the
spec on one line. This change inhibits the automatic insertion when
the current line starts with "-spec" or "-type".
|
|
|
|
Emacs has a facility for setting options on a per-file basis based on
comments in the source file. By default, all options are considered
"unsafe", and the user is queried before the variable is set. This
patch declares the variables erlang-indent-level, erlang-indent-guard
and erlang-argument-indent to be safe, if the value specified in the
source file is valid.
Such declarations usually look like this:
%% -*- erlang-indent-level: 2 -*-
and appear on the first line of the file.
|
|
A string whose last character is a dollar sign used to make the syntax
highlighter believe that the string never ends, breaking highlighting
of following code:
-vsn("$Revision: 42 $").
And the double quote as a character constant with a (superfluous)
backslash used to make the syntax highlighter believe that a new
string started:
foo() ->
$\".
This change fixes both problems by adding two regexps to
font-lock-syntactic-keywords in erlang-font-lock-init.
One case that is still broken is when a multi-line string ends with a
dollar sign:
bar() ->
"This multi-line string
ends with a $".
baz() ->
this_gets_incorrectly_highlighted.
|
|
An example that didn't work previously.
case Foo of
{ok, X} ->
ok;
_ ->
catch file:close(FD)
end.
|
|
Type highlighting reported by Jay Nelson
non_neg_integer() will highlight purple but pos_integer() does not.
Closing record indentation problem reported by Maxim Treskin:
-record(state, {
sequence_number = 1 :: integer()
}).
|
|
* mh/fix-record-indentation:
Fix indentation of records with line breaks inside lists
|
|
* mh/inferior-erlang-cmd-uniq:
inferior-erlang: specify command to run, uniquify buffer names
|
|
* mh/erlang-mode-imenu-arity:
Let imenu distinguish functions by arity
|
|
Create and assign the erlang-mode keymap to erlang-mode-map once
erlang.el is loaded, not the first time it is used. This way of doing
it follows the Emacs Lisp convention described at
http://www.gnu.org/software/emacs/manual/html_node/elisp/Tips-for-Defining.html
and also makes it easier for users to customize the keymap.
Remove the now unneeded functions erlang-keymap-init and
erlang-mode-commands.
Also move the definition of inferior-erlang-use-cmm, so it is
available when defining erlang-mode-map.
|
|
Make the function names used by M-x imenu contain the function arity
as well as the name. This makes it possible to jump to all functions
of the same name, as opposed to only the one that is defined first.
For example, in the following module there is now a way to jump
directly to foo/1:
-module(foo).
foo() ->
ok.
bar() ->
error.
foo(A) ->
{ok, A}.
|
|
Trying to indent this piece of code by hitting TAB on each line:
foo() ->
[#foo{
foo = foo}].
used to cause an error. Fix by ignoring errors when trying to skip
backwards from a record.
Also add this test case to test.erl.orig and test.erl.indented.
|
|
Add a new feature to the command inferior-erlang: when called with a
prefix argument, prompt for the command to execute to start the Erlang
shell. When possible (i.e., in Emacs 23 and later), allow tab
completion as in a normal shell.
Also create the shell buffer in such a way that, if
uniquify-buffer-name-style is not nil and several Erlang shell buffers
are started in different directories, the names of those buffers
reflect their working directories instead of being *erlang*,
*erlang*<2>, etc.
|
|
i.e. in emacs-21
|
|
|
|
|
|
* dgud/emacs-mode:
Added the old style skeletons, and a variable to change.
Move code skeletons to a separate file.
OTP-8446 dgud/emacs-mode
|
|
|
|
Use the updated skeletons from the Erlware Mode.
|
|
Used in records or tuple creation:
-record(record3, {a = 8#42423 bor
8#4234,
b = 8#5432
bor 2#1010101
c = 123 +
234,
d}).
and in functions calls
call(2#42423 bor
#4234,
2#5432,
other_arg),
|
|
|
|
|
|
In the following code
case X of foo -> 25
end,
Automatically indent the line you stand on (end,) before
adding newline and indent again.
That way 'end' will be indented correctly after the comma is written.
|