summaryrefslogtreecommitdiff
path: root/lib/tools/emacs
Commit message (Collapse)AuthorAgeFilesLines
* Run emacs tests from test_suiteDan Gudmundsson2018-10-092-110/+1
| | | | Drive emacs test from test_suite instead of bash script.
* Emacs: consider case in erlang-get-identifier-at-pointJohan Claesson2018-10-092-13/+15
|
* Emacs: do not accept compiler warnings in selected elisp filesJohan Claesson2018-10-098-78/+111
|
* Emacs: add test-erlang-modeJohan Claesson2018-10-091-0/+81
|
* erlang-mode: fix void variable align-rules-list errorGrigory Starinkin2018-08-281-1/+1
| | | | | | | erlang-mode crashes with the following error: Symbol’s value as variable is void: align-rules-list caused by #1728
* Merge pull request #1728 from davidw/emacs-alignDan Gudmundsson2018-08-161-0/+14
|\ | | | | OTP-15239
| * Require alignDavid N. Welton2018-03-031-0/+1
| |
| * Add Erlang alignment regexpsDavid N. Welton2018-02-251-0/+13
| | | | | | | | These allow for the alignment of maps and records
* | Update copyright yearHenrik Nord2018-06-181-1/+1
| |
* | Introduce is_map_key/2 guard BIFMichał Muskała2018-04-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This complements the `map_get/2` guard BIF introduced in #1784. Rationale. `map_get/2` allows accessing map fields in guards, but it might be problematic in more complex guard expressions, for example: foo(X) when map_get(a, X) =:= 1 or is_list(X) -> ... The `is_list/1` part of the guard could never succeed since the `map_get/2` guard would fail the whole guard expression. In this situation, this could be solved by using `;` instead of `or` to separate the guards, but it is not possible in every case. To solve this situation, this PR proposes a `is_map_key/2` guard that allows to check if a map has key inside a guard before trying to access that key. When combined with `is_map/1` this allows to construct a purely boolean guard expression testing a value of a key in a map. Implementation. Given the use case motivating the introduction of this function, the PR contains compiler optimisations that produce optimial code for the following guard expression: foo(X) when is_map(X) and is_map_key(a, X) and map_get(a, X) =:= 1 -> ok; foo(_) -> error. Given all three tests share the failure label, the `is_map_key/2` and `is_map/2` tests are optimised away. As with `map_get/2` the `is_map_key/2` BIF is allowed in match specs.
* | Introduce map_get guard-safe functionMichał Muskała2018-04-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rationale Today all compound data types except for maps can be deconstructed in guards. For tuples we have `element/2` and for lists `hd/1` and `tl/1`. Maps are completely opaque to guards. This means matching on maps can't be abstracted into macros, which is often done with repetitive guards. It also means that maps have to be always selected whole from ETS tables, even when only one field would be enough, which creates a potential efficiency issue. This PR introduces an `erlang:map_get/2` guard-safe function that allows extracting a map field in guard. An alternative to this function would be to introduce the syntax for extracting a value from a map that was planned in the original EEP: `Map#{Key}`. Even outside of guards, since this function is a guard-BIF it is more efficient than using `maps:get/2` (since it does not need to set up the stack), and more convenient from pattern matching on the map (compare: `#{key := Value} = Map, Value` to `map_get(key, Map)`). Performance considerations A common concern against adding this function is the notion that "guards have to be fast" and ideally execute in constant time. While there are some counterexamples (`length/1`), what is more important is the fact that adding those functions does not change in any way the time complexity of pattern matching - it's already possible to match on map fields today directly in patterns - adding this ability to guards will niether slow down or speed up the execution, it will only make certain programs more convenient to write. This first version is very naive and does not perform any optimizations.
* | Fix signal order for is_process_aliveRickard Green2018-03-221-1/+0
| |
* | Implementation of true asynchronous signaling between processesRickard Green2018-03-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Communication between Erlang processes has conceptually always been performed through asynchronous signaling. The runtime system implementation has however previously preformed most operation synchronously. In a system with only one true thread of execution, this is not problematic (often the opposite). In a system with multiple threads of execution (as current runtime system implementation with SMP support) it becomes problematic. This since it often involves locking of structures when updating them which in turn cause resource contention. Utilizing true asynchronous communication often avoids these resource contention issues. The case that triggered this change was contention on the link lock due to frequent updates of the monitor trees during communication with a frequently used server. The signal order delivery guarantees of the language makes it hard to change the implementation of only some signals to use true asynchronous signaling. Therefore the implementations of (almost) all signals have been changed. Currently the following signals have been implemented as true asynchronous signals: - Message signals - Exit signals - Monitor signals - Demonitor signals - Monitor triggered signals (DOWN, CHANGE, etc) - Link signals - Unlink signals - Group leader signals All of the above already defined as asynchronous signals in the language. The implementation of messages signals was quite asynchronous to begin with, but had quite strict delivery constraints due to the ordering guarantees of signals between a pair of processes. The previously used message queue partitioned into two halves has been replaced by a more general signal queue partitioned into three parts that service all kinds of signals. More details regarding the signal queue can be found in comments in the erl_proc_sig_queue.h file. The monitor and link implementations have also been completely replaced in order to fit the new asynchronous signaling implementation as good as possible. More details regarding the new monitor and link implementations can be found in the erl_monitor_link.h file.
* | Merge branch 'maint'Dan Gudmundsson2018-03-021-83/+165
|\ \ | | | | | | | | | | | | * maint: Add updated type-spec to Emacs skeletons of OTP behaviours
| * \ Merge branch 'pr/1620' into maintDan Gudmundsson2018-03-021-83/+165
| |\ \ | | | | | | | | | | | | | | | | * pr/1620: Add updated type-spec to Emacs skeletons of OTP behaviours
| | * | Add updated type-spec to Emacs skeletons of OTP behavioursHamidreza Soleimani2018-03-021-83/+165
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The changes are based on the latest versions of following modules and are also similar to gen_statem Emacs skeleton. Note that the gen_fsm is not updated because it is deprecated. application: * add/update type-spec for all callbacks * add start_phase/3 callback * add prep_stop/1 callback * add config_change/3 callback supervisor: * add/update type-spec for all callbacks supervisor_bridge: * add/update type-spec for all callbacks gen_server: * add/update type-spec for all callbacks * add format_status/2 callback gen_event: * add/update type-spec for all callbacks * add format_status/2 callback
* | | Merge branch 'maint'Dan Gudmundsson2018-03-021-40/+12
|\ \ \ | |/ / | | | | | | | | | * maint: Derive `erlang-shell-mode` properly from `comint-mode`
| * | Derive `erlang-shell-mode` properly from `comint-mode`Tianxiang Xiong2018-03-021-40/+12
| | |
* | | Merge branch 'maint'Dan Gudmundsson2018-03-014-1615/+48
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | * maint: emacs: delimiter first in icr works emacs: Indent delimiter first in term elements correctly emacs: Indent tuple (and maps) elements as list elements Add emacs indention testcase
| * | emacs: delimiter first in icr worksDan Gudmundsson2018-03-011-6/+7
| | |
| * | emacs: Indent delimiter first in term elements correctlyDan Gudmundsson2018-03-011-18/+26
| | |
| * | emacs: Indent tuple (and maps) elements as list elementsDan Gudmundsson2018-03-011-5/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid From: { ^^element1, ^^element2 } To: { ^element1, ^element2 }
| * | Add emacs indention testcaseDan Gudmundsson2018-03-013-1587/+1
| |/ | | | | | | | | | | Split the manual testcase and run them in daily tests instead. Easy to run directly as well: (cd ../test; cerl -eval "emacs_SUITE:indent([])")
* | Redirect system_flag(scheduler_wall_time,_) to kernel_refcRickard Green2017-12-191-2/+0
| |
* | Remove obsolete erlang:dgroup_leaderSverker Eriksson2017-11-151-1/+0
| |
* | Remove obsolete erlang:dexit/2Sverker Eriksson2017-11-151-1/+0
| |
* | Remove obsolete erlang:dlink/1, dunlink/1 and dist_exit/3Sverker Eriksson2017-11-151-3/+0
| |
* | Remove obsolete erlang:dsendSverker Eriksson2017-11-151-1/+0
| |
* | Merge branch 'maint'Dan Gudmundsson2017-09-131-95/+40
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | * maint: Update the version to 2.8.0 Remove the obsolete erlang-buffer-substring function Add a :package-version property to the new defcustom erlang-shell-prompt-read-only Bump the version number Make the erlang-shell prompt read-only by default Remove a mention of Emacs 21 Drop some redundant backwards compatibility code Enable lexical binding for erlang-mode Remove some ancient compatibility aliases
| * Merge remote-tracking branch 'upstream/pr/1474' into maintDan Gudmundsson2017-09-131-95/+40
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * upstream/pr/1474: Update the version to 2.8.0 Remove the obsolete erlang-buffer-substring function Add a :package-version property to the new defcustom erlang-shell-prompt-read-only Bump the version number Make the erlang-shell prompt read-only by default Remove a mention of Emacs 21 Drop some redundant backwards compatibility code Enable lexical binding for erlang-mode Remove some ancient compatibility aliases
| | * Update the version to 2.8.0Bozhidar Batsov2017-09-121-2/+2
| | |
| | * Remove the obsolete erlang-buffer-substring functionBozhidar Batsov2017-05-231-19/+11
| | |
| | * Add a :package-version property to the new defcustom ↵Bozhidar Batsov2017-05-071-1/+2
| | | | | | | | | | | | erlang-shell-prompt-read-only
| | * Bump the version numberBozhidar Batsov2017-05-071-2/+2
| | |
| | * Make the erlang-shell prompt read-only by defaultBozhidar Batsov2017-05-071-0/+8
| | | | | | | | | | | | Allow for this behaviour to be customized via a defcustom.
| | * Remove a mention of Emacs 21Bozhidar Batsov2017-05-071-1/+1
| | |
| | * Drop some redundant backwards compatibility codeBozhidar Batsov2017-04-291-43/+16
| | |
| | * Enable lexical binding for erlang-modeBozhidar Batsov2017-04-291-1/+1
| | |
| | * Remove some ancient compatibility aliasesBozhidar Batsov2017-04-291-29/+0
| | | | | | | | | | | | | | | | | | | | | Those were added 8 years ago and it's about time they were removed. Now that we depend on a newer Emacs release, we can also drop the function `erlang-obsolete`.
* | | Merge branch 'maint'Dan Gudmundsson2017-09-121-7/+21
|\ \ \ | |/ / | | | | | | | | | | | | * maint: Emacs: Update erlang-xref-find-definitions-module for Emacs 26 Emacs: Guess type of tag definition in Emacs 24
| * | Merge pull request #1559 from johanclaesson/tags2_maintDan Gudmundsson2017-09-121-7/+21
| |\ \
| | * | Emacs: Update erlang-xref-find-definitions-module for Emacs 26Johan Claesson2017-09-051-1/+6
| | | | | | | | | | | | | | | | | | | | The number of arguments to visit-tags-table-buffer have increased in Emacs 26.
| | * | Emacs: Guess type of tag definition in Emacs 24Johan Claesson2017-09-051-6/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This concerns tag finding commands in Emacs 24. If the word at point is preceded by a hash suggest as default a jump to a record definition. If it is a question mark suggest a macro. Otherwise assume it is a function. If it is not a qualified call assume it is a local function.
* | | | Merge branch 'maint' into john/erts/merge-zlib-and-vector-qJohn Högberg2017-09-061-0/+1
|\ \ \ \ | |/ / /
| * | | Merge branch 'lukas/erts/nif_vector_q/OTP-14598' into maintJohn Högberg2017-09-061-0/+1
| |\ \ \ | | |/ / | |/| | | | | | OTP-14520
| | * | erts: Add erlang:iolist_to_iovecLukas Larsson2017-09-051-0/+1
| | | | | | | | | | | | | | | | OTP-14520
* | | | Merge branch 'rickard/dist/OTP-14459' into rickard/dist/master/OTP-14459Rickard Green2017-08-281-0/+5
|\ \ \ \ | |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: erts/emulator/beam/bif.c erts/emulator/beam/dist.c erts/emulator/beam/dist.h erts/emulator/beam/erl_bif_info.c erts/emulator/beam/erl_node_tables.c erts/emulator/beam/erl_node_tables.h erts/emulator/beam/external.c
| * | | Support for distribution controller processesRickard Green2017-08-281-0/+5
| |/ /
* | | Emacs: Fix default target for xref-find-referencesJohan Claesson2017-08-231-3/+10
|/ / | | | | | | | | | | | | The default target is changed to be just the name at point when xref-find-references is invoked. Previously the default was the same as for xref-find-definitions. This included arity and other things that do not make sense for xref-find-references.
* | [emacs] fixup Forgot prognDan Gudmundsson2017-05-091-3/+4
| |