<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<title>tmpfile.YWLXtH</title>
<style>
html {
line-height: 1.5;
font-family: Georgia, serif;
font-size: 20px;
color: #1a1a1a;
background-color: #fdfdfd;
}
body {
margin: 0 auto;
max-width: 36em;
padding-left: 50px;
padding-right: 50px;
padding-top: 50px;
padding-bottom: 50px;
hyphens: auto;
word-wrap: break-word;
text-rendering: optimizeLegibility;
font-kerning: normal;
}
@media (max-width: 600px) {
body {
font-size: 0.9em;
padding: 1em;
}
}
@media print {
body {
background-color: transparent;
color: black;
font-size: 12pt;
}
p, h2, h3 {
orphans: 3;
widows: 3;
}
h2, h3, h4 {
page-break-after: avoid;
}
}
p {
margin: 1em 0;
}
a {
color: #1a1a1a;
}
a:visited {
color: #1a1a1a;
}
img {
max-width: 100%;
}
h1, h2, h3, h4, h5, h6 {
margin-top: 1.4em;
}
h5, h6 {
font-size: 1em;
font-style: italic;
}
h6 {
font-weight: normal;
}
ol, ul {
padding-left: 1.7em;
margin-top: 1em;
}
li > ol, li > ul {
margin-top: 0;
}
blockquote {
margin: 1em 0 1em 1.7em;
padding-left: 1em;
border-left: 2px solid #e6e6e6;
color: #606060;
}
code {
font-family: Menlo, Monaco, 'Lucida Console', Consolas, monospace;
font-size: 85%;
margin: 0;
}
pre {
margin: 1em 0;
overflow: auto;
}
pre code {
padding: 0;
overflow: visible;
}
.sourceCode {
background-color: transparent;
overflow: visible;
}
hr {
background-color: #1a1a1a;
border: none;
height: 1px;
margin: 1em 0;
}
table {
margin: 1em 0;
border-collapse: collapse;
width: 100%;
overflow-x: auto;
display: block;
font-variant-numeric: lining-nums tabular-nums;
}
table caption {
margin-bottom: 0.75em;
}
tbody {
margin-top: 0.5em;
border-top: 1px solid #1a1a1a;
border-bottom: 1px solid #1a1a1a;
}
th {
border-top: 1px solid #1a1a1a;
padding: 0.25em 0.5em 0.25em 0.5em;
}
td {
padding: 0.125em 0.5em 0.25em 0.5em;
}
header {
margin-bottom: 4em;
text-align: center;
}
#TOC li {
list-style: none;
}
#TOC a:not(:hover) {
text-decoration: none;
}
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
ul.task-list{list-style: none;}
.display.math{display: block; text-align: center; margin: 0.5rem auto;}
</style>
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
<![endif]-->
</head>
<body>
<p>Hi Gary,</p>
<p>Thanks a lot for your very helpful comments, and also for detailing this well your solutions to the issues you've raised. It's greatly appreciated.</p>
<p>I have updated the script using your input, see details below and in the diff. I only tested it quickly and I have to go in a meeting, hopefully I didn't introduce new bugs.</p>
<blockquote>
<p>That is very nice. No more piping rem to less and not asking for<br />
enough weeks or months. Thank you.</p>
<p>I had a problem when I first tried to add a reminder, though: vim<br />
opened the current directory instead of the argument to remint.sh.<br />
I took a look at the script and found a few issues.<br />
This should now be fixed in <code>master</code>. <code>remint</code> will take any file or folder given as argument, and in the latter case it will read any <code>*.rem</code> file it contains and create a <code>100-remint.rem</code> into that folder which will be used as default file for adding new events. If no argument is supplied, then it will look into <code>~/.config/remind/reminders</code> and <code>~/.reminders</code>, which both can be files or directories (using the same logic as above).</p>
</blockquote>
<blockquote>
<ul>
<li>EDITOR is an environment variable set by users to tell programs<br />
what their preferred editor is. It should not be altered as it is<br />
at line 36.<br />
I agree, I needed some way to detect whether it is set at all, but I have modified the corresponding line so that the scripts sets it if and only if not already set in environment.</li>
</ul>
</blockquote>
<blockquote>
<ul>
<li>On the help screen, the word "week" is missing its k. (Line 75)<br />
Fixed.</li>
</ul>
</blockquote>
<blockquote>
<ul>
<li>When executing $EDITOR, vim and vi, the script has the editor jump<br />
to line 2 of $FILE. That interferes with automatically jumping to<br />
the last cursor position, which I prefer for my reminders.<br />
Good point; everyone's habits with their text editors are so diverse it's not easy to set any opinionated default behavior. I've chosen to keep that line jump only for <code>a</code> (add) since this option is meant to autofill the currently selected date in the reminders file. <code>e</code> (edit) now just opens the file without any preset cursor coordinates.</li>
</ul>
</blockquote>
<blockquote>
<ul>
<li>When testing for the existence of a program, the script uses<br />
tests like this one for 'kak':</li>
</ul>
<p>if type "$(which kak)" > /dev/null; then</p>
<p>Using 'which' here is redundant--'type' alone will do what you<br />
want. Also, 'type' sends error messages to stderr, so that should<br />
be directed to /dev/null as well. The test then becomes this:</p>
<p>if type kak &> /dev/null; then<br />
You're absolutely right, thanks!</p>
</blockquote>
<blockquote>
<ul>
<li>Some comments state that you'd like to insert $REF<br />
programmatically. For vim, you can do this (at line 257):</li>
</ul>
<p>vim -c "put ='$REF '" -c "startinsert!" "$FILE"<br />
Thanks, I added it. Now hopefully I or someone else will find how to do something similar in <code>emacs</code> and most cases will be covered (I have set <code>vi</code> and <code>nano</code> as additional fallback editors, but I assume most users will be covered with <code>emacs</code> and <code>vim</code>).</p>
</blockquote>
<blockquote>
<ul>
<li>Remind can use the environment variable DOTREMINDERS to find the<br />
reminders file if it not in the default place. It would be nice<br />
if remint.sh used that as well. I changed the code at line 435<br />
to this:</li>
</ul>
<p>if [[ -n "$DOTREMINDERS" ]] && [[ -e "$DOTREMINDERS" ]]; then<br />
INPUT="$DOTREMINDERS"<br />
elif [[ -e "$HOME/.config/remind/reminders" ]]; then<br />
I didn't know about that, implemented your change.</p>
</blockquote>
<blockquote>
<ul>
<li>I'm not sure what the difference is between INPUT and FILE, but<br />
FILE was not defined the first time I tried using the 'a' (add)<br />
command, so I added</li>
</ul>
<p>FILE=${1}"</p>
<p>below line 466 (now line 468 in my modified copy).<br />
<code>$FILE</code> is the target file for <code>e</code> and <code>a</code>, <em>i.e.</em>, the file to edit and add new events to. <code>$INPUT</code> is what <code>remint</code>/<code>remind</code> read from, <em>i.e.</em>, the same as <code>$FILE</code> if using only a single file, or a directory. There was a hole in this logic (now fixed, hopefully) which was causing the issue you had initially with <code>vim</code> opening the folder instead of a file.</p>
</blockquote>
<blockquote>
<ul>
<li>Every time the ui function finishes some command other than 'q',<br />
it calls itself again. This puts another piece of information on<br />
bash's call stack. For such a small script that is used briefly,<br />
then quit, this is probably not a problem, but it could be if<br />
someone just left it running. I didn't change anything related to<br />
this.<br />
I am not sure I understand what would be the issue if the script is left running, since the function executes itself but is paused every so often by all those <code>read</code> lines to wait for user input. Maybe I missed something though.</li>
</ul>
</blockquote>
<blockquote>
<p>I hope that's helpful. I look forward to using remint.sh often.<br />
Very. Many thanks!</p>
</blockquote>
<p>Cheers,</p>
<p>M</p>
</body>
</html>