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: Sun, 30 May 2021 10:05:01 +0300 Message-ID: References: <878s3xpab1.fsf@zoho.eu> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28959"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/2.0.7+183 (3d24855) (2021-05-28) Cc: Christopher Dimech , help-gnu-emacs To: Eduardo Ochs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun May 30 09:08: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 1lnFYb-0007M9-Pe for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 30 May 2021 09:08:21 +0200 Original-Received: from localhost ([::1]:58618 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lnFYZ-0007WG-Ua for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 30 May 2021 03:08:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60712) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lnFY0-0007W4-Lv for help-gnu-emacs@gnu.org; Sun, 30 May 2021 03:07:44 -0400 Original-Received: from stw1.rcdrun.com ([217.170.207.13]:41243) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lnFXy-0000vY-8F for help-gnu-emacs@gnu.org; Sun, 30 May 2021 03:07:44 -0400 Original-Received: from localhost ([::ffff:41.210.145.96]) (AUTH: PLAIN admin, TLS: TLS1.3,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 00000000000ADF02.0000000060B339BB.00001DB4; Sun, 30 May 2021 00:07:38 -0700 Mail-Followup-To: Eduardo Ochs , Christopher Dimech , help-gnu-emacs Content-Disposition: inline In-Reply-To: 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:130316 Archived-At: * Eduardo Ochs [2021-05-30 07:33]: > Hi, just a curiosity... > > why do you prefer to use scratch buffers for elisp code instead of > using (semi-scratch?) files in which we record all our experiments? I use *scratch* buffer long time. It is for things that need not be saved. There is `persistent-scratch' library loaded that does save it over the sessions. However, whatever I write there is not of importance if it is lost. And temporary buffers I use because I don't want to save such. That is where I evaluate and test things that don't belong to any file neither should be saved. Bufffer could be saved though if necessary. > In the tutorials of eev I try to convince the new users to treat their > notes and scratch code as "field notes", and save everything they > can... one of my arguments is this: Then it is not temporary any more, not scratch any more. Not something being free to forget it and drop it. Temporary buffer is just a more static version of IELM, or more expanded version of M-: so things in M-: evaluation I also don't save; with the difference that scratch buffer is separated from other buffers, it will not work with buffer variables, and in my case I never need such. Example text in Emacs Lisp scratch that still hangs there is the stuff with Fortran discussion where some testing of outline-minor-mode was required: ``` outline-regexp ⇒ "[* ]+" (setq outline-regexp "[! ]+") outline-heading-alist ⇒ nil (setq outline-heading-alist '(("!" . 1) ("!!" . 2) ("!!!" . 3))) ! ! Something Program nOK !!! Somethingp ! Something More Something ``` that stuff I would not save. The point learned is that there are variables to be set for outline-minor-mode for it to make it work. I don't need to know which variables, I will find them in future by inspecting {C-h v outline TAB} list of variables or by {M-x customize-group RET outlines RET} > Learning eev is also like learning to use paper notebooks. It is > much easier to understand the notes and ideas what we wrote > ourselves in our notebooks than to understand what other people > wrote in their notebooks... That is right. I like any guidances related to notes, you remember that I switched from Org and file system based editing to mostly database backed column's value editing so it is always relevant to me. `eev' can be used there I guess. > when we go back to what _we_ wrote we are able to reconnect with > what we were thinking, even when our notes are quite terse because > we did not write down all details - and we can't do that with other > people's notes. That is right. What is interesting in my system is that I have: - dates that are relevant to creation of a node (which can be of any type); - dates relevant to modification of a node; - which user in collaboration created it, or modified it; - any access and additional actions on a single node/document are recorded, for example change of a name from Johnny to John would be recorded by its date/time and by user name; - any activation of a node/document, like opening of a hyperlink is recorded too, automatically; if user did read the note, or modified the node/document, or opened up the document is recorded; - and so on; that all works without disturbance for user; Then the whol track or history can be played back, it is possible to find out: - which people or participants where assigned to tasks or documents at specific times, dates in past; - which stuff was researched back in time; - related to which groups, companies, organizations, people, projects, etc. Those are not main feautures, just side effects. Some of such features are within these Hyperscope ring functions: ;;;; ↝ HYPERSCOPE RING FUNCTIONS Here is the variable initialization defined by fetching information from a database: (defvar hyperscope-ring-current (rcd-sql-first "SELECT hyperscopering_id FROM hyperscopering ORDER BY hyperscopering_id DESC LIMIT 1" hs-db) "Hyperscope's current ring item.") The "ring" remains in the database and can be stored in a variable, but it is persistent along sessions. (defvar hyperscope-ring (rcd-sql-list "SELECT hyperscopering_hyperdocument FROM hyperscopering ORDER BY hyperscopering_id DESC" hs-db) "Hyperscope ring uses RCD utilities function `next-circular-list-item'") However it is not yet upgraded for multiple users, as then I just need to add the columns like `usercreated' and `usermodified' so that ring becomes collaborative: hyperscopering_id | integer | hyperscopering_datecreated | timestamp without time zone | hyperscopering_datemodified | timestamp without time zone | hyperscopering_usercreated | text | hyperscopering_usermodified | text | hyperscopering_hyperdocument | integer | hyperscopering_description | text | Then instead of this function: (defvar hyperscope-ring-current (rcd-sql-first "SELECT hyperscopering_id FROM hyperscopering WHERE ORDER BY hyperscopering_id DESC LIMIT 1" hs-db) "Hyperscope's current ring item.") I would need to use this one: (defvar hyperscope-ring-current (rcd-sql-first "SELECT hyperscopering_id FROM hyperscopering WHERE hyperscopering_usercreated = current_user ORDER BY hyperscopering_id DESC LIMIT 1" hs-db) "Hyperscope's current ring item.") As that one would choose only those items related to current user of the database. Thus multiple users can contribute documents where all things get tracked. Choosing the last item accessed or activated is easy: (defun hyperscope-ring-last () (rcd-sql-first "SELECT hyperscopering_hyperdocument FROM hyperscopering WHERE hyperscopering_usercreated = current_user ORDER BY hyperscopering_id DESC LIMIT 1" hs-db)) Updating new items is just calling the function, while ignoring duplicates (who knows maybe duplicates are also important): (defun hyperscope-ring (id) "Setup Hyperscope ring" (let ((last (hyperscope-ring-last))) (cond ((null last) (hyperscope-ring-update id)) ((= last id) (ignore)) (t (hyperscope-ring-update id))))) And here is how somebody is recording everything within Memacs: Memacs https://github.com/novoid/Memacs > (From:) > http://angg.twu.net/eev-intros/find-here-links-intro.html > (find-here-links-intro) > > Grepping and `C-s'-ing our own notes is easy, and most of the time we > can read - and reuse - what we wrote. Often I am re-using notes, or duplicating it to have a new version, single click, and then editing new version. Unless those are some disposable notes. Then again I have a `hyperscope-capture-buffer' function where whatever I write in other buffer is captured in the dynamic knowledge repository. Then such function leaves a link like this one, as if I placed the "stamp" in the email, I can quicker find some important email captured as a note: (hyperscope 38116) Description of such note is: * Captured Buffer Text Buffer name: mutt-protected-1001-4182-5758066564440477891 Buffer file: /home/data1/protected/tmp/mutt-protected-1001-4182-5758066564440477891 Time captured: 2021-05-30-09:34:13 Why would anybody "capture" one's own buffer? Well, why not, it can be single key, some text that can be re-used for later or re-ordered for articles. The difference is that "grep" need not be used but full text search and results for searching "eev" appear almost instantly. A node can be related to Eduardo Ochs and later the notes related to single person can be listed. A classic file system allows user tags and group tags, but nothing about relations to other people, groups, organizations, various activities or businesses. > By the way (for Christopher): eev has a hands-on elisp tutorial. It's > here: > > http://angg.twu.net/eev-intros/find-elisp-intro.html > (find-elisp-intro) Hyperlink generation functions are useful. I don't know if I can use such to enter URL into the database for example, you tell me. You have PDF link generation functions. But is it generic that I could connect it to something else? For example to invoke a key, capture the PDF URL or URL or file system location (also link) and return it as link which can be then entered in the database. Or is it hard coded? And finally why not integrate the database in your system, it would help greatly. Install this module: emacs-libpq @ Github https://github.com/anse1/emacs-libpq Then install this package: RCD Database Basics https://hyperscope.link/3/7/4/9/3/RCD-Database-Basics-37493.html Then use M-x cf-sql-table to design your own first SQL table. Integrate eev with permanent database backed information. -- 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/