zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH] Set TMPSUFFIX=.zsh in edit-command-line
@ 2021-05-28 13:35 Akinori MUSHA
  2021-05-29 11:41 ` Daniel Shahaf
  0 siblings, 1 reply; 5+ messages in thread
From: Akinori MUSHA @ 2021-05-28 13:35 UTC (permalink / raw)
  To: zsh-workers


[-- Attachment #1.1.1: Type: text/plain, Size: 355 bytes --]

This patch makes the name of a temporary file to have a .zsh suffix so
that the invoked editor will know it's a zsh script.  The .zsh suffix is 
commonly recognized by editors like Emacs, Vim and VS Code.

It's so much easier to edit a command line in a proper editing mode than 
in a plain text mode.

-- 
Akinori MUSHA / https://akinori.org/


[-- Attachment #1.1.2: 0001-Let-EDITOR-invoked-by-edit-command-line-know-it-s-a-.patch --]
[-- Type: text/plain, Size: 760 bytes --]

From 10a2d01b5163e79374060e65f968339a5f3145ae Mon Sep 17 00:00:00 2001
From: Akinori MUSHA <knu@idaemons.org>
Date: Fri, 28 May 2021 22:20:33 +0900
Subject: [PATCH] Let EDITOR invoked by edit-command-line know it's a zsh
 script

---
 Functions/Zle/edit-command-line | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Functions/Zle/edit-command-line b/Functions/Zle/edit-command-line
index 3781244b2..5f7ea321f 100644
--- a/Functions/Zle/edit-command-line
+++ b/Functions/Zle/edit-command-line
@@ -8,6 +8,7 @@
 
 emulate -L zsh
 local left right prebuffer buffer=$BUFFER lbuffer=$LBUFFER
+local TMPSUFFIX=.zsh
 # set up parameters depending on which context we are called from,
 # see below comment for more details
 if (( REGION_ACTIVE )); then
-- 
2.30.1



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 203 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-06-03  7:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-28 13:35 [PATCH] Set TMPSUFFIX=.zsh in edit-command-line Akinori MUSHA
2021-05-29 11:41 ` Daniel Shahaf
2021-05-31 22:54   ` Bart Schaefer
2021-06-02  3:27     ` Akinori MUSHA
2021-06-03  7:51     ` Oliver Kiddle

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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 NNTP newsgroup(s).