From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Hongyi Zhao Newsgroups: gmane.emacs.help Subject: Re: [External] : Find the longest word in the word list file. Date: Wed, 11 Aug 2021 16:58:32 +0800 Message-ID: References: <20210811064643.GB21436@tuxteam.de> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13604"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs To: tomas@tuxteam.de Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Aug 11 10:59:21 2021 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 1mDk53-0003LK-HI for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 11 Aug 2021 10:59:21 +0200 Original-Received: from localhost ([::1]:55388 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mDk51-0004P0-HY for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 11 Aug 2021 04:59:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40224) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mDk4V-0004On-2l for help-gnu-emacs@gnu.org; Wed, 11 Aug 2021 04:58:47 -0400 Original-Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]:38408) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mDk4T-00031N-Oq for help-gnu-emacs@gnu.org; Wed, 11 Aug 2021 04:58:46 -0400 Original-Received: by mail-lf1-x134.google.com with SMTP id x27so4190767lfu.5 for ; Wed, 11 Aug 2021 01:58:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=2ciYycVwEuWcHO5HjJpGMtwHz+Yn6tIA+uDTsUQctIk=; b=DSthU4Rd2lY5PwWoQR2pTbv4ybYs8lSHgo5ybNljxEnbnUcX/9CiiRG1l8FXCPjMxf UbTk9u4L44IA7JMgnjK3N9RCgt/r+790YYLYkzCpALa2C+ACkRRP+SJgTupGg8K9B3nM pPixXVukVicOVwWNBYqdyU3i9MNYxkc7/7EyWZs1GEAZNAwfPor/6QfDqzqLvmGZQECM DUivWg4cVfoON9AuLQSY169GIcJr2OXi2/jZCys0x+H6pfBYDAiidkyMthRbAr1MGwE+ v7RlSyM8mfQXcsDQRCrttfmGOMRaY3RLSiR7fiyn3lrumnIhl7Eg/SlPaT92DXcKS1Yr hegg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=2ciYycVwEuWcHO5HjJpGMtwHz+Yn6tIA+uDTsUQctIk=; b=uBU8u2ZWl2gwKbPhWxTomVLw+a3nP95PcnH7wN3SGK5XxR740GEskuzdrxYSR1aI8W gDuiF8aOg4fCoEeqTqLJAXOVEv+s85e8PI+Z+f6c0QlMB5PvXHThbjMrLLvRJ3rGQ18f 6V4mW8sWkG4ipV2wjjdgXZ5krCAa2F4l6uzuMlcjHaQGAn4yfBuIN0iqLwjPES/9A13f U+iXU2bGUo1CQpPgElq+Pi1hJQzJbnqypDW8prH+MzYqQrp3a2wnGIFq31GE+c9g5o7+ ilC0kWJD/MvDo32V7NmUdKTrgwVuwHxps0Rjq4HmnFcPmK/F5ZEadu5BSWZluk9Xh4jS sADg== X-Gm-Message-State: AOAM531dpEiqPRdgkXvSr3VOlZYeknXRhw/5h5GHAhrBrJKtMW74vczh 2G2Y5TsgwM+QRiWHo1xOVXcn3ZYxfKayzlsuj1r6Uh8eHi4GLih35qs= X-Google-Smtp-Source: ABdhPJy8RYzW7nJU4ghBCLYgU43R1KwiHsCJx2ZFyHqTD+jiiQBj9lQ+Qq1BuqJrzEMl84rR9z8QdLJ1hDKpdbD1C9U= X-Received: by 2002:ac2:46fb:: with SMTP id q27mr6958899lfo.466.1628672324224; Wed, 11 Aug 2021 01:58:44 -0700 (PDT) In-Reply-To: <20210811064643.GB21436@tuxteam.de> Received-SPF: pass client-ip=2a00:1450:4864:20::134; envelope-from=hongyi.zhao@gmail.com; helo=mail-lf1-x134.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:132447 Archived-At: On Wed, Aug 11, 2021 at 2:47 PM wrote: > > On Wed, Aug 11, 2021 at 11:00:53AM +0800, Hongyi Zhao wrote: > > On Wed, Aug 11, 2021 at 9:51 AM Drew Adams wrote: > > [...] > > > Thank you for your solution, but it seems so complicated to me. > > You prefer something to hack on yourself ;-) > > OK, here's one attempt. But be careful. I just tested it > twice, so there may be two bugs left :-) > > (defun goto-longest-line () > (let ((maxpos) > (maxlen 0)) > (goto-char (point-min)) > (while > (let ((len (- (line-end-position) > (line-beginning-position)))) > (when (> len maxlen) > (setq maxlen len > maxpos (point))) > (= (forward-line) 0))) > (goto-char maxpos))) Wonderful. How to test it with the word list file opened? I try to put the above code on the minibuffer of the opened word list file's frame, and then hit `M-:', but it doesn't work. Best, Hongyi