Skip to content

Commit 6beb719

Browse files
committed
Call Rust modules "mod" whenever possible, to avoid confusion
1 parent de22840 commit 6beb719

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
6262

6363
## [0.9.0] - 2019-07-11
6464
- `ResultExt` is now a collection of Emacs-specific extension methods for `Result`, instead of a re-export of `failure::ResultExt`.
65-
- Added `failure` as a re-exported sub-module.
65+
- Added `failure` as a re-exported sub-mod.
6666
- Added `unwrap_or_propagate` for better panic handling: propagation of non-local exits without `Result`, and improved error messages.
6767

6868
## [0.8.0] - 2019-04-20

emacs-macros/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ pub fn module(attr_ts: TokenStream, item_ts: TokenStream) -> TokenStream {
9090
/// - `crate-prefix` is the feature name followed by `-`. This can be customized by the `name`,
9191
/// `defun_prefix`, and `separator` options on #[[`module`]].
9292
///
93-
/// - `mod-prefix` is constructed from the function's Rust module path (with `_` and `::` replaced
93+
/// - `mod-prefix` is constructed from the function's Rust `mod` path (with `_` and `::` replaced
9494
/// by `-`). This can be turned off crate-wide, or for individual function, using the option
9595
/// `mod_in_name`.
9696
///

guide/src/functions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Writing Functions
22

3-
You can use the attribute macro `#[defun]` to export Rust functions to the Lisp runtime, so that Lisp code can call them. The exporting process happens when the module is loaded, even if the definitions are inside another function that is never called, or inside a private module.
3+
You can use the attribute macro `#[defun]` to export Rust functions to the Lisp runtime, so that Lisp code can call them. The exporting process happens when the module is loaded, even if the definitions are inside another function that is never called, or inside a private `mod`.
44

55
## Input Parameters
66

@@ -81,7 +81,7 @@ See [Custom Types](./custom-types.md) for more details on embedding Rust data st
8181

8282
By default, the function's Lisp name has the form `<feature-prefix>[mod-prefix]<base-name>`.
8383
- `feature-prefix` is the feature name followed by `-`. This can be customized by the `name`, `defun_prefix`, and `separator` [options](./module.md#options) on `#[emacs::module]`.
84-
- `mod-prefix` is constructed from the function's Rust module path (with `_` and `::` replaced by `-`). This can be turned off crate-wide, or for individual function, using the option `mod_in_name`.
84+
- `mod-prefix` is constructed from the function's Rust `mod` path (with `_` and `::` replaced by `-`). This can be turned off crate-wide, or for individual function, using the option `mod_in_name`.
8585
- `base-name` is the function's Rust name (with `_` replaced by `-`). This can be overridden with the option `name`.
8686

8787
Examples:

src/init.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,13 @@ fn lisp_name(s: &str) -> String {
9696
s.replace("_", "-")
9797
}
9898

99-
pub fn lisp_pkg(module_path: &str) -> String {
100-
let crate_name = module_path.split("::").nth(0).expect("module_path is empty!");
99+
pub fn lisp_pkg(mod_path: &str) -> String {
100+
let crate_name = mod_path.split("::").nth(0).expect("mod_path is empty!");
101101
lisp_name(&crate_name)
102102
}
103103

104-
pub fn lisp_path(module_path: &str) -> String {
105-
let split = module_path.split("::");
104+
pub fn lisp_path(mod_path: &str) -> String {
105+
let split = mod_path.split("::");
106106
let mut path =
107107
__PREFIX__.try_lock().expect("Failed to acquire read lock of module prefix").join("");
108108
for segment in split.skip(1) {

0 commit comments

Comments
 (0)