From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Emanuel Berg via Users list for the GNU Emacs text editor Newsgroups: gmane.emacs.help Subject: trekking, compute sum of weight of items, Edmund Hillary and Tenzing Norgay Date: Wed, 25 Mar 2020 02:08:20 +0100 Message-ID: <87ftdx2qd7.fsf@ebih.ebihd> Reply-To: Emanuel Berg Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="109287"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) To: help-gnu-emacs@gnu.org Cancel-Lock: sha1:RLXE1FZBlQD7ED8NILpWAI/Bs0M= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Mar 25 02:08:48 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jGuXH-000SI4-8Y for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 25 Mar 2020 02:08:47 +0100 Original-Received: from localhost ([::1]:57212 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jGuXG-00089F-BA for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 24 Mar 2020 21:08:46 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:32841) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jGuWz-000898-4g for help-gnu-emacs@gnu.org; Tue, 24 Mar 2020 21:08:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jGuWx-0004wF-Vo for help-gnu-emacs@gnu.org; Tue, 24 Mar 2020 21:08:29 -0400 Original-Received: from ciao.gmane.io ([159.69.161.202]:53238) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jGuWx-0004vR-Pz for help-gnu-emacs@gnu.org; Tue, 24 Mar 2020 21:08:27 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1jGuWw-000Rvc-3U for help-gnu-emacs@gnu.org; Wed, 25 Mar 2020 02:08:26 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: help-gnu-emacs@gnu.org Mail-Copies-To: never X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 159.69.161.202 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:122649 Archived-At: I have now compiled a list of 18 items, and wrote some Elisp to sum the weight, it is already at 7.4 kg. I think 10 kg is some sort of practical, physical, and/or psychological maximum PS. when Edmund Hillary made the 8335-8500 meter climb on his way to the top of Mt. Everest, together with Tenzing Norgay in 1953, they each carried 23-28 kg. it was -27C and the inclination 30-45 degrees I yank the file here ... Elisp last! The problem with `digits-sum' is that you can't use digits anywhere else, that's why I put the sum converted to Roman Numerals, otherwise, the next time you do the count, the sum will be included as well! (Another way to do this, is to include a unit, grams or g in this case, without a whitespace - some people like to do that anyway (exclude the whitespace), so why not? e.g. 8000mAh and 7383g.) anyway: comb ? see "even more" comic book 580 drybag 305 flashlight (3AAA) 73 flashlight (USB) 55 knife 90 piece of cloth (big) 100 piece of cloth (small) 60 powerbank 8000mAh 245 science book 411 skin lotion ? see "even more" sleeping bag 1215 sleeping pad 880 spoon/fork ? see "even more" sticky tape 90 tent 2515 Trangia 619 water bottle 115 even more 30 --------------------- MMMMMMM CCC L XXX III (defun digits-sum () (interactive) (save-excursion (goto-char (point-min)) (let ((sum 0)) (while (forward-word) (let ((number (number-at-point))) (when number (cl-incf sum number) ))) (message "%s" sum) ))) (defalias 'd #'digits-sum) ---------------------------------------------------------------------- this file: https://dataswamp.org/~incal/TENT -- underground experts united http://user.it.uu.se/~embe8573 https://dataswamp.org/~incal