[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] ob-shell: consistent prefix
From: |
Matt |
Subject: |
[PATCH] ob-shell: consistent prefix |
Date: |
Mon, 15 Jan 2024 22:12:23 +0100 |
User-agent: |
Zoho Mail |
The attached patch makes names in ob-shell.el use the same prefix
"org-babel-shell-" (along with a few similar minor consistency
updates).
Without the patch, three naming conventions exist:
- org-babel-shell
- org-babel-sh
- ob-shell <----- that's my fault :)
The Org Babel shell library was previously called "ob-sh.el" and later
changed to "ob-shell.el". When this happened, the meaning of the "sh"
changed. When the library was called "ob-sh.el", "sh" meant a generic
shell. When the library was renamed "ob-shell.el", "shell" took on
the role of a generic shell and "sh" became a reference to /bin/sh.
The current "sh" names are generic and not specific to "/bin/sh" or
something like the Bourne Shell. The patch updates all "sh" names
to "shell".
When I submitted my async changes, I introduced an "ob-shell" prefix.
Emacs names typically begin with the library name and I just continued
in that style. Org is different, however, because it's the "org-"
library. For sub-libraries, like Babel, the convention is
"org-babel-<language>-". ob-shell.el is unusual in that it supports
multiple languages. However, ob-C.el also supports multiple languages
and uses "org-babel-<language>-". I find there's no confusion using
this style.
FWIW, I found it confusing when I first started learning the Org code
base that the naming convention is at the "org-" level and not at the
library level (for example, "ob-shell-"). A large part of my
confusion, I think, was simply inconsistencies within ob-shell.
It's late for me, so rather than commit in a rush, I'm posting this
for review/comment. The tests pass and I think I preserved all the
API function names (like org-babel-execute:template).
Thoughts?
--
Matt Trzcinski
Emacs Org contributor (ob-shell)
Learn more about Org mode at https://orgmode.org
Support Org development at https://liberapay.com/org-mode
0001-make-name-prefixes-consistent.diff
Description: Binary data
- [PATCH] ob-shell: consistent prefix,
Matt <=