From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Louis Newsgroups: gmane.emacs.help Subject: Re: Lookarounds and recursion in Emacs regexes Date: Sat, 4 Feb 2023 18:46:52 +0300 Message-ID: References: <87h6wbeti3.fsf@mbork.pl> <877cx7n5an.fsf@dataswamp.org> <878rhelfks.fsf@dataswamp.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2841"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/2.2.9+54 (af2080d) (2022-11-21) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Feb 04 16:47:43 2023 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 1pOKlS-0000TW-3f for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 04 Feb 2023 16:47:42 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pOKkv-00087G-Kd; Sat, 04 Feb 2023 10:47:09 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pOKku-00086p-DM for help-gnu-emacs@gnu.org; Sat, 04 Feb 2023 10:47:08 -0500 Original-Received: from stw1.rcdrun.com ([217.170.207.13]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pOKkr-0003TO-Pp for help-gnu-emacs@gnu.org; Sat, 04 Feb 2023 10:47:08 -0500 Original-Received: from localhost ([::ffff:197.239.9.104]) (AUTH: PLAIN admin, TLS: TLS1.3,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 0000000000055D9C.0000000063DE7DFC.00001C38; Sat, 04 Feb 2023 08:47:07 -0700 Mail-Followup-To: help-gnu-emacs@gnu.org Content-Disposition: inline In-Reply-To: <878rhelfks.fsf@dataswamp.org> Received-SPF: pass client-ip=217.170.207.13; envelope-from=bugs@gnu.support; helo=stw1.rcdrun.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-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.29 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-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:142599 Archived-At: * Emanuel Berg [2023-02-04 17:54]: > > Although somewhat proficient, I never learnt to love Python. > > People don't love Python like they do Lisp, but no doubt it > has it's good sides - development speed not the least. Do you want to say that development speed in Lisp is slower than in Python? I think that development speed does not depend too much on the language. One important issue for speed is functional programming, making one function after the other. Python has it, Lisp has it. But different paradigms are possible. So when I program with small functions each doing something, then you start doing higher level functions, and after some work done, it becomes really speedy to make what you want. Download the book of Paul Graham - On Lisp: http://www.paulgraham.com/onlisptext.html Ordering things in libraries, preparing functions in such way to be useful to programmer, and having one's own utilities library, all that contributes to really speedy programming. 69727 entries I have recently imported from Gutenberg free library, the index of all the books. Now I can speedily search on my computer for any works. Let us say something about "Sweden", I get 119 results. Or something like: The Wanderings of Persiles and Sigismunda: A Northern Story https://gutenberg.org/ebooks/61561 And I can quickly, within a second produce such hyperlinks, or just press a key and come to the web page of that book to download it, or to read it straight. Few functions below are re-using previously made functions, and multiple Emacs libraries. Application usage can be seen here: https://gnu.support/images/2023/02/2023-02-04/2023-02-04-16:41:08.ogv And it is made on top of previous functions, by using these here below: (defun rcd-db-gutenberg-search (&optional prefix query) (interactive "p") (let* ((query (or query (rcd-region-string) (rcd-ask-get "Query by name: "))) (logic (cond (current-prefix-arg "OR") (t "AND"))) (title (rcd-sql-search-snippet-for-and-column "gutenberg_title" query nil logic)) (authors (rcd-sql-search-snippet-for-and-column "gutenberg_authors" query nil logic)) (subjects (rcd-sql-search-snippet-for-and-column "gutenberg_subjects" query nil logic)) (sql (format "SELECT gutenberg_id, gutenberg_title FROM gutenberg WHERE %s OR %s OR %s" title authors subjects)) (title (format "Gutenberg entries for `%s'" (string-join (split-string query (concat " " logic " ")))))) (rcd-db-sql-report title sql [("ID" 6 t) ("Name" 50 t)] "gutenberg" nil (lambda () (interactive) (rcd-db-gutenberg-search prefix query))))) (defun rcd-db-gutenberg-browse-url-1 (id) (format "https://gutenberg.org/ebooks/%d" id)) (defun rcd-db-gutenberg-read-html-images-1 (id) (format "https://gutenberg.org/ebooks/%d.html.images" id)) (defun rcd-db-gutenberg-browse-url (&optional id) "Browse URL for Gutenberg entry." (interactive nil rcd-db-list-mode) (when-tabulated-id "gutenberg" (let ((url (rcd-db-gutenberg-browse-url-1 id))) (browse-url url)))) (defun rcd-db-gutenberg-read-html-images (&optional id) "Read HTML with images for Gutenberg entry." (interactive nil rcd-db-list-mode) (when-tabulated-id "gutenberg" (let ((url (rcd-db-gutenberg-read-html-images-1 id))) (browse-url url)))) I have no idea of Python, but I am sure that same can be done with Python in speedy time provided programmer re-uses existing libraries. Familiarity is what makes "speed" as well, user familiar with programming language will be speedy as compared to one not as familiar. -- Jean Take action in Free Software Foundation campaigns: https://www.fsf.org/campaigns In support of Richard M. Stallman https://stallmansupport.org/