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: How users start programming in Emacs Lisp... Date: Mon, 31 May 2021 01:27:26 +0300 Message-ID: References: <87sg24ggxt.fsf@zoho.eu> 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="2443"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/2.0.7+183 (3d24855) (2021-05-28) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon May 31 00:33:24 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 1lnTzn-0000Qq-Jr for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 31 May 2021 00:33:23 +0200 Original-Received: from localhost ([::1]:50940 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lnTzl-0002pH-Lm for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 30 May 2021 18:33:21 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42584) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lnTz9-0002p8-Cj for help-gnu-emacs@gnu.org; Sun, 30 May 2021 18:32:43 -0400 Original-Received: from stw1.rcdrun.com ([217.170.207.13]:41297) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lnTz7-0007EJ-8P for help-gnu-emacs@gnu.org; Sun, 30 May 2021 18:32:43 -0400 Original-Received: from localhost ([::ffff:102.86.7.33]) (AUTH: PLAIN admin, TLS: TLS1.3,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 00000000000AE2D6.0000000060B41286.00007599; Sun, 30 May 2021 15:32:37 -0700 Mail-Followup-To: help-gnu-emacs@gnu.org Content-Disposition: inline In-Reply-To: <87sg24ggxt.fsf@zoho.eu> 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.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:130358 Archived-At: * Emanuel Berg via Users list for the GNU Emacs text editor [2021-05-30 22:31]: > What is this SQL thing I keep hear about BTW, you send it to/from > Emacs and get the data neatly or what does it do and what databases > do you use it with? I am sure you know it. SQL https://en.wikipedia.org/wiki/SQL > You keep track of all the weaponry you have at home? :) > > Well, actually, if I had enough I would now that I say it. > Bad example. > > Is relational algebra the base for SQL? You have got it right. Relational algebra - Wikipedia https://en.wikipedia.org/wiki/Relational_algebra Though I know nothing about it... but I should. SQL database spare programming time and effort. Compared to Org, the file `org-agenda.el' is full of features and handles all kinds of things. It is however slow and has several keys that handle its incapacities, such as sticky views or stuck projects. And it distorts the users' view of what agenda really is, as it is not just "agenda", rather a menu of search functions, for example it encompasses the function `org-search-view'. The function `org-agenda' should be renamed to something else, as the true agenda is just the `org-agenda-list', but users will not be warned. With the SQL, as when objects are in the database, the 415 kilobytes org-agenda.el or at least we can say several kilobytes of spaghetti Emacs Lisp code is replaced with the SQL query and report function: (defun hyperscope-hyperdocuments-agenda () (interactive) (rcd-speak "Hyperscope agenda") (let ((sql "SELECT DISTINCT timestamps_hlinks, timestamptypes_name, to_char(timestamps_timestamp::date, 'Day'), timestamps_timestamp::date, hyobjects_name, actionstatuses_name FROM hyobjects, timestamps, timestamptypes, actionstatuses WHERE hyobjects_id = timestamps_hlinks AND timestamptypes_id = timestamps_timestamptypes AND timestamptypes_inagenda IS TRUE AND actionstatuses_id = hyobjects_actionstatuses AND actionstatuses_actionstatustypes != 3 ORDER BY timestamps_timestamp DESC") (highlights (append '("ACTION") (hyperscope-timestamp-list t)))) (rcd-db-sql-report "Hyperscope Agenda" sql [("ID" 5 t) ("Type" 10 t) ("Day" 9 t) ("Timestamp" 10 t) ("Hyperdocument" 55) ("Action" 10 t)] "hyobjects" '("Timestamp" . t) 'hyperscope-hyperdocuments-agenda highlights))) Comparison ========== Try reading function `org-agenda' and `org-agenda-list' and compare to the SQL above. -- Jean Take action in Free Software Foundation campaigns: https://www.fsf.org/campaigns Sign an open letter in support of Richard M. Stallman https://stallmansupport.org/