emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Okamsn via "General discussions about Org-mode." <emacs-orgmode@gnu.org>
To: emacs-orgmode@gnu.org
Subject: [PATCH] Add alias for `org-insert-structure-template' using "block" term
Date: Thu, 14 Nov 2024 03:09:30 +0000	[thread overview]
Message-ID: <a5580772-2690-4675-b851-420c738bc562@protonmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 694 bytes --]

Hello,

Markup structures like "#+begin_src" and "#+being_quote" can be
inserted using the command `org-insert-structure-template'.  In much
of the documentation, these structures are called "blocks", including
the existing documentation for `org-insert-structure-template'.
I personally found the name `org-insert-structure-template' harder to 
remember when wanting to insert a "block", because I kept assuming that 
the word "block" would be used in the name of the command.

This attached patch adds the alias `org-insert-block-template' for 
`org-insert-structure-template', which I would have found more memorable 
when learning how to use Org's markup blocks.

Thank you.

[-- Attachment #2: 0001-org.el-Add-alias-for-org-insert-structure-template-u.patch --]
[-- Type: text/x-patch, Size: 1363 bytes --]

From b58cf3de62bdc34c5ead9a40fe8ad424ed55da73 Mon Sep 17 00:00:00 2001
From: Earl Hyatt <okamsn@protonmail.com>
Date: Wed, 13 Nov 2024 21:31:10 -0500
Subject: [PATCH] org.el: Add alias for `org-insert-structure-template' using
 "block" term

* lisp/org.el (org-insert-block-template): Create as an alias
of `org-insert-structure-template'.

Markup structures like "#+begin_src" and "#+being_quote" can be
inserted using the command `org-insert-structure-template'.  In much
of the documentation, these structures are called "blocks", including
the existing documentation for `org-insert-structure-template'.
Therefore, add the alias `org-insert-block-template' as a more
discoverable name in case a user is familiar with the term "block"
but not with the term "structure".
---
 lisp/org.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/org.el b/lisp/org.el
index 1e9057935..a47ee3567 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -9276,6 +9276,7 @@ (defun org--insert-structure-template-unique-keys (keys)
 	    (cl-sort menu-keys #'<
 		     :key (lambda (elm) (cl-position (cdr elm) keys))))))
 
+(defalias 'org-insert-block-template #'org-insert-structure-template)
 (defun org-insert-structure-template (type)
   "Insert a block structure of the type #+begin_foo/#+end_foo.
 Select a block from `org-structure-template-alist' then type
-- 
2.43.0


                 reply	other threads:[~2024-11-14  3:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a5580772-2690-4675-b851-420c738bc562@protonmail.com \
    --to=emacs-orgmode@gnu.org \
    --cc=okamsn@protonmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).