[dev] environment variables versus runtime configuration (rc) files versus X resources

2014-11-03 Thread Greg Reagle
I just had a thought that might be of interest to fans of the suckless
philosophy.

It occurred to me that environment variables can be used to configure a
program, instead of programming in a parser or extension language into a
program.  Are there any reasons not to just use environment variables? 
Then a rc file could just be a shell script that sets environment
variables.  Do you know of any programs that do this?  I assume there
are disadvantages, but what?

-- 
http://www.fastmail.fm - Choose from over 50 domains or use your own




[dev] slides for runit and ignite, Christian Neukirchen

2014-11-03 Thread Greg Reagle
http://suckless.org/conference
I'd love to see the slides for 
Christian presented runit and ignite and discussed if these systems
  are in line with the suckless philosophy.

-- 
http://www.fastmail.fm - Choose from over 50 domains or use your own




Re: [dev] environment variables versus runtime configuration (rc) files versus X resources

2014-11-03 Thread Greg Reagle
On Mon, Nov 3, 2014, at 02:37 PM, Markus Teich wrote:
> you still have to parse the contents of the environment variables
> compared to
> static compiled in configuration as in config.h.

That's true and that's a good point, but I am interested in discussing
environment variables as a form of *run-time* configuration, not compile
time.  I know that many suckless programs use only compile-time
configuration and command line options, but I imagine that there might
be some cases where compile-time configuration is not appropriate (e.g.
intended audience is not programmers or program is hard/slow to
compile).

-- 
http://www.fastmail.fm - Or how I learned to stop worrying and
  love email again




Re: [dev] environment variables versus runtime configuration (rc) files versus X resources

2014-11-03 Thread Greg Reagle
On Mon, Nov 3, 2014, at 02:59 PM, Dimitris Papastamos wrote:
> The environment is also of limited size.  I think POSIX guarantees a
> space
> of about 2kB iirc for environment variables.

Thanks Dimitris.  That would definitely be a disadvantage.

> This approach also does not scale in general as people will start naming
> variables differently and possibly result in collisions.

Of course developers would have to use a prefix to prevent name
collisions.  Instead of a line in .muttrc
set edit_headers = yes
There would be a line in .muttrc
export mutt_edit_headers=yes

-- 
http://www.fastmail.fm - Same, same, but different...




Re: [dev] environment variables versus runtime configuration (rc) files versus X resources

2014-11-03 Thread Greg Reagle
On Mon, Nov 3, 2014, at 02:45 PM, FRIGN wrote:
> Not everyone runs his programs from a shell.

Definitely.  I wouldn't want that to be a requirement.  I would want the
environment to be a tool for implementing run-time configuration, rather
than a user-interface requirement.  Whether that is possible or
advisable is another issue.

-- 
http://www.fastmail.fm - Choose from over 50 domains or use your own




Re: [dev] environment variables versus runtime configuration (rc) files versus X resources

2014-11-03 Thread Greg Reagle
On Mon, Nov 3, 2014, at 03:21 PM, Dimitris Papastamos wrote:
> Another down-side is that different shells use different syntax for
> setting
> and unsetting environment variables, which can be a PITA if you want
> to share your configuration.

I am just speculating here, a though experiment, but that shouldn't be a
problem if a shell is chosen by convention (maybe Bourne shell).  Using
mutt as an example just because I happen to use mutt, and it has way too
many runtime configuration variables to use the recompile config.h
approach.  If the mutt developers chose to use Bourne shell syntax, then
all mutt users would be using the same syntax.  So .muttrc would be
export mutt_edit_headers=yes
export mutt_mime_forward=ask-yes
and so on.  And mutt could reduce its lines of code by relying on an
external tool.

But since I am speculating, I am probably overlooking some significant
issues.  I don't know how much code could really be discarded.  A few
serious problems have already been pointed out, such as lack of space in
the environment.  But I've had fun thinking about throwing away all the
many many lines of codes duplicated across applications to control
run-time configuration.  It will probably remain a fun thought and no
more.

-- 
http://www.fastmail.fm - mmm... Fastmail...




Re: [dev] environment variables versus runtime configuration (rc) files versus X resources

2014-11-03 Thread Greg Reagle
On Mon, Nov 3, 2014, at 04:11 PM, Charlie Kester wrote:
> Environment variables are essentially global variables, visible to every
> program and not just the one you want to configure.

Not necessarily.  If you set them in .profile or .bashrc or .xsession
then yes, but each program processes its own rc file.  Other programs
would not be affected.  Of course the environment would be inherited by
any child processes, but I don't see a problem there.  To use mutt as an
example, mutt would process .muttrc on startup (using environment
variables and a shell) so it wouldn't need its own cusom rc processing
code.  Other programs would not see these variables, other than child
processes of mutt.

Just using mutt as an example here, not trying to pick on mutt.  I just
need an example to make things more clear.

-- 
http://www.fastmail.fm - mmm... Fastmail...




Re: [dev] environment variables versus runtime configuration (rc) files versus X resources

2014-11-03 Thread Greg Reagle
On Mon, Nov 3, 2014, at 05:14 PM, Martti Kühne wrote:
> On Mon, Nov 3, 2014 at 10:30 PM, Brandon Mulcahy 
> wrote:
> > choice (besides doing something like `export option=a; command; export
> > option=b`). I do wish the concept of aliasing were a bit more general.
> 
> 
> Did you hear of the shell feature where you could immediately pass
> environment variables by prepending them to your command?
> Like so:
> 
> export option=b;
> option=a command;
> echo $option # shows b

And if your shell of choice doesn't happen to support that feature, or
if you just want to do it in a way that will work regardless of the
shell, there is the env command:
env a=1 b=2 c=3 command

-- 
http://www.fastmail.fm - Accessible with your email software
  or over the web




Re: [dev] [st] delele behaves as backspace... again

2014-11-04 Thread Greg Reagle
On Tue, Nov 4, 2014, at 01:24 PM, k...@shike2.com wrote:
> If you are interested in this solution this is the patch:

Thank you very much, that is much better.  Now my Backspace keys deletes
one character to the left AND my Delete key deletes one character to the
right, on the command line and in nano and emacs.  Even Ctrl-H in Emacs
invokes help.

In case you're curious I run Manjaro Linux with fish and dvtm.  This
patch also makes st comply with Debian policy,
http://www.debian.org/doc/debian-policy/ch-opersys.html#s9.8

-- 
http://www.fastmail.fm - A no graphics, no pop-ups email service




[dev] why reinvent busybox etc.?

2014-11-07 Thread Greg Reagle
I infer from the existence of sbase and ubase that the other
alternatives that already exist (e.g. busybox, toybox, GNU) are
considered too full of suck. Is that right?

I would guess that the GNU utilities are considerd too bloated.  What
are the perceived shortcomings of busybox and toybox?  What about Plan 9
from User Space?

Thanks.

-- 
http://www.fastmail.fm - A no graphics, no pop-ups email service




Re: [dev] why reinvent busybox etc.?

2014-11-07 Thread Greg Reagle
I neglected to mention the Heirloom Toolchest at
http://heirloom.sourceforge.net/tools.html as another alternative.

On Fri, Nov 7, 2014, at 11:56 AM, Greg Reagle wrote:
> I infer from the existence of sbase and ubase that the other
> alternatives that already exist (e.g. busybox, toybox, GNU) are
> considered too full of suck. Is that right?
> 
> I would guess that the GNU utilities are considerd too bloated.  What
> are the perceived shortcomings of busybox and toybox?  What about Plan 9
> from User Space?
> 
> Thanks.

-- 
http://www.fastmail.fm - One of many happy users:
  http://www.fastmail.fm/help/overview_quotes.html




Re: [dev] dvtm status update

2014-11-07 Thread Greg Reagle
I am also a very happy daily user of dvtm and I recommend it.  I use it
like such:
dtach -A ~/dtach-socket -z -r winch dvtm -M

I used tmux before dvtm.  I didn't have any real problems with tmux, but
I like dvtm better because I find tmux to be too elaborate, too many
options, too many keybindings, too much functionality in one program.  I
found this article helpful "Three-way mini shootout between GNU screen,
tmux and dtach+dvtm" at
http://chithanh.blogspot.com/2010/07/three-way-mini-shootout-between-gnu.html

-- 
http://www.fastmail.fm - Access all of your messages and folders
  wherever you are




Re: [dev] [sbase] style

2014-11-18 Thread Greg Reagle
Another way to provide style guidance is to refer to a particular source
file or project as an epitome or paragon, if such a paragon exists  That
takes much less time than explicitly developing a style guide.

-- 
http://www.fastmail.com - Does exactly what it says on the tin




[dev] why avoid install?

2014-11-18 Thread Greg Reagle
Hello.  Is there a particular reason that a combination of cp, mkdir,
and chmod are used rather than the install command, in several suckless
projects (in the install target of Makefile)?  

Sorry if the answer is obvious.  I am trying to learn.  Thanks.

-- 
http://www.fastmail.com - The way an email service should be




Re: [dev] Operating system choice

2014-11-19 Thread Greg Reagle
On 11/19/2014 01:19 PM, Josh Lawrence wrote:
> I'm curious to know what flavor of *nix people on this list use on a
> day-to-day basis.

I use:
Ubuntu LTS: job workstation and job server
Manjaro: job laptop and home laptop
Debian stable: home desktop and job server

I really like the stability of Debian, the ease of use of Ubuntu, and the 
recent packages of Manjaro.  For my coworkers (who are neither programmers nor 
sysadmins) who want Linux I install Xubuntu LTS.

I have dabbled with OpenBSD and NetBSD.  From what I know of Plan 9 (which is 
just a little bit), it seems to be the ultimate in sucklessness.




Re: [dev] Operating system choice

2014-11-20 Thread Greg Reagle
On Thu, Nov 20, 2014, at 09:25 PM, Charles Thorley wrote:
> It's surprising to me that Minix 3 appears to be, by way of googling
> 'site:lists.suckless.org minix', almost completely ignored by this
> mailing list.  This thread brought that curiosity to my attention once
> again.  I wonder if anyone would be willing to shed some light on this
> apparent discrepancy, even if it's only to correct my misunderstanding.

Well I am a member of this mailing list, and I am very interested in
Minix.  I find it too immature to be "usable" at this point, but it is
fascinating.  For example it has very limited hardware support.  I
fervently hope that it does really well.  I have made some very very
minor contributions to the Minix wiki and I've run it in a virtual
machine.  Note that when it is fully mature it will be a NetBSD clone
but with a very reliable and fault-tolerant core of the operating
system.

