diff options
author | B. Stack <bgstack15@gmail.com> | 2022-04-07 09:43:17 -0400 |
---|---|---|
committer | B. Stack <bgstack15@gmail.com> | 2022-04-07 09:49:34 -0400 |
commit | 6253daa83d11aa07027476d05b4385295c3fe944 (patch) | |
tree | 5bdfb8ca22bda8633203865b09a5e0d5c59a8d0b /scite-fedora | |
parent | use full global.properties in rpm (diff) | |
download | stackrpms-6253daa83d11aa07027476d05b4385295c3fe944.tar.gz stackrpms-6253daa83d11aa07027476d05b4385295c3fe944.tar.bz2 stackrpms-6253daa83d11aa07027476d05b4385295c3fe944.zip |
fix #29: add functions to scite stackrpms.lua
Diffstat (limited to 'scite-fedora')
-rw-r--r-- | scite-fedora/SciTEGlobal.properties | 16 | ||||
-rw-r--r-- | scite-fedora/scite.spec | 16 | ||||
-rw-r--r-- | scite-fedora/stackrpms.lua (renamed from scite-fedora/emitUnicode.lua) | 33 |
3 files changed, 53 insertions, 12 deletions
diff --git a/scite-fedora/SciTEGlobal.properties b/scite-fedora/SciTEGlobal.properties index 4150caa..1dd5e11 100644 --- a/scite-fedora/SciTEGlobal.properties +++ b/scite-fedora/SciTEGlobal.properties @@ -549,12 +549,22 @@ txt2tags verilog vhdl visualprolog # The set of imports allowed can be set with #imports.include=ave -ext.lua.startup.script=$(SciteDefaultHome)/emitUnicode.lua -command.name.8.*=Emit UTF8 Unicode +ext.lua.startup.script=$(SciteDefaultHome)/stackrpms.lua +command.name.8.*=Emit &UTF8 Unicode command.subsystem.8.*=3 -command.8.*=emitUtf8UnicodeIntoTheSciteEditor +command.8.*=emitUnicode command.mode.8.*=savebefore:no command.shortcut.8.*=Ctrl+U +command.name.9.*=Insert &Date AH +command.subsystem.9.*=3 +command.9.*=InsertDateAH +command.mode.9.*=savebefore:no +command.shortcut.9.*=F5 +command.name.10.*=Insert Date iso8601 +command.subsystem.10.*=3 +command.10.*=InsertDateIso +command.mode.10.*=savebefore:no +command.shortcut.10.*=Shift+F5 # Import all the language specific properties files in this directory import * diff --git a/scite-fedora/scite.spec b/scite-fedora/scite.spec index d51ddd2..1cc96e7 100644 --- a/scite-fedora/scite.spec +++ b/scite-fedora/scite.spec @@ -5,8 +5,8 @@ %define with_lua 1 # Use bundled lua. If 0, then use distro lua %define with_bundled_lua 0 -# Add my emitUnicode lua script -%define with_emitunicode 1 +# Add my custom lua script +%define with_custom_script 1 # Choose GTK=2 or GTK=3. El6 is hardcoded to 2. %define gtk_ 3 @@ -47,8 +47,8 @@ Url: http://www.scintilla.org/SciTE.html Packager: B. Stack <bgstack15@gmail.com> Source0: https://www.scintilla.org/scite%{tarballversion}.tgz -%if 0%{with_emitunicode} -Source1: emitUnicode.lua +%if 0%{with_custom_script} +Source1: stackrpms.lua %endif Source2: SciTEGlobal.properties Patch0: scite-utf8.patch @@ -121,8 +121,8 @@ desktop-file-install --delete-original \ --remove-key Encoding \ %{buildroot}%{_datadir}/applications/SciTE.desktop -%if 0%{with_emitunicode} -install -D -p -m 644 %{SOURCE1} %{buildroot}%{_datadir}/scite/emitUnicode.lua +%if 0%{with_custom_script} +install -D -p -m 644 %{SOURCE1} %{buildroot}%{_datadir}/scite/stackrpms.lua %endif install -D -p -m 666 %{SOURCE2} %{buildroot}%{_datadir}/scite/SciTEGlobal.properties %if 0%{?fedora} @@ -147,9 +147,9 @@ install -D -p -m 666 %{SOURCE2} %{buildroot}%{_datadir}/scite/SciTEGlobal.proper %{_libdir}/* %changelog -* Mon Apr 04 2022 B. Stack <bgstack15@gmail.com> - 5.2.2-1/3.7.6-1 +* Mon Apr 04 2022 B. Stack <bgstack15@gmail.com> - 5.2.2-2/3.7.6-1 - Update version -- Add tunables: gtk, lua, bundled lua, add emitunicode +- Add tunables: gtk, lua, bundled lua, add stackrpms.lua - Add customized SciTEGlobal.properties * Thu Mar 24 2022 B. Stack <bgstack15@gmail.com> - 5.2.1-1/3.7.6-1 diff --git a/scite-fedora/emitUnicode.lua b/scite-fedora/stackrpms.lua index 70d32b1..8423feb 100644 --- a/scite-fedora/emitUnicode.lua +++ b/scite-fedora/stackrpms.lua @@ -226,7 +226,7 @@ end -- Writes a message to the Output pane, if no codepoint existed -- at the left of the cursor. -- -function emitUtf8UnicodeIntoTheSciteEditor() +function emitUnicode() local ok = emitUtf8Unicode() if not ok then @@ -245,3 +245,34 @@ end -- -- http://lua-users.org/lists/lua-l/2007-08/msg00276.html -- http://keplerproject.github.io/luadoc/ + +-- Reference: http://lua-users.org/wiki/SciteInsertDate +-- Tags used by os.date: +-- %a abbreviated weekday name (e.g., Wed) +-- %A full weekday name (e.g., Wednesday) +-- %b abbreviated month name (e.g., Sep) +-- %B full month name (e.g., September) +-- %c date and time (e.g., 09/16/98 23:48:10) +-- %d day of the month (16) [01-31] +-- %H hour, using a 24-hour clock (23) [00-23] +-- %I hour, using a 12-hour clock (11) [01-12] +-- %M minute (48) [00-59] +-- %m month (09) [01-12] +-- %p either "am" or "pm" (pm) +-- %S second (10) [00-61] +-- %w weekday (3) [0-6 = Sunday-Saturday] +-- %x date (e.g., 09/16/98) +-- %X time (e.g., 23:48:10) +-- %Y full year (1998) +-- %y two-digit year (98) [00-99] +-- %% the character '%' +function InsertDateAH() + local dow = tostring(os.date("%w") + 1) + local d1 = os.date("%Y-%m-%d-") + local d2 = os.date(" %H:%M") + editor:AddText(d1..dow..d2) +end +function InsertDateIso() + local date_string = os.date("%Y-%m-%dT%T") + editor:AddText(date_string) +end |