summaryrefslogtreecommitdiffstats
path: root/usr.bin/more
diff options
context:
space:
mode:
authorhoek <hoek@FreeBSD.org>1999-12-26 02:39:26 +0000
committerhoek <hoek@FreeBSD.org>1999-12-26 02:39:26 +0000
commit0bf78e4bac60a0b4869939a26f56d6ce791d1c53 (patch)
tree1e8ba525419db61c66d91af605674f5b065a9d1c /usr.bin/more
parent4562f83d3ba03d808482666b8a362d0ce3eb7237 (diff)
downloadFreeBSD-src-0bf78e4bac60a0b4869939a26f56d6ce791d1c53.zip
FreeBSD-src-0bf78e4bac60a0b4869939a26f56d6ce791d1c53.tar.gz
Expand source comments a little -=> increased readability.
Diffstat (limited to 'usr.bin/more')
-rw-r--r--usr.bin/more/default.morerc36
-rw-r--r--usr.bin/more/ncommand.c7
2 files changed, 35 insertions, 8 deletions
diff --git a/usr.bin/more/default.morerc b/usr.bin/more/default.morerc
index 7a2ccb4..65f6db5 100644
--- a/usr.bin/more/default.morerc
+++ b/usr.bin/more/default.morerc
@@ -9,6 +9,9 @@
# is recompiled). The correct way to change the global defaults is by
# adding a /etc/dot.morerc global initialization file.
#
+# In general, the average user is not expected have any interest in changing
+# default keybindings.
+#
# If you use an ~/.morerc that is dependent on specific features of this
# default morerc, you should copy this default morerc to ~/.defmorerc so that
# possible future changes in this file do not cause problems for you. The
@@ -20,17 +23,40 @@
# compiled into more(1)) is missing or away without leave (chroot directory,
# fs crash, badly written rescue floppy, or any other reason).
#
-# BUGS: a) There is no documentation.
+# BUGS: a) There is no documentation (this is arguably a feature).
# b) There is no "map" command.
#
# $FreeBSD$
#
-# required -- initialize more(1)
+# The "deftog" is required to initialize more(1).
+#
+# Each of the toggle variables in the proceeding list will be initialized.
+# A toggle variable "togvar" will be initialized into two variables:
+# ${togvar_s} and ${togvar_n}. The _s variant will hold a string representing
+# the toggle state, and the _n variant will hold a number representing the
+# toggle state. The toggle states are numbered from 0 to n, in the order
+# listed for the toggle.
+#
+# _ls_direction forw back direction of last search
+# _ls_sense noinvert invert find match/non-matching to last search
+# _wraplines off on currently wrapping lines?
+# _statprompt on off currently displaying the long prompt?
+#
+# If the fact that "off on" is in a different order from "on off" bothers
+# you, then you are probably abusing the variables.
+#
+# Additionally, the following variables are set,
+#
+# ${_curhscroll} number of columns scrolled horizontally
+# ${_ls_regexp} regular expression from the last search
+#
+
deftog
+
#
-# basic internal initialization
+# basic internal initialization for things used inside this file
#
set lsthscr 1
# Add "set hkey_scroll true" to ~/.morerc to enable all the hjkl keys (but
@@ -124,8 +150,8 @@ macro 0 \' 'gomark ?'
macro 0 :t 'asktag'
macro 1 t 'nexttag ${number}'
macro 1 T 'prevtag ${number}'
-macro 0 "" 'stat (${_stat_n} + 1)'
-macro 0 = 'stat (${_stat_n} + 1)'
+macro 0 "" 'stat (${_statprompt_n} + 1)'
+macro 0 = 'stat (${_statprompt_n} + 1)'
macro 0 q 'quit'
macro 0 :q 'quit'
macro 0 ZZ 'quit'
diff --git a/usr.bin/more/ncommand.c b/usr.bin/more/ncommand.c
index 1806922..13c22f6 100644
--- a/usr.bin/more/ncommand.c
+++ b/usr.bin/more/ncommand.c
@@ -763,7 +763,7 @@ cdeftog(cident, args)
extern int horiz_off, wraplines;
ENDPARSE;
- settog("_stat", 1, 2, "on", "off");
+ settog("_statprompt", 1, 2, "on", "off");
settog("_ls_direction", 0, 2, "forw", "back");
settog("_ls_sense", 0, 2, "noinvert", "invert");
setvari("_curhscroll", (long) horiz_off);
@@ -1253,7 +1253,8 @@ cfile_list(cident, args)
* stat <<on|off>>
*
* Display the detailed statistics as part of the prompt. The toggle option
- * variable is called _stat (giving ${_stat_s} and ${_stat_n}).
+ * variable is called _statprompt (giving ${_statprompt_s} and
+ * ${_statprompt_n}).
*/
static const char *
cstat(cident, args)
@@ -1265,7 +1266,7 @@ cstat(cident, args)
ARGTOG(onoff, 2, "on", "off");
ENDPARSE;
statprompt(onoff);
- settog("_stat", onoff, 2, "on", "off");
+ settog("_statprompt", onoff, 2, "on", "off");
return args;
}
OpenPOWER on IntegriCloud