Speaking of NetBSD, I really like the concept of the NetBSD packaging
system (pkgsrc) as one packaging system for all the Unix-like operating
systems.  I don't know if it's implemented in a suckless way, but I
don't like all the duplication of effort of the very many packaging
systems out there.

These are my own opinions only.

-- 
http://www.fastmail.com - Email service worth paying for. Try it for free




Re: [dev] [surf] web videos idea

2014-11-23 Thread Greg Reagle
I use extension DownloadHelper for Firefox then play movie file with
mplayer.  You can also inspect the source of the HTML page as the full
URL of the video is often there (usually ends with .mp4 or .flv).  Many
video players will work with an http URL so you don't need an extra
download step.

On Fri, Nov 21, 2014, at 07:39 PM, Henrique Lengler wrote:
> I have a video player (mplayer) installed on my computer with a lot of
> codecs, so it is able to play a lot of videos formats.
> I don't like the idea of installing some plugins like gstreamer to play
> vide on on the browser if have a video player already working.
> 
> This is the Unix philosophy: Write programs that do one thing and do 
> it well. Write programs to WORK TOGETHER.
> 
> So I just thought, is there a way to combine both, my web browser that
> will
> care only about display the html stuff, and leave the video work to my 
> video player? This would be awesome.

-- 
http://www.fastmail.com - Same, same, but different...




[dev] Project ideas: goblin

2014-11-25 Thread Greg Reagle
>From http://suckless.org/project_ideas:
> Write the most useful unix userland commands in the new Go language
> created by Google to form a robust base for future Unix-like
> userlands that do not suffer from the vulnerabilities that are
> common in C or C++ code.

Is anyone still interested in this?  I am tempted to dabble in this.
I do not share the love of C that a lot of the suckless programmers
seem to have (though I do share the hatred of C++), and I think that a
higher level language would have a lot of advantages.

However, it seems pointless to proceed unless the Go version is going
to supplant the C version.  Why have the duplication?

Has anyone taken a stab at this?  Any other thoughts?

Thank you.

-- 
http://www.fastmail.com - The professional email service




Re: [dev] Project ideas: goblin

2014-11-25 Thread Greg Reagle
On Tue, Nov 25, 2014, at 05:18 PM, Bobby Powers wrote:
> To be clear - I don't support rewriting system utilities in Go.  *base
> are starting to look nice, and statically link down to a very small
> size.  I don't see any wins in rewriting these in Go.

Thank you for your feedback.  This seems to be the consensus.  I have no
interest in re-writing programs in Go that won't be adopted by suckless.

-- 
http://www.fastmail.com - Access your email from home and the web




Re: [dev] Project ideas: goblin

2014-11-25 Thread Greg Reagle
On Tue, Nov 25, 2014, at 05:29 PM, FRIGN wrote:
> Frankly, we don't need yet another discussion on a topic like this.

Thank you for your feedback.  I wasn't trying to start a *discussion*,
but as it was listed on http://suckless.org/project_ideas, I wanted to
see whether there would actually be support from the suckless community
for it.  It seems that there is not (which is fine, I just wanted to
know).

If you don't want the topic to come up again, removing it from
http://suckless.org/project_ideas might decrease the likelihood that
someone will ask about it.

-- 
http://www.fastmail.com - Accessible with your email software
  or over the web




Re: [dev] Object-Oriented C for interface safety?

2014-11-26 Thread Greg Reagle
If you want to program in C, there are ways to implement abstract data
types, encapsulation, and implementation hiding that are fairly easy. 
Basically this involves using the "static" keyword for functions and
variables that you want to be private to the implementation and don't
put their prototypes/declaration in the .h file you intend for public
use.  Then you can declare the variables and functions that you want to
be public without the "static" keyword and put their prototypes in the
public .h file. You can craft the module at whatever level of
abstraction/data hiding that you want.

Here is one example
http://alastairs-place.net/blog/2013/06/03/encapsulation-in-c/

If you want a higher level language than C (I don't blame you if you
do), some people on this list have recently mentioned Go and Rust.

-- 
http://www.fastmail.com - IMAP accessible web-mail




[dev] problem report for sbase/cal

2014-12-15 Thread Greg Reagle
greagle@530GA ~/a/sbase> ./cal -3
November 2014  December 2014  January 2015
Su Mo Tu We Th Fr Sa   Su Mo Tu We Th Fr Sa   Su Mo Tu We Th Fr Sa
   1   1  2  3  4  5  6 1  2  3  4
 2  3  4  5  6  7  87  8  9 10 11 12 135  6  7  8  9 10 11
 9 10 11 12 13 14 15   14 15 16 17 18 19 20   12 13 14 15 16 17 18
16 17 18 19 20 21 22   21 22 23 24 25 26 27   19 20 21 22 23 24 25
23 24 25 26 27 28 29   28 29 30 3126 27 28 29 30 31
30
greagle@530GA ~/a/sbase> ./cal 1 2015
January 2015
Su Mo Tu We Th Fr Sa
 1  2  3
 4  5  6  7  8  9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31

January 2015 is supposed to start on a Thursday.  Note the first result
is incorrect but the second result is correct.  I wish I could provide a
patch too, but I don't understand the calendar algorithm(s) used in
cal.c.  Incidentally, I am in the process of doing a rewrite of cal for
my own education and entertainment (and maybe for submission to
suckless, if it turns out well), and it does not have this problem, but,
alas, it is not ready yet.

-- 
http://www.fastmail.com - IMAP accessible web-mail




Re: [dev] [ratox] status of helper scripts

2014-12-18 Thread Greg Reagle
On Thu, Dec 18, 2014, at 10:52 AM, sek...@posteo.se wrote:
> That language catox is written in ... I'll have to contact the author, no
> idea how to get this going.

LiveScript  http://livescript.net/

-- 
http://www.fastmail.com - Accessible with your email software
  or over the web




Re: [dev] [dmenu] [PATCHES 1-5] Changes and cleanup

2014-12-23 Thread Greg Reagle
On Tue, Dec 23, 2014, at 10:42 AM, Anthony J. Bentley wrote:
> The point of this rule is not visual alignment. Width of the type doesn't
> matter; it is always one tab. The advantage is that you can find the
> declaration of member foo by grepping for ^Ifoo.

That violates the suckless style guide at http://suckless.org/style:
"This means no tabs except beginning of line"

-- 
http://www.fastmail.com - A fast, anti-spam email service.




[dev] problem report with sbase/cal

2014-12-23 Thread Greg Reagle
Greetings.  I was born well after the year -7, so I don't know if there
were any calendar shenanigans going on that long ago, but it looks like
an error:

greagle@530GA ~/D/p/sbase> ./cal -3 1 -7
January -7 February -7 March -7
Su Mo Tu We Th Fr Sa   Su Mo Tu We Th Fr Sa   Su Mo Tu We Th Fr Sa
 1  2  3  4  5  6  7   1  2  3  4  5  6  1  2  3  4  5
 8  9 10 11 12 13 147  8  9 10 11 12 136  7  8  9 10 11 12
15 16 17 18 19 20 21   14 15 16 17 18 19 20   13 14 15 16 17 18 19
22 23 24 25 26 27 28   21 22 23 24 25 26 27   20 21 22 23 24 25 26
29 30 31   28 27 28 29 30 31

Note that Monday (Feb. 1) follows Tuesday (Jan. 31) and that Tuesday
(Mar. 7) follows Sunday (Feb. 28).  I cannot compare it to the cal
installed on my computer (util-linux) because it only deals with
positive years.

As I mentioned earlier, I am re-writing cal for my fun and my education,
and now it is ready for its debut.  I'll introduce it in another
message.  My re-write does not have this problem.

-- 
http://www.fastmail.com - mmm... Fastmail...




[dev] [PATCH] - no limit on number of months: removed MONTHMAX - strings printed to stdout rather than copied to memory - rewritten date calculation algorithms

2014-12-23 Thread Greg Reagle

---
 cal.c | 153
 ++
 1 file changed, 78 insertions(+), 75 deletions(-)

diff --git a/cal.c b/cal.c
index dca2313..20d26be 100644
--- a/cal.c
+++ b/cal.c
@@ -1,101 +1,105 @@
 /* See LICENSE file for copyright and license details. */
+/* © 2014 Greg Reagle  */
 #include 
 #include 
 #include 
 
 #include "util.h"
 
-#define MONTHMAX 100
+static int
+isleap(int year)
+{
+   if (year % 400 == 0)
+   return 1;
+   if (year % 100 == 0)
+   return 0;
+   return (year % 4 == 0);
+}
+
+static int
+monthlength(int year, int month)
+{
+   int mdays[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
};
+   return (month==1 && isleap(year))  ?  29  :  mdays[month];
+}
 
