summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2013-10-27 23:54:08 -0400
committerJesse Luehrs <doy@tozt.net>2013-10-27 23:57:33 -0400
commit647e000e0d5021d7684ade725599ad78634f8ad4 (patch)
tree7d24ca7137e517e501a590e055bc1e51cd2ad663
parentdad82f6d1eaf565300fc6833f6da43b2f1097801 (diff)
downloadconf-647e000e0d5021d7684ade725599ad78634f8ad4.tar.gz
conf-647e000e0d5021d7684ade725599ad78634f8ad4.zip
update some things from their external sources
-rwxr-xr-xbin/git/git-imerge729
-rw-r--r--fortune/calvin643
-rw-r--r--fortune/perl514
-rw-r--r--vim/syntax/nhdes.vim45
-rw-r--r--vim/syntax/tmux.vim34
-rw-r--r--weechat/perl/autoload/buffers.pl152
-rw-r--r--weechat/perl/autoload/chatters.pl27
-rw-r--r--weechat/python/autoload/bitlbee_typing_notice.py162
8 files changed, 1407 insertions, 899 deletions
diff --git a/bin/git/git-imerge b/bin/git/git-imerge
index a9d646c..f2e7772 100755
--- a/bin/git/git-imerge
+++ b/bin/git/git-imerge
@@ -48,42 +48,14 @@ of an incremental merge can (crudely) be visualized using the
An incremental merge can be interrupted and resumed arbitrarily, or
even pushed to a server to allow somebody else to work on it.
-When an incremental merge is finished, you can discard the
-intermediate merge commits and create a simpler history to record
-permanently in your project repository using either the "finish" or
-"simplify" command. The incremental merge can be simplified in one of
-three ways:
- * merge
- keep only a simple merge of the second branch into the first
- branch, discarding all intermediate merges. The result is
- similar to what you would get from
-
- git checkout BRANCH1
- git merge BRANCH2
-
- * rebase
- keep the versions of the commits from the second branch rebased
- onto the first branch. The result is similar to what you would
- get from
-
- git checkout BRANCH2
- git rebase BRANCH1
-
- * rebase-with-history
- like rebase, except that each of the rebased commits is recorded
- as a merge from its original version to its rebased predecessor.
- This is a style of rebasing that does not discard the old
- version of the branch, and allows an already-published branch to
- be rebased. See [3] for more information.
-
-Simple operation:
+Instructions:
For basic operation, you only need to know three git-imerge commands.
-To merge BRANCH into MASTER or rebase BRANCH onto MASTER,
+To merge BRANCH2 into BRANCH1 or rebase BRANCH2 onto BRANCH1,
- git checkout MASTER
- git-imerge start --name=NAME --goal=GOAL --first-parent BRANCH
+ git checkout BRANCH1
+ git-imerge start --name=NAME --goal=GOAL --first-parent BRANCH2
while not done:
<fix conflict presented to you>
git commit
@@ -93,30 +65,60 @@ To merge BRANCH into MASTER or rebase BRANCH onto MASTER,
where
NAME is the name for this merge (and also the default name of the
- branch to which the results will be saved)
+ branch to which the results will be saved).
+
+ GOAL describes how you want the "finish" or "simplify" command to
+ record the results of the incremental merge in your project's
+ permanent history. The "goal" of the incremental merge can be
+ one of the following:
+
+ * merge
+ keep only a simple merge of the second branch into the
+ first branch, discarding all intermediate merges. The end
+ result is similar to what you would get from
+
+ git checkout BRANCH1
+ git merge BRANCH2
+
+ * rebase
+ keep the versions of the commits from the second branch
+ rebased onto the first branch. The end result is similar
+ to what you would get from
- GOAL describes how you want to simplify the results:
+ git checkout BRANCH2
+ git rebase BRANCH1
- "merge" for a simple merge
+ * rebase-with-history
+ like rebase, except that it retains the old versions of
+ the rebased commits in the history. It is equivalent to
+ merging the commits from BRANCH2 into BRANCH1, one commit
+ at a time. In other words, it transforms this:
- "rebase" for a simple rebase
+ o---o---o---o BRANCH1
+ \
+ A---B---C---D BRANCH2
- "rebase-with-history" for a rebase that retains history. This
- is equivalent to merging the commits from BRANCH into MASTER,
- one commit at a time. In other words, it transforms this::
+ into this:
- o---o---o---o MASTER
- \
- A---B---C---D BRANCH
+ o---o---o---o---A'--B'--C'--D' NEW_BRANCH
+ \ / / / /
+ --------A---B---C---D
- into this::
+ It is safe to rebase an already-published branch using this
+ approach. See [3] for more information.
- o---o---o---o---A'--B'--C'--D' MASTER
- \ / / / /
- --------A---B---C---D BRANCH
+ * full
+ don't simplify the incremental merge at all: do all of the
+ intermediate merges and retain them all in the permanent
+ history.
- This is like a rebase, except that it retains the history of
- individual merges. See [3] for more information.
+For the full documentation, type
+
+ git-imerge --help
+
+and
+
+ git-imerge SUBCOMMAND --help
[1] http://softwareswirl.blogspot.com/2013/05/git-imerge-practical-introduction.html
@@ -190,12 +192,12 @@ except ImportError:
return output
-STATE_VERSION = (1, 0, 0)
+STATE_VERSION = (1, 2, 0)
ZEROS = '0' * 40
ALLOWED_GOALS = [
- #'full',
+ 'full',
'rebase-with-history',
'rebase',
'merge',
@@ -428,7 +430,7 @@ def get_log_message(commit):
def get_author_info(commit):
a = check_output([
'git', '--no-pager', 'log', '-n1',
- '--format=%an%x00%ae%x00%ad', commit
+ '--format=%an%x00%ae%x00%ai', commit
]).strip().split('\x00')
return {
@@ -509,19 +511,22 @@ class TemporaryHead(object):
return False
-def reparent(commit, parent_sha1s):
+def reparent(commit, parent_sha1s, msg=None):
"""Create a new commit object like commit, but with the specified parents.
commit is the SHA1 of an existing commit and parent_sha1s is a
list of SHA1s. Create a new commit exactly like that one, except
that it has the specified parent commits. Return the SHA1 of the
resulting commit object, which is already stored in the object
- database but is not yet referenced by anything."""
+ database but is not yet referenced by anything.
+
+ If msg is set, then use it as the commit message for the new
+ commit."""
old_commit = check_output(['git', 'cat-file', 'commit', commit])
separator = old_commit.index('\n\n')
headers = old_commit[:separator + 1].splitlines(True)
- rest = old_commit[separator + 1:]
+ rest = old_commit[separator + 2:]
new_commit = StringIO()
for i in range(len(headers)):
@@ -536,7 +541,13 @@ def reparent(commit, parent_sha1s):
else:
new_commit.write(line)
- new_commit.write(rest)
+ new_commit.write('\n')
+ if msg is None:
+ new_commit.write(rest)
+ else:
+ new_commit.write(msg)
+ if not msg.endswith('\n'):
+ new_commit.write('\n')
process = subprocess.Popen(
['git', 'hash-object', '-t', 'commit', '-w', '--stdin'],
@@ -557,7 +568,7 @@ class AutomaticMergeFailed(Exception):
self.commit1, self.commit2 = commit1, commit2
-def automerge(commit1, commit2):
+def automerge(commit1, commit2, msg=None):
"""Attempt an automatic merge of commit1 and commit2.
Return the SHA1 of the resulting commit, or raise
@@ -565,8 +576,12 @@ def automerge(commit1, commit2):
worktree."""
call_silently(['git', 'checkout', '-f', commit1])
+ cmd = ['git', '-c', 'rerere.enabled=false', 'merge']
+ if msg is not None:
+ cmd += ['-m', msg]
+ cmd += [commit2]
try:
- call_silently(['git', '-c', 'rerere.enabled=false', 'merge', commit2])
+ call_silently(cmd)
except CalledProcessError:
# We don't use "git merge --abort" here because it was only
# added in git version 1.7.4.
@@ -682,8 +697,8 @@ class MergeRecord(object):
def clear_ref(source):
check_call([
'git', 'update-ref',
- '-d', 'imerge %r: Remove obsolete %s merge' % (name, source,),
- 'refs/imerge/%s/%s/%d-%d' % (name, source, i1, i2),
+ '-m', 'imerge %r: Remove obsolete %s merge' % (name, source,),
+ '-d', 'refs/imerge/%s/%s/%d-%d' % (name, source, i1, i2),
])
if self.flags & self.MANUAL:
@@ -1016,7 +1031,7 @@ class MergeFrontier(object):
return AnsiColor.B_RED + node + AnsiColor.END
if legend is None:
- legend = ["?", "*", ".", "#", "@", "-", "|", "+"]
+ legend = ['?', '*', '.', '#', '@', '-', '|', '+']
merge = node & ~cls.FRONTIER_MASK
within = merge == Block.MERGE_MANUAL or (node & cls.FRONTIER_WITHIN)
skip = [Block.MERGE_MANUAL, Block.MERGE_BLOCKED, Block.MERGE_UNBLOCKED]
@@ -1071,16 +1086,16 @@ class MergeFrontier(object):
f.write(diagram[i1][i2])
f.write('\n')
- def write_html(self, f, name, cssfile="imerge.css", abbrev_sha1=7):
+ def write_html(self, f, name, cssfile='imerge.css', abbrev_sha1=7):
class_map = {
- Block.MERGE_UNKNOWN: "merge_unknown",
- Block.MERGE_MANUAL: "merge_manual",
- Block.MERGE_AUTOMATIC: "merge_automatic",
- Block.MERGE_BLOCKED: "merge_blocked",
- Block.MERGE_UNBLOCKED: "merge_unblocked",
- self.FRONTIER_WITHIN: "frontier_within",
- self.FRONTIER_RIGHT_EDGE: "frontier_right_edge",
- self.FRONTIER_BOTTOM_EDGE: "frontier_bottom_edge",
+ Block.MERGE_UNKNOWN: 'merge_unknown',
+ Block.MERGE_MANUAL: 'merge_manual',
+ Block.MERGE_AUTOMATIC: 'merge_automatic',
+ Block.MERGE_BLOCKED: 'merge_blocked',
+ Block.MERGE_UNBLOCKED: 'merge_unblocked',
+ self.FRONTIER_WITHIN: 'frontier_within',
+ self.FRONTIER_RIGHT_EDGE: 'frontier_right_edge',
+ self.FRONTIER_BOTTOM_EDGE: 'frontier_bottom_edge',
}
def map_to_classes(node):
@@ -1104,17 +1119,17 @@ class MergeFrontier(object):
diagram = self.create_diagram()
for i2 in range(self.block.len2):
- f.write(" <tr>\n")
+ f.write(' <tr>\n')
for i1 in range(self.block.len1):
classes = map_to_classes(diagram[i1][i2])
record = self.block.get_value(i1, i2)
- sha1 = record.sha1 or ""
+ sha1 = record.sha1 or ''
td_id = record.sha1 and ' id="%s"' % (record.sha1) or ''
- td_class = classes and ' class="' + " ".join(classes) + '"' or ''
- f.write(" <td%s%s>%.*s</td>\n" % (
+ td_class = classes and ' class="' + ' '.join(classes) + '"' or ''
+ f.write(' <td%s%s>%.*s</td>\n' % (
td_id, td_class, abbrev_sha1, sha1))
- f.write(" </tr>\n")
- f.write("</table>\n</body>\n</html>\n")
+ f.write(' </tr>\n')
+ f.write('</table>\n</body>\n</html>\n')
@staticmethod
def _iter_non_empty_blocks(blocks):
@@ -1255,18 +1270,20 @@ class MergeFrontier(object):
blocks = list(self.iter_blocker_blocks())
if not blocks:
raise BlockCompleteError('The block is already complete')
- # Try blocks from biggest to smallest:
- blocks.sort(key=lambda block: block.get_area(), reverse=True)
+
+ # Try blocks from left to right:
+ blocks.sort(key=lambda block: block.get_original_indexes(0, 0))
+
for block in blocks:
- if block.auto_outline_frontier():
+ if block.auto_expand_frontier():
return
else:
# None of the blocks could be expanded. Suggest that the
# caller do a manual merge of the commit that is blocking
- # the *smallest* blocker block.
- i1, i2 = blocks[-1].get_original_indexes(1, 1)
+ # the leftmost blocker block.
+ i1, i2 = blocks[0].get_original_indexes(1, 1)
raise FrontierBlockedError(
- 'Frontier blocked; suggest manual merge of %d-%d' % (i1, i2),
+ 'Conflict; suggest manual merge of %d-%d' % (i1, i2),
i1, i2
)
@@ -1299,14 +1316,22 @@ class Block(object):
Members:
+ name -- the name of the imerge of which this block is part.
+
len1, len2 -- the dimensions of the block.
"""
- def __init__(self, len1, len2):
+ def __init__(self, name, len1, len2):
+ self.name = name
self.len1 = len1
self.len2 = len2
+ def get_merge_state(self):
+ """Return the MergeState instance containing this Block."""
+
+ raise NotImplementedError()
+
def get_area(self):
"""Return the area of this block, ignoring the known edges."""
@@ -1420,9 +1445,11 @@ class Block(object):
def do_merge(i1, commit1, i2, commit2, msg='Autofilling %d-%d...', record=True):
if (i1, i2) in self:
return self[i1,i2].sha1
+ (i1orig, i2orig) = self.get_original_indexes(i1, i2)
+ sys.stderr.write(msg % (i1orig, i2orig))
+ logmsg = 'imerge \'%s\': automatic merge %d-%d' % (self.name, i1orig, i2orig)
try:
- sys.stderr.write(msg % self.get_original_indexes(i1, i2))
- merge = automerge(commit1, commit2)
+ merge = automerge(commit1, commit2, msg=logmsg)
sys.stderr.write('success.\n')
except AutomaticMergeFailed, e:
sys.stderr.write('unexpected conflict. Backtracking...\n')
@@ -1441,42 +1468,75 @@ class Block(object):
for i2 in range(1, self.len2 - 1):
above = do_merge(i1, above, i2, self[0,i2].sha1)
- # We will compare two ways of doing the final "vertex" merge:
- # as a continuation of the bottom edge, or as a continuation
- # of the right edge. We only accept it if both approaches
- # succeed and give identical trees.
i1, i2 = self.len1 - 1, self.len2 - 1
- vertex_v1 = do_merge(
- i1, self[i1,0].sha1, i2, left,
- msg='Autofilling %d-%d (first way)...',
- record=False,
- )
- vertex_v2 = do_merge(
- i1, above, i2, self[0,i2].sha1,
- msg='Autofilling %d-%d (second way)...',
- record=False,
- )
- if get_tree(vertex_v1) == get_tree(vertex_v2):
- sys.stderr.write(
- 'The two ways of autofilling %d-%d agree.\n'
- % self.get_original_indexes(i1, i2)
+ if i1 > 1 and i2 > 1:
+ # We will compare two ways of doing the final "vertex" merge:
+ # as a continuation of the bottom edge, or as a continuation
+ # of the right edge. We only accept it if both approaches
+ # succeed and give identical trees.
+ vertex_v1 = do_merge(
+ i1, self[i1,0].sha1, i2, left,
+ msg='Autofilling %d-%d (first way)...',
+ record=False,
)
+ vertex_v2 = do_merge(
+ i1, above, i2, self[0,i2].sha1,
+ msg='Autofilling %d-%d (second way)...',
+ record=False,
+ )
+ if get_tree(vertex_v1) == get_tree(vertex_v2):
+ sys.stderr.write(
+ 'The two ways of autofilling %d-%d agree.\n'
+ % self.get_original_indexes(i1, i2)
+ )
+ # Everything is OK. Now reparent the actual vertex merge to
+ # have above and left as its parents:
+ merges.append((i1, i2, reparent(vertex_v1, [above, left])))
+ else:
+ sys.stderr.write(
+ 'The two ways of autofilling %d-%d do not agree. Backtracking...\n'
+ % self.get_original_indexes(i1, i2)
+ )
+ raise UnexpectedMergeFailure('Inconsistent vertex merges', i1, i2)
else:
- sys.stderr.write(
- 'The two ways of autofilling %d-%d do not agree. Backtracking...\n'
- % self.get_original_indexes(i1, i2)
+ do_merge(
+ i1, above, i2, left,
+ msg='Autofilling %d-%d...',
)
- raise UnexpectedMergeFailure('Inconsistent vertex merges', i1, i2)
-
- # Everything is OK. Now reparent the actual vertex merge to
- # have above and left as its parents:
- merges.append((i1, i2, reparent(vertex_v1, [above, left])))
# Done! Now we can record the results:
sys.stderr.write('Recording autofilled block %s.\n' % (self,))
for (i1, i2, merge) in merges:
self[i1, i2].record_merge(merge, MergeRecord.NEW_AUTO)
+ def auto_fill_micromerge(self):
+ """Try to fill the very first micromerge in this block.
+
+ Return True iff the attempt was successful."""
+
+ assert (1, 1) not in self
+ if self.len1 <= 1 or self.len2 <= 1 or self.is_blocked(1, 1):
+ return False
+
+ i1, i2 = 1, 1
+ (i1orig, i2orig) = self.get_original_indexes(i1, i2)
+ sys.stderr.write('Attempting to merge %d-%d...' % (i1orig, i2orig))
+ logmsg = 'imerge \'%s\': automatic merge %d-%d' % (self.name, i1orig, i2orig)
+ try:
+ merge = automerge(
+ self[i1, i2 - 1].sha1,
+ self[i1 - 1, i2].sha1,
+ msg=logmsg,
+ )
+ sys.stderr.write('success.\n')
+ except AutomaticMergeFailed, e:
+ sys.stderr.write('conflict.\n')
+ self[i1,i2].record_blocked(True)
+ return False
+ else:
+ self[i1, i2].record_merge(merge, MergeRecord.NEW_AUTO)
+ return True
+
def auto_outline_frontier(self, merge_frontier=None):
"""Try to outline the merge frontier of this block.
@@ -1489,7 +1549,7 @@ class Block(object):
# Nothing to do.
return False
- best_block = max(merge_frontier, key=lambda block: block.get_area())
+ best_block = max(merge_frontier, key=lambda block: block.get_original_indexes(0, 0))
try:
best_block.auto_outline()
@@ -1506,6 +1566,15 @@ class Block(object):
f2.block.auto_outline_frontier(f2)
return True
+ def auto_expand_frontier(self):
+ merge_state = self.get_merge_state()
+ if merge_state.manual:
+ return False
+ elif merge_state.goal == 'full':
+ return self.auto_fill_micromerge()
+ else:
+ return self.auto_outline_frontier()
+
# The codes in the 2D array returned from create_diagram()
MERGE_UNKNOWN = 0
MERGE_MANUAL = 1
@@ -1545,11 +1614,11 @@ class Block(object):
def format_diagram(self, legend=None, diagram=None):
if legend is None:
legend = [
- AnsiColor.D_GRAY + "?" + AnsiColor.END,
- AnsiColor.B_GREEN + "*" + AnsiColor.END,
- AnsiColor.B_GREEN + "." + AnsiColor.END,
- AnsiColor.B_RED + "#" + AnsiColor.END,
- AnsiColor.B_YELLOW + "@" + AnsiColor.END,
+ AnsiColor.D_GRAY + '?' + AnsiColor.END,
+ AnsiColor.B_GREEN + '*' + AnsiColor.END,
+ AnsiColor.B_GREEN + '.' + AnsiColor.END,
+ AnsiColor.B_RED + '#' + AnsiColor.END,
+ AnsiColor.B_YELLOW + '@' + AnsiColor.END,
]
if diagram is None:
diagram = self.create_diagram()
@@ -1592,23 +1661,30 @@ class SubBlock(Block):
def __init__(self, block, slice1, slice2):
(start1, len1) = self._convert_to_slice(slice1, block.len1)
(start2, len2) = self._convert_to_slice(slice2, block.len2)
- Block.__init__(self, len1, len2)
+ Block.__init__(self, block.name, len1, len2)
if isinstance(block, SubBlock):
# Peel away one level of indirection:
- self._block = block._block
+ self._merge_state = block._merge_state
self._start1 = start1 + block._start1
self._start2 = start2 + block._start2
else:
- self._block = block
+ assert(isinstance(block, MergeState))
+ self._merge_state = block
self._start1 = start1
self._start2 = start2
+ def get_merge_state(self):
+ return self._merge_state
+
def get_original_indexes(self, i1, i2):
i1, i2 = self._normalize_indexes((i1, i2))
- return self._block.get_original_indexes(i1 + self._start1, i2 + self._start2)
+ return self._merge_state.get_original_indexes(
+ i1 + self._start1,
+ i2 + self._start2,
+ )
def convert_original_indexes(self, i1, i2):
- (i1, i2) = self._block.convert_original_indexes(i1, i2)
+ (i1, i2) = self._merge_state.convert_original_indexes(i1, i2)
if not (
self._start1 <= i1 < self._start1 + self.len1
and self._start2 <= i2 < self._start2 + self.len2
@@ -1618,15 +1694,19 @@ class SubBlock(Block):
def _set_value(self, i1, i2, sha1, flags):
self._check_indexes(i1, i2)
- self._block._set_value(i1 + self._start1, i2 + self._start2, sha1, flags)
+ self._merge_state._set_value(
+ i1 + self._start1,
+ i2 + self._start2,
+ sha1, flags,
+ )
def get_value(self, i1, i2):
self._check_indexes(i1, i2)
- return self._block.get_value(i1 + self._start1, i2 + self._start2)
+ return self._merge_state.get_value(i1 + self._start1, i2 + self._start2)
def __str__(self):
return '%s[%d:%d,%d:%d]' % (
- self._block,
+ self._merge_state,
self._start1, self._start1 + self.len1,
self._start2, self._start2 + self.len2,
)
@@ -1670,7 +1750,7 @@ class MergeState(Block):
state = json.loads(state_string)
version = tuple(map(int, state['version'].split('.')))
- if version[0] != STATE_VERSION[0] or version > STATE_VERSION:
+ if version[0] != STATE_VERSION[0] or version[1] > STATE_VERSION[1]:
raise Failure(
'The format of imerge %s (%s) is not compatible with this script version.'
% (name, state['version'],)
@@ -1683,7 +1763,7 @@ class MergeState(Block):
"""Verify that a MergeState with the given name exists.
Just check for the existence, readability, and compatible
- version of the "state" reference. If the reference doesn't
+ version of the 'state' reference. If the reference doesn't
exist, just return False. If it exists but is unusable for
some other reason, raise an exception."""
@@ -1747,8 +1827,8 @@ class MergeState(Block):
)
@staticmethod
- def initialize(name, goal, tip1, tip2):
- """Create and return a new MergeState object."""
+ def check_name_format(name):
+ """Check that name is a valid imerge name."""
if '/' in name:
raise Failure('Name %r must not include a slash character!' % (name,))
@@ -1760,6 +1840,12 @@ class MergeState(Block):
except CalledProcessError:
raise Failure('Name %r is not a valid refname component!' % (name,))
+ @staticmethod
+ def initialize(name, tip1, tip2, goal=DEFAULT_GOAL, manual=False):
+ """Create and return a new MergeState object."""
+
+ MergeState.check_name_format(name)
+
if check_output(['git', 'for-each-ref', 'refs/imerge/%s' % (name,)]):
raise Failure('Name %r is already in use!' % (name,))
@@ -1801,7 +1887,14 @@ class MergeState(Block):
if goal == 'rebase':
MergeState._check_no_merges(commits2)
- return MergeState(name, goal, merge_base, commits1, commits2, MergeRecord.NEW_MANUAL)
+ return MergeState(
+ name, merge_base,
+ tip1, commits1,
+ tip2, commits2,
+ MergeRecord.NEW_MANUAL,
+ goal=goal,
+ manual=manual,
+ )
@staticmethod
def read(name):
@@ -1863,13 +1956,9 @@ class MergeState(Block):
if state is None:
raise Failure(
'No state found; it should have been a blob reference at '
- '"refs/imerge/%s/state' % (name,)
+ '"refs/imerge/%s/state"' % (name,)
)
- goal = state['goal']
- if goal not in ALLOWED_GOALS:
- raise Failure('Goal %r, read from state, is not recognized.' % (goal,))
-
blockers = state.get('blockers', [])
if unexpected:
@@ -1902,7 +1991,23 @@ class MergeState(Block):
except KeyError:
break
- state = MergeState(name, goal, merge_base, commits1, commits2, MergeRecord.SAVED_MANUAL)
+ tip1 = state.get('tip1', commits1[-1])
+ tip2 = state.get('tip2', commits2[-1])
+
+ goal = state['goal']
+ if goal not in ALLOWED_GOALS:
+ raise Failure('Goal %r, read from state, is not recognized.' % (goal,))
+
+ manual = state['manual']
+
+ state = MergeState(
+ name, merge_base,
+ tip1, commits1,
+ tip2, commits2,
+ MergeRecord.SAVED_MANUAL,
+ goal=goal,
+ manual=manual,
+ )
# Now write the rest of the merges to state:
for ((i1, i2), (sha1, source)) in merges.iteritems():
@@ -1973,10 +2078,19 @@ class MergeState(Block):
if MergeState.get_default_name() == name:
MergeState.set_default_name(None)
- def __init__(self, name, goal, merge_base, commits1, commits2, source):
- Block.__init__(self, len(commits1) + 1, len(commits2) + 1)
- self.name = name
+ def __init__(
+ self, name, merge_base,
+ tip1, commits1,
+ tip2, commits2,
+ source,
+ goal=DEFAULT_GOAL,
+ manual=False,
+ ):
+ Block.__init__(self, name, len(commits1) + 1, len(commits2) + 1)
+ self.tip1 = tip1
+ self.tip2 = tip2
self.goal = goal
+ self.manual = bool(manual)
# A simulated 2D array. Values are None or MergeRecord instances.
self._data = [[None] * self.len2 for i1 in range(self.len1)]
@@ -1987,6 +2101,9 @@ class MergeState(Block):
for (i2, commit) in enumerate(commits2, 1):
self.get_value(0, i2).record_merge(commit, source)
+ def get_merge_state(self):
+ return self
+
def set_goal(self, goal):
if goal not in ALLOWED_GOALS:
raise ValueError('%r is not an allowed goal' % (goal,))
@@ -2079,7 +2196,7 @@ class MergeState(Block):
swapped = False
if i1first < i1second:
# Swap parents to make the parent from above the first parent:
- (i1first, i2first, i1second, i2second) = (i1second, i2second, i2first, i1first)
+ (i1first, i2first, i1second, i2second) = (i1second, i2second, i1first, i2first)
swapped = True
if i1first != i1second + 1 or i2first != i2second - 1:
raise ManualMergeUnusableError(
@@ -2140,6 +2257,18 @@ class MergeState(Block):
])
checkout(refname)
+ def simplify_to_full(self, refname, force=False):
+ for i1 in range(1, self.len1):
+ for i2 in range(1, self.len2):
+ if not (i1, i2) in self:
+ raise Failure(
+ 'Cannot simplify to "full" because '
+ 'merge %d-%d is not yet done'
+ % (i1, i2)
+ )
+
+ self._set_refname(refname, self[-1, -1].sha1, force=force)
+
def simplify_to_rebase_with_history(self, refname, force=False):
i1 = self.len1 - 1
for i2 in range(1, self.len2):
@@ -2156,7 +2285,11 @@ class MergeState(Block):
tree = get_tree(self[i1, i2].sha1)
# Create a commit, copying the old log message:
- commit = commit_tree(tree, [commit, orig], msg=get_log_message(orig))
+ msg = (
+ get_log_message(orig).rstrip('\n')
+ + '\n\n(rebased-with-history from commit %s)\n' % orig
+ )
+ commit = commit_tree(tree, [commit, orig], msg=msg)
self._set_refname(refname, commit, force=force)
@@ -2169,6 +2302,23 @@ class MergeState(Block):
% (i1, i2)
)
+ if not force:
+ # A rebase simplification is allowed to discard history,
+ # as long as the *pre-simplification* apex commit is a
+ # descendant of the branch to be moved.
+ try:
+ ref_oldval = get_commit_sha1(refname)
+ except ValueError:
+ # refname doesn't already exist; no problem.
+ pass
+ else:
+ commit = self[-1, -1].sha1
+ if not MergeState._is_ancestor(ref_oldval, commit):
+ raise Failure(
+ '%s is not an ancestor of %s; use --force if you are sure'
+ % (commit, refname,)
+ )
+
commit = self[i1, 0].sha1
for i2 in range(1, self.len2):
orig = self[0, i2].sha1
@@ -2180,7 +2330,9 @@ class MergeState(Block):
tree, [commit], msg=get_log_message(orig), metadata=authordata,
)
- self._set_refname(refname, commit, force=force)
+ # We checked above that the update is OK, so here we can set
+ # force=True:
+ self._set_refname(refname, commit, force=True)
def simplify_to_merge(self, refname, force=False):
if not (-1, -1) in self:
@@ -2194,7 +2346,7 @@ class MergeState(Block):
# Create a preliminary commit with a generic commit message:
sha1 = commit_tree(
tree, parents,
- msg='Merge commit %s into commit %s' % (parents[1], parents[0]),
+ msg='Merge %s into %s (using imerge)' % (self.tip2, self.tip1),
)
self._set_refname(refname, sha1, force=force)
@@ -2207,7 +2359,9 @@ class MergeState(Block):
The merge must be complete before calling this method."""
- if self.goal == 'rebase-with-history':
+ if self.goal == 'full':
+ self.simplify_to_full(refname, force=force)
+ elif self.goal == 'rebase-with-history':
self.simplify_to_rebase_with_history(refname, force=force)
elif self.goal == 'rebase':
self.simplify_to_rebase(refname, force=force)
@@ -2230,8 +2384,10 @@ class MergeState(Block):
state = dict(
version='.'.join(map(str, STATE_VERSION)),
- goal=self.goal,
blockers=blockers,
+ tip1=self.tip1, tip2=self.tip2,
+ goal=self.goal,
+ manual=self.manual,
)
state_string = json.dumps(state, sort_keys=True) + '\n'
@@ -2250,14 +2406,16 @@ class MergeState(Block):
])
def __str__(self):
- return 'MergeState(%r, goal=%r)' % (self.name, self.goal,)
+ return 'MergeState(\'%s\', tip1=\'%s\', tip2=\'%s\', goal=\'%s\')' % (
+ self.name, self.tip1, self.tip2, self.goal,
+ )
def request_user_merge(merge_state, i1, i2):
"""Prepare the working tree for the user to do a manual merge.
- It is assumed that the merge above and to the left of (i1, i2) are
- already done."""
+ It is assumed that the merges above and to the left of (i1, i2)
+ are already done."""
above = merge_state[i1, i2 - 1]
left = merge_state[i1 - 1, i2]
@@ -2270,10 +2428,11 @@ def request_user_merge(merge_state, i1, i2):
refname, above.sha1,
])
checkout(refname)
+ logmsg = 'imerge \'%s\': manual merge %d-%d' % (merge_state.name, i1, i2)
try:
check_call([
'git', 'merge', '--no-commit',
- '-m', 'Merge %d-%d of incremental merge \'%s\'' % (i1, i2, merge_state.name,),
+ '-m', logmsg,
left.sha1,
])
except CalledProcessError:
@@ -2298,39 +2457,110 @@ def request_user_merge(merge_state, i1, i2):
% (i1, i2)
)
-def incorporate_user_merge(merge_state):
+
+def incorporate_user_merge(merge_state, edit_log_msg=None):
"""If the user has done a merge for us, incorporate the results.
- If reference refs/heads/imerge/NAME exists, try to incorporate it
- into merge_state, delete the reference, and return (i1,i2)
- corresponding to the merge. If the reference cannot be used,
- raise NoManualMergeError(). If the reference exists but cannot be
- used, raise a ManualMergeUnusableError. This function must be
- called with a clean work tree."""
+ If the scratch reference refs/heads/imerge/NAME exists and is
+ checked out, first check if there are staged changes that can be
+ committed. Then try to incorporate the current commit into
+ merge_state, delete the reference, and return (i1,i2)
+ corresponding to the merge. If the scratch reference does not
+ exist, raise NoManualMergeError(). If the scratch reference
+ exists but cannot be used, raise a ManualMergeUnusableError. If
+ there are unstaged changes in the working tree, emit an error
+ message and raise UncleanWorkTreeError."""
refname = MergeState.get_scratch_refname(merge_state.name)
+
try:
commit = get_commit_sha1(refname)
except ValueError:
- raise NoManualMergeError('There was no merge at %s!' % (refname,))
+ raise NoManualMergeError('Reference %s does not exist.' % (refname,))
+
+ try:
+ head_name = check_output(['git', 'symbolic-ref', '--quiet', 'HEAD']).strip()
+ except CalledProcessError:
+ raise NoManualMergeError('HEAD is currently detached.')
+
+ if head_name != refname:
+ # This should not usually happen. The scratch reference
+ # exists, but it is not current. Perhaps the user gave up on
+ # an attempted merge then switched to another branch. We want
+ # to delete refname, but only if it doesn't contain any
+ # content that we don't already know.
+ try:
+ merge_state.find_index(commit)
+ except CommitNotFoundError:
+ # It points to a commit that we don't have in our records.
+ raise Failure(
+ 'The scratch reference, %(refname)s, already exists but is not\n'
+ 'checked out. If it points to a merge commit that you would like\n'
+ 'to use, please check it out using\n'
+ '\n'
+ ' git checkout %(refname)s\n'
+ '\n'
+ 'and then try to continue again. If it points to a commit that is\n'
+ 'unneeded, then please delete the reference using\n'
+ '\n'
+ ' git update-ref -d %(refname)s\n'
+ '\n'
+ 'and then continue.'
+ % dict(refname=refname)
+ )
+ else:
+ # It points to a commit that is already recorded. We can
+ # delete it without losing any information.
+ check_call([
+ 'git', 'update-ref',
+ '-m',
+ 'imerge %r: Remove obsolete scratch reference'
+ % (merge_state.name,),
+ '-d', refname,
+ ])
+ sys.stderr.write(
+ '%s did not point to a new merge; it has been deleted.\n'
+ % (refname,)
+ )
+ raise NoManualMergeError(
+ 'Reference %s was not checked out.' % (refname,)
+ )
+
+ # If we reach this point, then the scratch reference exists and is
+ # checked out. Now check whether there is staged content that
+ # can be committed:
merge_frontier = MergeFrontier.map_known_frontier(merge_state)
+ try:
+ check_call(['git', 'diff-index', '--cached', '--quiet', 'HEAD', '--'])
+ except CalledProcessError:
+ # There are staged changes; commit them if possible.
+ cmd = ['git', 'commit', '--no-verify']
+
+ if edit_log_msg is not None:
+ if edit_log_msg:
+ cmd += ['--edit']
+ else:
+ cmd += ['--no-edit']
+
+ try:
+ check_call(cmd)
+ except CalledProcessError:
+ raise Failure('Could not commit staged changes.')
+ commit = get_commit_sha1('HEAD')
+
+ require_clean_work_tree('proceed')
+
# This might throw ManualMergeUnusableError:
(i1, i2) = merge_state.incorporate_manual_merge(commit)
- try:
- headref = check_output(['git', 'symbolic-ref', '-q', 'HEAD']).strip()
- except CalledProcessError:
- pass
- else:
- if headref == refname:
- # Detach head so that we can delete refname.
- check_call([
- 'git', 'update-ref', '--no-deref',
- '-m', 'Detach HEAD from %s' % (refname,),
- 'HEAD', commit,
- ])
+ # Now detach head so that we can delete refname.
+ check_call([
+ 'git', 'update-ref', '--no-deref',
+ '-m', 'Detach HEAD from %s' % (refname,),
+ 'HEAD', commit,
+ ])
check_call([
'git', 'update-ref',
@@ -2385,8 +2615,8 @@ def choose_merge_name(name, default_to_unique=True):
raise Failure('Please select an incremental merge using --name')
-def read_merge_state(name=None):
- return MergeState.read(choose_merge_name(name))
+def read_merge_state(name=None, default_to_unique=True):
+ return MergeState.read(choose_merge_name(name, default_to_unique=default_to_unique))
@Failure.wrap
@@ -2397,42 +2627,46 @@ def main(args):
)
subparsers = parser.add_subparsers(dest='subcommand', help='sub-command')
- parser_start = subparsers.add_parser(
+ subparser = subparsers.add_parser(
'start',
help=(
'start a new incremental merge '
'(equivalent to "init" followed by "continue")'
),
)
- parser_start.add_argument(
+ subparser.add_argument(
'--name', action='store', default=None,
help='name to use for this incremental merge',
)
- parser_start.add_argument(
+ subparser.add_argument(
'--goal',
action='store', default=DEFAULT_GOAL,
choices=ALLOWED_GOALS,
help='the goal of the incremental merge',
)
- #parser_start.add_argument(
- # '--conflicts', ...
- # action='store', default='pairwise',
- # choices=['pairwise', 'fewest'],
- # help='what sort of conflicts will be presented to the user',
- # )
- parser_start.add_argument(
+ subparser.add_argument(
+ '--manual',
+ action='store_true', default=False,
+ help=(
+ 'ask the user to complete all merges manually, even when they '
+ 'appear conflict-free. This option disables the usual bisection '
+ 'algorithm and causes the full incremental merge diagram to be '
+ 'completed.'
+ ),
+ )
+ subparser.add_argument(
'--first-parent', action='store_true', default=None,
help=(
'handle only the first parent commits '
'(this option is currently required)'
),
)
- parser_start.add_argument(
+ subparser.add_argument(
'branch', action='store',
help='the tip of the branch to be merged into HEAD',
)
- parser_continue = subparsers.add_parser(
+ subparser = subparsers.add_parser(
'continue',
help=(
'record the merge at branch imerge/NAME '
@@ -2442,23 +2676,32 @@ def main(args):
'conflict that has to be resolved manually)'
),
)
- parser_continue.add_argument(
+ subparser.add_argument(
'--name', action='store', default=None,
help='name of merge to continue',
)
+ subparser.set_defaults(edit=None)
+ subparser.add_argument(
+ '--edit', '-e', dest='edit', action='store_true',
+ help='commit staged changes with the --edit option',
+ )
+ subparser.add_argument(
+ '--no-edit', dest='edit', action='store_false',
+ help='commit staged changes with the --no-edit option',
+ )
- parser_finish = subparsers.add_parser(
+ subparser = subparsers.add_parser(
'finish',
help=(
'simplify then remove a completed incremental merge '
'(equivalent to "simplify" followed by "remove")'
),
)
- parser_finish.add_argument(
+ subparser.add_argument(
'--name', action='store', default=None,
help='name of merge to finish',
)
- parser_finish.add_argument(
+ subparser.add_argument(
'--goal',
action='store', default=None,
choices=ALLOWED_GOALS,
@@ -2467,7 +2710,7 @@ def main(args):
'(default is the value provided to "init" or "start")'
),
)
- parser_finish.add_argument(
+ subparser.add_argument(
'--branch',
action='store', default=None,
help=(
@@ -2478,42 +2721,42 @@ def main(args):
'specified.'
),
)
- parser_finish.add_argument(
+ subparser.add_argument(
'--force',
action='store_true', default=False,
help='allow the target branch to be updated in a non-fast-forward manner',
)
- parser_diagram = subparsers.add_parser(
+ subparser = subparsers.add_parser(
'diagram',
help='display a diagram of the current state of a merge',
)
- parser_diagram.add_argument(
+ subparser.add_argument(
'--name', action='store', default=None,
help='name of merge to diagram',
)
- parser_diagram.add_argument(
+ subparser.add_argument(
'--commits', action='store_true', default=False,
help='show the merges that have been made so far',
)
- parser_diagram.add_argument(
+ subparser.add_argument(
'--frontier', action='store_true', default=False,
help='show the current merge frontier',
)
- parser_diagram.add_argument(
+ subparser.add_argument(
'--html', action='store', default=None,
help='generate HTML diagram showing the current merge frontier',
)
- parser_diagram.add_argument(
+ subparser.add_argument(
'--color', dest='color', action='store_true', default=None,
help='draw diagram with colors',
)
- parser_diagram.add_argument(
+ subparser.add_argument(
'--no-color', dest='color', action='store_false',
help='draw diagram without colors',
)
- parser_list = subparsers.add_parser(
+ subparser = subparsers.add_parser(
'list',
help=(
'list the names of incremental merges that are currently in progress. '
@@ -2521,57 +2764,70 @@ def main(args):
),
)
- parser_init = subparsers.add_parser(
+ subparser = subparsers.add_parser(
'init',
help='initialize a new incremental merge',
)
- parser_init.add_argument(
+ subparser.add_argument(
'--name', action='store', default=None,
help='name to use for this incremental merge',
)
- parser_init.add_argument(
+ subparser.add_argument(
'--goal',
action='store', default=DEFAULT_GOAL,
choices=ALLOWED_GOALS,
help='the goal of the incremental merge',
)
- #parser_init.add_argument(
- # '--conflicts', ...
- # action='store', default='pairwise',
- # choices=['pairwise', 'fewest'],
- # help='what sort of conflicts will be presented to the user',
- # )
- parser_init.add_argument(
+ subparser.add_argument(
+ '--manual',
+ action='store_true', default=False,
+ help=(
+ 'ask the user to complete all merges manually, even when they '
+ 'appear conflict-free. This option disables the usual bisection '
+ 'algorithm and causes the full incremental merge diagram to be '
+ 'completed.'
+ ),
+ )
+ subparser.add_argument(
'--first-parent', action='store_true', default=None,
help=(
'handle only the first parent commits '
'(this option is currently required)'
),
)
- parser_init.add_argument(
+ subparser.add_argument(
'branch', action='store',
help='the tip of the branch to be merged into HEAD',
)
- parser_record = subparsers.add_parser(
+ subparser = subparsers.add_parser(
'record',
help='record the merge at branch imerge/NAME',
)
- parser_record.add_argument(
+ subparser.add_argument(
'--name', action='store', default=None,
help='name of merge to which the merge should be added',
)
+ subparser.set_defaults(edit=None)
+ subparser.add_argument(
+ '--edit', '-e', dest='edit', action='store_true',
+ help='commit staged changes with the --edit option',
+ )
+ subparser.add_argument(
+ '--no-edit', dest='edit', action='store_false',
+ help='commit staged changes with the --no-edit option',
+ )
- parser_autofill = subparsers.add_parser(
+ subparser = subparsers.add_parser(
'autofill',
help='autofill non-conflicting merges',
)
- parser_autofill.add_argument(
+ subparser.add_argument(
'--name', action='store', default=None,
help='name of merge to autofill',
)
- parser_simplify = subparsers.add_parser(
+ subparser = subparsers.add_parser(
'simplify',
help=(
'simplify a completed incremental merge by discarding unneeded '
@@ -2579,11 +2835,11 @@ def main(args):
'that are retained'
),
)
- parser_simplify.add_argument(
+ subparser.add_argument(
'--name', action='store', default=None,
help='name of merge to simplify',
)
- parser_simplify.add_argument(
+ subparser.add_argument(
'--goal',
action='store', default=None,
choices=ALLOWED_GOALS,
@@ -2592,7 +2848,7 @@ def main(args):
'(default is the value provided to "init" or "start")'
),
)
- parser_simplify.add_argument(
+ subparser.add_argument(
'--branch',
action='store', default=None,
help=(
@@ -2603,26 +2859,26 @@ def main(args):
'specified.'
),
)
- parser_simplify.add_argument(
+ subparser.add_argument(
'--force',
action='store_true', default=False,
help='allow the target branch to be updated in a non-fast-forward manner',
)
- parser_remove = subparsers.add_parser(
+ subparser = subparsers.add_parser(
'remove',
help='irrevocably remove an incremental merge',
)
- parser_remove.add_argument(
+ subparser.add_argument(
'--name', action='store', default=None,
help='name of incremental merge to remove',
)
- parser_reparent = subparsers.add_parser(
+ subparser = subparsers.add_parser(
'reparent',
help='change the parents of the HEAD commit',
)
- parser_reparent.add_argument(
+ subparser.add_argument(
'parents', nargs='*', help='[PARENT...]',
)
@@ -2653,8 +2909,16 @@ def main(args):
parser.error(
'Please specify the --name to be used for this incremental merge'
)
+ try:
+ tip1 = check_output(
+ ['git', 'symbolic-ref', '--quiet', '--short', 'HEAD'],
+ ).strip()
+ except CalledProcessError:
+ tip1 = 'HEAD'
+ tip2 = options.branch
merge_state = MergeState.initialize(
- options.name, options.goal, 'HEAD', options.branch,
+ options.name, tip1, tip2,
+ goal=options.goal, manual=options.manual,
)
merge_state.save()
MergeState.set_default_name(options.name)
@@ -2669,8 +2933,16 @@ def main(args):
parser.error(
'Please specify the --name to be used for this incremental merge'
)
+ try:
+ tip1 = check_output(
+ ['git', 'symbolic-ref', '--quiet', '--short', 'HEAD'],
+ ).strip()
+ except CalledProcessError:
+ tip1 = 'HEAD'
+ tip2 = options.branch
merge_state = MergeState.initialize(
- options.name, options.goal, 'HEAD', options.branch,
+ options.name, tip1, tip2,
+ goal=options.goal, manual=options.manual,
)
merge_state.save()
MergeState.set_default_name(options.name)
@@ -2684,10 +2956,9 @@ def main(args):
elif options.subcommand == 'remove':
MergeState.remove(choose_merge_name(options.name, default_to_unique=False))
elif options.subcommand == 'continue':
- require_clean_work_tree('proceed')
merge_state = read_merge_state(options.name)
try:
- incorporate_user_merge(merge_state)
+ incorporate_user_merge(merge_state, edit_log_msg=options.edit)
except NoManualMergeError:
pass
except NotABlockingCommitError, e:
@@ -2702,10 +2973,9 @@ def main(args):
else:
sys.stderr.write('Merge is complete!\n')
elif options.subcommand == 'record':
- require_clean_work_tree('proceed')
merge_state = read_merge_state(options.name)
try:
- incorporate_user_merge(merge_state)
+ incorporate_user_merge(merge_state, edit_log_msg=options.edit)
except NoManualMergeError, e:
raise Failure(str(e))
except NotABlockingCommitError:
@@ -2740,8 +3010,7 @@ def main(args):
merge_state.simplify(refname, force=options.force)
elif options.subcommand == 'finish':
require_clean_work_tree('proceed')
- options.name = choose_merge_name(options.name, default_to_unique=False)
- merge_state = read_merge_state(options.name)
+ merge_state = read_merge_state(options.name, default_to_unique=False)
merge_frontier = MergeFrontier.map_known_frontier(merge_state)
if not merge_frontier.is_complete():
raise Failure('Merge %s is not yet complete!' % (merge_state.name,))
@@ -2750,7 +3019,7 @@ def main(args):
merge_state.set_goal(options.goal)
merge_state.save()
merge_state.simplify(refname, force=options.force)
- MergeState.remove(options.name)
+ MergeState.remove(merge_state.name)
elif options.subcommand == 'diagram':
if not (options.commits or options.frontier):
options.frontier = True
@@ -2767,7 +3036,7 @@ def main(args):
sys.stdout.write('\n')
if options.html:
merge_frontier = MergeFrontier.map_known_frontier(merge_state)
- html = open(options.html, "w")
+ html = open(options.html, 'w')
merge_frontier.write_html(html, merge_state.name)
html.close()
sys.stdout.write(
diff --git a/fortune/calvin b/fortune/calvin
index 2476c29..914631e 100644
--- a/fortune/calvin
+++ b/fortune/calvin
@@ -1,405 +1,478 @@
- That's the difference between me and the rest of the world! Happiness isn't
-good enough for me! I demand euphoria! -- Calvin
+That's the difference between me and the rest of the world! Happiness
+isn't good enough for me! I demand euphoria!
+ -- Calvin
%
- The purpose of writing is to inflate weak ideas, obscure pure reasoning, and
-inhibit clarity. With a little practice, writing can be an intimidating and
-impenetrable fog! -- Calvin
+The purpose of writing is to inflate weak ideas, obscure pure
+reasoning, and inhibit clarity. With a little practice, writing can be
+an intimidating and impenetrable fog!
+ -- Calvin
%
- Calvin: I'm a genius, but I'm a misunderstood genius. Hobbes: What's
-misunderstood about you? Calvin: Nobody thinks I'm a genius. -- Calvin
+Calvin: I'm a genius, but I'm a misunderstood genius.
+Hobbes: What's misunderstood about you?
+Calvin: Nobody thinks I'm a genius.
%
- Well, it just seemed wrong to cheat on an ethics test. -- Calvin
+Well, it just seemed wrong to cheat on an ethics test.
+ -- Calvin
%
- Calvin: Can you make a living playing silly games? His Dad: Actually, you
-can be among the most overpaid people on the planet.
+Calvin: Can you make a living playing silly games?
+His Dad: Actually, you can be among the most overpaid people on the
+ planet.
%
- If you do the job badly enough, sometimes you don't get asked to do it
-again. -- Calvin
+If you do the job badly enough, sometimes you don't get asked to do it
+again.
+ -- Calvin
%
- The only skills I have the patience to learn are those that have no real
-application in life. -- Calvin
+The only skills I have the patience to learn are those that have no
+real application in life.
+ -- Calvin
%
- Some people are pragmatists, taking things as they come and making the best
-of the choices available. Some people are idealists, standing for principle and
-refusing to compromise. And some people just act on any whim that enters their
-heads. I pragmatically turn my whims into principles! -- Calvin
+Some people are pragmatists, taking things as they come and making the
+best of the choices available. Some people are idealists, standing for
+principle and refusing to compromise. And some people just act on any
+whim that enters their heads. I pragmatically turn my whims into
+principles!
+ -- Calvin
%
- Sometimes I think the surest sign that intelligent life exists elsewhere in
-the universe is that none of it has tried to contact us. -- Calvin
+Sometimes I think the surest sign that intelligent life exists
+elsewhere in the universe is that none of it has tried to contact us.
+ -- Calvin
%
- It seems like once people grow up, they have no idea what's cool.
- -- Calvin
+It seems like once people grow up, they have no idea what's cool.
+ -- Calvin
%
- The real fun of living wisely is that you get to be smug about it.
- -- Calvin
+The real fun of living wisely is that you get to be smug about it.
+ -- Calvin
%
- Calvin: Know what I pray for? Hobbes: What? Calvin: The strength to change
-what I can, the inability to accept what I can't, and the incapacity to tell
-the difference. -- Calvin
+Calvin: Know what I pray for?
+Hobbes: What?
+Calvin: The strength to change what I can, the inability to accept what
+ I can't, and the incapacity to tell the difference.
%
- I say, if your knees aren't green by the end of the day, you ought to
-seriously re-examine your life. -- Calvin
+I say, if your knees aren't green by the end of the day, you ought to
+seriously re-examine your life.
+ -- Calvin
%
- But Calvin is no kind and loving god! He's one of the old gods! He demands
-sacrifice! -- Calvin
+But Calvin is no kind and loving god! He's one of the old gods! He
+demands sacrifice!
+ -- Calvin
%
- It's psychosomatic. You need a lobotomy. I'll get a saw.
- -- Calvin
+It's psychosomatic. You need a lobotomy. I'll get a saw.
+ -- Calvin
%
- Why waste time learning, when ignorance is instantaneous?
- -- Calvin
+Why waste time learning, when ignorance is instantaneous?
+ -- Calvin
%
- Hobbes: What would you call the creation of the universe?
- Calvin: The Horrendous Space Kablooie!
+Hobbes: What would you call the creation of the universe?
+Calvin: The Horrendous Space Kablooie!
%
- If something is so complicated that you can't explain it in 10 seconds, then
-it's probably not worth knowing anyway. -- Calvin
+If something is so complicated that you can't explain it in 10 seconds,
+then it's probably not worth knowing anyway.
+ -- Calvin
%
- Who wouldn't be interested in everything we do?!
- -- Calvin
+Who wouldn't be interested in everything we do?!
+ -- Calvin
%
- I think we dream so we don't have to be apart so long. If we're in each
-other's dreams, we can play together all night. -- Calvin
+I think we dream so we don't have to be apart so long. If we're in each
+other's dreams, we can play together all night.
+ -- Calvin
%
- This one's tricky. You have to use imaginary numbers, like eleventeen ...
- -- Hobbes
+This one's tricky. You have to use imaginary numbers, like eleventeen
+...
+ -- Hobbes
%
- You can present the material, but you can't make me care.
- -- Calvin
+You can present the material, but you can't make me care.
+ -- Calvin
%
- YAAH! DEATH TO OATMEAL!
- -- Calvin
+YAAH! DEATH TO OATMEAL!
+ -- Calvin
%
- From now on, I'll connect the dots my own way.
- -- Calvin
+From now on, I'll connect the dots my own way.
+ -- Calvin
%
- I'm learning real skills that I can apply throughout the rest of my life ...
-Procrastinating and rationalizing. -- Calvin
+I'm learning real skills that I can apply throughout the rest of my
+life ... Procrastinating and rationalizing.
+ -- Calvin
%
- Reality continues to ruin my life.
- -- Calvin
+Reality continues to ruin my life.
+ -- Calvin
%
- Calvin: Sometimes when I'm talking, my words can't keep up with my thoughts.
-I wonder why we think faster than we speak. Hobbes: Probably so we can think
-twice.
+Calvin: Sometimes when I'm talking, my words can't keep up with my
+thoughts. I wonder why we think faster than we speak.
+Hobbes: Probably so we can think twice.
%
- I liked things better when I didn't understand them.
- -- Calvin
+I liked things better when I didn't understand them.
+ -- Calvin
%
- Is it a right to remain ignorant?
- -- Calvin
+Is it a right to remain ignorant?
+ -- Calvin
%
- I think nighttime is dark so you can imagine your fears with less
-distraction. -- Calvin
+I think nighttime is dark so you can imagine your fears with less
+distraction.
+ -- Calvin
%
- Miss Wormwood: What state do you live in?
- Calvin: Denial.
- Miss Wormwood: I don't suppose I can argue with that...
+Miss Wormwood: What state do you live in?
+Calvin: Denial.
+Miss Wormwood: I don't suppose I can argue with that...
%
- What's the point of wearing your favorite rocketship underpants if nobody
-ever asks to see 'em? -- Calvin
+What's the point of wearing your favorite rocketship underpants if
+nobody ever asks to see 'em?
+ -- Calvin
%
- My life needs a rewind/erase button.
- -- Calvin
+My life needs a rewind/erase button.
+ -- Calvin
%
- Weekends don't count unless you spend them doing something completely
-pointless. -- Calvin
+Weekends don't count unless you spend them doing something completely
+pointless.
+ -- Calvin
%
- You know, Hobbes, some days even my lucky rocketship underpants don't help.
- -- Calvin
+You know, Hobbes, some days even my lucky rocketship underpants don't
+help.
+ -- Calvin
%
- I imagine bugs and girls have a dim perception that nature played a cruel
-trick on them, but they lack the intelligence to really comprehend the
-magnitude of it. -- Calvin
+I imagine bugs and girls have a dim perception that nature played a
+cruel trick on them, but they lack the intelligence to really
+comprehend the magnitude of it.
+ -- Calvin
%
- Susie: You'd get a good grade without doing any work.
- Calvin: So?
- Susie: It's wrong to get rewards you haven't earned.
- Calvin: I've never heard of anyone who couldn't live with that.
+Susie: You'd get a good grade without doing any work.
+Calvin: So?
+Susie: It's wrong to get rewards you haven't earned.
+Calvin: I've never heard of anyone who couldn't live with that.
%
- If you couldn't find any weirdness, maybe we'll just have to make some!
- -- Calvin
+If you couldn't find any weirdness, maybe we'll just have to make some!
+ -- Calvin
%
- "MOM, CAN I SET FIRE TO MY BED MATTRESS?" "No, Calvin." "CAN I RIDE MY
-TRICYCLE ON THE ROOF?" "No, Calvin." "Then can I have a cookie?" "No, Calvin."
-("She's on to me.")
+"MOM, CAN I SET FIRE TO MY BED MATTRESS?" "No, Calvin." "CAN I RIDE MY
+TRICYCLE ON THE ROOF?" "No, Calvin." "Then can I have a cookie?" "No,
+Calvin." ("She's on to me.")
%
- I like to say "quark"! Quark, quark, quark, quark!
- -- Calvin
+I like to say "quark"! Quark, quark, quark, quark!
+ -- Calvin
%
- I don't need to compromise my principles, because they don't have the
-slightest bearing on what happens to me anyway. -- Calvin
+I don't need to compromise my principles, because they don't have the
+slightest bearing on what happens to me anyway.
+ -- Calvin
%
- For your information, I'm staying like this, and everyone else can just get
-used to it! If people don't like me the way I am, well TOUGH BEANS! It's a free
-country! I don't need anyone's permission to be the way I want! This is how I
-am - Take it or leave it! -- Calvin
+For your information, I'm staying like this, and everyone else can just
+get used to it! If people don't like me the way I am, well TOUGH BEANS!
+It's a free country! I don't need anyone's permission to be the way I
+want! This is how I am - Take it or leave it!
+ -- Calvin
%
- Know what I pray for? The strength to change what I can, the inability to
-accept what I can't and the incapacity to tell the difference. -- Calvin
+Know what I pray for? The strength to change what I can, the inability
+to accept what I can't and the incapacity to tell the difference.
+ -- Calvin
%
- As usual, goodness hardly puts up a fight.
- -- Calvin
+As usual, goodness hardly puts up a fight.
+ -- Calvin
%
- If we don't all watch the same TV, what will keep our culture homogeneous?
- -- Calvin
+If we don't all watch the same TV, what will keep our culture
+homogeneous?
+ -- Calvin
%
- My behaviour is addictive functioning in a disease process of toxic
-co-dependency. I need holistic healing and wellness before I'll accept any
-responsibility for my actions. -- Calvin
+My behaviour is addictive functioning in a disease process of toxic
+co-dependency. I need holistic healing and wellness before I'll accept
+any responsibility for my actions.
+ -- Calvin
%
- My family is dysfunctional and my parents won't empower me. Consequently
-I'm not self actualized. -- Calvin
+My family is dysfunctional and my parents won't empower me.
+Consequently I'm not self actualized.
+ -- Calvin
%
- Nothing I do is my fault.
- -- Calvin
+Nothing I do is my fault.
+ -- Calvin
%
- Why should I have to work for everything? It's like saying that I don't
-deserve it. -- Calvin
+Why should I have to work for everything? It's like saying that I don't
+deserve it.
+ -- Calvin
%
- Why do we drink cow's milk? Who was the first guy who first looked at a cow
-and said "I think I'll drink whatever comes out of these things when I squeeze
-'em!"? -- Calvin
+Why do we drink cow's milk? Who was the first guy who first looked at a
+cow and said "I think I'll drink whatever comes out of these things
+when I squeeze 'em!"?
+ -- Calvin
+%
+Hobbes: What if the public doesn't like your work?
+Calvin: They are not supposed to like it. This is avant-garde stuff!
+ I'm criticizing the low brows who can't appreciate great art
+ like this!
%
- Hobbes : What if the public doesn't like your work?
- Calvin : They are not supposed to like it. This is avant-garde stuff!
- I'm criticizing the low brows who can't appreciate great art
- like this!
+I don't need to compromise my principles, because they don't have the
+slightest bearing on what happens to me anyway.
+ -- Calvin
%
- I don't need to compromise my principles, because they don't have the
-slightest bearing on what happens to me anyway. -- Calvin
+The dame was hysterical. Dames usually are.
+ -- Calvin as Tracer Bullet
+%
+Thank you. before I begin, I'd like everyone to notice that my report
+is in a professional, clear plastic binder... When a report looks this
+good, you know it'll get an A. That's a tip kids. Write it down.
+ -- Calvin
+%
+Calvin: I think we have got enough information now, don't you?
+Hobbes: All we have is one "fact" that you made up.
+Calvin: That's plenty. By the time we add an introduction, a few
+ illustrations and a conclusion, it'll look like a graduate
+ thesis.
%
- The dame was hysterical. Dames Usually are. -- Calvin as Tracer Bullet
+Wormwood: Calvin, how about you?
+Calvin: Hard to say ma'am. I think my cerebellum just fused.
%
- Thank you. before I begin, I'd like everyone to notice that my report is in
-a professional, clear plastic binder...When a report looks this good, you know
-it'll get an A. That's a tip kids. Write it down. -- Calvin
+If you want to stay dad you've got to polish your image. I think the
+image we need to create for you is "repentant but learning".
+ -- Calvin
%
- Calvin : I think we have got enough information now, don't you?
- Hobbes : All we have is one "fact" that you made up.
- Calvin : That's plenty. By the time we add an introduction, a few
- illustrations and a conclusion, it'll look like a graduate thesis.
+"Dad buried in landslide! Jubilant throngs fill streets! Stunned father
+inconsolable - demands recount!"
+ -- Calvin
%
- Wormwood : Calvin, how about you?
- Calvin : Hard to say ma'am. I think my cerebellum just fused.
+Often it takes some calamity to make us live in the present. Then
+suddenly we wake up and see all the mistakes we have made. But it is
+too late to change anything.
+ -- Calvin
+%
+Sometimes it seems things go by too quickly. We are so busy watching
+out for what's just ahead of us that we don't take the time to enjoy
+where we are.
+ -- Calvin
+%
+Hobbes: Well, you still have afternoons and weekends.
+Calvin: That's when I watch TV.
%
- If you want to stay dad you've got to polish your image. I think the image
-we need to create for you is "repentant but learning". -- Calvin
+Hobbes: Shouldn't we read the instructions?
+Calvin: Do I look like a sissy?
%
- "Dad buried in landslide! Jubilant throngs fill streets! Stunned father
-inconsolable - demands recount!" -- Calvin
+You know what we need, Hobbes? We need an attitude. Yeah, you can't be
+cool if you don't have an attitude.
+ -- Calvin
%
- Often it takes some calamity to make us live in the present. Then suddenly
-we wake up and see all the mistakes we have made. But it is too late to change
-anything. -- Calvin
+Why can't I ever build character at a Miami condo or a casino somewhere?
+ -- Calvin
%
- Sometimes it seems things go by too quickly. We are so busy watching out for
-what's just ahead of us that we don't take the time to enjoy where we are.
- -- Calvin
+Sometimes one should just look at things and think about things without
+doing things.
+ -- Calvin
%
- Hobbes : Well, you still have afternoons and weekends
- Calvin : That's when I watch TV.
+What do you get when you cross a cantaloupe with lassie? A melon-collie
+baby! Get it?? HA HA HA OH OH HA HA!
+ -- Calvin
%
- Hobbes : Shouldn't we read the instructions?
- Calvin : Do I look like a sissy?
+Hobbes: How is the diorama coming along?
+Calvin: I'm almost finished.
+Hobbes: I don't see the roadrunner. Weren't you going to put one in?
+Calvin: See the cotton balls I glued down?
+Hobbes: Yeah?
+Calvin: The roadrunner just ran out of the scene leaving behind clouds
+ of dust!
%
- You know what we need, Hobbes? We need an attitude. Yeah, you can't be cool
-if you don't have an attitude. -- Calvin
+It must be awful to be a girl. I'm sure it's frustrating knowing that
+men are bigger, stronger and better at abstract thought than women.
+Really, if you are a girl, what would make you go on living?
+ -- Calvin, Dictator-For-Life, of GROSS (Get Rid Of
+ Slimy girlS)
%
- Why can't I ever build character at a Miami condo or a casino somewhere?
- -- Calvin
+There's never enough time to do all the nothing you want.
+ -- Calvin
%
- Sometimes one should just look at things and think about things without
-doing things. -- Calvin
+Golly, I'd hate to have a kid like me!
+ -- Calvin
%
- What do you get when you cross a cantaloupe with lassie? A melon-collie
-baby! Get it?? HA HA HA OH OH HA HA! -- Calvin
+This is so cool I've to go to the bathroom.
+ -- Calvin
%
- Hobbes : How is the diorama coming along?
- Calvin : I'm almost finished.
- Hobbes : I don't see the roadrunner. Weren't you going to put one in?
- Calvin : See the cotton balls I glued down?
- Hobbes : Yeah?
- Calvin : The roadrunner just ran out of the scene leaving behind clouds
- of dust!
+I imagine girls and bugs have a dim perception that nature played a
+cruel trick on them but they lack the intelligence to really comprehend
+the magnitude of it.
+ -- Calvin
%
- It must be awful to be a girl. I'm sure it's frustrating knowing that men
-are bigger, stronger and better at abstract thought than women. Really, if you
-are a girl, what would make you go on living? --Calvin, Dictator-For-Life, of
-GROSS (Get Rid Of Slimy girlS)
+Dad are you vicariously living through me in the hope that my
+accomplishments will validate your mediocre life and in some way
+compensate for all the opportunities you botched?
+ -- Calvin
%
- There's never enough time to do all the nothing you want.
- -- Calvin
+If you care, you just get disappointed all the time. If you don't care
+nothing matters so you are never upset.
+ -- Calvin
%
- Golly, I'd hate to have a kid like me!
- -- Calvin
+Life is full of surprises but never when you need one.
+ -- Calvin
%
- This is so cool I've to go to the bathroom.
- -- Calvin
+I'm killing time while I wait for life to shower me with meaning and
+happiness.
+ -- Calvin
%
- I imagine girls and bugs have a dim perception that nature played a cruel
-trick on them but they lack the intelligence to really comprehend the magnitude
-of it. -- Calvin
+"The dynamics of inter-being and mono logical imperatives in Dick and
+Jane: A study in psychic transrelational gender modes". Academia, here
+I come.
+ -- Calvin
%
- Dad are you vicariously living through me in the hope that my
-accomplishments will validate your mediocre life and in some way compensate for
-all the opportunities you botched ? -- Calvin
+Miss Wormwood: Calvin where was the Byzantine empire?
+Calvin: I'll take "outer planets" for $100.
%
- If you care, you just get disappointed all the time. If you don't care
-nothing matters so you are never upset. -- Calvin
+How many boards would the Mongols hoard if the Mongol hordes got bored?
+ -- Calvin
%
- Life is full of surprises but never when you need one.
- -- Calvin
+I thrive on change... I thrive on making other people change.
+ -- Calvin
%
- I'm killing time while I wait for life to shower me with meaning and
-happiness. -- Calvin
+Be careful or be road-kill.
+ -- Calvin
%
- "The dynamics of inter-being and mono logical imperatives in Dick and Jane :
-A study in psychic transrelational gender modes". Academia, here I come.
- -- Calvin
+A good compromise leaves everyone mad.
+ -- Calvin
%
- Miss Wormwood : Calvin where was the Byzantine empire?
- Calvin : I'll take "outer planets" for $100.
+Given that sooner or later we're all just going to die, what's the
+point of learning about integers?
+ -- Calvin
%
- How many boards would the Mongols hoard if the Mongol hordes got bored?
- -- Calvin
+Miss Wormwood, could we arrange our seats in a little circle and have a
+little discussion? Specifically, I'd like to debate whether cannibalism
+ought to be grounds for leniency in murders since it is less wasteful.
+ -- Calvin
%
- I thrive on change... I thrive on making other people change.
- -- Calvin
+The only skills I have patience to learn are those that have no real
+application in life.
+ -- Calvin
%
- Be careful or be road-kill.
- -- Calvin
+You don't get to be mom if you can't fix everything just right.
+ -- Calvin
%
- A good compromise leaves everyone mad.
- -- Calvin
+Calvin: Who can fathom the feminine mind?
+Hobbes: I like 'em anyway.
%
- Given that sooner or later we're all just going to die, what's the point of
-learning about integers? -- Calvin
+If people could put rainbows in zoos, they'd do it.
+ -- Hobbes
%
- Miss Wormwood, could we arrange our seats in a little circle and have a
-little discussion? Specifically, I'd like to debate whether cannibalism ought
-to be grounds for leniency in murders since it is less wasteful.
- -- Calvin
+Summer is butter on your chin and corn mush between every tooth.
+ -- Calvin
%
- The only skills I have patience to learn are those that have no real
-application in life. -- Calvin
+If we wanted more leisure, we'd invent machines that do things less
+efficiently.
+ -- Calvin's dad
%
- "You don't get to be mom if you can't fix everything just right." -Calvin
+To make a bad day worse, spend it wishing for the impossible.
+ -- Calvin
%
- "Who can fathom the feminine mind?" -Calvin "I like `em anyway" -Hobbes
+Susie: When life gives you a lemon, make lemonade.
+Calvin: I say, when life gives you a lemon, wing it right back and add
+ some lemons of your own!
%
- "If people could put rainbows in zoos, they'd do it." -Hobbes
+If good things lasted forever, would we appreciate how precious they
+are?
+ -- Hobbes
%
- "Summer is butter on your chin and corn mush between every tooth." -Calvin
+But the important thing is persistence.
+ -- Calvin trying to juggle eggs
%
- "If we wanted more leisure, we'd invent machines that do things less
-efficiently." -Calvin's dad
+I suppose the secret to happiness is learning to appreciate the moment.
+ -- Calvin
%
- "To make a bad day worse, spend it wishing for the impossible." -Calvin
+Weekends don't count unless you spend them doing something completely
+pointless.
+ -- Calvin
%
- "When life gives you a lemon, make lemonade." -Susie "I say, when life gives
-you a lemon, wing it right back and add some lemons of your own!" -Calvin
+It's hard to be mad at someone who misses you while you're asleep.
+ -- Calvin
%
- "If good things lasted forever, would we appreciate how precious they are?"
--Hobbes
+Oops, I always forget the purpose of competition is to divide people
+into winners and losers.
+ -- Hobbes being sarcastic
%
- "But the important thing is persistence." -Calvin trying to juggle eggs
+Someday I'll write my own philosophy book.
+ -- Calvin
%
- "I suppose the secret to happiness is learning to appreciate the moment."
--Calvin
+Some things don't need the thought people give them.
+ -- Hobbes
%
- "Weekends don't count unless you spend them doing something completely
-pointless." -Calvin
+Mom knows EVERYTHING!
+ -- Calvin
%
- "It's hard to be mad at someone who misses you while you're asleep." -Calvin
+I'm a simple man with complex tastes.
+ -- Calvin
%
- "Oops, I always forget the purpose of competition is to divide people into
-winners and losers." -Hobbes being sarcastic
+Endorsing products is the American way of expressing individuality.
+ -- Calvin
%
- "Someday I'll write my own philosophy book." -Calvin
+One of the joys of being a kid is that experiences are new and
+therefore more intense.
+ -- Calvin sniffing mustard
%
- "Some things don't need the thought people give them." -Hobbes
+It's great to have a friend who appreciates an earnest discussion of
+ideas.
+ -- Calvin
%
- "Mom knows EVERYTHING" -Calvin
+That's the problem with science. You've got a bunch of empiricists
+trying to describe things of unimaginable wonder.
+ -- Calvin
%
- "I'm a simple man with complex tastes." -Calvin
+All this modern technology just makes people try to do everything at
+once.
+ -- Hobbes
%
- "Endorsing products is the American way of expressing individuality."
--Calvin
+I suppose if we couldn't laugh at things that don't make sense, we
+couldn't react to a lot of life.
+ -- Hobbes
%
- "One of the joys of being a kid is that experiences are new and therefore
-more intense." -Calvin sniffing mustard
+I don't understand this! Not a single part of my horoscope came true!
+... The paper should print Mom's daily predictions. Those sure come
+true.
+ -- Calvin
%
- "It's great to have a friend who appreciates an earnest discussion of
-ideas." -Calvin
+I don't know which is worse, ...that everyone has his price, or that
+the price is always so low.
+ -- Calvin
%
- "That's the problem with science. You've got a bunch of empiricists trying
-to describe things of unimaginable wonder." -Calvin
+I propose we leave math to the machines and go play outside.
+ -- Calvin
%
- "All this modern technology just makes people try to do everything at once."
--Hobbes
+It takes an uncommon mind to think of these things.
+ -- Calvin
%
- "I suppose if we couldn't laugh at things that don't make sense, we couldn't
-react to a lot of life." -Hobbes
+That's the problem with nature, something's always stinging you or
+oozing mucous all over you. Let's go and watch TV.
+ -- Calvin
%
- "I don't understand this! Not a single part of my horoscope came true! ...
-The paper should print Mom's daily predictions. Those sure come true."
--Calvin
+As a math atheist, I think I should be excused from this.
+ -- Calvin, to Hobbes
%
- "I don't know which is worse, ...that everyone has his price, or that the
-price is always so low." -Calvin
+This game lends itself to certain abuses.
+ -- Calvin
%
- "I propose we leave math to the machines and go play outside."
- --- Calvin
+I'm just very selective about the reality I choose to accept.
+ -- Calvin
%
- It takes an uncommon mind to think of these things.
- --- Calvin
+I have plenty of common sense, I just choose to ignore it.
+ -- Calvin
%
- "That's the problem with nature, something's always stinging you
- or oozing mucous all over you. Let's go and watch TV."
- --- Calvin
+A voice crackles in Calvin's radio:
+ "Enemy fighters at two o'clock!"
+ "Roger. What should I do until then?"
%
- As a math atheist, I think I should be excused from this.
- --- Calvin, to Hobbes
+I'm looking for something that can deliver a 50-pound payload of snow
+on a small feminine target. Can you suggest something? Hello...?
+ -- Calvin
%
- This game lends itself to certain abuses.
- --- Calvin
+My ethicator machine must've had a built-in moral compromise spectral
+release phantasmatron! I'm a genius!
+ -- Calvin
%
- I'm just very selective about the reality I choose to accept.
- --- Calvin
+That's the whole problem with science. You've got a bunch of
+empiricists trying to describe things of unimaginable wonder.
+ -- Calvin
%
- I have plenty of common sense, I just choose to ignore it.
- --- Calvin
+Until you stalk and overrun, you can't devour anyone.
+ -- Hobbes
%
- A voice crackles in Calvin's radio:
- "Enemy fighters at two o'clock!"
- "Roger. What should I do until then?"
+The inside of my head was exploding with fireworks. Fortunately, my
+last thought turned out the lights when it left.
+ -- Calvin
%
- I'm looking for something that can deliver a 50-pound payload of snow
- on a small feminine target. Can you suggest something? Hello...?
- --- Calvin
+Mom and dad say I should make my life an example of the principles I
+believe in. But every time I do, they tell me to stop it.
+ -- Calvin
%
- "My ethicator machine must've had a built-in moral compromise
- spectral release phantasmatron! I'm a genius!" --- Calvin
+Verbing weirds language.
+ -- Calvin
%
- "That's the whole problem with science. You've got a bunch of
- empiricists trying to describe things of unimaginable wonder."
- --- Calvin
-%
- "Until you stalk and overrun, you can't devour anyone."
- --- Hobbes
-%
- "The inside of my head was exploding with fireworks. Fortunately,
- my last thought turned out the lights when it left."
- --- Calvin
-%
- "Mom and dad say I should make my life an example of the principles I
- believe in. But every time I do, they tell me to stop it."
- --- Calvin
-%
- Verbing weirds language.
- --- Calvin.
-%
- "The intrepid Spaceman Spiff is stranded on a distant planet!
- ..our hero ruefully acknowledges that this happens fairly
- frequently.." --- Calvin and Hobbes
+The intrepid Spaceman Spiff is stranded on a distant planet! ...our
+hero ruefully acknowledges that this happens fairly frequently...
+ -- Calvin as Spaceman Spiff
diff --git a/fortune/perl b/fortune/perl
index 66d00ee..e283cb0 100644
--- a/fortune/perl
+++ b/fortune/perl
@@ -1,98 +1,98 @@
All language designers are arrogant. Goes with the territory... :-)
- -- Larry Wall in <1991Jul13.010945.19157@netlabs.com
+ -- Larry Wall in <1991Jul13.010945.19157@netlabs.com
%
Although the Perl Slogan is There's More Than One Way to Do It, I hesitate
to make 10 ways to do something. :-)
- -- Larry Wall in <9695@jpl-devvax.JPL.NASA.GOV>
+ -- Larry Wall in <9695@jpl-devvax.JPL.NASA.GOV>
%
And don't tell me there isn't one bit of difference between null and space,
because that's exactly how much difference there is. :-)
- -- Larry Wall in <10209@jpl-devvax.JPL.NASA.GOV>
+ -- Larry Wall in <10209@jpl-devvax.JPL.NASA.GOV>
%
"And I don't like doing silly things (except on purpose)."
- -- Larry Wall in <1992Jul3.191825.14435@netlabs.com>
+ -- Larry Wall in <1992Jul3.191825.14435@netlabs.com>
%
: And it goes against the grain of building small tools.
Innocent, Your Honor. Perl users build small tools all day long.
- -- Larry Wall in <1992Aug26.184221.29627@netlabs.com>
+ -- Larry Wall in <1992Aug26.184221.29627@netlabs.com>
%
/* And you'll never guess what the dog had */
/* in its mouth... */
- -- Larry Wall in stab.c from the perl source code
+ -- Larry Wall in stab.c from the perl source code
%
Because . doesn't match \n. [\0-\377] is the most efficient way to match
everything currently. Maybe \e should match everything. And \E would
of course match nothing. :-)
- -- Larry Wall in <9847@jpl-devvax.JPL.NASA.GOV>
+ -- Larry Wall in <9847@jpl-devvax.JPL.NASA.GOV>
%
Be consistent.
- -- Larry Wall in the perl man page
+ -- Larry Wall in the perl man page
%
Besides, including <std_ice_cubes.h> is a fatal error on machines that
don't have it yet. Bad language design, there... :-)
- -- Larry Wall in <1991Aug22.220929.6857@netlabs.com>
+ -- Larry Wall in <1991Aug22.220929.6857@netlabs.com>
%
Besides, it's good to force C programmers to use the toolbox occasionally. :-)
- -- Larry Wall in <1991May31.181659.28817@jpl-devvax.jpl.nasa.gov>
+ -- Larry Wall in <1991May31.181659.28817@jpl-devvax.jpl.nasa.gov>
%
Besides, REAL computers have a rename() system call. :-)
- -- Larry Wall in <7937@jpl-devvax.JPL.NASA.GOV>
+ -- Larry Wall in <7937@jpl-devvax.JPL.NASA.GOV>
%
break; /* don't do magic till later */
- -- Larry Wall in stab.c from the perl source code
+ -- Larry Wall in stab.c from the perl source code
%
But you have to allow a little for the desire to evangelize when you
think you have good news.
- -- Larry Wall in <1992Aug26.184221.29627@netlabs.com>
+ -- Larry Wall in <1992Aug26.184221.29627@netlabs.com>
%
Chip Salzenberg sent me a complete patch to add System V IPC (msg, sem and
shm calls), so I added them. If that bothers you, you can always undefine
them in config.sh. :-) -- Larry Wall in <9384@jpl-devvax.JPL.NASA.GOV>
%
/* dbmrefcnt--; */ /* doesn't work, rats */
- -- Larry Wall in hash.c from the perl source code
+ -- Larry Wall in hash.c from the perl source code
%
#define NULL 0 /* silly thing is, we don't even use this */
- -- Larry Wall in perl.c from the perl source code
+ -- Larry Wall in perl.c from the perl source code
%
#define SIGILL 6 /* blech */
- -- Larry Wall in perl.c from the perl source code
+ -- Larry Wall in perl.c from the perl source code
%
Does the same as the system call of that name.
If you don't know what it does, don't worry about it.
- -- Larry Wall in the perl man page regarding chroot(2)
+ -- Larry Wall in the perl man page regarding chroot(2)
%
double value; /* or your money back! */
short changed; /* so triple your money back! */
- -- Larry Wall in cons.c from the perl source code
+ -- Larry Wall in cons.c from the perl source code
%
Down that path lies madness. On the other hand, the road to hell is
paved with melting snowballs.
- -- Larry Wall in <1992Jul2.222039.26476@netlabs.com>
+ -- Larry Wall in <1992Jul2.222039.26476@netlabs.com>
%
echo "Congratulations. You aren't running Eunice."
- -- Larry Wall in Configure from the perl distribution
+ -- Larry Wall in Configure from the perl distribution
%
echo "Hmmm...you don't have Berkeley networking in libc.a..."
echo "but the Wollongong group seems to have hacked it in."
- -- Larry Wall in Configure from the perl distribution
+ -- Larry Wall in Configure from the perl distribution
%
echo "ICK, NOTHING WORKED!!! You may have to diddle the includes.";;
- -- Larry Wall in Configure from the perl distribution
+ -- Larry Wall in Configure from the perl distribution
%
echo $package has manual pages available in source form.
echo "However, you don't have nroff, so they're probably useless to you."
- -- Larry Wall in Configure from the perl distribution
+ -- Larry Wall in Configure from the perl distribution
%
echo "Your stdio isn't very std."
- -- Larry Wall in Configure from the perl distribution
+ -- Larry Wall in Configure from the perl distribution
%
#else /* !STDSTDIO */ /* The big, slow, and stupid way */
- -- Larry Wall in str.c from the perl source code
+ -- Larry Wall in str.c from the perl source code
%
[End of diatribe. We now return you to your regularly scheduled
programming...]
- -- Larry Wall in Configure from the perl distribution
+ -- Larry Wall in Configure from the perl distribution
%
Even if you aren't in doubt, consider the mental welfare of the person who
has to maintain the code after you, and who will probably put parens in
@@ -101,58 +101,58 @@ the wrong place. -- Larry Wall in the perl man page
"Help save the world!" -- Larry Wall in README
%
Hey, I had to let awk be better at *something*... :-)
- -- Larry Wall in <1991Nov7.200504.25280@netlabs.com>1
+ -- Larry Wall in <1991Nov7.200504.25280@netlabs.com>1
%
I already have too much problem with people thinking the efficiency of
a perl construct is related to its length. On the other hand, I'm
perfectly capable of changing my mind next week... :-) --lwall
%
I don't know if it's what you want, but it's what you get. :-)
- -- Larry Wall in <10502@jpl-devvax.JPL.NASA.GOV>
+ -- Larry Wall in <10502@jpl-devvax.JPL.NASA.GOV>
%
I dunno, I dream in Perl sometimes...
- -- Larry Wall in <8538@jpl-devvax.JPL.NASA.GOV>
+ -- Larry Wall in <8538@jpl-devvax.JPL.NASA.GOV>
%
If I allowed "next $label" then I'd also have to allow "goto $label",
and I don't think you really want that... :-)
- -- Larry Wall in <1991Mar11.230002.27271@jpl-devvax.jpl.nasa.gov>
+ -- Larry Wall in <1991Mar11.230002.27271@jpl-devvax.jpl.nasa.gov>
%
If I don't document something, it's usually either for a good reason,
or a bad reason. In this case it's a good reason. :-)
- -- Larry Wall in <1992Jan17.005405.16806@netlabs.com>
+ -- Larry Wall in <1992Jan17.005405.16806@netlabs.com>
%
"I find this a nice feature but it is not according to the documentation.
Or is it a BUG?"
"Let's call it an accidental feature. :-)"
- -- Larry Wall in <6909@jpl-devvax.JPL.NASA.GOV>
+ -- Larry Wall in <6909@jpl-devvax.JPL.NASA.GOV>
%
if (instr(buf,sys_errlist[errno])) /* you don't see this */
- -- Larry Wall in eval.c from the perl source code
+ -- Larry Wall in eval.c from the perl source code
%
if (rsfp = mypopen("/bin/mail root","w")) { /* heh, heh */
- -- Larry Wall in perl.c from the perl source code
+ -- Larry Wall in perl.c from the perl source code
%
If you consistently take an antagonistic approach, however, people are
going to start thinking you're from New York. :-)
- -- Larry Wall to Dan Bernstein in <10187@jpl-devvax.JPL.NASA.GOV>
+ -- Larry Wall to Dan Bernstein in <10187@jpl-devvax.JPL.NASA.GOV>
%
If you want to program in C, program in C. It's a nice language. I
use it occasionally... :-)
- -- Larry Wall in <7577@jpl-devvax.JPL.NASA.GOV>
+ -- Larry Wall in <7577@jpl-devvax.JPL.NASA.GOV>
%
If you want to see useful Perl examples, we can certainly arrange to have
comp.lang.misc flooded with them, but I don't think that would help the
advance of civilization. :-)
- -- Larry Wall in <1992Mar5.180926.19041@netlabs.com>
+ -- Larry Wall in <1992Mar5.180926.19041@netlabs.com>
%
If you want your program to be readable, consider supplying the argument.
- -- Larry Wall in the perl man page
+ -- Larry Wall in the perl man page
%
I know it's weird, but it does make it easier to write poetry in perl. :-)
- -- Larry Wall in <7865@jpl-devvax.JPL.NASA.GOV>
+ -- Larry Wall in <7865@jpl-devvax.JPL.NASA.GOV>
%
I'll say it again for the logic impaired.
- -- Larry Wall
+ -- Larry Wall
%
I might be able to shoehorn a reference count in on top of the numeric
value by disallowing multiple references on scalars with a numeric value,
@@ -160,44 +160,44 @@ but it wouldn't be as clean. I do occasionally worry about that. --lwall
%
I'm sure that that could be indented more readably, but I'm scared of
the awk parser.
- -- Larry Wall in <6849@jpl-devvax.JPL.NASA.GOV>
+ -- Larry Wall in <6849@jpl-devvax.JPL.NASA.GOV>
%
In general, if you think something isn't in Perl, try it out, because it
usually is. :-)
- -- Larry Wall in <1991Jul31.174523.9447@netlabs.com>
+ -- Larry Wall in <1991Jul31.174523.9447@netlabs.com>
%
In general, they do what you want, unless you want consistency.
- -- Larry Wall in the perl man page
+ -- Larry Wall in the perl man page
%
Interestingly enough, since subroutine declarations can come anywhere,
you wouldn't have to put BEGIN {} at the beginning, nor END {} at the
end. Interesting, no? I wonder if Henry would like it. :-) --lwall
%
I think it's a new feature. Don't tell anyone it was an accident. :-)
- -- Larry Wall on s/foo/bar/eieio in <10911@jpl-devvax.JPL.NASA.GOV>
+ -- Larry Wall on s/foo/bar/eieio in <10911@jpl-devvax.JPL.NASA.GOV>
%
"It is easier to port a shell than a shell script."
- -- Larry Wall
+ -- Larry Wall
%
It is, of course, written in Perl. Translation to C is left as an
exercise for the reader. :-) -- Larry Wall in <7448@jpl-devvax.JPL.NASA.GOV>
%
It's all magic. :-)
- -- Larry Wall in <7282@jpl-devvax.JPL.NASA.GOV>
+ -- Larry Wall in <7282@jpl-devvax.JPL.NASA.GOV>
%
It's documented in The Book, somewhere...
- -- Larry Wall in <10502@jpl-devvax.JPL.NASA.GOV>
+ -- Larry Wall in <10502@jpl-devvax.JPL.NASA.GOV>
%
> (It's sorta like sed, but not. It's sorta like awk, but not. etc.)
Guilty as charged. Perl is happily ugly, and happily derivative.
- -- Larry Wall in <1992Aug26.184221.29627@netlabs.com>
+ -- Larry Wall in <1992Aug26.184221.29627@netlabs.com>
%
It's there as a sop to former Ada programmers. :-)
- -- Larry Wall regarding 10_000_000 in <11556@jpl-devvax.JPL.NASA.GOV>
+ -- Larry Wall regarding 10_000_000 in <11556@jpl-devvax.JPL.NASA.GOV>
%
It won't be covered in the book. The source code has to be useful for
something, after all... :-)
- -- Larry Wall in <10160@jpl-devvax.JPL.NASA.GOV>
+ -- Larry Wall in <10160@jpl-devvax.JPL.NASA.GOV>
%
: I've heard that there is a shell (bourne or csh) to perl filter, does
: anyone know of this or where I can get it?
@@ -206,90 +206,90 @@ Yeah, you filter it through Tom Christiansen. :-) -- Larry Wall
: I've tried (in vi) "g/[a-z]\n[a-z]/s//_/"...but that doesn't
: cut it. Any ideas? (I take it that it may be a two-pass sort of solution).
In the first pass, install perl. :-)
- -- Larry Wall <6849@jpl-devvax.JPL.NASA.GOV>
+ -- Larry Wall <6849@jpl-devvax.JPL.NASA.GOV>
%
I won't mention any names, because I don't want to get sun4's into
trouble... :-) -- Larry Wall in <11333@jpl-devvax.JPL.NASA.GOV>
%
Just don't compare it with a real language, or you'll be unhappy... :-)
- -- Larry Wall in <1992May12.190238.5667@netlabs.com>
+ -- Larry Wall in <1992May12.190238.5667@netlabs.com>
%
Just don't create a file called -rf. :-)
- -- Larry Wall in <11393@jpl-devvax.JPL.NASA.GOV>
+ -- Larry Wall in <11393@jpl-devvax.JPL.NASA.GOV>
%
last|perl -pe '$_ x=/(..:..)...(.*)/&&"'$1'"ge$1&&"'$1'"lt$2'
That's gonna be tough for Randal to beat... :-)
- -- Larry Wall in <1991Apr29.072206.5621@jpl-devvax.jpl.nasa.gov>
+ -- Larry Wall in <1991Apr29.072206.5621@jpl-devvax.jpl.nasa.gov>
%
Let's say the docs present a simplified view of reality... :-)
- -- Larry Wall in <6940@jpl-devvax.JPL.NASA.GOV>
+ -- Larry Wall in <6940@jpl-devvax.JPL.NASA.GOV>
%
Let us be charitable, and call it a misleading feature :-)
- -- Larry Wall in <2609@jato.Jpl.Nasa.Gov>
+ -- Larry Wall in <2609@jato.Jpl.Nasa.Gov>
%
Lispers are among the best grads of the Sweep-It-Under-Someone-Else's-Carpet
School of Simulated Simplicity. [Was that sufficiently incendiary? :-)]
- -- Larry Wall in <1992Jan10.201804.11926@netlabs.com
+ -- Larry Wall in <1992Jan10.201804.11926@netlabs.com
%
No, I'm not going to explain it. If you can't figure it out, you didn't
want to know anyway... :-)
- -- Larry Wall in <1991Aug7.180856.2854@netlabs.com>
+ -- Larry Wall in <1991Aug7.180856.2854@netlabs.com>
%
/* now make a new head in the exact same spot */
- -- Larry Wall in cons.c from the perl source code
+ -- Larry Wall in cons.c from the perl source code
%
OK, enough hype.
- -- Larry Wall in the perl man page
+ -- Larry Wall in the perl man page
%
OOPS! You naughty creature! You didn't run Configure with sh!
I will attempt to remedy the situation by running sh for you...
- -- Larry Wall in Configure from the perl distribution
+ -- Larry Wall in Configure from the perl distribution
%
Perl is designed to give you several ways to do anything, so
consider picking the most readable one.
- -- Larry Wall in the perl man page
+ -- Larry Wall in the perl man page
%
Perl itself is usually pretty good about telling you what you shouldn't
do. :-)
- -- Larry Wall in <11091@jpl-devvax.JPL.NASA.GOV>
+ -- Larry Wall in <11091@jpl-devvax.JPL.NASA.GOV>
%
Perl programming is an *empirical* science!
- -- Larry Wall in <10226@jpl-devvax.JPL.NASA.GOV>
+ -- Larry Wall in <10226@jpl-devvax.JPL.NASA.GOV>
%
pos += screamnext[pos] /* does this goof up anywhere? */
- -- Larry Wall in util.c from the perl source code
+ -- Larry Wall in util.c from the perl source code
%
Q. Why is this so clumsy?
A. The trick is to use Perl's strengths rather than its weaknesses.
- -- Larry Wall in <8225@jpl-devvax.JPL.NASA.GOV>
+ -- Larry Wall in <8225@jpl-devvax.JPL.NASA.GOV>
%
Randal said it would be tough to do in sed. He didn't say he didn't
understand sed. Randal understands sed quite well. Which is why he
uses Perl. :-) -- Larry Wall in <7874@jpl-devvax.JPL.NASA.GOV>
%
Real programmers can write assembly code in any language. :-)
- -- Larry Wall in <8571@jpl-devvax.JPL.NASA.GOV>
+ -- Larry Wall in <8571@jpl-devvax.JPL.NASA.GOV>
%
Remember though that
THERE IS NO GENERAL RULE FOR CONVERTING A LIST INTO A SCALAR.
- -- Larry Wall in the perl man page
+ -- Larry Wall in the perl man page
%
s = (char*)(long)retval; /* ouch */
- -- Larry Wall in doio.c from the perl source code
+ -- Larry Wall in doio.c from the perl source code
%
signal(i, SIG_DFL); /* crunch, crunch, crunch */
- -- Larry Wall in doarg.c from the perl source code
+ -- Larry Wall in doarg.c from the perl source code
%
Sorry. My testing organization is either too small, or too large, depending
on how you look at it. :-)
- -- Larry Wall in <1991Apr22.175438.8564@jpl-devvax.jpl.nasa.gov>
+ -- Larry Wall in <1991Apr22.175438.8564@jpl-devvax.jpl.nasa.gov>
%
stab_val(stab)->str_nok = 1; /* what a wonderful hack! */
- -- Larry Wall in stab.c from the perl source code
+ -- Larry Wall in stab.c from the perl source code
%
str->str_pok |= SP_FBM; /* deep magic */
s = (unsigned char*)(str->str_ptr); /* deeper magic */
- -- Larry Wall in util.c from the perl source code
+ -- Larry Wall in util.c from the perl source code
%
Tactical? TACTICAL!?!? Hey, buddy, we went from kilotons to megatons
several minutes ago. We don't need no stinkin' tactical nukes.
@@ -297,29 +297,29 @@ several minutes ago. We don't need no stinkin' tactical nukes.
%
That means I'll have to use $ans to suppress newlines now.
Life is ridiculous.
- -- Larry Wall in Configure from the perl distribution
+ -- Larry Wall in Configure from the perl distribution
%
The autodecrement is not magical.
- -- Larry Wall in the perl man page
+ -- Larry Wall in the perl man page
%
The only disadvantage I see is that it would force everyone to get Perl.
Horrors. :-)
- -- Larry Wall in <8854@jpl-devvax.JPL.NASA.GOV>
+ -- Larry Wall in <8854@jpl-devvax.JPL.NASA.GOV>
%
*** The previous line contains the naughty word "$&".\n
if /(ibm|apple|awk)/; # :-)
- -- Larry Wall in the perl man page
+ -- Larry Wall in the perl man page
%
There ain't nothin' in this world that's worth being a snot over.
- -- Larry Wall in <1992Aug19.041614.6963@netlabs.com>
+ -- Larry Wall in <1992Aug19.041614.6963@netlabs.com>
%
There are many times when you want it to ignore the rest of the string just
like atof() does. Oddly enough, Perl calls atof(). How convenient. :-)
- -- Larry Wall in <1991Jun24.231628.14446@jpl-devvax.jpl.nasa.gov>
+ -- Larry Wall in <1991Jun24.231628.14446@jpl-devvax.jpl.nasa.gov>
%
There are probably better ways to do that, but it would make the parser
more complex. I do, occasionally, struggle feebly against complexity... :-)
- -- Larry Wall in <7886@jpl-devvax.JPL.NASA.GOV>
+ -- Larry Wall in <7886@jpl-devvax.JPL.NASA.GOV>
%
There are still some other things to do, so don't think if I didn't fix
your favorite bug that your bug report is in the bit bucket. (It may be,
@@ -327,14 +327,14 @@ but don't think it. :-) Larry Wall in <7238@jpl-devvax.JPL.NASA.GOV>
%
There is, however, a strange, musty smell in the air that reminds me of
something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
- -- Larry Wall in Configure from the perl distribution
+ -- Larry Wall in Configure from the perl distribution
%
"The road to hell is paved with melting snowballs."
- -- Larry Wall in <1992Jul2.222039.26476@netlabs.com>
+ -- Larry Wall in <1992Jul2.222039.26476@netlabs.com>
%
/* This bit of chicanery makes a unary function followed by
a parenthesis into a function with one argument, highest precedence. */
- -- Larry Wall in toke.c from the perl source code
+ -- Larry Wall in toke.c from the perl source code
%
"...this does not mean that some of us should not want, in a rather
dispassionate sort of way, to put a bullet through csh's head."
@@ -345,24 +345,24 @@ Of course it can be written in Perl. Now if you'd said nroff,
that would be more challenging... -- Larry Wall
%
Though I'll admit readability suffers slightly...
- -- Larry Wall in <2969@jato.Jpl.Nasa.Gov>
+ -- Larry Wall in <2969@jato.Jpl.Nasa.Gov>
%
tmps_base = tmps_max; /* protect our mortal string */
- -- Larry Wall in stab.c from the perl source code
+ -- Larry Wall in stab.c from the perl source code
%
Unix is like a toll road on which you have to stop every 50 feet to
pay another nickel. But hey! You only feel 5 cents poorer each time.
- -- Larry Wall in <1992Aug13.192357.15731@netlabs.com>
+ -- Larry Wall in <1992Aug13.192357.15731@netlabs.com>
%
"We all agree on the necessity of compromise. We just can't agree on
when it's necessary to compromise."
- -- Larry Wall in <1991Nov13.194420.28091@netlabs.com>
+ -- Larry Wall in <1991Nov13.194420.28091@netlabs.com>
%
/* we have tried to make this normal case as abnormal as possible */
- -- Larry Wall in cmd.c from the perl source code
+ -- Larry Wall in cmd.c from the perl source code
%
What about WRITING it first and rationalizing it afterwords? :-)
- -- Larry Wall in <8162@jpl-devvax.JPL.NASA.GOV>
+ -- Larry Wall in <8162@jpl-devvax.JPL.NASA.GOV>
%
: 1. What is the possibility of this being added in the future?
In the near future, the probability is close to zero. In the distant
@@ -370,368 +370,368 @@ future, I'll be dead, and posterity can do whatever they like... :-) --lwall
%
"What is the sound of Perl? Is it not the sound of a wall that
people have stopped banging their heads against?"
- -- Larry Wall in <1992Aug26.184221.29627@netlabs.com>
+ -- Larry Wall in <1992Aug26.184221.29627@netlabs.com>
%
When in doubt, parenthesize. At the very least it will let some
poor schmuck bounce on the % key in vi.
- -- Larry Wall in the perl man page
+ -- Larry Wall in the perl man page
%
"You can't have filenames longer than 14 chars.
You can't even think about them!"
- -- Larry Wall in Configure from the perl distribution
+ -- Larry Wall in Configure from the perl distribution
%
You have to admit that it's difficult to misplace the Perl sources. :-)
- -- Larry Wall in <1992Aug26.184221.29627@netlabs.com>
+ -- Larry Wall in <1992Aug26.184221.29627@netlabs.com>
%
Your csh still thinks true is false. Write to your vendor today and tell
them that next year Configure ought to "rm /bin/csh" unless they fix their
blasted shell. :-) -- Larry Wall in Configure from the perl distribution
%
You want it in one line? Does it have to fit in 80 columns? :-)
- -- Larry Wall in <7349@jpl-devvax.JPL.NASA.GOV>
+ -- Larry Wall in <7349@jpl-devvax.JPL.NASA.GOV>
%
Well, enough clowning around. Perl is, in intent, a cleaned up and
summarized version of that wonderful semi-natural language known as
"Unix".
- -- Larry Wall in <1994Apr6.184419.3687@netlabs.com>
+ -- Larry Wall in <1994Apr6.184419.3687@netlabs.com>
%
Anyway, there's plenty of room for doubt. It might seem easy enough,
but computer language design is just like a stroll in the park.
Jurassic Park, that is.
- -- Larry Wall in <1994Jun15.074039.2654@netlabs.com>
+ -- Larry Wall in <1994Jun15.074039.2654@netlabs.com>
%
I want to see people using Perl to glue things together creatively, not
just technically but also socially.
- -- Larry Wall in <199702111730.JAA28598@wall.org>
+ -- Larry Wall in <199702111730.JAA28598@wall.org>
%
The whole history of computers is rampant with cheerleading at best and
bigotry at worst.
- -- Larry Wall in <199702111730.JAA28598@wall.org>
+ -- Larry Wall in <199702111730.JAA28598@wall.org>
%
Unix weanies are as bad at this as anyone.
- -- Larry Wall in <199702111730.JAA28598@wall.org>
+ -- Larry Wall in <199702111730.JAA28598@wall.org>
%
If someone stinks, view it as a reason to help them, not a reason to
avoid them.
- -- Larry Wall in <199702111730.JAA28598@wall.org>
+ -- Larry Wall in <199702111730.JAA28598@wall.org>
%
As usual, I'm overstating the case to knock a few neurons loose, but the
truth is usually somewhere in the muddle, uh, middle.
- -- Larry Wall in <199702111639.IAA28425@wall.org>
+ -- Larry Wall in <199702111639.IAA28425@wall.org>
%
Odd that we think definitions are definitive. :-)
- -- Larry Wall in <199702221943.LAA20388@wall.org>
+ -- Larry Wall in <199702221943.LAA20388@wall.org>
%
: But for some things, Perl just isn't the optimal choice.
(yet) :-)
- -- Larry Wall in <199702221943.LAA20388@wall.org>
+ -- Larry Wall in <199702221943.LAA20388@wall.org>
%
I don't like this official/unofficial distinction. It sound, er, officious.
- -- Larry Wall in <199702221943.LAA20388@wall.org>
+ -- Larry Wall in <199702221943.LAA20388@wall.org>
%
If you write something wrong enough, I'll be glad to make up a new
witticism just for you.
- -- Larry Wall in <199702221943.LAA20388@wall.org>
+ -- Larry Wall in <199702221943.LAA20388@wall.org>
%
Perl 5 introduced everything else, including the ability to introduce
everything else.
- -- Larry Wall in <199702252152.NAA28845@wall.org>
+ -- Larry Wall in <199702252152.NAA28845@wall.org>
%
So far we've managed to avoid turning Perl into APL. :-)
- -- Larry Wall in <199702251904.LAA28261@wall.org>
+ -- Larry Wall in <199702251904.LAA28261@wall.org>
%
Not that I have anything much against redundancy. But I said that already.
- -- Larry Wall in <199702271735.JAA04048@wall.org>
+ -- Larry Wall in <199702271735.JAA04048@wall.org>
%
They can always run stderr through uniq. :-)
- -- Larry Wall in <199704012331.PAA16535@wall.org>
+ -- Larry Wall in <199704012331.PAA16535@wall.org>
%
I'd put my money where my mouth is, but my mouth keeps moving.
- -- Larry Wall in <199704051723.JAA28035@wall.org>
+ -- Larry Wall in <199704051723.JAA28035@wall.org>
%
Of course, I reserve the right to make wholly stupid changes to Perl
if I think they improve the language. :-)
- -- Larry Wall in <199704251604.JAA27300@wall.org>
+ -- Larry Wall in <199704251604.JAA27300@wall.org>
%
Call me bored, but don't call me boring.
- -- Larry Wall in <199705101952.MAA00756@wall.org>
+ -- Larry Wall in <199705101952.MAA00756@wall.org>
%
I think $[ is more like a coelacanth than a mastadon.
- -- Larry Wall in <199705101952.MAA00756@wall.org>
+ -- Larry Wall in <199705101952.MAA00756@wall.org>
%
: I used to think that this was just another demonstration of Larry's
: enormous skill at pulling off what other people would fail or balk at.
Well, everyone else knew it was impossible, so they didn't try. :-)
- -- Larry Wall in <199705101952.MAA00756@wall.org>
+ -- Larry Wall in <199705101952.MAA00756@wall.org>
%
We question most of the mantras around here periodically, in case
you hadn't noticed. :-)
- -- Larry Wall in <199705101952.MAA00756@wall.org>
+ -- Larry Wall in <199705101952.MAA00756@wall.org>
%
(Presuming for the sake of argument that it's even *possible* to design
better code in Perl than in C. :-)
- -- Larry Wall on core code vs. module code design
+ -- Larry Wall on core code vs. module code design
%
: The hierarchy is excessive.
So is the anarchy. :-)
- -- Larry Wall in <199705101952.MAA00756@wall.org>
+ -- Larry Wall in <199705101952.MAA00756@wall.org>
%
That could certainly be done, but I don't want to fall into the Forth
trap, where every running Forth implementation is really a different
language.
- -- Larry Wall in <199705101952.MAA00756@wall.org>
+ -- Larry Wall in <199705101952.MAA00756@wall.org>
%
Tcl long ago fell into the Forth trap, and is now trying desperately to
extricate itself (with some help from Sun's marketing department).
- -- Larry Wall in <199705101952.MAA00756@wall.org>
+ -- Larry Wall in <199705101952.MAA00756@wall.org>
%
The core is not frozen, but slushy.
- -- Larry Wall in <199705101952.MAA00756@wall.org>
+ -- Larry Wall in <199705101952.MAA00756@wall.org>
%
The whole intent of Perl 5's module system was to encourage the growth
of Perl culture rather than the Perl core.
- -- Larry Wall in <199705101952.MAA00756@wall.org>
+ -- Larry Wall in <199705101952.MAA00756@wall.org>
%
Randal can write one-liners again. Everyone is happy, and peace spreads
over the whole Earth.
- -- Larry Wall in <199705101952.MAA00756@wall.org>
+ -- Larry Wall in <199705101952.MAA00756@wall.org>
%
Life gets boring, someone invents another necessity, and once again we
turn the crank on the screwjack of progress hoping that nobody gets
screwed.
- -- Larry Wall in <199705101952.MAA00756@wall.org>
+ -- Larry Wall in <199705101952.MAA00756@wall.org>
%
No prisoner's dilemma here. Over the long term, symbiosis is more
useful than parasitism. More fun, too. Ask any mitochondria.
- -- Larry Wall in <199705102042.NAA00851@wall.org>
+ -- Larry Wall in <199705102042.NAA00851@wall.org>
%
Obviously I was either onto something, or on something.
- -- Larry Wall on the creation of Perl
+ -- Larry Wall on the creation of Perl
%
It's the Magic that counts.
- -- Larry Wall on Perl's apparent ugliness
+ -- Larry Wall on Perl's apparent ugliness
%
May you do Good Magic with Perl.
- -- Larry Wall's blessing
+ -- Larry Wall's blessing
%
P.S. Perl's master plan (or what passes for one) is to take over the
world like English did. Er, *as* English did...
- -- Larry Wall in <199705201832.LAA28393@wall.org>
+ -- Larry Wall in <199705201832.LAA28393@wall.org>
%
You can prove anything by mentioning another computer language. :-)
- -- Larry Wall in <199706242038.NAA29853@wall.org>
+ -- Larry Wall in <199706242038.NAA29853@wall.org>
%
I think you didn't get a reply because you used the terms "correct" and
"proper", neither of which has much meaning in Perl culture. :-)
- -- Larry Wall in <199706251602.JAA01786@wall.org>
+ -- Larry Wall in <199706251602.JAA01786@wall.org>
%
I'm sure a mathematician would claim that 0 and 1 are both very
interesting numbers. :-)
- -- Larry Wall in <199707300650.XAA05515@wall.org>
+ -- Larry Wall in <199707300650.XAA05515@wall.org>
%
True, it returns "" for false, but "" is an even more interesting
number than 0.
- -- Larry Wall in <199707300650.XAA05515@wall.org>
+ -- Larry Wall in <199707300650.XAA05515@wall.org>
%
Any false value is gonna be fairly boring in Perl, mathematicians
notwithstanding.
- -- Larry Wall in <199707300650.XAA05515@wall.org>
+ -- Larry Wall in <199707300650.XAA05515@wall.org>
%
We didn't put in ^^ because then we'd have to keep telling people what
it means, and then we'd have to keep telling them why it doesn't short
circuit. :-/
- -- Larry Wall in <199707300650.XAA05515@wall.org>
+ -- Larry Wall in <199707300650.XAA05515@wall.org>
%
Anybody want a binary telemetry frame editor written in Perl?
- -- Larry Wall in <199708012226.PAA22015@wall.org>
+ -- Larry Wall in <199708012226.PAA22015@wall.org>
%
Most places distinguish them merely by using the appropriate value.
Hooray for context...
- -- Larry Wall in <199708040319.UAA16213@wall.org>
+ -- Larry Wall in <199708040319.UAA16213@wall.org>
%
But then it's a bit odd to think that declaring something int could
actually slow down the program, if it ended up forcing more conversions
back to string.
- -- Larry Wall in <199708040319.UAA16213@wall.org>
+ -- Larry Wall in <199708040319.UAA16213@wall.org>
%
It's possible that I'm just an idiot, and don't recognize a sleepy
slavemaster when I see one.
- -- Larry Wall in <199708040319.UAA16213@wall.org>
+ -- Larry Wall in <199708040319.UAA16213@wall.org>
%
Perhaps I'm missing the gene for making enemies. :-)
- -- Larry Wall in <199708040319.UAA16213@wall.org>
+ -- Larry Wall in <199708040319.UAA16213@wall.org>
%
Perl has a long tradition of working around compilers.
- -- Larry Wall in <199708252256.PAA00105@wall.org>
+ -- Larry Wall in <199708252256.PAA00105@wall.org>
%
Personally, I like to defiantly split my infinitives. :-)
- -- Larry Wall in <199708271551.IAA10211@wall.org>
+ -- Larry Wall in <199708271551.IAA10211@wall.org>
%
Real theology is always rather shocking to people who already
think they know what they think. I'm still shocked myself. :-)
- -- Larry Wall in <199708261932.MAA05218@wall.org>
+ -- Larry Wall in <199708261932.MAA05218@wall.org>
%
But maybe we don't really need that...
- -- Larry Wall in <199709011851.LAA07101@wall.org>
+ -- Larry Wall in <199709011851.LAA07101@wall.org>
%
The computer should be doing the hard work. That's what it's paid to do,
after all.
- -- Larry Wall in <199709012312.QAA08121@wall.org>
+ -- Larry Wall in <199709012312.QAA08121@wall.org>
%
The following two statements are usually both true:
There's not enough documentation.
There's too much documentation.
- -- Larry Wall in <199709020026.RAA08431@wall.org>
+ -- Larry Wall in <199709020026.RAA08431@wall.org>
%
I don't think I'm gonna agree with that. Way too much visual confusion...
- -- Larry Wall in <199709021627.JAA11966@wall.org>
+ -- Larry Wall in <199709021627.JAA11966@wall.org>
%
There's certainly precedent for that already too. (Not claiming it's
*good* precedent, mind you. :-)
- -- Larry Wall in <199709021744.KAA12428@wall.org>
+ -- Larry Wall in <199709021744.KAA12428@wall.org>
%
Of course, this being Perl, we could always take both approaches. :-)
- -- Larry Wall in <199709021744.KAA12428@wall.org>
+ -- Larry Wall in <199709021744.KAA12428@wall.org>
%
For the run-time caching, I was going to suggest "cached" (doh!), but
perhaps "once" is more meaningful to ordinary people.
- -- Larry Wall in <199709021812.LAA12571@wall.org>
+ -- Larry Wall in <199709021812.LAA12571@wall.org>
%
The random quantum fluctuations of my brain are historical accidents that
happen to have decided that the concepts of dynamic scoping and lexical
scoping are orthogonal and should remain that way.
- -- Larry Wall in <199709021854.LAA12794@wall.org>
+ -- Larry Wall in <199709021854.LAA12794@wall.org>
%
At many levels, Perl is a "diagonal" language.
- -- Larry Wall in <199709021854.LAA12794@wall.org>
+ -- Larry Wall in <199709021854.LAA12794@wall.org>
%
I'm serious about thinking through all the possibilities before we
settle on anything. All things have the advantages of their
disadvantages, and vice versa.
- -- Larry Wall in <199709032332.QAA21669@wall.org>
+ -- Larry Wall in <199709032332.QAA21669@wall.org>
%
Part of language design is purturbing the proposed feature in various
directions to see how it might generalize in the future.
- -- Larry Wall in <199709032332.QAA21669@wall.org>
+ -- Larry Wall in <199709032332.QAA21669@wall.org>
%
Sometimes we choose the generalization. Sometimes we don't.
- -- Larry Wall in <199709032332.QAA21669@wall.org>
+ -- Larry Wall in <199709032332.QAA21669@wall.org>
%
I wouldn't ever write the full sentence myself, but then, I never use
goto either.
- -- Larry Wall in <199709032332.QAA21669@wall.org>
+ -- Larry Wall in <199709032332.QAA21669@wall.org>
%
It's appositival, if it's there. And it doesn't have to be there.
And it's really obvious that it's there when it's there.
- -- Larry Wall in <199709032332.QAA21669@wall.org>
+ -- Larry Wall in <199709032332.QAA21669@wall.org>
%
Oh, get ahold of yourself. Nobody's proposing that we parse English.
- -- Larry Wall in <199709032332.QAA21669@wall.org>
+ -- Larry Wall in <199709032332.QAA21669@wall.org>
%
As with all the other proposals, it's basically just a list of words.
You can deal with that... :-)
- -- Larry Wall in <199709032332.QAA21669@wall.org>
+ -- Larry Wall in <199709032332.QAA21669@wall.org>
%
I hope I'm not getting so famous that I can't think out load [sic] anymore.
- -- Larry Wall in <199709032332.QAA21669@wall.org>
+ -- Larry Wall in <199709032332.QAA21669@wall.org>
%
It would be possible to optimize some forms of goto, but I haven't
bothered.
- -- Larry Wall in <199709041935.MAA27136@wall.org>
+ -- Larry Wall in <199709041935.MAA27136@wall.org>
%
A "goto" in Perl falls into the category of hard things that should be
possible, not easy things that should be easy.
- -- Larry Wall in <199709041935.MAA27136@wall.org>
+ -- Larry Wall in <199709041935.MAA27136@wall.org>
%
How do Crays and Alphas handle the POSIX problem?
- -- Larry Wall in <199709050042.RAA29379@wall.org>
+ -- Larry Wall in <199709050042.RAA29379@wall.org>
%
One of the reasons Perl is faster than certain other unnamed interpreted
languages is that it binds variable names to a particular package (or
scope) at compile time rather than at run time.
- -- Larry Wall in <199709050035.RAA29328@wall.org>
+ -- Larry Wall in <199709050035.RAA29328@wall.org>
%
Well, that's more-or-less what I was saying, though obviously addition
is a little more cosmic than the bitwise operators.
- -- Larry Wall in <199709051808.LAA01780@wall.org>
+ -- Larry Wall in <199709051808.LAA01780@wall.org>
%
You tell it that it's indicative by appending $!. That's why we made $!
such a short variable name, after all. :-)
- -- Larry Wall in <199709081801.LAA20629@wall.org>
+ -- Larry Wall in <199709081801.LAA20629@wall.org>
%
The choice of approaches could be made the responsibility of the
programmer.
- -- Larry Wall in <199709081901.MAA20863@wall.org>
+ -- Larry Wall in <199709081901.MAA20863@wall.org>
%
As someone pointed out, you could have an attribute that says "optimize
the heck out of this routine", and your definition of heck would be a
parameter to the optimizer.
- -- Larry Wall in <199709081854.LAA20830@wall.org>
+ -- Larry Wall in <199709081854.LAA20830@wall.org>
%
I guess what I'm saying is that the croak in question is requiring
agreement (in the linguistic sense) that isn't buying us anything.
- -- Larry Wall in <199709241628.JAA08908@wall.org>
+ -- Larry Wall in <199709241628.JAA08908@wall.org>
%
If you're going to define a shortcut, then make it the base [sic] darn
shortcut you can.
- -- Larry Wall in <199709241628.JAA08908@wall.org>
+ -- Larry Wall in <199709241628.JAA08908@wall.org>
%
It is my job in life to travel all roads, so that some may take the road
less travelled, and others the road more travelled, and all have a
pleasant day.
- -- Larry Wall in <199709241628.JAA08908@wall.org>
+ -- Larry Wall in <199709241628.JAA08908@wall.org>
%
It's getting harder and harder to think out loud. One of these days
someone's gonna go off and kill Thomas a'Becket for me...
- -- Larry Wall in <199709242015.NAA10312@wall.org>
+ -- Larry Wall in <199709242015.NAA10312@wall.org>
%
I was about to say, "Avoid fame like the plague," but you know, they can
cure the plague with penicillin these days.
- -- Larry Wall in <199709242015.NAA10312@wall.org>
+ -- Larry Wall in <199709242015.NAA10312@wall.org>
%
But the possibility of abuse may be a good reason for leaving
capabilities out of other computer languages, it's not a good reason for
leaving capabilities out of Perl.
- -- Larry Wall in <199709251614.JAA15718@wall.org>
+ -- Larry Wall in <199709251614.JAA15718@wall.org>
%
Oh, wait, that was Randal...nevermind...
- -- Larry Wall in <199709261754.KAA23761@wall.org>
+ -- Larry Wall in <199709261754.KAA23761@wall.org>
%
:-) your own self.
- -- Larry Wall in <199709261754.KAA23761@wall.org>
+ -- Larry Wall in <199709261754.KAA23761@wall.org>
%
P.S. I suppose I really should be nicer to people today, considering
I'll be singing in Billy Graham's choir tonight... :-)
- -- Larry Wall in <199709261754.KAA23761@wall.org>
+ -- Larry Wall in <199709261754.KAA23761@wall.org>
%
Magically turning people's old scalar contexts into list contexts is a
recipe for several kinds of disaster.
- -- Larry Wall in <199709291631.JAA08648@wall.org>
+ -- Larry Wall in <199709291631.JAA08648@wall.org>
%
: The following (relative to AutoSplit 1.03) attempts to please everyone
: and perhaps pleases no one:
I think that's way cool.
- -- Larry Wall in <199709292015.NAA09627@wall.org>
+ -- Larry Wall in <199709292015.NAA09627@wall.org>
%
And we can always supply them with a program that makes identical files
into links to a single file.
- -- Larry Wall in <199709292012.NAA09616@wall.org>
+ -- Larry Wall in <199709292012.NAA09616@wall.org>
%
I wasn't recommending that we make the links for them, only provide them
with the tools to do so if they want to take the gamble (or the gambol).
- -- Larry Wall in <199709292259.PAA10407@wall.org>
+ -- Larry Wall in <199709292259.PAA10407@wall.org>
%
This has been planned for some time. I guess we'll just have to find
someone with an exceptionally round tuit.
- -- Larry Wall in <199709302338.QAA17037@wall.org>
+ -- Larry Wall in <199709302338.QAA17037@wall.org>
%
switch (ref $@) {
OverflowError =>
@@ -744,213 +744,213 @@ warn "King needs to be trained";
die;
}
- -- Larry Wall in <199709302338.QAA17037@wall.org>
+ -- Larry Wall in <199709302338.QAA17037@wall.org>
%
I surely do hope that's a syntax error.
- -- Larry Wall in <199710011752.KAA21624@wall.org>
+ -- Larry Wall in <199710011752.KAA21624@wall.org>
%
Soitainly. I was assuming that came with the OO-ness of it.
- -- Larry Wall in <199710011802.LAA21692@wall.org>
+ -- Larry Wall in <199710011802.LAA21692@wall.org>
%
Because the demand for it is low enough that it would be best handled
as an XSUB, and the demand for it is low enough that nobody has
bothered to write it as an XSUB.
- -- Larry Wall on in-place Perl sorting
+ -- Larry Wall on in-place Perl sorting
%
But that looks a little too much like a declaration for my tastes, when
in fact it isn't one. So forget I mentioned it.
- -- Larry Wall in <199710011704.KAA21395@wall.org>
+ -- Larry Wall in <199710011704.KAA21395@wall.org>
%
I'm not sure whether that's actually useful...
- -- Larry Wall in <199710011704.KAA21395@wall.org>
+ -- Larry Wall in <199710011704.KAA21395@wall.org>
%
Anyway, my money is still on use strict vars . . .
- -- Larry Wall in <199710011704.KAA21395@wall.org>
+ -- Larry Wall in <199710011704.KAA21395@wall.org>
%
By rule #1, 5.005 should always allow localization of lexical @_ . . .
- -- Larry Wall in <199710011704.KAA21395@wall.org>
+ -- Larry Wall in <199710011704.KAA21395@wall.org>
%
I *know* it's weird, but strict vars already comes very, very close to
partitioning the crowd into those who can deal with local lexicals and
those who can't.
- -- Larry Wall in <199710050130.SAA04762@wall.org>
+ -- Larry Wall in <199710050130.SAA04762@wall.org>
%
If you remove stricture from a large Perl program currently, you're just
installing delayed bugs, whereas with this feature, you're installing an
instant bug that's easily fixed. Whoopee.
- -- Larry Wall in <199710050130.SAA04762@wall.org>
+ -- Larry Wall in <199710050130.SAA04762@wall.org>
%
The reason I like hitching a ride on strict vars is that it cuts down
the number of rarely used pragmas people have to remember, yet provides
a way to get to the point where we might, just maybe, someday, make
local lexicals the default for everyone, without having useless pragmas
wandering around various programs, or using up another bit in $^H.
- -- Larry Wall in <199710050130.SAA04762@wall.org>
+ -- Larry Wall in <199710050130.SAA04762@wall.org>
%
I don't think it's worth washing hogs over.
- -- Larry Wall in <199710060253.TAA09723@wall.org>
+ -- Larry Wall in <199710060253.TAA09723@wall.org>
%
It's certainly easy to calculate the average attendance for Perl
conferences.
- -- Larry Wall in <199710071721.KAA19014@wall.org>
+ -- Larry Wall in <199710071721.KAA19014@wall.org>
%
Tcl tends to get ported to weird places like routers.
- -- Larry Wall in <199710071721.KAA19014@wall.org>
+ -- Larry Wall in <199710071721.KAA19014@wall.org>
%
Historically Tcl has always stored all intermediate results as strings.
(With 8.0 they're rethinking that. Of course, Perl rethought that from
the start.)
- -- Larry Wall in <199710071721.KAA19014@wall.org>
+ -- Larry Wall in <199710071721.KAA19014@wall.org>
%
I knew I'd hate COBOL the moment I saw they'd used "perform" instead of
"do".
- -- Larry Wall on a not-so-popular programming language
+ -- Larry Wall on a not-so-popular programming language
%
Just don't make the '9' format pack/unpack numbers... :-)
- -- Larry Wall in <199710091434.HAA00838@wall.org>
+ -- Larry Wall in <199710091434.HAA00838@wall.org>
%
I think that's easier to read. Pardon me. Less difficult to read.
- -- Larry Wall in <199710120226.TAA06867@wall.org>
+ -- Larry Wall in <199710120226.TAA06867@wall.org>
%
That wouldn't be good enough.
- -- Larry Wall in <199710131621.JAA14907@wall.org>
+ -- Larry Wall in <199710131621.JAA14907@wall.org>
%
To ordinary folks, conversion is not always automatic. It's something
that may or may not require explicit assistance. See Billy Graham. :-)
- -- Larry Wall in <199710141738.KAA22289@wall.org>
+ -- Larry Wall in <199710141738.KAA22289@wall.org>
%
The prayer of serenity applies here. To both of us. :-)
- -- Larry Wall in <199710141802.LAA22443@wall.org>
+ -- Larry Wall in <199710141802.LAA22443@wall.org>
%
Well, you can implement a Perl peek() with unpack('P',...). Once you
have that, there's only security through obscurity. :-)
- -- Larry Wall in <199710161537.IAA07828@wall.org>
+ -- Larry Wall in <199710161537.IAA07828@wall.org>
%
It may be possible to get this condition from within Perl if a signal
handler runs at just the wrong moment. Another point for Chip... :-)
- -- Larry Wall in <199710161546.IAA07885@wall.org>
+ -- Larry Wall in <199710161546.IAA07885@wall.org>
%
As pointed out in a followup, Real Perl Programmers prefer things to be
visually distinct.
- -- Larry Wall in <199710161841.LAA13208@wall.org>
+ -- Larry Wall in <199710161841.LAA13208@wall.org>
%
The Harvard Law states: Under controlled conditions of light, temperature,
humidity, and nutrition, the organism will do as it damn well pleases.
- -- Larry Wall in <199710161841.LAA13208@wall.org>
+ -- Larry Wall in <199710161841.LAA13208@wall.org>
%
That should probably be written:
no !@#$%^&*:@!semicolon
- -- Larry Wall in <199710161841.LAA13208@wall.org>
+ -- Larry Wall in <199710161841.LAA13208@wall.org>
%
That gets us out of deciding how to spell Reg[eE]xp?|RE . . .
Of course, then we have to decide what ref $re returns... :-)
- -- Larry Wall in <199710171838.LAA24968@wall.org>
+ -- Larry Wall in <199710171838.LAA24968@wall.org>
%
Depends on how you define "always". :-)
- -- Larry Wall in <199710211647.JAA17957@wall.org>
+ -- Larry Wall in <199710211647.JAA17957@wall.org>
%
'Course, that doesn't work when 'a' contains parentheses.
- -- Larry Wall in <199710211647.JAA17957@wall.org>
+ -- Larry Wall in <199710211647.JAA17957@wall.org>
%
I was trying not to mention backtracking. Which, of course, means that
yours is "righter" than mine, in a theoretical sense.
- -- Larry Wall in <199710211624.JAA17833@wall.org>
+ -- Larry Wall in <199710211624.JAA17833@wall.org>
%
Not that I'm against sneaking some notions into people's heads upon
occasion. (Or blasting them in outright.)
- -- Larry Wall in <199710211624.JAA17833@wall.org>
+ -- Larry Wall in <199710211624.JAA17833@wall.org>
%
(To the extent that anyone but a Prolog programmer can understand \X totally.
(And to the extent that a Prolog programmer can understand "cut". :-))
- -- Larry Wall in <199710211624.JAA17833@wall.org>
+ -- Larry Wall in <199710211624.JAA17833@wall.org>
%
But you'll notice Perl has a goto.
- -- Larry Wall in <199710211624.JAA17833@wall.org>
+ -- Larry Wall in <199710211624.JAA17833@wall.org>
%
Suppose you're working on an optimizer to render \X unnecessary (or
rather, redundant, which isn't the same thing in my book).
- -- Larry Wall in <199710211624.JAA17833@wall.org>
+ -- Larry Wall in <199710211624.JAA17833@wall.org>
%
Wow, I'm being shot at from both sides. That means I *must* be right. :-)
- -- Larry Wall in <199710211959.MAA18990@wall.org>
+ -- Larry Wall in <199710211959.MAA18990@wall.org>
%
You don't have to wait--you can have it in 5.004_54 or so. :-)
- -- Larry Wall in <199710221740.KAA24455@wall.org>
+ -- Larry Wall in <199710221740.KAA24455@wall.org>
%
There's something to be said for returning the whole syntax tree.
- -- Larry Wall in <199710221833.LAA24741@wall.org>
+ -- Larry Wall in <199710221833.LAA24741@wall.org>
%
It's not really a rule--it's more like a trend.
- -- Larry Wall in <199710221721.KAA24321@wall.org>
+ -- Larry Wall in <199710221721.KAA24321@wall.org>
%
Double *sigh*. _04 is going onto thousands of CDs even as we speak,
so to speak.
- -- Larry Wall in <199710221718.KAA24299@wall.org>
+ -- Larry Wall in <199710221718.KAA24299@wall.org>
%
The code also assumes that it's difficult to misspell "a" or "b". :-)
- -- Larry Wall in <199710221731.KAA24396@wall.org>
+ -- Larry Wall in <199710221731.KAA24396@wall.org>
%
Well, hey, let's just make everything into a closure, and then we'll
have our general garbage collector, installed by "use less memory".
- -- Larry Wall in <199710221744.KAA24484@wall.org>
+ -- Larry Wall in <199710221744.KAA24484@wall.org>
%
No, that'd be silly.
- -- Larry Wall in <199710221710.KAA24242@wall.org>
+ -- Larry Wall in <199710221710.KAA24242@wall.org>
%
People who understand context would be steamed to have someone else
dictating how they can call it.
- -- Larry Wall in <199710221710.KAA24242@wall.org>
+ -- Larry Wall in <199710221710.KAA24242@wall.org>
%
For the sake of argument I'll ignore all your fighting words.
- -- Larry Wall in <199710221710.KAA24242@wall.org>
+ -- Larry Wall in <199710221710.KAA24242@wall.org>
%
Think of prototypes as a funny markup language--the interpretation is
left up to the rendering engine.
- -- Larry Wall in <199710221710.KAA24242@wall.org>
+ -- Larry Wall in <199710221710.KAA24242@wall.org>
%
Either approach may give birth to various sorts of monstrosities.
- -- Larry Wall in <199710221950.MAA25210@wall.org>
+ -- Larry Wall in <199710221950.MAA25210@wall.org>
%
The way these things go, there are probably 6 or 8 kludgey ways to do
it, and a better way that involves rethinking something that hasn't
been rethunk yet.
- -- Larry Wall in <199710221859.LAA24889@wall.org>
+ -- Larry Wall in <199710221859.LAA24889@wall.org>
%
Obviously your filters are throwing away mail from Randal. :-)
- -- Larry Wall in <199710221937.MAA25131@wall.org>
+ -- Larry Wall in <199710221937.MAA25131@wall.org>
%
Beauty? What's that?
- -- Larry Wall in <199710221937.MAA25131@wall.org>
+ -- Larry Wall in <199710221937.MAA25131@wall.org>
%
Oh yeah. Forgot about those. Getting senile, I guess...
- -- Larry Wall in <199710261551.HAA17791@wall.org>
+ -- Larry Wall in <199710261551.HAA17791@wall.org>
%
'Course, I haven't weighed in yet. :-)
- -- Larry Wall in <199710281816.KAA29614@wall.org>
+ -- Larry Wall in <199710281816.KAA29614@wall.org>
%
I'm afraid my gut level reaction is basically, "'proceed' is cute, but
cute doesn't cut it in the emergency room."
- -- Larry Wall in <199710281816.KAA29614@wall.org>
+ -- Larry Wall in <199710281816.KAA29614@wall.org>
%
I suppose one could claim that an undocumented feature has no
semantics. :-(
- -- Larry Wall in <199710290036.QAA01818@wall.org>
+ -- Larry Wall in <199710290036.QAA01818@wall.org>
%
: How would you disambiguate these situations?
By shooting the person who did the latter.
- -- Larry Wall in <199710290235.SAA02444@wall.org>
+ -- Larry Wall in <199710290235.SAA02444@wall.org>
%
Yes, we have consensus that we need 64 bit support. :-)
- -- Larry Wall in <199710291922.LAA07101@wall.org>
+ -- Larry Wall in <199710291922.LAA07101@wall.org>
%
: - cut in regexps
I don't think we reached consensus on that. We're still backtracking...
- -- Larry Wall in <199710291922.LAA07101@wall.org>
+ -- Larry Wall in <199710291922.LAA07101@wall.org>
%
Maybe it's time to break that.
- -- Larry Wall in <199710311718.JAA19082@wall.org>
+ -- Larry Wall in <199710311718.JAA19082@wall.org>
%
Boss: You forgot to assign the result of your map!
@@ -961,66 +961,66 @@ Boss: And what's that "goto" doing there?!?
Hacker: Er, I guess my finger slipped when I was typing "getservbyport"...
Boss: Ah well, accidents will happen. Maybe we should have picked APL.
- -- Larry Wall in <199710311732.JAA19169@wall.org>
+ -- Larry Wall in <199710311732.JAA19169@wall.org>
%
Perhaps they will have to outlaw sending random lists of words. fee fie
foe foo [sic]
- -- Larry Wall in <199710311916.LAA19760@wall.org>
+ -- Larry Wall in <199710311916.LAA19760@wall.org>
%
Hey, if pi == 3, and three == 0, does that make pi == 0? :-)
- -- Larry Wall in <199711011926.LAA25557@wall.org>
+ -- Larry Wall in <199711011926.LAA25557@wall.org>
%
I think you're letting your knowledge of internals interfere with your
linguistic judgement here.
- -- Larry Wall in <199711011949.LAA25651@wall.org>
+ -- Larry Wall in <199711011949.LAA25651@wall.org>
%
(Never thought I'd be telling Malcolm and Ilya the same thing... :-)
- -- Larry Wall in <199711071819.KAA29909@wall.org>
+ -- Larry Wall in <199711071819.KAA29909@wall.org>
%
And other operators aren't so special syntactically, but weird
in other ways, like "scalar", and "goto".
- -- Larry Wall in <199711071749.JAA29751@wall.org>
+ -- Larry Wall in <199711071749.JAA29751@wall.org>
%
Portability should be the default.
- -- Larry Wall in <199711072201.OAA01123@wall.org>
+ -- Larry Wall in <199711072201.OAA01123@wall.org>
%
Actually, it also looks like we should optimize (13,2,42,8,'hike') into
a pp_padav copy as well.
- -- Larry Wall in <199711081945.LAA06315@wall.org>
+ -- Larry Wall in <199711081945.LAA06315@wall.org>
%
If this were Ada, I suppose we'd just constant fold 1/0 into
die "Illegal division by zero"
- -- Larry Wall in <199711100226.SAA12549@wall.org>
+ -- Larry Wall in <199711100226.SAA12549@wall.org>
%
Are you perchance running on a 64-bit machine?
- -- Larry Wall in <199711102149.NAA16878@wall.org>
+ -- Larry Wall in <199711102149.NAA16878@wall.org>
%
Almost nothing in Perl serves a single purpose.
- -- Larry Wall in <199712040054.QAA13811@wall.org>
+ -- Larry Wall in <199712040054.QAA13811@wall.org>
%
There's some entertainment value in watching people juggle nitroglycerin.
- -- Larry Wall in <199712041747.JAA18908@wall.org>
+ -- Larry Wall in <199712041747.JAA18908@wall.org>
%
Reserve your abuse for your true friends.
- -- Larry Wall in <199712041852.KAA19364@wall.org>
+ -- Larry Wall in <199712041852.KAA19364@wall.org>
%
Er, Tom, I hate to be the one to point this out, but your fix list
is starting to resemble a feature list. You must be human or something.
- -- Larry Wall in <199801081824.KAA29602@wall.org>
+ -- Larry Wall in <199801081824.KAA29602@wall.org>
%
It's hard to tune heavily tuned code. :-)
- -- Larry Wall in <199801141725.JAA07555@wall.org>
+ -- Larry Wall in <199801141725.JAA07555@wall.org>
%
Perl will always provide the null.
- -- Larry Wall in <199801151818.KAA14538@wall.org>
+ -- Larry Wall in <199801151818.KAA14538@wall.org>
%
It's easy to solve the halting problem with a shotgun. :-)
- -- Larry Wall in <199801151836.KAA14656@wall.org>
+ -- Larry Wall in <199801151836.KAA14656@wall.org>
%
Well, I think Perl should run faster than C. :-)
- -- Larry Wall in <199801200306.TAA11638@wall.org>
+ -- Larry Wall in <199801200306.TAA11638@wall.org>
%
To Perl, or not to Perl, that is the kvetching.
- -- Larry Wall in <199801200310.TAA11670@wall.org>
+ -- Larry Wall in <199801200310.TAA11670@wall.org>
%
diff --git a/vim/syntax/nhdes.vim b/vim/syntax/nhdes.vim
index f2eefd3..dcafdf3 100644
--- a/vim/syntax/nhdes.vim
+++ b/vim/syntax/nhdes.vim
@@ -14,6 +14,9 @@ syn sync minlines=30
" we're case sensitive
syn case match
+" some keywords use '-'
+setlocal iskeyword+=-
+
syn region nhDesComment start=/^[ \t]*#/ end=/$/
syn keyword nhDesCommandNoArgs
@@ -40,6 +43,9 @@ syn keyword nhDesConstant
syn region nhDesString start=/"/ end=/"/
syn match nhDesChar /'.'/
+syn match nhDesCoord /(\s*\d\+\s*,\s*\d\+\s*)/
+syn match nhDesRegion /(\s*\d\+\s*,\s*\d\+\s*,\s*\d\+\s*,\s*\d\+\s*)/
+
syn match nhDesMapCharDoor /[+S]/ contained
syn match nhDesMapCharFloor /[\.B]/ contained
syn match nhDesMapCharCorridor /[#H]/ contained
@@ -57,7 +63,12 @@ syn match nhDesMapCharLinenum /[0123456789]/ contained
" TODO: Any better way to do this?
syn match nhDesMapCharError /[^+S\.B#H\-\| WP}{\\ACLKITF0-9]/ contained
-syn region nhDesMap matchgroup=nhDesCommandNoArgs start=/^MAP$/ end=/^ENDMAP$/ contains=nhDesMapCharError,nhDesMapCharDoor,nhDesMapCharFloor,nhDesMapCharCorridor,nhDesMapCharWall,nhDesMapCharWater,nhDesMapCharThrone,nhDesMapCharAir,nhDesMapCharCloud,nhDesMapCharLava,nhDesMapCharSink,nhDesMapCharIce,nhDesMapCharTree,nhDesMapCharIronbars,nhDesMapCharLinenum
+syn region nhDesMap matchgroup=nhDesCommandNoArgs start=/^MAP$/ end=/^ENDMAP$/
+ \ contains=nhDesMapCharError,nhDesMapCharDoor,nhDesMapCharFloor,
+ \ nhDesMapCharCorridor,nhDesMapCharWall,nhDesMapCharWater,
+ \ nhDesMapCharThrone,nhDesMapCharAir,nhDesMapCharCloud,nhDesMapCharLava,
+ \ nhDesMapCharSink,nhDesMapCharIce,nhDesMapCharTree,nhDesMapCharIronbars,
+ \ nhDesMapCharLinenum
hi def link nhDesComment Comment
hi def link nhDesCommandNoArgs KeyWord
@@ -66,21 +77,23 @@ hi def link nhDesRegister Constant
hi def link nhDesConstant Constant
hi def link nhDesString String
hi def link nhDesChar String
+hi def link nhDesCoord Number
+hi def link nhDesRegion Number
-highlight nhDesMapCharDoor ctermbg=black ctermfg=brown
-highlight nhDesMapCharFloor ctermbg=black ctermfg=grey
-highlight nhDesMapCharCorridor ctermbg=black ctermfg=grey
-highlight nhDesMapCharWall ctermbg=black ctermfg=grey
-highlight nhDesMapCharWater ctermbg=black ctermfg=darkblue
-highlight nhDesMapCharThrone ctermbg=black ctermfg=yellow
-highlight nhDesMapCharAir ctermbg=black ctermfg=lightblue
-highlight nhDesMapCharCloud ctermbg=black ctermfg=grey
-highlight nhDesMapCharLava ctermbg=black ctermfg=red
-highlight nhDesMapCharSink ctermbg=black ctermfg=grey
-highlight nhDesMapCharIce ctermbg=black ctermfg=lightblue
-highlight nhDesMapCharTree ctermbg=black ctermfg=green
-highlight nhDesMapCharIronbars ctermbg=black ctermfg=cyan
-highlight nhDesMapCharLinenum ctermbg=black ctermfg=darkgrey
-highlight nhDesMapCharError ctermbg=red ctermfg=yellow
+highlight nhDesMapCharDoor ctermbg=black ctermfg=brown guibg=black guifg=brown
+highlight nhDesMapCharFloor ctermbg=black ctermfg=grey guibg=black guifg=grey
+highlight nhDesMapCharCorridor ctermbg=black ctermfg=grey guibg=black guifg=grey
+highlight nhDesMapCharWall ctermbg=black ctermfg=grey guibg=black guifg=grey
+highlight nhDesMapCharWater ctermbg=black ctermfg=darkblue guibg=black guifg=darkblue
+highlight nhDesMapCharThrone ctermbg=black ctermfg=yellow guibg=black guifg=yellow
+highlight nhDesMapCharAir ctermbg=black ctermfg=lightblue guibg=black guifg=lightblue
+highlight nhDesMapCharCloud ctermbg=black ctermfg=grey guibg=black guifg=grey
+highlight nhDesMapCharLava ctermbg=black ctermfg=red guibg=black guifg=red
+highlight nhDesMapCharSink ctermbg=black ctermfg=grey guibg=black guifg=grey
+highlight nhDesMapCharIce ctermbg=black ctermfg=lightblue guibg=black guifg=lightblue
+highlight nhDesMapCharTree ctermbg=black ctermfg=green guibg=black guifg=green
+highlight nhDesMapCharIronbars ctermbg=black ctermfg=cyan guibg=black guifg=cyan
+highlight nhDesMapCharLinenum ctermbg=black ctermfg=darkgrey guibg=black guifg=darkgrey
+highlight nhDesMapCharError ctermbg=red ctermfg=yellow guibg=red guifg=yellow
let b:current_syntax = "nhdes"
diff --git a/vim/syntax/tmux.vim b/vim/syntax/tmux.vim
index 6556e16..e85f8ff 100644
--- a/vim/syntax/tmux.vim
+++ b/vim/syntax/tmux.vim
@@ -3,6 +3,20 @@
" Maintainer: Tiago Cunha <tcunha@users.sourceforge.net>
" Last Change: $Date: 2010-07-27 18:29:07 $
" License: This file is placed in the public domain.
+"
+" To install this file:
+"
+" - Drop the file in the syntax directory into runtimepath (such as
+" ~/.vim/syntax/tmux.vim).
+" - Make the filetype recognisable by adding the following to filetype.vim
+" (~/.vim/filetype.vim):
+"
+" augroup filetypedetect
+" au BufNewFile,BufRead .tmux.conf*,tmux.conf* setf tmux
+" augroup END
+"
+" - Switch on syntax highlighting by adding "syntax enable" to .vimrc.
+"
if version < 600
syntax clear
@@ -41,19 +55,22 @@ syn keyword tmuxCmds
\ choose-buffer clearhist clear-history deleteb delete-buffer lsb
\ list-buffers loadb load-buffer pasteb paste-buffer saveb save-buffer
\ setb set-buffer showb show-buffer
- \ clock-mode if[-shell] lock[-server] run[-shell] [server-]info
- \ choose-list
+ \ clock-mode if[-shell] lock[-server] run[-shell] server-info info
+ \ choose-list wait-for
syn keyword tmuxOptsSet
\ buffer-limit escape-time exit-unattached exit-unattached quiet
\ set-clipboard
\ base-index bell-action bell-on-alert default-command default-path
\ default-shell default-terminal destroy-unattached detach-on-destroy
- \ display-panes-[active-]colour display-[panes-]time history-limit
- \ lock-after-time lock-command lock-server message-[command-]attr
- \ message-[command-]bg message-[command-]fg message-limit
+ \ display-panes-active-colour display-panes-colour display-panes-time
+ \ display-time history-limit
+ \ lock-after-time lock-command lock-server
+ \ message-command-attr message-attr message-command-bg message-bg
+ \ message-command-fg message-fg message-limit
\ mouse-resize-pane mouse-select-pane mouse-select-window mouse-utf8
- \ pane-[active-]border-bg pane-[active-]border-fg prefix prefix2
+ \ pane-active-border-bg pane-border-bg pane-active-border-fg
+ \ pane-border-fg prefix prefix2
\ renumber-windows repeat-time set-remain-on-exit set-titles
\ set-titles-string status status-attr status-bg status-fg
\ status-interval status-justify status-keys status-left
@@ -75,8 +92,9 @@ syn keyword tmuxOptsSetw
\ window-status-content-bg window-status-content-fg
\ window-status-activity-attr window-status-activity-bg
\ window-status-activity-fg window-status-attr
- \ window-status-[current-]attr window-status-[current-]bg
- \ window-status-[current-]fg window-status-[current-]format
+ \ window-status-current-attr window-status-attr window-status-current-bg
+ \ window-status-bg window-status-current-fg window-status-fg
+ \ window-status-current-format window-status-format
\ window-status-separator xterm-keys wrap-search
syn keyword tmuxTodo FIXME NOTE TODO XXX contained
diff --git a/weechat/perl/autoload/buffers.pl b/weechat/perl/autoload/buffers.pl
index 447777f..e2b49e5 100644
--- a/weechat/perl/autoload/buffers.pl
+++ b/weechat/perl/autoload/buffers.pl
@@ -1,6 +1,6 @@
#
-# Copyright (C) 2008-2012 Sebastien Helleu <flashcode@flashtux.org>
-# Copyright (C) 2011-2012 Nils G <weechatter@arcor.de>
+# Copyright (C) 2008-2013 Sebastien Helleu <flashcode@flashtux.org>
+# Copyright (C) 2011-2013 Nils G <weechatter@arcor.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -19,7 +19,11 @@
# Display sidebar with list of buffers.
#
# History:
-#
+# 2013-10-20, nils_2@freenode.#weechat:
+# v4.0: add options "detach_displayed_buffers", "detach_display_window_number"
+# 2013-09-27, nils_2@freenode.#weechat:
+# v3.9: add option "toggle_bar" and option "show_prefix_query" (idea by IvarB)
+# : fix problem with linefeed at end of list of buffers (reported by grawity)
# 2012-10-18, nils_2@freenode.#weechat:
# v3.8: add option "mark_inactive", to mark buffers you are not in (idea by xrdodrx)
# : add wildcard "*" for immune_detach_buffers (idea by StarWeaver)
@@ -134,7 +138,8 @@
use strict;
use Encode qw( decode encode );
# -------------------------------[ internal ]-------------------------------------
-my $version = "3.8";
+my $SCRIPT_NAME = "buffers";
+my $version = "4.0";
my $BUFFERS_CONFIG_FILE_NAME = "buffers";
my $buffers_config_file;
@@ -152,26 +157,33 @@ my %buffers_timer = ();
my %Hooks = ();
# --------------------------------[ init ]--------------------------------------
-weechat::register("buffers", "Sebastien Helleu <flashcode\@flashtux.org>", $version,
- "GPL3", "Sidebar with list of buffers", "", "");
+weechat::register($SCRIPT_NAME, "Sebastien Helleu <flashcode\@flashtux.org>", $version,
+ "GPL3", "Sidebar with list of buffers", "shutdown_cb", "");
my $weechat_version = weechat::info_get("version_number", "") || 0;
buffers_config_init();
buffers_config_read();
-weechat::bar_item_new("buffers", "build_buffers", "");
-weechat::bar_new("buffers", "0", "0", "root", "", "left", "horizontal",
+weechat::bar_item_new($SCRIPT_NAME, "build_buffers", "");
+weechat::bar_new($SCRIPT_NAME, "0", "0", "root", "", "left", "horizontal",
"vertical", "0", "0", "default", "default", "default", "1",
- "buffers");
+ $SCRIPT_NAME);
+
+if ( check_bar_item() == 0 )
+{
+ weechat::command("","/bar show " . $SCRIPT_NAME) if ( weechat::config_boolean($options{"toggle_bar"}) eq 1 );
+}
+
weechat::hook_signal("buffer_*", "buffers_signal_buffer", "");
weechat::hook_signal("window_switch", "buffers_signal_buffer", "");
weechat::hook_signal("hotlist_*", "buffers_signal_hotlist", "");
-weechat::hook_signal("window_switch", "buffers_signal_buffer", "");
#weechat::hook_command_run("/input switch_active_*", "buffers_signal_buffer", "");
-weechat::bar_item_update("buffers");
+weechat::bar_item_update($SCRIPT_NAME);
+
+
if ($weechat_version >= 0x00030600)
{
- weechat::hook_focus("buffers", "buffers_focus_buffers", "");
+ weechat::hook_focus($SCRIPT_NAME, "buffers_focus_buffers", "");
weechat::hook_hsignal("buffers_mouse", "buffers_hsignal_mouse", "");
weechat::key_bind("mouse", \%mouse_keys);
}
@@ -206,10 +218,13 @@ weechat::hook_command( $cmd_buffers_detach,
if ($weechat_version >= 0x00030800)
{
weechat::hook_config("buffers.look.detach", "hook_timer_detach", "");
+ $Hooks{timer_detach} = weechat::hook_timer( weechat::config_integer( $options{"detach"}) * 1000, 60, 0, "buffers_signal_buffer", "") if ( weechat::config_integer( $options{"detach"}) > 0 );
}
weechat::hook_config("buffers.look.show_lag", "hook_timer_lag", "");
+ $Hooks{timer_lag} = weechat::hook_timer( weechat::config_integer(weechat::config_get("irc.network.lag_refresh_interval")) * 1000, 0, 0, "buffers_signal_hotlist", "") if ( weechat::config_boolean($options{"show_lag"}) );
+
# -------------------------------- [ command ] --------------------------------
sub buffers_cmd_whitelist
{
@@ -287,6 +302,7 @@ my ( $data, $buffer, $args ) = @_;
}
return weechat::WEECHAT_RC_OK;
}
+
sub create_whitelist
{
my @buffers_list = @{$_[0]};
@@ -313,7 +329,7 @@ sub hook_timer_detach
weechat::unhook($Hooks{timer_detach}) if $Hooks{timer_detach};
$Hooks{timer_detach} = weechat::hook_timer( weechat::config_integer( $options{"detach"}) * 1000, 60, 0, "buffers_signal_buffer", "");
}
- weechat::bar_item_update("buffers");
+ weechat::bar_item_update($SCRIPT_NAME);
return weechat::WEECHAT_RC_OK;
}
@@ -330,7 +346,7 @@ sub hook_timer_lag
weechat::unhook($Hooks{timer_lag}) if $Hooks{timer_lag};
$Hooks{timer_lag} = weechat::hook_timer( weechat::config_integer(weechat::config_get("irc.network.lag_refresh_interval")) * 1000, 0, 0, "buffers_signal_hotlist", "");
}
- weechat::bar_item_update("buffers");
+ weechat::bar_item_update($SCRIPT_NAME);
return weechat::WEECHAT_RC_OK;
}
@@ -398,19 +414,23 @@ my %default_options_look =
"indenting_number" => ["indenting_number", "boolean", "use indenting for numbers. This option only takes effect if bar is left/right positioned", "", 0, 0,"on", "on", 0, "", "", "buffers_signal_config", "", "", ""],
"short_names" => ["short_names", "boolean", "display short names (remove text before first \".\" in buffer name)", "", 0, 0,"on", "on", 0, "", "", "buffers_signal_config", "", "", ""],
"show_number" => ["show_number", "boolean", "display channel number in front of buffername", "", 0, 0,"on", "on", 0, "", "", "buffers_signal_config", "", "", ""],
- "show_number_char" => ["number_char", "string", "display a char after channel number", "", 0, 0,".", ".", 0, "", "", "buffers_signal_config", "", "", ""],
- "show_prefix" => ["prefix", "boolean", "show your prefix for channel", "", 0, 0,"off", "off", 0, "", "", "buffers_signal_config", "", "", ""],
- "show_prefix_empty" => ["prefix_empty", "boolean", "use a placeholder for channels without prefix", "", 0, 0,"on", "on", 0, "", "", "buffers_signal_config", "", "", ""],
+ "show_number_char" => ["number_char", "string", "display a char behind channel number", "", 0, 0,".", ".", 0, "", "", "buffers_signal_config", "", "", ""],
+ "show_prefix" => ["prefix", "boolean", "displays your prefix for channel in front of buffername", "", 0, 0,"off", "off", 0, "", "", "buffers_signal_config", "", "", ""],
+ "show_prefix_empty" => ["prefix_empty", "boolean", "use a placeholder for channels without prefix", "", 0, 0,"on", "on", 0, "", "", "buffers_signal_config", "", "", ""],
+"show_prefix_query" => ["prefix_for_query", "string", "prefix displayed in front of query buffer", "", 0, 0,"", "", 0, "", "", "buffers_signal_config", "", "", ""],
"sort" => ["sort", "integer", "sort buffer-list by \"number\" or \"name\"", "number|name", 0, 0,"number", "number", 0, "", "", "buffers_signal_config", "", "", ""],
"core_to_front" => ["core_to_front", "boolean", "core buffer and buffers with free content will be listed first. Take only effect if buffer sort is by name", "", 0, 0,"off", "off", 0, "", "", "buffers_signal_config", "", "", ""],
"jump_prev_next_visited_buffer" => ["jump_prev_next_visited_buffer", "boolean", "jump to previously or next visited buffer if you click with left/right mouse button on currently visiting buffer", "", 0, 0,"off", "off", 0, "", "", "buffers_signal_config", "", "", ""],
"name_size_max" => ["name_size_max","integer","maximum size of buffer name. 0 means no limitation","",0,256,0,0,0, "", "", "buffers_signal_config", "", "", ""],
"name_crop_suffix" => ["name_crop_suffix","string","contains an optional char(s) that is appended when buffer name is shortened","",0,0,"+","+",0,"","","buffers_signal_config", "", "", ""],
- "detach" => ["detach", "integer","detach channel from buffers list after a specific period of time (in seconds) without action (weechat ≥ 0.3.8 required)", "", 0, 31536000,0, "number", 0, "", "", "buffers_signal_config", "", "", ""],
+ "detach" => ["detach", "integer","detach channel from buffers list after a specific period of time (in seconds) without action (weechat ≥ 0.3.8 required) (0 means \"off\")", "", 0, 31536000,0, "number", 0, "", "", "buffers_signal_config", "", "", ""],
"immune_detach_buffers"=> ["immune_detach_buffers", "string", "Comma seperated list of buffers to NOT automatically detatch. Allows \"*\" wildcard. Ex: \"BitlBee,freenode.*\"", "", 0, 0,"", "", 0, "", "", "buffers_signal_config_immune_detach_buffers", "", "", ""],
"detach_query" => ["detach_query", "boolean", "query buffer will be detachted", "", 0, 0,"off", "off", 0, "", "", "buffers_signal_config", "", "", ""],
"detach_free_content" => ["detach_free_content", "boolean", "buffers with free content will be detached (Ex: iset, chanmon)", "", 0, 0,"off", "off", 0, "", "", "buffers_signal_config", "", "", ""],
+ "detach_displayed_buffers" => ["detach_displayed_buffers", "boolean", "buffers displayed in a (split) window will be detached", "", 0, 0,"on", "on", 0, "", "", "buffers_signal_config", "", "", ""],
+ "detach_display_window_number" => ["detach_display_window_number", "boolean", "window number will be add, behind buffer name (this option takes only effect with \"detach_displayed_buffers\" option)", "", 0, 0,"off", "off", 0, "", "", "buffers_signal_config", "", "", ""],
"mark_inactive" => ["mark_inactive", "boolean", "if option is \"on\", inactive buffers (those you are not in) will have parentesis around them. An inactive buffer will not be detached.", "", 0, 0,"off", "off", 0, "", "", "buffers_signal_config", "", "", ""],
+ "toggle_bar" => ["toogle_bar", "boolean", "if option is \"on\", buffers bar will hide/show when script is (un)loaded.", "", 0, 0,"on","on", 0, "", "", "buffers_signal_config", "", "", ""],
);
# section "color"
my $section_color = weechat::config_new_section($buffers_config_file,"color", 0, 0, "", "", "", "", "", "", "", "", "", "");
@@ -443,7 +463,8 @@ my %default_options_look =
$default_options_look{$option}[3],$default_options_look{$option}[4],$default_options_look{$option}[5],
$default_options_look{$option}[6],$default_options_look{$option}[7],$default_options_look{$option}[8],
$default_options_look{$option}[9],$default_options_look{$option}[10],$default_options_look{$option}[11],
- $default_options_look{$option}[12],$default_options_look{$option}[13],$default_options_look{$option}[14]);
+ $default_options_look{$option}[12],$default_options_look{$option}[13],$default_options_look{$option}[14],
+ $default_options_look{$option}[15]);
}
}
@@ -515,6 +536,7 @@ sub build_buffers
$buffer->{"number"} = $number;
$buffer->{"active"} = $active;
$buffer->{"current_buffer"} = weechat::infolist_integer($infolist, "current_buffer");
+ $buffer->{"num_displayed"} = weechat::infolist_integer($infolist, "num_displayed");
$buffer->{"plugin_name"} = weechat::infolist_string($infolist, "plugin_name");
$buffer->{"name"} = weechat::infolist_string($infolist, "name");
$buffer->{"short_name"} = weechat::infolist_string($infolist, "short_name");
@@ -593,6 +615,31 @@ sub build_buffers
push(@current1, $buffer);
}
}
+ elsif ( $buffer->{"current_buffer"} eq 0
+ and not exists $hotlist{$buffer->{"pointer"}}
+# and $buffer->{"type"} eq "channel"
+ and exists $buffers_timer{$buffer->{"pointer"}}
+ and $detach_time > 0
+ and $weechat_version >= 0x00030800
+ and $current_time - $buffers_timer{$buffer->{"pointer"}} >= $detach_time)
+ { # check for option detach_displayed_buffers and if buffer is displayed in a split window
+ if ( $buffer->{"num_displayed"} eq 1
+ and weechat::config_boolean($options{"detach_displayed_buffers"}) eq 0 )
+ {
+ my $infolist_window = weechat::infolist_get("window","","");
+ while (weechat::infolist_next($infolist_window))
+ {
+ my $buffer_ptr = weechat::infolist_pointer($infolist_window, "buffer");
+ if ($buffer_ptr eq $buffer->{"pointer"})
+ {
+ $buffer->{"window"} = weechat::infolist_integer($infolist_window, "number");
+ }
+ }
+ weechat::infolist_free($infolist_window);
+
+ push(@current2, $buffer);
+ }
+ }
}
else # buffer in "immune_detach_buffers"
{
@@ -831,6 +878,9 @@ sub build_buffers
}
}
}
+
+ $str .= weechat::config_string( $options{"show_prefix_query"}) if (weechat::config_string( $options{"show_prefix_query"} ) ne "" and $buffer->{"type"} eq "private");
+
if (weechat::config_boolean( $options{"show_prefix"} ) eq 1)
{
my $nickname = weechat::buffer_get_string($buffer->{"pointer"}, "localvar_nick");
@@ -880,38 +930,32 @@ sub build_buffers
if (weechat::config_boolean( $options{"short_names"} ) eq 1)
{
- my $name = $buffer->{"short_name"};
- $name = '?' . $name if $buffer->{"type"} eq 'private';
- $name =~ s|#iinteractive/|#|;
if (weechat::config_integer($options{"name_size_max"}) >= 1) # check max_size of buffer name
{
- $str .= encode("UTF-8", substr(decode("UTF-8", $name), 0, weechat::config_integer($options{"name_size_max"})));
+ $str .= encode("UTF-8", substr(decode("UTF-8", $buffer->{"short_name"}), 0, weechat::config_integer($options{"name_size_max"})));
$str .= weechat::color(weechat::config_color( $options{"color_number_char"})).weechat::config_string($options{"name_crop_suffix"}) if (length($buffer->{"short_name"}) > weechat::config_integer($options{"name_size_max"}));
$str .= add_inactive_parentless($buffer->{"type"},$buffer->{"nicks_count"});
$str .= add_hotlist_count($buffer->{"pointer"},%hotlist);
}
else
{
- $str .= $name;
+ $str .= $buffer->{"short_name"};
$str .= add_inactive_parentless($buffer->{"type"},$buffer->{"nicks_count"});
$str .= add_hotlist_count($buffer->{"pointer"},%hotlist);
}
}
else
{
- my $name = $buffer->{"name"};
- $name = '?' . $name if $buffer->{"type"} eq 'private';
- $name =~ s|#iinteractive/|#|;
if (weechat::config_integer($options{"name_size_max"}) >= 1) # check max_size of buffer name
{
- $str .= encode("UTF-8", substr(decode("UTF-8", $name,), 0, weechat::config_integer($options{"name_size_max"})));
+ $str .= encode("UTF-8", substr(decode("UTF-8", $buffer->{"name"},), 0, weechat::config_integer($options{"name_size_max"})));
$str .= weechat::color(weechat::config_color( $options{"color_number_char"})).weechat::config_string($options{"name_crop_suffix"}) if (length($buffer->{"name"}) > weechat::config_integer($options{"name_size_max"}));
$str .= add_inactive_parentless($buffer->{"type"},$buffer->{"nicks_count"});
$str .= add_hotlist_count($buffer->{"pointer"},%hotlist);
}
else
{
- $str .= $name;
+ $str .= $buffer->{"name"};
$str .= add_inactive_parentless($buffer->{"type"},$buffer->{"nicks_count"});
$str .= add_hotlist_count($buffer->{"pointer"},%hotlist);
}
@@ -930,10 +974,21 @@ sub build_buffers
$str .= weechat::color("default") . " (" . weechat::color($color_lag) . $lag . weechat::color("default") . ")";
}
}
+ if (weechat::config_boolean($options{"detach_displayed_buffers"}) eq 0
+ and weechat::config_boolean($options{"detach_display_window_number"}) eq 1)
+ {
+ if ($buffer->{"window"})
+ {
+ $str .= weechat::color("default") . " (" . weechat::color(weechat::config_color( $options{"color_number"})) . $buffer->{"window"} . weechat::color("default") . ")";
+ }
+ }
$str .= "\n";
$old_number = $buffer->{"number"};
}
+ # remove spaces and/or linefeed at the end
+ $str =~ s/\s+$//;
+ chomp($str);
return $str;
}
@@ -1057,13 +1112,13 @@ my ($data, $signal, $signal_data) = @_;
}
}
- weechat::bar_item_update("buffers");
+ weechat::bar_item_update($SCRIPT_NAME);
return weechat::WEECHAT_RC_OK;
}
sub buffers_signal_hotlist
{
- weechat::bar_item_update("buffers");
+ weechat::bar_item_update($SCRIPT_NAME);
return weechat::WEECHAT_RC_OK;
}
@@ -1072,20 +1127,20 @@ sub buffers_signal_config_whitelist
{
@whitelist_buffers = ();
@whitelist_buffers = split( /,/, weechat::config_string( $options{"look_whitelist_buffers"} ) );
- weechat::bar_item_update("buffers");
+ weechat::bar_item_update($SCRIPT_NAME);
return weechat::WEECHAT_RC_OK;
}
sub buffers_signal_config_immune_detach_buffers
{
@immune_detach_buffers = ();
@immune_detach_buffers = split( /,/, weechat::config_string( $options{"immune_detach_buffers"} ) );
- weechat::bar_item_update("buffers");
+ weechat::bar_item_update($SCRIPT_NAME);
return weechat::WEECHAT_RC_OK;
}
sub buffers_signal_config
{
- weechat::bar_item_update("buffers");
+ weechat::bar_item_update($SCRIPT_NAME);
return weechat::WEECHAT_RC_OK;
}
@@ -1096,7 +1151,7 @@ sub buffers_focus_buffers
my %info = %{$_[1]};
my $item_line = int($info{"_bar_item_line"});
undef my $hash;
- if (($info{"_bar_item_name"} eq "buffers") && ($item_line >= 0) && ($item_line <= $#buffers_focus))
+ if (($info{"_bar_item_name"} eq $SCRIPT_NAME) && ($item_line >= 0) && ($item_line <= $#buffers_focus))
{
$hash = $buffers_focus[$item_line];
}
@@ -1202,3 +1257,30 @@ sub check_immune_detached_buffers
}
return 0;
}
+
+sub shutdown_cb
+{
+ weechat::command("","/bar hide " . $SCRIPT_NAME) if ( weechat::config_boolean($options{"toggle_bar"}) eq 1 );
+ return weechat::WEECHAT_RC_OK
+}
+
+sub check_bar_item
+{
+ my $item = 0;
+ my $infolist = weechat::infolist_get("bar", "", "");
+ while (weechat::infolist_next($infolist))
+ {
+ my $bar_items = weechat::infolist_string($infolist, "items");
+ if (index($bar_items,$SCRIPT_NAME) != -1)
+ {
+ my $name = weechat::infolist_string($infolist, "name");
+ if ($name ne $SCRIPT_NAME)
+ {
+ $item = 1;
+ last;
+ }
+ }
+ }
+ weechat::infolist_free($infolist);
+ return $item;
+} \ No newline at end of file
diff --git a/weechat/perl/autoload/chatters.pl b/weechat/perl/autoload/chatters.pl
index 7478f9b..993ccad 100644
--- a/weechat/perl/autoload/chatters.pl
+++ b/weechat/perl/autoload/chatters.pl
@@ -39,12 +39,14 @@
# Version 0.3: missing return value for callbacks fixed
# version check added
# improved option handling
+# 2013-02-07, Ailin Nemui <anti.teamidiot.de>
+# Version 0.4: add focus info
#
use strict;
use warnings;
-my $version = "0.3";
+my $version = "0.4";
my $script_name = "chatters";
my $weechat_version = "";
@@ -88,8 +90,12 @@ weechat::hook_timer(60000, 0, 0, "cleanup_chatters", 0);
# On config change
weechat::hook_config("plugins.var.perl.${script_name}.*", "config_change_cb", "");
+
weechat::bar_item_new($chatters_bar_item_name, "chatters_bar_cb", "");
+# For mouse support
+weechat::hook_focus($chatters_bar_item_name, "chatters_focus_cb", "") if $weechat_version >= 0x00030600;
+
###############################################################################
# Buffer update callback
sub chatters_bar_cb
@@ -131,7 +137,7 @@ sub buffer_close_cb
{
delete $chatter_groups{$channel};
}
-return weechat::WEECHAT_RC_OK;
+ return weechat::WEECHAT_RC_OK;
}
###############################################################################
@@ -202,7 +208,22 @@ sub config_change_cb
{
cleanup_chatters();
}
-return weechat::WEECHAT_RC_OK;
+ return weechat::WEECHAT_RC_OK;
+}
+
+###############################################################################
+# Adds nick info to focus hashtable
+sub chatters_focus_cb
+{
+ my $channel = buf_to_channel_key($_[1]{_buffer});
+ if ($channel and $chatter_groups{$channel} and
+ $_[1]{_bar_item_line} > 0 and $_[1]{_bar_item_line} <= keys %{ $chatter_groups{$channel} })
+ {
+ +{ nick => (sort {uc($a) cmp uc($b)} keys %{ $chatter_groups{$channel} })[$_[1]{_bar_item_line}-1] }
+ }
+ else {
+ $_[1]
+ }
}
###############################################################################
diff --git a/weechat/python/autoload/bitlbee_typing_notice.py b/weechat/python/autoload/bitlbee_typing_notice.py
index 307083b..7e76988 100644
--- a/weechat/python/autoload/bitlbee_typing_notice.py
+++ b/weechat/python/autoload/bitlbee_typing_notice.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
#
# Copyright (c) 2010 by Alexander Schremmer <alex@alexanderweb.de>
+# Copyright (c) 2013 by Corey Halpin <chalpin@cs.wisc.edu>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -17,78 +18,89 @@
#
#
-# (this script requires WeeChat 0.3.0 or newer)
+# (this script requires WeeChat 0.3.6 or newer)
#
# History:
+# 2013-06-24, Priska Herger <policecar@23bit.net>
+# version 0.4: bug fix: if TYPING 0, don't show typing.
+# 2013-04-27, Corey Halpin <chalpin@cs.wisc.edu>
+# version 0.3:
+# * Use irc_message_parse to extract nicks
+# * Send typing = 0 at message completion in private buffers
+# * Make server, channel, and timeout configurable w/o editing plugin code.
# 2010-05-20, Alexander Schremmer <alex@alexanderweb.de>
# version 0.2: also handle users that do not send a TYPING 0 msg before quitting
# removed InfoList code
# 2010-05-16, Alexander Schremmer <alex@alexanderweb.de>
# version 0.1: initial release
+
+# Configuration options via /set:
+#
+# 'channel'
+# description: Name of your bitlbee channel
+# command: /set plugins.var.python.bitlbee_typing_notice.channel &bitlbee
+#
+# 'server'
+# description: Server running your bitlbee instance.
+# command: /set plugins.var.python.bitlbee_typing_notice.server localhost
+#
+# 'timeout'
+# description: Send "not typing" after this many seconds w/o typing.
+# command: /set plugins.var.python.bitlbee_typing_notice.timeout 4
+#
+# Note, the plugin must be reloaded after either of these settings are changed.
+# /python reload works for this.
+
+
import weechat as w
import re
SCRIPT_NAME = "bitlbee_typing_notice"
SCRIPT_AUTHOR = "Alexander Schremmer <alex@alexanderweb.de>"
-SCRIPT_VERSION = "0.2"
+SCRIPT_VERSION = "0.4"
SCRIPT_LICENSE = "GPL3"
SCRIPT_DESC = "Shows when somebody is typing on bitlbee and sends the notice as well"
+typing = {} # Record nicks who sent typing notices. key = subject nick, val = typing level.
-bitlbee_channel = "&bitlbee"
-bitlbee_server_name = "bitlbee"
-
-KEEP_TYPING_TIMEOUT = 1
-STOP_TYPING_TIMEOUT = 7
-
-typing = {}
-sending_typing = {}
-
+sending_typing = {} # Nicks to whom we're sending typing notices.
+# key = target nick, val = sequence number used to determine when the typing notice
+# should be removed.
def channel_has_nick(server, channel, nick):
buffer = w.buffer_search("", "%s.%s" % (server, channel))
return bool(w.nicklist_search_nick(buffer, "", nick))
-
-def redraw(nick):
- w.bar_item_update("bitlbee_typing_notice")
-
-
+# Callback which checks for ctcp typing notices sent to us.
+# Updates typing data, hides the ctcp notices.
def ctcp_cb(data, modifier, modifier_data, string):
- if modifier_data != bitlbee_server_name:
+ if modifier_data != w.config_get_plugin("server"):
+ return string
+ msg_hash = w.info_get_hashtable(
+ "irc_message_parse", {"message": string} )
+ if msg_hash["command"] != "PRIVMSG":
return string
- match = re.match(r'(.*) PRIVMSG (.*)', string)
+ match = re.search('\001TYPING ([0-9])\001', msg_hash["arguments"])
if match:
- host, msg = match.groups()
- match = re.search('\001TYPING ([0-9])\001', msg)
- if match:
- nick = re.match(':(?P<nick>.+)!', string).groups()[0]
- typing_level = int(match.groups()[0])
- if typing_level == 0:
- try:
- del typing[nick]
- except KeyError:
- pass
- redraw(nick)
- elif typing_level == 1:
- typing[nick] = 1
- # XXX add ICQ/Yahoo hack
- redraw(nick)
- elif typing_level == 2:
- typing[nick] = 2
- redraw(nick)
- return ""
- return string
- buffer = w.buffer_search("", "%s.%s" % (server, channel))
+ nick = msg_hash["nick"]
+ typing_level = int(match.groups()[0])
+ if typing_level == 0 and nick in typing:
+ del typing[nick]
+ elif typing_level > 0:
+ typing[nick] = typing_level
+ w.bar_item_update("bitlbee_typing_notice")
+ return ""
+ else:
+ return string
+
def stop_typing(data, signal, signal_data):
- nick = re.match(':(?P<nick>.+)!', signal_data).groups()[0]
- try:
- del typing[nick]
- except KeyError:
- pass
- redraw(nick)
+ msg_hash = w.info_get_hashtable(
+ "irc_message_parse", {"message": signal_data } )
+ if msg_hash["nick"] in typing:
+ del typing[msg_hash["nick"]]
+ w.bar_item_update("bitlbee_typing_notice")
return w.WEECHAT_RC_OK
def typed_char(data, signal, signal_data):
@@ -98,41 +110,52 @@ def typed_char(data, signal, signal_data):
channel = w.buffer_get_string(buffer, 'localvar_channel')
buffer_type = w.buffer_get_string(buffer, 'localvar_type')
- if server != bitlbee_server_name or input_s.startswith("/"):
+ if server != w.config_get_plugin("server") or input_s.startswith("/"):
return w.WEECHAT_RC_OK
if buffer_type == "private":
- if input_s:
+ if len(input_s)==0:
+ send_typing(channel, 0) # Line sent or deleted -- no longer typing
+ else:
send_typing(channel, 1)
- elif channel == bitlbee_channel:
+ elif channel == w.config_get_plugin("channel"):
nick_completer = w.config_string("weechat.completion.nick_completer")
parts = input_s.split(":", 1)
if len(parts) > 1:
nick = parts[0]
send_typing(nick, 1)
-
return w.WEECHAT_RC_OK
def typing_disable_timer(data, remaining_calls):
nick, cookie = data.rsplit(":", 1)
cookie = int(cookie)
- if sending_typing[nick] == cookie:
+ if nick in sending_typing and sending_typing[nick]==cookie:
send_typing_ctcp(nick, 0)
- sending_typing[nick] = False
+ del sending_typing[nick]
return w.WEECHAT_RC_OK
+
def send_typing_ctcp(nick, level):
- buffer = w.buffer_search("irc", "%s.%s" % (bitlbee_server_name, bitlbee_channel))
+ if not channel_has_nick(w.config_get_plugin("server"),
+ w.config_get_plugin("channel"), nick):
+ return
+ buffer = w.buffer_search("irc", "%s.%s" %
+ (w.config_get_plugin("server"),
+ w.config_get_plugin("channel")) )
w.command(buffer, "/mute -all /ctcp %s TYPING %i" % (nick, level))
+
def send_typing(nick, level):
- if not channel_has_nick(bitlbee_server_name, bitlbee_channel, nick):
- return
- cookie = sending_typing.get(nick, 1) + 1
- if not sending_typing.get(nick, None):
- send_typing_ctcp(nick, level)
- sending_typing[nick] = cookie
- w.hook_timer(4000, 0, 1, "typing_disable_timer", "%s:%i" % (nick, cookie))
+ if level == 0 and nick in sending_typing:
+ send_typing_ctcp(nick, 0)
+ del sending_typing[nick]
+ elif level > 0 :
+ if nick not in sending_typing:
+ send_typing_ctcp(nick, level)
+ cookie = sending_typing.get(nick, 0) + 1
+ sending_typing[nick] = cookie
+ w.hook_timer( int(1000 * float(w.config_get_plugin('timeout'))), 0, 1,
+ "typing_disable_timer", "%s:%i" % (nick, cookie))
def typing_notice_item_cb(data, buffer, args):
@@ -147,11 +170,20 @@ def typing_notice_item_cb(data, buffer, args):
return ""
-if w.register(SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION, SCRIPT_LICENSE,
+# Main
+if __name__ == "__main__":
+ if w.register(SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION, SCRIPT_LICENSE,
SCRIPT_DESC, "", ""):
- w.hook_signal("input_text_changed", "typed_char", "")
- w.hook_signal(bitlbee_server_name + ",irc_in_quit", "stop_typing", "")
- w.hook_signal(bitlbee_server_name + ",irc_in_privmsg", "stop_typing", "")
- w.bar_item_new('bitlbee_typing_notice', 'typing_notice_item_cb', '')
- w.hook_modifier("irc_in_privmsg", "ctcp_cb", "")
+ if not w.config_get_plugin('channel'):
+ w.config_set_plugin('channel', "&bitlbee")
+ if not w.config_get_plugin('server'):
+ w.config_set_plugin('server', "localhost")
+ if not w.config_get_plugin('timeout'):
+ w.config_set_plugin('timeout', "4")
+
+ w.hook_signal("input_text_changed", "typed_char", "")
+ w.hook_signal(w.config_get_plugin("server")+",irc_in_quit", "stop_typing", "")
+ w.hook_signal(w.config_get_plugin("server")+",irc_in_privmsg", "stop_typing", "")
+ w.bar_item_new('bitlbee_typing_notice', 'typing_notice_item_cb', '')
+ w.hook_modifier("irc_in_privmsg", "ctcp_cb", "")