-static void drawcal(int, int, int, int, int, int);
-static int dayofweek(int, int, int, int);
-static int isleap(int);
-static void usage(void);
+/* From http://www.tondering.dk/claus/cal/chrweek.php#calcdow */
+static int
+dayofweek(int year, int month, int dom)
+{
+   int m, y, a;
+   month += 1;  /*  in this formula, 1 <= month <= 12  */
+   a = (14 - month) / 12;
+   y = year - a;
+   m = month + 12*a - 2;
+   return (dom + y + y/4 - y/100 + y/400 +((31*m)/12)) % 7;
+}
+
+static void 
+printgrid(int year, int month, int fday, int line)
+{
+   int dom, offset, d=0;
+
+   offset = dayofweek(year, month, 1) - fday;
+   if (offset < 0)
+   offset += 7;
+   if (line==1) {
+   for ( ; d < offset; ++d)
+   printf("   ");
+   dom = 1;
+   } else {
+   dom = 8-offset + (line-2)*7;
+   }
+   for ( ; d < 7 && dom <= monthlength(year, month); ++d, ++dom)
+   printf("%2d ", dom);
+   for ( ; d < 7; ++d)
+   printf("   ");
+}
 
 static void
 drawcal(int year, int month, int day, int ncols, int nmons, int fday)
 {
-   char str[21];
-   int count[MONTHMAX];
-   int d, i, r, j;
-   int moff, yoff, cur, last, ndays, day1;
-   char *smon[] = {
-   "January", "February", " March",
-   " April", "  May", "  June",
-   "  July", " August", "   September",
-   "October", "November", "December" };
-   int mdays[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
};
-   int row = 0;
+   char *smon[] = {"  January", " February", "March", "   
April",
+   "  May", " June", " July", "  
August",
+   "September", "  October", " November", "
December" };
char *days[] = { "Su", "Mo", "Tu", "We", "Th", "Fr", "Sa", };
-
-   if (!ncols)
-   ncols = nmons;
-   while (nmons > 0) {
-   last = MIN(nmons, ncols);
-   for (i = 0; i < last; i++) {
-   moff = month + ncols * row + i - 1;
-   cur = moff % 12;
-   yoff = year + moff / 12;
-
-   snprintf(str, sizeof(str), "%s %d", smon[cur],
yoff);
-   printf("%-20s   ", str);
-   count[i] = 1;
+   int m, n, col, cur_year, cur_month, line, dow;
+
+   for (m = 0; m < nmons; ) {
+   n = m;
+   for (col = 0; m < nmons && col < ncols; ++col, ++m) {
+   cur_year = year + m/12;
+   cur_month = month + m%12;
+   if (cur_month > 11) {
+   cur_month -= 12;
+   cur_year += 1;
+   }
+   printf("   %s %d", smon[cur_month],
cur_year);
+   printf("  ");
}
printf("\n");
-
-   for (i = 0; i < last; i++) {
-   for (j = fday; j < LEN(days); j++)
-   printf("%s ", days[j]);
-   for (j = 0; j < fday; j++)
-   printf("%s ", days[j]);
+   for (col = 0, m = n; m < nmons && col < ncols; ++col,
++m) {
+   for (dow = fday; dow < (fday+7); ++dow)
+   printf("%s ", days[dow%7]);
printf("  ");
}
printf("\n");
-
-   for (r = 0

Re: [dev] [PATCH] - no limit on number of months: removed MONTHMAX - strings printed to stdout rather than copied to memory - rewritten date calculation algorithms

2014-12-23 Thread Greg Reagle
I re-wrote this 

-- 
http://www.fastmail.com - Does exactly what it says on the tin




Re: [dev] [PATCH] - no limit on number of months: removed MONTHMAX - strings printed to stdout rather than copied to memory - rewritten date calculation algorithms

2014-12-23 Thread Greg Reagle
Sorry, truncated message.  Trying again.

I re-wrote this primarily for my own fun and education, but it has a few
benefits in my biased opinion:

- no limit on number of months (removed MONTHMAX)

- strings printed to stdout rather than copied to memory, eliminating
the potential for out-of-range and buffer-overflow errors

- rewritten date calculation algorithms are more clear to me

-- 
http://www.fastmail.com - Or how I learned to stop worrying and
  love email again




Re: [dev] [PATCH] - no limit on number of months: removed MONTHMAX - strings printed to stdout rather than copied to memory - rewritten date calculation algorithms

2014-12-23 Thread Greg Reagle
I don't think it is fair to the other authors for my name to be listed
without qualification in the LICENSE file since I only modified one
file.  That is why I put my name in the one file that I modified.  That
issue could be addressed, however, by putting my name in the LICENSE
file accompanied by "cal.c" to make that clear.

On Tue, Dec 23, 2014, at 12:34 PM, FRIGN wrote:
> On Tue, 23 Dec 2014 12:28:08 -0500
> Greg Reagle  wrote:
> 
> >  /* See LICENSE file for copyright and license details. */
> > +/* © 2014 Greg Reagle  */
> 
> See LICENSE file for copyright and license details.
> See LICENSE file for copyright and license details.
> See LICENSE file for copyright and license details.
> See LICENSE file for copyright and license details.
> See LICENSE file for copyright and license details.
> See LICENSE file for copyright and license details.
> See LICENSE file for copyright and license details.
> 
> -- 
> FRIGN 
> 

-- 
http://www.fastmail.com - A fast, anti-spam email service.




Re: [dev] [PATCH] - no limit on number of months: removed MONTHMAX - strings printed to stdout rather than copied to memory - rewritten date calculation algorithms

2014-12-23 Thread Greg Reagle
On Tue, Dec 23, 2014, at 01:01 PM, Dimitris Papastamos wrote:
> You did not rewrite cal(1) in its entirety.

Very true.  I am well aware of that.  I never claimed that I did.  My
point was that cal.c was the *only* file that I modified.

Would you like me to re-submit a corrected patch (i.e. my name in
LICENSE rather than cal.c) now, or wait to see if anyone actually likes
it (maybe it won't get accepted anyway)?

Thank you.

-- 
http://www.fastmail.com - Send your email first class




[dev] [PATCH] cal: Removed unused "day" variable

2015-01-06 Thread Greg Reagle
---
 cal.1 |  3 +--
 cal.c | 12 
 2 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/cal.1 b/cal.1
index a679350..c215340 100644
--- a/cal.1
+++ b/cal.1
@@ -14,8 +14,7 @@ cal \- print calendar
 .IR firstday ]
 .RB [ \-n
 .IR nmonths ]
-.RB [ [ [
-.IR day ]
+.RB [ [
 .IR month ]
 .IR year ]
 .SH DESCRIPTION
diff --git a/cal.c b/cal.c
index 28e58fe..53c6022 100644
--- a/cal.c
+++ b/cal.c
@@ -56,7 +56,7 @@ printgrid(int year, int month, int fday, int line)
 }
 
 static void
-drawcal(int year, int month, int day, int ncols, int nmons, int fday)
+drawcal(int year, int month, int ncols, int nmons, int fday)
 {
char *smon[] = {"  January", " February", "March", "April",
"  May", " June", " July", "   August",
@@ -103,14 +103,14 @@ static void
 usage(void)
 {
eprintf("usage: %s [-1] [-3] [-m] [-s] [-y] [-c columns]"
-   " [-f firstday] [-n nmonths] [ [ [day] month] year]\n",
+   " [-f firstday] [-n nmonths] [ [month] year]\n",
argv0);
 }
 
 int
 main(int argc, char *argv[])
 {
-   int year, month, day, ncols, nmons, fday;
+   int year, month, ncols, nmons, fday;
struct tm *ltime;
time_t now;
 
@@ -118,7 +118,6 @@ main(int argc, char *argv[])
ltime = localtime(&now);
year = ltime->tm_year + 1900;
month = ltime->tm_mon + 1;
-   day = ltime->tm_mday;
fday = 0;
 
ncols = 3;
@@ -160,9 +159,6 @@ main(int argc, char *argv[])
} ARGEND;
 
switch (argc) {
-   case 3:
-   day = estrtol(argv[0], 0);
-   argv++;
case 2:
month = estrtol(argv[0], 0);
argv++;
@@ -179,7 +175,7 @@ main(int argc, char *argv[])
usage();
}
 
-   drawcal(year, month-1, day, ncols, nmons, fday);
+   drawcal(year, month-1, ncols, nmons, fday);
 
return 0;
 }
-- 
2.2.1




[dev] [PATCH] If only the year operand is given, cal shall produce a calendar for all twelve months in the given calendar year.

2015-01-08 Thread Greg Reagle
---
 cal.1 |  5 +
 cal.c | 11 ++-
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/cal.1 b/cal.1
index a679350..aebd992 100644
--- a/cal.1
+++ b/cal.1
@@ -29,6 +29,11 @@ of calendars side by side. Each row of calendars contains at 
most
 .IR columns
 number of calendars. The defaults are obtained using
 .IR localtime (3).
+If
+.IR year
+is given without
+.IR month
+print the whole year, unless overridden by options.
 .SH OPTIONS
 .TP
 .B \-1
diff --git a/cal.c b/cal.c
index 28e58fe..8b04e56 100644
--- a/cal.c
+++ b/cal.c
@@ -122,7 +122,7 @@ main(int argc, char *argv[])
fday = 0;
 
ncols = 3;
-   nmons = 1;
+   nmons = 0;
 
ARGBEGIN {
case '1':
@@ -159,6 +159,15 @@ main(int argc, char *argv[])
usage();
} ARGEND;
 
+   if (nmons == 0) {
+   if (argc == 1) {
+   month = 1;
+   nmons = 12;
+   } else {
+   nmons = 1;
+   }
+   }
+
switch (argc) {
case 3:
day = estrtol(argv[0], 0);
-- 
2.2.1




[dev] sbase/cal patch for Julian calendar

2015-01-13 Thread Greg Reagle
Greetings.  I made this change in two stages hence two commits, but I
think it makes more sense to combine them into one commit. 
Unfortunately, I am not a master of git and I don't know how.  I can use
git diff to combine the changes, but git format-patch wants to do one
patch per commit.

It is attached.

-- 
http://www.fastmail.com - Accessible with your email software
  or over the web

From 715bf6068f98089a03ca2beb38facbe568ac07ff Mon Sep 17 00:00:00 2001
From: Greg Reagle 
Date: Thu, 8 Jan 2015 17:16:19 -0500
Subject: [PATCH 1/2] Julian when month is Sep 1752 or before. Gregorian when
 month is Oct 1752 or after.

---
 cal.1 |  1 +
 cal.c | 22 +-
 2 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/cal.1 b/cal.1
index c215340..659d46a 100644
--- a/cal.1
+++ b/cal.1
@@ -28,6 +28,7 @@ of calendars side by side. Each row of calendars contains at most
 .IR columns
 number of calendars. The defaults are obtained using
 .IR localtime (3).
+The Julian calendar is used for Septmeber 1752 and before.  Starting with October 1752, the Gregorian calendar is used.
 .SH OPTIONS
 .TP
 .B \-1
diff --git a/cal.c b/cal.c
index 53c6022..a000843 100644
--- a/cal.c
+++ b/cal.c
@@ -5,6 +5,9 @@
 
 #include "util.h"
 
+enum caltype {Julian, Gregorian};
+enum {Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec};
+
 static int
 isleap(int year)
 {
@@ -19,27 +22,36 @@ static int
 monthlength(int year, int month)
 {
 	int mdays[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
-	return (month==1 && isleap(year))  ?  29  :  mdays[month];
+	return (month==Feb && isleap(year))  ?  29  :  mdays[month];
 }
 
 /* From http://www.tondering.dk/claus/cal/chrweek.php#calcdow */
 static int
-dayofweek(int year, int month, int dom)
+dayofweek(int year, int month, int dom, enum caltype cal)
 {
 	int m, y, a;
 	month += 1;  /*  in this formula, 1 <= month <= 12  */
 	a = (14 - month) / 12;
 	y = year - a;
 	m = month + 12*a - 2;
-	return (dom + y + y/4 - y/100 + y/400 +((31*m)/12)) % 7;
+
+	if (cal == Gregorian)
+		return (dom + y + y/4 - y/100 + y/400 + (31*m)/12) % 7;
+	else  /* cal == Julian */
+		return (5 + dom + y + y/4 + (31*m)/12) % 7;
 }
 
 static void
 printgrid(int year, int month, int fday, int line)
 {
-	int dom, offset, d=0;
+	enum caltype cal, offset, dom, d=0;
+
+	if (year < 1752 || (year == 1752 && month <= Sep))
+		cal = Julian;
+	else 
+		cal = Gregorian;
+	offset = dayofweek(year, month, 1, cal) - fday;
 
-	offset = dayofweek(year, month, 1) - fday;
 	if (offset < 0)
 		offset += 7;
 	if (line==1) {
-- 
2.2.1


From 3520c5cccb9958a056e4885108060bdf8ed03526 Mon Sep 17 00:00:00 2001
From: Greg Reagle 
Date: Tue, 13 Jan 2015 12:37:30 -0500
Subject: [PATCH 2/2] Using the Julian calendar for dates through September 2,
 1752 and the Gregorian calendar for dates from September 14, 1752.

---
 cal.1 |  4 +++-
 cal.c | 39 ++-
 2 files changed, 29 insertions(+), 14 deletions(-)

diff --git a/cal.1 b/cal.1
index 659d46a..8619460 100644
--- a/cal.1
+++ b/cal.1
@@ -28,7 +28,7 @@ of calendars side by side. Each row of calendars contains at most
 .IR columns
 number of calendars. The defaults are obtained using
 .IR localtime (3).
-The Julian calendar is used for Septmeber 1752 and before.  Starting with October 1752, the Gregorian calendar is used.
+The Julian calendar is used through Sep 2, 1752, and the Gregorian calendar is used starting the next day with Sep 14, 1752.
 .SH OPTIONS
 .TP
 .B \-1
@@ -58,3 +58,5 @@ Specify the first day of the week. 0 is Sunday and 6 is Saturday.
 Specify the number months to print. The default is 1.
 .SH SEE ALSO
 .IR localtime (3)
+.SH STANDARDS
+This program tries to conform to IEEE Std 1003.1, 2013 Edition, q.v. http://pubs.opengroup.org/onlinepubs/9699919799/utilities/cal.html.
diff --git a/cal.c b/cal.c
index a000843..a493ec9 100644
--- a/cal.c
+++ b/cal.c
@@ -5,24 +5,30 @@
 
 #include "util.h"
 
-enum caltype {Julian, Gregorian};
 enum {Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec};
+enum caltype {Julian, Gregorian};
+enum {TRANS_YEAR = 1752, TRANS_MONTH = Sep, TRANS_DAY = 2};
 
 static int
-isleap(int year)
+isleap(int year, enum caltype cal)
 {
-	if (year % 400 == 0)
-		return 1;
-	if (year % 100 == 0)
-		return 0;
-	return (year % 4 == 0);
+	if (cal == Gregorian) {
+		if (year % 400 == 0)
+			return 1;
+		if (year % 100 == 0)
+			return 0;
+		return (year % 4 == 0);
+	}
+	else { /* cal == Julian */
+		return (year % 4 == 0);
+	}
 }
 
 static int
-monthlength(int year, int month)
+monthlength(int year, int month, enum caltype cal)
 {
 	int mdays[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
-	return (month==Feb && isleap(year))  ?  29  :  mdays[month];
+	return (month==Feb && isleap(year,cal))  ?  29  :  mdays[month];
 }
 
 /* From http://www.tondering.dk/claus/cal/chrweek.php#calcdow

Re: [dev] sbase/cal patch for Julian calendar

2015-01-16 Thread Greg Reagle
On Fri, Jan 16, 2015, at 05:04 AM, Dimitris Papastamos wrote:
> Applied your patches (squashed into a single patch), thanks!

Awesome.  Thanks for squashing for me.

-- 
http://www.fastmail.com - Choose from over 50 domains or use your own




[dev] sbase/cal: If only the year operand is given, cal shall produce a calendar for all twelve months in the given calendar year

2015-01-16 Thread Greg Reagle
Rebased as requested.  See attachment.

-- 
http://www.fastmail.com - Email service worth paying for. Try it for free

From 0485b04e2515484a3ed47ccc348bc791a856017f Mon Sep 17 00:00:00 2001
From: Greg Reagle 
Date: Thu, 8 Jan 2015 14:21:37 -0500
Subject: [PATCH] If only the year operand is given, cal shall produce a
 calendar for all twelve months in the given calendar year.

---
 cal.1 |  8 +++-
 cal.c | 11 ++-
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/cal.1 b/cal.1
index 8619460..e58b9d4 100644
--- a/cal.1
+++ b/cal.1
@@ -28,7 +28,13 @@ of calendars side by side. Each row of calendars contains at most
 .IR columns
 number of calendars. The defaults are obtained using
 .IR localtime (3).
-The Julian calendar is used through Sep 2, 1752, and the Gregorian calendar is used starting the next day with Sep 14, 1752.
+If
+.IR year
+is given without
+.IR month
+print the whole year, unless overridden by options.  The Julian calendar is used 
+through Sep 2, 1752, and the Gregorian calendar is used starting the next day 
+with Sep 14, 1752.
 .SH OPTIONS
 .TP
 .B \-1
diff --git a/cal.c b/cal.c
index 8d6dda0..52c2f6d 100644
--- a/cal.c
+++ b/cal.c
@@ -146,7 +146,7 @@ main(int argc, char *argv[])
 	fday = 0;
 
 	ncols = 3;
-	nmons = 1;
+	nmons = 0;
 
 	ARGBEGIN {
 	case '1':
@@ -183,6 +183,15 @@ main(int argc, char *argv[])
 		usage();
 	} ARGEND;
 
+	if (nmons == 0) {
+		if (argc == 1) {
+			month = 1;
+			nmons = 12;
+		} else {
+			nmons = 1;
+		}
+	}
+
 	switch (argc) {
 	case 2:
 		month = estrtol(argv[0], 0);
-- 
1.9.1



[dev] pseudo-problem copying and pasting

2015-01-22 Thread Greg Reagle
Whoever posted recently about a problem with Ctrl-y in surf, you might
very well be experiencing a confusion about the way copy and paste works
in X, rather than a genuine bug.  Note that surf, by default, when you
press Ctrl-y, copies into PRIMARY, and the paste command in a lot of
programs pastes from CLIPBOARD.

You could change surf to use CLIPBOARD instead, as was detailed in
another post.  

You could also try to remember to use the middle mouse button to paste
after pressing Ctrl-y in surf.  A lot of mouses don't have a middle
button, so on a two button mouse, middle-mouse button emulation needs to
be turned on.  On a mouse with a scroll wheel, that scroll wheel often
functions as the middle button when pressed.

-- 
http://www.fastmail.com - Does exactly what it says on the tin




[dev] surf questions

2015-01-22 Thread Greg Reagle
Sorry if the questions are rudimentary.

1) I am running surf and tabbed both from git, and XFCE.  Running tabbed
surf -e, all of my tab titles begin with "AcGDISVM:T- |".  Why is that? 
What does it mean?  Can I get rid of it?

2) How is searching supposed to work?  When I hit Ctrl-f I get "
_SURF_FIND: 1: _SURF_FIND: dmenu: not found".

-- 
http://www.fastmail.com - The way an email service should be




Re: [dev] surf questions

2015-01-22 Thread Greg Reagle
And what is caret browsing?

- Original message -
From: Greg Reagle 
To: "dev@suckless.org" 
Subject: [dev] surf questions
Date: Thu, 22 Jan 2015 15:37:23 -0500

Sorry if the questions are rudimentary.

1) I am running surf and tabbed both from git, and XFCE.  Running tabbed
surf -e, all of my tab titles begin with "AcGDISVM:T- |".  Why is that? 
What does it mean?  Can I get rid of it?

2) How is searching supposed to work?  When I hit Ctrl-f I get "
_SURF_FIND: 1: _SURF_FIND: dmenu: not found".

-- 
http://www.fastmail.com - The way an email service should be



-- 
http://www.fastmail.com - mmm... Fastmail...




[dev] sbase/tee: -i option ignores SIGINT

2015-01-22 Thread Greg Reagle
Patch attached

-- 
http://www.fastmail.com - Choose from over 50 domains or use your own



0001-i-option-ignores-SIGINT.patch
Description: Binary data


Re: [dev] pseudo-problem copying and pasting

2015-01-26 Thread Greg Reagle
On Sun, Jan 25, 2015, at 06:26 AM, Vampyrah Broadcasting wrote:
> It was me. Could you hint me to that post?

Are you aware that:
1) You can use the middle mouse button to paste after hitting Ctrl-y in
surf, and that requires no change to surf?
2) You can right click on a link in surf and a pop-up menu appears
including the item "Copy Link Location" which *does* use the clipboard
(it seems to use both clipboard and primary).

As far as a post on how to change the source code of surf to use the
clipoard rather than the primary selection for Ctrl-y, I just looked and
I cannot find it either.  Maybe it was a message to individuals rather
than to the mailing list.  Just taking a wild guess, changing it might
be as easy as replacing GDK_SELECTION_PRIMARY with
GDK_SELECTION_CLIPBOARD in function clipboard().  I haven't tried it,
just a guess.

-- 
http://www.fastmail.com - Does exactly what it says on the tin




[dev] surf: documented indicators in man page

2015-01-26 Thread Greg Reagle
Patch attached.

-- 
http://www.fastmail.com - The professional email service



0001-Documented-indicators.patch
Description: Binary data


[dev] surf alternatives for Adblock Plus, Privacy Badger, Self-Destructing Cookies, BetterPrivacy

2015-01-26 Thread Greg Reagle
Hello.  I am trying surf instead of Firefox (which I've used for very
many years).  So far so good.  The difference in memory usage is
amazing.

There are a few Firefox extensions that I've come to rely on.  What do
you use or what do you suggest that I use to provide the functionality
of the following Firefox extensions:

Adblock Plus for blocking ads, see https://adblockplus.org/

Privacy Badger for blocking trackers, see
https://www.eff.org/privacybadger

Self-Destructing Cookies for automatically deleting cookies, see
https://addons.mozilla.org/en-US/firefox/addon/self-destructing-cookies/

BetterPrivacy for blocking Flash cookies, see
https://addons.mozilla.org/en-US/firefox/addon/betterprivacy/

Thanks!

-- 
http://www.fastmail.com - Email service worth paying for. Try it for free




[dev] surf: see hover URL without changing title

2015-01-27 Thread Greg Reagle
I like that surf shows me the URL of the link over which my mouse is
hovering, but I don't want it to change the window title.  I want the
window title to stay the title of the web page that I am viewing.

Any ideas on how to make this happen?  Thanks.

-- 
http://www.fastmail.com - A no graphics, no pop-ups email service




Re: [dev] surf: see hover URL without changing title

2015-01-27 Thread Greg Reagle
On Tue, Jan 27, 2015, at 11:36 AM, Christoph Lohmann wrote:
> Propose a patch and put it on the wiki.

Yes I undertand that.  Perhaps I should have been less open-ended with
my question.  Where/how would be a good place to display the hoverlink
if not the title?  A pop-up window?  stdout?  A statusbar?  Are there
any precedents in surf for anything similar?

Thanks.

-- 
http://www.fastmail.com - A fast, anti-spam email service.




Re: [dev] surf: see hover URL without changing title

2015-01-27 Thread Greg Reagle
On Tue, Jan 27, 2015, at 11:41 AM, Greg Reagle wrote:
> Yes I undertand that.  Perhaps I should have been less open-ended with
> my question.  Where/how would be a good place to display the hoverlink
> if not the title?  A pop-up window?  stdout?  A statusbar?  Are there
> any precedents in surf for anything similar?

Well, here is the real problem.  I don't mind at all the title of the
window changing to the hoverlink in most cases, but when I *leave* a
surf window (either by mouse or keyboard) and the title stays the
hoverlink that my mouse happened to pass over last (this happens a lot
for me), I don't find that useful.  I want the title of the window to be
the title of the web page.

-- 
http://www.fastmail.com - mmm... Fastmail...




Re: [dev] surf: see hover URL without changing title

2015-01-27 Thread Greg Reagle
On Tue, Jan 27, 2015, at 11:52 AM, Christoph Lohmann wrote:
> Then hook to the window leaving event in GTK or X11 and set the title to
> your needs. I will welcome a patch.

Patch is attached.  I am a total novice in GTK programming, so I don't
know what type the callback function is supposed to be (hence the void
pointers) or whether I registered it properly.  But it does work well
for me.

-- 
http://www.fastmail.com - Access your email from home and the web



0001-ensure-that-window-title-is-web-page-title-not-hover.patch
Description: Binary data


[dev] thorough checking of suckless programs

2015-02-10 Thread Greg Reagle
Greetings.  I am excited to see all the recent progress on sbase. 

Has anyone tried any software checkers on suckless programs?  For
example:
- Electric Fence 
- DUMA
- Memcheck of Valgrind
- ProPolice
- StackGuard

Is there any interest in subjecting suckless software to such tests?  I
have not used these checkers, but I am willing to learn, iff there is
interest.

-- 
http://www.fastmail.com - Access all of your messages and folders
  wherever you are




[dev] st: selecting text affects both primary and clipbaord

2015-02-19 Thread Greg Reagle
When I select text in st using the mouse, it sets both the primary
selection and the clipboard selection.  It should only set the primary
selection.  The clipboard is supposed to be only for explicitly
requested copying.

From
http://standards.freedesktop.org/clipboards-spec/clipboards-latest.txt:

Application authors should follow the following guidelines to get
correct behavior:

 - selecting but with no explicit copy should only set PRIMARY,
   never CLIPBOARD

-- 
http://www.fastmail.com - IMAP accessible web-mail




[dev] st: documenting keys in man page

2015-02-19 Thread Greg Reagle
See attached.

-- 
http://www.fastmail.com - Same, same, but different...



0001-document-keys-in-man-page.patch
Description: Binary data


Re: [dev] st: selecting text affects both primary and clipbaord

2015-02-20 Thread Greg Reagle
On Thu, Feb 19, 2015, at 06:46 PM, Wander Nauta wrote:
> I know this isn't a democracy, but I agree with Greg, it makes more
> sense to only set PRIMARY, not CLIPBOARD, in selcopy. Removing the
> clipboard-related lines from xsetsel seems to do the trick. I've
> attached a patch that does just that.

If the suckless powers that be don't want to apply this patch to the
main branch, can we get it listed on http://st.suckless.org/patches/?

-- 
http://www.fastmail.com - IMAP accessible web-mail




[dev] need updated patch for st to use DEL (0x7F) for backspace key

2015-02-20 Thread Greg Reagle
Greetings.  I have a patch file (which is attached) that no longer
applies since st has changed.  I don't remember whether it was emailed
to me or I got it from a website.  Would someone be kind enough to issue
a new version of the patch?  Also, I think such a patch should be
considered for inclusion at http://st.suckless.org/patches/.  Thank you!

-- 
http://www.fastmail.com - Email service worth paying for. Try it for free



backspace-patch-from-k0ga
Description: Binary data


Re: [dev] st: selecting text affects both primary and clipbaord

2015-02-20 Thread Greg Reagle
On Fri, Feb 20, 2015, at 01:50 PM, random...@fastmail.us wrote:
> Another reason to leave it as-is is that, while in other applications it
> is reasonable to select text for some purpose other than copying it
> (e.g. to delete it or replace it), people will not want their clipboard
> obliterated in this case. However, in a terminal emulator, the only
> thing you can do with selected text is copy it.

It is true that the only reason I select text in st is to copy it, but I
still don't want it clobbering my clipboard.  The only reason I select
text in xterm is to copy it, and I appreciate that doing so only affects
the primary selection.  That is the way well behaved X applications are
supposed to work.

> PuTTY on MS Windows puts selected text immediately in the clipboard and
> apparently no-one has ever objected to this behavior - if anyone had I'm
> sure they would have added it to the dozens of configurable options it
> already has.

Putty on MS Windows is not an X application.  As far as I know, Windows
has only one selection (to use the X terminology): the clipboard.  So I
don't see the point of comparing it.

-- 
http://www.fastmail.com - Access all of your messages and folders
  wherever you are




Re: [dev] st: selecting text affects both primary and clipbaord

2015-02-20 Thread Greg Reagle
On Fri, Feb 20, 2015, at 02:18 PM, sta...@cs.tu-berlin.de wrote:
> * Greg Reagle 2015-02-20 20:07
> > It is true that the only reason I select text in st is to copy it, but I
> > still don't want it clobbering my clipboard.  
> 
> does the current behaviour break some scripts or habits of yours and
> how?

No scripts, but habit--yes.  I am in the habit of using the clipboard
and primary selections independently, carrying different data in them. 
I moved from xterm to st.  But it's not just xterm, *no other program* I
use sets the clipboard from merely selecting text, and there is good
reason for this.

I have applied the patch posted to the list recently, so that st behaves
in the way that I like.  It is no longer causing me any trouble.  It is
still my opinion that the default behavior of st should change, but
that's just my opinion.  It would be nice to at least to have the patch
included at http://st.suckless.org/patches/.

-- 
http://www.fastmail.com - Access all of your messages and folders
  wherever you are




Re: [dev] st: selecting text affects both primary and clipbaord

2015-02-21 Thread Greg Reagle
On Sat, Feb 21, 2015 at 09:26:50AM +0100, k...@shike2.com wrote:
> You can do it by yourself. Clone the wiki repository and push the
> change.

Oh, I did not know that the wiki was in a git repository.  Thank you for
informing me.  I don't think I have permission to push (I have limited
experience with and understanding of git), but I'll work on a patch to include
the patch for st.



[dev] patch to the website that includes a patch for st that makes st not clobber the clipboard

2015-02-23 Thread Greg Reagle
I've attached a patch to the website that includes a patch for st that
makes st not clobber the clipboard.

-- 
http://www.fastmail.com - Faster than the air-speed velocity of an
  unladen european swallow



0001-include-st-patch-to-make-selecting-text-not-affect-t.patch
Description: Binary data


Re: [dev] patch to the website that includes a patch for st that makes st not clobber the clipboard

2015-02-23 Thread Greg Reagle
On Mon, Feb 23, 2015, at 11:25 AM, Markus Teich wrote:
> Just push it, as long as there is no abuse, this git repo allows for
> unauthenticated pushes. The changes will then be reviewed by a maintainer
> and
> should be visible online soon afterwards.
> 
> (This is explained on the website as well…)

Where?

-- 
http://www.fastmail.com - IMAP accessible web-mail




Re: [dev] patch to the website that includes a patch for st that makes st not clobber the clipboard

2015-02-23 Thread Greg Reagle
On Mon, Feb 23, 2015, at 11:25 AM, Markus Teich wrote:
> Just push it

Thank you Markus and Dimitris for pointing out http://suckless.org/wiki
to me.  I pushed it.  I pushed it real good (starts singing Salt-N-Peppa
song).

-- 
http://www.fastmail.com - Faster than the air-speed velocity of an
  unladen european swallow




Re: [dev] [st] can't use Xterm font

2015-02-23 Thread Greg Reagle
On Sat, Feb 21, 2015, at 10:24 AM, Vampyrah Broadcasting wrote:
> I want to use Xterms font in st. The Arch Wiki page about Xterm (
> https://wiki.archlinux.org/index.php/Xterm ) says that xterm uses the
> font
> -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-?
> also abbrevated to 6x13. I have verified that with xfontsel. My
> problem is that I cant select this font in the config.h file of st,
> nor can I use anything else that looks like XTerms font in xfontsel.
> Instead, it looks like what's in the attachment. What must I do to
> make the font right?

I have a similar problem, possibly the same problem.  I am running
Xubuntu 14.04.  I really like the font from xterm that I've used for
many years before switching over to st recently, but it shows up
distorted like in your screen shot.  A lot of the fonts I try show up
distorted like that.

What I am doing now is I've made config.h in st:
static char font[] = "Liberation
Mono:pixelsize=15:antialias=false:autohint=false";
This looks pretty good for me.  I'd prefer to be able to use the xterm
font, but Liberation Mono is good enough for me to work with.  Also,
FYI, in case you don't already know, you can use keys to increase and
decrease the font size.  I submitted a patch to update the man page but
it hasn't been included yet.

I have a hunch that the problem has something to do with the type of the
font, trutype versus bitmapped versus type 1, but I am no expert in font
technology.

-- 
http://www.fastmail.com - Access your email from home and the web




[dev] thanks to suckless developers for st and dvtm

2015-02-23 Thread Greg Reagle
I am now using st with dvtm and I can scroll up and down in the current
dvtm window using Shift+PageUp or Shift+PageDown, for the first time.  I
could never get this to work in xterm (perhaps a more savvy person could
have) because xterm gobbled up the Shift+PageUp/Down key strokes for its
own use.

I could use Ctrl-G then PageUp/Down, but that is really cumbersome to
scroll compared to Shift+PageUp/Down.

-- 
http://www.fastmail.com - Or how I learned to stop worrying and
  love email again




Re: [dev] [st] can't use Xterm font

2015-02-24 Thread Greg Reagle
It's not the the xterm font, but I am just as happy with the font when I
run "st -f mono" (I am running Xubuntu 14.04). Does anyone know how to
figure out specifically which font is being used in this case?  Thanks.

-- 
http://www.fastmail.com - Faster than the air-speed velocity of an
  unladen european swallow




Re: [dev] [st] can't use Xterm font

2015-02-24 Thread Greg Reagle
On Tue, Feb 24, 2015, at 03:50 PM, Samuel Holland wrote:
> fc-match mono

That works.  Thank you so much.  I am familiar with the old commands
xlsfonts and xfontsel, which, apparently, aren't relevant anymore.  I
guess X does fonts differently, not like when I learned the old commands
years ago.

In case anyone is curious, the answer I got was:
~> fc-match mono
DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book"

-- 
http://www.fastmail.com - Faster than the air-speed velocity of an
  unladen european swallow




Re: [dev] Suckless unit testing in C?

2015-02-25 Thread Greg Reagle
On 02/25/2015 02:35 PM, Eduardo A. Bustamante López wrote:
> This is very simplistic.
> 
> I'll give you some examples:
> 
> - ii: I don't see it using netcat.
> - quark: Doesn't use inetd
> - surf: depends on webkit for most stuff
> - dwm: X11 API
> 
> Why aren't these communicating with stdin or stdout?

I think that is a great question.  I would find it very instructive to see that 
question answered.  I am a big fan of the suckless attitude, but I am not an 
expert suckless programmer like some of the people on this list.  If you are 
inclined, please educate me.  I am an eager student.  Would it be possible or 
desirable to make any of the suckless tools/programs to suck even less by 
writing them to use netcat or inetd and removing all network-specific code?  Do 
one thing and do it well?  Is Plan 9 the logical extreme of this practice?




Re: [dev] [sbase][PATCH] Add col command

2015-03-03 Thread Greg Reagle
On Tue, Mar 3, 2015, at 08:40 AM, Dimitris Papastamos wrote:
> This reminds me, we should really find another name for cols(1) now that
> we have col(1).

columnize, multicol

-- 
http://www.fastmail.com - Access all of your messages and folders
  wherever you are




[dev] script for launching surf

2015-03-03 Thread Greg Reagle
I am presenting this in case you find it interesting, useful, or
instructive, or for any constructive criticism so I can learn more.

Here is the script I use to launch surf called mysurf:
#!/bin/sh

cd ~/downloads
exec surf "$@" 2>>surf-stder >>surf-stdout

I don't launch surf directly because:

I could be in any directory when I start surf and surf sometimes
downloads files that I don't even ask for, so these downloaded files
with random names used to be spread throughout my directory tree when I
invoked surf directly.  Now they are all in ~/downloads.

I don't want my tty being polluted with messages from surf, so I save
them all in the same place, in case I ever want to see them (which I
rarely do).

The 'exec' on the last line is because I don't need the shell after I
start surf.

-- 
http://www.fastmail.com - Does exactly what it says on the tin




Re: [dev] script for launching surf

2015-03-03 Thread Greg Reagle
On Tue, Mar 3, 2015, at 04:04 PM, Raphaël Proust wrote:
> Why do you call it `mysurf` instead of just `surf`?

Because it's not the same as surf.  It behaves differently than surf.

> (You could still
> launch the original surf using /usr/bin/surf or whatever is
> appropriate on your system.)

"/usr/local/bin/surf" is a lot of typing compared to "surf".

It's probably just a matter of personal preference though.

-- 
http://www.fastmail.com - Email service worth paying for. Try it for free




Re: [dev] st: selecting text affects both primary and clipbaord

2015-03-09 Thread Greg Reagle
On Mon, Mar 9, 2015, at 04:15 PM, Christoph Lohmann wrote:
> Can  you  please elaborate where you use both selections in parallel for
> different tasks and where st does interfere?

Hi Christoph.  Well actually yes I do use both selections independently.
I use clipboard selection when I explicitly command cut/copy/paste, and
I use primary selection when I implicitly copy/paste (i.e. when
selecting with mouse-button-1 and pasting with mouse-button-2).  I keep
track of them separately in my mind and they have different contents and
I use them for different purposes.  I find this feature quite useful. 
Having st set both selections when I'm just selecting with the mouse
destroys my clipboard selection data.  It is all explained in the web
page that I've referred to several times already.

But this discussion happened already on this list, and despite the
obvious correctness of what I'm saying here, the powers that be
preferred to keep the current broken behavior, so the correct behavior
is now a patch on the wiki.

-- 
http://www.fastmail.com - Email service worth paying for. Try it for free




Re: [dev] [st] [PATCH] FAQ: fix wordingy

2015-03-09 Thread Greg Reagle
On Tue, Mar 10, 2015 at 01:38:46AM +0100, Markus Teich wrote:
> Ivan Delalande wrote:
> > OpenBSD lacks of librt, despite it *being* mandatory in POSIX
> 
> Heyho,
> 
> While we're at it, according to my understanding of the english language the
> `of` is wrong and should be removed since `lack` is used as a verb and not as 
> a
> noun here.

That's right.  "to lack" is a transitive verb in English.



Re: [dev] Potential bug in st fallback font code

2015-03-10 Thread Greg Reagle
On Tue, Mar 10, 2015 at 06:39:49AM +0100, Christoph Lohmann wrote:
> Why  are you throwing half‐baked bug reports at me without doing any de‐
> bugging on your own? First of all, this is suckless: Bug reports have to
> be  opened with a patch attached. Second: Don’t reply to yourself if you
> don’t have any new information in it.

He wasn't throwing anything at you.  He was posting bug reports to the mailing
list.  You are not forced to address them.  Even if you are unwilling to
consider bug reports without patches, some others on the mailing list might be
interested in helping to make the bug more reproducible or to debug it.
Remember, this is suckless.



Re: [dev] st: selecting text affects both primary and clipbaord

2015-03-10 Thread Greg Reagle
On Tue, Mar 10, 2015, at 05:02 PM, Christoph Lohmann wrote:
> The text convinced me that st did it wrong. It is now using primary just
> for the selection. Are there any good suggestions for  the  shortcut  to
> copy to the clipboard? Ctrl + y does interfere with everything.

My two cents . . .

It could go the CUA route and do Shift+Insert for paste (from clipboard)
and Control+Insert for copy (to clipboard).  

It could go the other way and do a variant of Ctrl+C for copy and Ctrl+V
for paste.  I wouldn't use them directly because the programs running in
st probably need those keys.  So Alt+Ctrl+C/V or Shitf+Ctrl+C/V or
Alt+C/V.

Also, it could provide key bindings for both CUA and the other way.  I
don't think that would complicate the code much.

I don't think ther *needs* to be a key for paste from primary selection
since that is what the middle button does, but it wouldn't hurt to
provide a key.  Maybe we have some X users who hate touching their
mouse.

-- 
http://www.fastmail.com - The professional email service




Re: [dev] [st] [PATCH] FAQ: fix wording

2015-03-10 Thread Greg Reagle
On Tue, Mar 10, 2015, at 05:28 PM, Roberto E. Vargas Caballero wrote:
>   OpenBSD lacks librt, despite it being mandatory in POSIX

That is fine, but I think a little bit better would be: "OpenBSD lacks
librt, even though librt is required by POSIX."

-- 
http://www.fastmail.com - mmm... Fastmail...




Re: [dev] st: selecting text affects both primary and clipbaord

2015-03-12 Thread Greg Reagle
On 03/10/2015 10:49 PM, Alex Pilon wrote:
> Are you thinking of something like the attached?

That looks fine to me, looking at it briefly, but I haven't tested it (yet).




Re: [dev] st: selecting text affects both primary and clipbaord

2015-03-12 Thread Greg Reagle
I see some people arguing *passionately* about the keybindings, as if
they don't know that they can be changed.  Yea we can and should have
some discussion about reasonable defaults, but you can set the keys
however you want in config.h.  Just some perspective.  Suckless people
are passionate. :>

-- 
http://www.fastmail.com - Access all of your messages and folders
  wherever you are




Re: [dev] [faq] How do I push to st repository?

2015-03-16 Thread Greg Reagle
On Sun, Mar 15, 2015, at 11:02 AM, Markus Teich wrote:
> read http://git-scm.com/book/en/v2 at least until chapter 3.

Thanks for this recommendation.  I will read it.  (I know it was
intended for someone else.)  I have a pretty good basic understanding of
git and I've created, merged, and deleted branches, for instance, but a
good solid education in git will be very useful.  Thanks again.

-- 
http://www.fastmail.com - Does exactly what it says on the tin




Re: [dev] sed breaks utf8 in [ ]

2015-03-30 Thread Greg Reagle
On Mon, Mar 30, 2015, at 02:33 PM, FRIGN wrote:
> POSIX locales are an insane concept. 
> The idea of localized differences has its origin in the
> sick minds of the POSIX-authors.

Don't be so diplomatic.  How do you really feel?

-- 
http://www.fastmail.com - Choose from over 50 domains or use your own




Re: [dev] sed breaks utf8 in [ ]

2015-03-31 Thread Greg Reagle
Somebody wrote:
> >  I agree there should be localized date-formats,

I am a big fan of the ISO 8601 date format: today would be 2015-03-31.
It sorts dates properly and goes from largest unit of time to smallest
(year then month then day).  I think it would be fine for the suckless
tools to support only this date format.  

-- 
http://www.fastmail.com - Or how I learned to stop worrying and
  love email again




[dev] [PATCH] Added dvtm and abduco to rocks.md on website

2015-04-06 Thread Greg Reagle
I am including the patch as an attachment so webmail doesn't mess up the
formatting.

-- 
http://www.fastmail.com - Send your email first class



0001-Added-dvtm-and-abduco-to-rocks.md-on-website.patch
Description: Binary data


Re: [dev] A suckless issue tracker

2015-04-07 Thread Greg Reagle
On Mon, Apr 6, 2015, at 04:38 PM, FRIGN wrote:
> Isn't it bad enough that we have these Arch-hipsters
> on this ml who constantly discuss things without
> providing patches?

Would you like to discuss that issue?

By the way, I've never encountered the term "Arch-hipster" before--very
very amusing.   I've been chuckling at your message so much.  Thanks for
the mirth.

P.S. My first sentence is an attempt at humor.

-- 
http://www.fastmail.com - Or how I learned to stop worrying and
  love email again




[dev] How to use ssam in Ubuntu 14.04

2015-05-07 Thread Greg Reagle
I know this might be off-topic, but I think there are a lot of Plan 9
fans here.

I want to run ssam (http://man.cat-v.org/p9p/1/ssam).  I have installed
package 9base (version 1:6-6) which provides sam, but not ssam.  Is
there a way for me to call sam so it works like ssam?  Is there another
way I should be getting ssam?  Thanks.

-- 
http://www.fastmail.com - The professional email service




Re: [dev] How to use ssam in Ubuntu 14.04

2015-05-08 Thread Greg Reagle
On Thu, May 7, 2015, at 03:20 PM, Connor Lane Smith wrote:
> It's also in the 9base git repo [1], just not in a release.
> 
> [1]: http://git.suckless.org/9base/tree/ssam

Thank you so much, that works!

-- 
http://www.fastmail.com - Same, same, but different...




[dev] surf patch: Explain cookie management in the man page.

2015-05-08 Thread Greg Reagle
Attached is the patch.  This might seem obvious to many of you, but I
think it would be nice to have it explained in the man page for people
who are not computer experts like the suckless developers.  Probably
suckless users will be able to figure this out eventually, but this
explanation can save them some time.

-- 
http://www.fastmail.com - Email service worth paying for. Try it for free



0001-Explain-cookie-management-in-the-man-page.patch
Description: Binary data


[dev] dvtm: don't change master or numbering

2015-05-22 Thread Greg Reagle
Hello.  I would like dvtm to behave differently.  I don't want creating
a new shell window (Mod-c) to make the new shell window the master; I
want the master to stay the master.  I also don't want creating a new
shell window to renumber all the windows; I want the new window to be
one plus the last window number.

I have started to work on this, and it seems that adding the new window
to the end of the window list rather than the beginning will achieve
these two goals.

Has anyone already implemented this functionality?  Does the way I'm
suggesting make sense?

Thanks!

-- 
http://www.fastmail.com - Does exactly what it says on the tin




Re: [dev] dvtm: don't change master or numbering

2015-05-22 Thread Greg Reagle
On Fri, May 22, 2015, at 02:26 PM, Greg Reagle wrote:
> Hello.  I would like dvtm to behave differently.  I don't want creating
> a new shell window (Mod-c) to make the new shell window the master; I
> want the master to stay the master.  I also don't want creating a new
> shell window to renumber all the windows; I want the new window to be
> one plus the last window number.
> 
> I have started to work on this, and it seems that adding the new window
> to the end of the window list rather than the beginning will achieve
> these two goals.
> 
> Has anyone already implemented this functionality?  Does the way I'm
> suggesting make sense?

So here is my attempt.  It compiles and works pretty well.  It has one
issue that I think might be a problem though.  In the window numbering,
the visible windows can be in a state where they are not continuous
(e.g. window 3 might be minimized and windows 1,2,4 might be visible).

Any thoughts?  Thanks.

-- 
http://www.fastmail.com - IMAP accessible web-mail

diff --git a/dvtm.c b/dvtm.c
index 464a223..efbbec6 100644
--- a/dvtm.c
+++ b/dvtm.c
@@ -503,6 +503,19 @@ attach(Client *c) {
 }
 
 static void
+attachatend(Client *c) {
+   Client *j;
+
+   for (j = clients; j && j->next; j = j->next) ; /* set j to last client*/
+   if (j)
+   j->next = c;
+   else
+   clients = c;
+   c->next = NULL;
+   c->prev = j;
+}
+
+static void
 attachafter(Client *c, Client *a) { /* attach c after a */
if (c == a)
return;
@@ -1029,7 +1042,7 @@ create(const char *args[]) {
c->x = wax;
c->y = way;
debug("client with pid %d forked\n", c->pid);
-   attach(c);
+   attachatend(c);
focus(c);
arrange();
 }


Re: [dev] dvtm: don't change master or numbering

2015-05-22 Thread Greg Reagle
On Fri, May 22, 2015, at 05:31 PM, Ross Mohn wrote:
> I don't think this should be mainline workflow, but it probably makes a
> nice patch. However, you should understand that window numbering is
> always the same with the master being window #1 and the rest in
> consecutive order. The clients are then arranged within those
> pre-numbered windows, The clients can move around to different window
> positions, but the window numbers stay the same. When you minimize a
> window, it takes its client with it and moves to the end of the stack.
> When you unminimize a window, it pops up to the master (#1), bringing
> its client along, and pushes the other clients down the stack.

Thanks for that explanation.  In that case my patch is seriously flawed,
because it screws up the window numbers.  

I've written another patch that does it a bit differently, it creates
new clients as the second window, so it preserves the master as master
(as I want), and it doesn't screw up the window numbering.  However, it
still does gratuitous renumbering.

What I really want is more stability.  When I have mutt (or whatever)
running in my master window, I want it to stay as my master window
unless I tell dvtm explicitly to change the master window.  This means I
don't want newly created clients to automatically take the master
window, and I don't want un-minimized clients to automatically take the
master window.

Another stability goal is that I don't want every client shifting its
windows number by one, unless I explicitly tell dvtm to do so.  So if I
create a new window or un-minimize a window, I'd like it to be placed as
the last visible window so that no visible clients need to change their
window number.  Of course if I choose to Mod-Enter, I know that
re-numbering will be required, there's no getting around that.

Based on what I understand currently of the internals of dvtm (which is
not a lot and maybe somewhat confused), I would like newly created
clients and un-minimized clients to go after the last visible window. 
This way the master stays the master and all the visible clients keep
their window number.  Does that make sense?

So I'm thinking that I need to write an attach function that will attach
a client after the last visible window and before the first minimized
window, and call that for newly created and un-minimized clients.  Is
that the solution?

-- 
http://www.fastmail.com - Access your email from home and the web




Re: [dev] dvtm: don't change master or numbering

2015-05-26 Thread Greg Reagle
On Sat, May 23, 2015, at 01:56 PM, Ross Mohn wrote:
> Getting new windows and un minimized windows to go on the stack instead
> of taking over the master window is pretty easy. Having them go to the
> end I'll have to think about a little more. Here's an easy solution that
> makes them go to the top of the stack instead of to the master.
> (Definitely NOT fully tested, and also I don't really endorse this as a
> use case!)
> 
> Put these two lines in the "commands for use by keybindings"
> section in dvtm.c:
> static void createonstack(const char *args[]);
> static void toggleminimizeonstack(const char *args[]);
> 
> The put these two functions lower down in dvtm.c:
> static void
> createonstack(const char *args[]) {
> create(NULL);
> zoom(NULL);
> }
> 
> static void
> toggleminimizeonstack(const char *args[]) {
> if (sel->minimized) {
> toggleminimize(NULL);
> zoom(NULL);
> } else
> toggleminimize(NULL);
> }
> 
> Finally, replace the 'c' and '.' commands in config.h:
> { { MOD, 'c', }, { createonstack, { NULL } } },
> { { MOD, '.', }, { toggleminimizeonstack, { NULL } } },

Thank you for this code.  I tested it, and it doesn't work properly.  I
still appreciate your collaborating with me on this issue.  I'll be
submitting a tested patch next.

-- 
http://www.fastmail.com - The way an email service should be




[dev] dvtm: [PATCH] Created and un-minimized clients go to top of stack instead of master window.

2015-05-26 Thread Greg Reagle
On Fri, May 22, 2015, at 02:26 PM, Greg Reagle wrote:
> Hello.  I would like dvtm to behave differently.  I don't want creating
> a new shell window (Mod-c) to make the new shell window the master; I
> want the master to stay the master.  I also don't want creating a new
> shell window to renumber all the windows; I want the new window to be
> one plus the last window number.

Patch is attached.  I've tested it of course.  This achieves my goal of
giving stability to the master window.  I didn't like it changing every
time I did a create or un-minimize.

I would prefer the created or un-minimized client to go the the bottom
of the stack rather than the top, thereby achieving more stability in
the window numbering.  I've tried to implement this, without success so
far.

Does anyone (beside me) prefer the way dvtm works with this patch?

-- 
http://www.fastmail.com - IMAP accessible web-mail



0001-Created-and-un-minimized-clients-go-to-top-of-stack-.patch
Description: Binary data


Re: [dev] dvtm: don't change master or numbering

2015-05-26 Thread Greg Reagle
On Tue, May 26, 2015, at 01:31 PM, Marc André Tanner wrote:
> On Fri, May 22, 2015 at 02:26:30PM -0400, Greg Reagle wrote:
> > Hello.  I would like dvtm to behave differently.  I don't want creating
> > a new shell window (Mod-c) to make the new shell window the master; I
> > want the master to stay the master.
> 
> Why would you want that? It seems natural to place the new window in
> the master area. It is also how dwm behaves.

It is a matter of personal preference.  I usually keep mutt in my master
window and I want it to stay in the master because the master is the
largest window.  When I create or un-minimize new windows, I don't want
them to displace mutt.  Before I wrote this patch, I would have to do a
zoom after every create or un-minimize.

> > I also don't want creating a new
> > shell window to renumber all the windows; I want the new window to be
> > one plus the last window number.
> For me the number refers to a place where the window is being displayed
> hence if I select MOD+2 I always want to select the first window of
> the stack area.

I assume you are misunderstanding me, because I agree with you that when
I select Mod+2 I always want the first window of the stack.  I want
created or un-minimized clients to go to the last window of the stack. 
I am not suggesting changing the way window numbering works.

> If you want a stable and unique identifier for a window (e.g. for
> scripting purposes) you can use its id. However since the ids only ever
> increase (after closing a few windows you will encounter gaps) it is
> probably not what you want.

Thanks for letting me know about this, but I am not writing scripts for
it but using it interactively.

-- 
http://www.fastmail.com - Email service worth paying for. Try it for free




Re: [dev] dvtm: [PATCH] Created and un-minimized clients go to top of stack instead of master window.

2015-05-27 Thread Greg Reagle
On 05/27/2015 03:40 AM, Raphaël Proust wrote:
> Can I suggest a rename to attachaside? It would make it consistent
> with dwm's attachaside: http://dwm.suckless.org/patches/attachaside

Thanks for pointing out the similarity of my patch for dvtm to the attachaside 
patch for dwm.  This will make its behavior more obvious to people who know 
dwm.  I don't know or use dwm myself, so I cannot say whether it is the same 
behavior, but if you say it is, then I believe you.

Regarding the name of the patch, it doesn't really have a name currently.  The 
commit message describes what it does.  But if it is posted on a webpage for 
dvtm patches, or it is included as a branch in git, I am fine with the name 
being attachaside.




Re: [dev] surf release?

2015-06-01 Thread Greg Reagle
On Mon, Jun 1, 2015, at 01:46 PM, Jack L. Frost wrote:
> As a packager, I'd very much appreciate tagging once in a while so that
> we have
> static targets for patching and packaging.

I don't know git well, just the basics, but why don't you use a git
commit id as the target for patching and packaging?  As far as I
understand, a tag is just a "friendly" name for a commit id anyway.

-- 
http://www.fastmail.com - The professional email service




Re: [dev] surf release?

2015-06-01 Thread Greg Reagle
On Mon, Jun 1, 2015, at 02:36 PM, Eric Pruitt wrote:
> On Mon, Jun 01, 2015 at 02:18:01PM -0400, Greg Reagle wrote:
> > I don't know git well, just the basics, but why don't you use a git
> > commit id as the target for patching and packaging?  As far as I
> > understand, a tag is just a "friendly" name for a commit id anyway.
> 
> If $APPLICATION versions 4541b821941a65e9c220acec2ab7256d7b21d690 and up
> support features X, Y and Z, can you tell me whether or not version
> 02e09b181db9b55d93a43a943d49048a4aeb0364 also has those features?

Based on only the git commit id, the answer is no, and traditional
version numbers are generally easier to compare; I see your point.  But
with access to the git log, then the answer is yes.  Also, each git
commit has a time-stamp (AFAIK).  So the timestamp might be a way to
express the version number, for example 2015.06.01.15.00.29
(year.month.day.hours.minutes.seconds in UTC), in a packaging system
that expects a traditional version number.  These could be compared like
traditional version numbers.

> This
> become even more of a nuisance when you only have immediate access to a
> compiled binary; I often build packages on one machine then distribute
> only the binaries. Using hashes for versioning means you can't
> $APPLICATION -V to easily figure out how old the binary is I'm using.

I see your point.  One way to resolve this problem is to have the -V
option display the git commit id and timestamp.

Just to clarify, I'm not saying that using the git commit id and/or
timestamp is better than or as good as a traditional version number. 
What I'm saying is that, given an upstream that doesn't tag versions
often enough for your liking, using the git commit id and/or timestamp
seems like a workable solution.

-- 
http://www.fastmail.com - Does exactly what it says on the tin




Re: [dev] surf release?

2015-06-01 Thread Greg Reagle
To follow up on my suggestion to use a git commit as a version, the
following command in fish automatically produces a version number:
date --date (git log -1 --pretty=format:%aD) -u +%Y.%m.%d.%H.%M.%S

In bash, it would be:
date --date "$(git log -1 --pretty=format:%aD)" -u +%Y.%m.%d.%H.%M.%S

-- 
http://www.fastmail.com - Or how I learned to stop worrying and
  love email again




Re: [dev] surf release?

2015-06-01 Thread Greg Reagle
On Mon, Jun 1, 2015, at 03:31 PM, Jack L. Frost wrote:
> 1) How do I know if a certain tag is stable enough to use? Do I just take
> the
> current HEAD? Do I spend my time extensively testing a few latest tags to
> figure out if they are stable or not?

I assume by tag you mean commit because we are discussing a lack of
tags.  Ask the developer(s) about which commit is considered stable.  Or
use the current HEAD.  Both are reasonable options (for a suckless
project, not saying that using current HEAD would be good for other
projects).  It's up to you how you want to spend your time, but I
certainly don't think there is any *need* for you to do any testing to
determine what is stable, when you can just ask the developer(s) and/or
use the current HEAD.  You could also, if you want to be very
conservative, use the latest tag, which in surf was 0.6 on 2013-02-10.  

I am not a surf developer with any authority (I guess I am technically a
surf developer since I submitted 2 minor patches, but I have no power or
authority at all), but as a surf user, I would be happier with the
packaged version being the current HEAD at time of packaging.

-- 
http://www.fastmail.com - A no graphics, no pop-ups email service




Re: [dev] [dvtm] Commands document, one page PDF

2015-08-10 Thread Greg Reagle
On Sat, Aug 8, 2015, at 02:39 PM, Ross Mohn wrote:
> I've finished a one page document of all the default commands in dvtm

Very nice.  Thank you.  Reading this made me find a typo in the current
dvtm man page: dvtm.1:

.B Mod\-d
Change to vertical stack tiling layout.

which should be Mod\-f

-- 
http://www.fastmail.com - The professional email service




Re: [dev] [dvtm] Commands document, one page PDF

2015-08-10 Thread Greg Reagle
On Sat, Aug 8, 2015, at 02:39 PM, Ross Mohn wrote:
> I've finished a one page document of all the default commands in dvtm
> with their default key bindings. A4 and Letter formats are available at
> http://waxandwane.org/dvtm.html. The commands are organized into the
> following categories:
> 
>   * Windows/Client Commands
>   * Layout Commands
>   * Copy & Paste Commands
>   * Tag Commands
>   * Mouse Commands
>   * Application and Miscellaneous Commands

I found your document useful, and others might find it useful too, but I
wonder if it would be good to merge your changes upstream rather than
maintaining a separate document.  The man page is the definitive
documentation, and most of the information in your document is already
in the man page.

I don't know the basis for the ordering of the keyboard commands in the
man page.  Is there an order or organization?  Perhaps they should be
organized like in your document.

Did you know that you can very easily produce a postscript document from
a man page?  On my system, doing "man -t dvtm > dvtm.ps" will do so.  To
produce a PDF document, "man -t dvtm | ps2pdf - dvtm.pdf".

-- 
http://www.fastmail.com - Does exactly what it says on the tin




Re: [dev] [st] Terminal abnormal key codes

2015-09-02 Thread Greg Reagle
I've been reading this conversation with interest.  I tried different shells 
with xterm versus st.

On 09/02/2015 11:29 AM, Fabian Homborg wrote:
> If you launch fish in { konsole, xterm, gnome-terminal, linux in-kernel
> VTs, iTerm2, ... } your keys work, without smkx.
> 
> If you launch fish in st, your keys don't, until you do "tput smkx".

I confirm that this is true on my computer:  for the shells fish, bash, ksh, 
and mksh, in xterm, the Delete key works; whereas in st it doesn't work without 
tput smkx.

However, with zsh in st, the Delete key works immediately.




Re: [dev] [st] Terminal abnormal key codes

2015-09-02 Thread Greg Reagle
On 09/02/2015 12:21 PM, Greg Reagle wrote:
> I've been reading this conversation with interest.  I tried different shells 
> with xterm versus st.
> 
> On 09/02/2015 11:29 AM, Fabian Homborg wrote:
>> If you launch fish in { konsole, xterm, gnome-terminal, linux in-kernel
>> VTs, iTerm2, ... } your keys work, without smkx.
>>
>> If you launch fish in st, your keys don't, until you do "tput smkx".
> 
> I confirm that this is true on my computer:  for the shells fish, bash, ksh, 
> and mksh, in xterm, the Delete key works; whereas in st it doesn't work 
> without tput smkx.
> 
> However, with zsh in st, the Delete key works immediately.

Sorry, correction.  I mis-reported on ksh.  Here are my results:

Delete key
|  | xterm | xterm | st| st|
|  | rmkx  | smkx  | rmkx  | smkx  |
|--+---+---+---+---|
| zsh  | works | works | works | works |
|--+---+---+---+---|
| bash | works | works | no-op | works |
| mksh | works | works | no-op | works |
| tcsh | works | works | no-op | works |
|--+---+---+---+---|
| fish | works | works | '[P'  | works |
| ksh  | '~'   | '~'   | '~'   | '~'   |


The anomaly of '[P' with fish might be fixed in a later version.  I am running 
fish, version 2.1.2-1256-g64af63b.




Re: [dev] [st] Terminal abnormal key codes

2015-09-02 Thread Greg Reagle
On 09/02/2015 01:00 PM, Fabian Homborg wrote:
>> The anomaly of '[P' with fish might be fixed in a later version.  I am 
>> running fish, version 2.1.2-1256-g64af63b.
> 
> That's why we are discussing this.

I updated fish to 2.2.0-1~trusty amd64 (from the PPA) and the '[P' behavior 
still occurs.

> zsh doesn't work for me either, 
> Are you sure your distribution doesn't already add that?

Yes you're right.  My distribution adds code to /etc/zsh/zshrc to make it work.




Re: [dev] [st] Terminal abnormal key codes

2015-09-02 Thread Greg Reagle
On 09/02/2015 11:29 AM, Fabian Homborg wrote:
> Roberto E. Vargas Caballero  writes:
> That's not what I'm talking about. Of course a tone of terminals have
> smkx defined, but fish currently doesn't send it and works on (as far as
> I know) anything but st.
> 
> In other words:
> 
> If you launch fish in { konsole, xterm, gnome-terminal, linux in-kernel
> VTs, iTerm2, ... } your keys work, without smkx.
> 
> If you launch fish in st, your keys don't, until you do "tput smkx".

Some friendly advice to Fabian and fish developers (I am a big fan of fish).  I 
am a suckless user not developer (although I've contributed some minor code) 
and I've been on this list a while.  The suckless developers thrive on being 
different and superior.  So any appeal to popularity ("all the other terminal 
emulators do it this way") will fall on deaf ears, and probably even backfire.  

You've got to make your case differently/better.  I do not have expertise on 
terminfo and terminal emulators myself, so I don't have an opinion about this 
issue, although I find it interesting.

You also have to have patience.  I suggested a correction to st based on a 
standard, and although it was vehemently opposed at first, it eventually was 
accepted. See 
http://git.suckless.org/st/commit/?id=28259f5750f0dc7f52bbaf8b746ec3dc576a58ee




[dev] sbase: is od needed?

2015-09-28 Thread Greg Reagle
Howdy.  Would it be useful for me to write od?  Has anyone else worked 
on it?




Re: [dev] sbase: is od needed?

2015-09-28 Thread Greg Reagle

On 09/28/2015 01:02 PM, Dimitris Papastamos wrote:

On Mon, Sep 28, 2015 at 12:51:19PM -0400, Greg Reagle wrote:

Howdy.  Would it be useful for me to write od?  Has anyone else worked on
it?

Yes it is in the TODO, send a patch to hackers@ when you have something to show.

There was an implementation of a subset of od done in the past but it
was never merged because it needed reworking.  IIRC, it was not posted on
the ml so don't bother looking.


Thanks, I've started on it.




[dev] sbase: od: type 'c': format characters in octal as specified by standard

2015-10-02 Thread Greg Reagle
This is relative to master.  This seems to be required by the base 
standard, not an XSI extension.


>From 4bdc2f611795e683405b55ac574247262a485f9f Mon Sep 17 00:00:00 2001
From: Greg Reagle 
Date: Fri, 2 Oct 2015 09:38:39 -0400
Subject: [PATCH] od: type 'c': format characters in octal as specified by
 standard

---
 od.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/od.c b/od.c
index 9521605..e39461d 100644
--- a/od.c
+++ b/od.c
@@ -59,7 +59,7 @@ printchar(FILE *f, unsigned char c)
 		if (strchr("\a\b\t\n\b\f\r\0", c)) {
 			fprintf(f, "%3s ", escdict[c]);
 		} else {
-			fprintf(f, "%3c ", c);
+			fprintf(f, "%03hho ", c);
 		}
 		break;
 	default:
-- 
1.9.1



  1   2   3   4   >