From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eduardo Ochs Newsgroups: gmane.emacs.help Subject: Re: How users start programming in Emacs Lisp... Date: Sun, 30 May 2021 04:51:04 -0300 Message-ID: References: <878s3xpab1.fsf@zoho.eu> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21966"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs , Jean Louis Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun May 30 09:52:01 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 1lnGEq-0005Rn-2Z for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 30 May 2021 09:52:00 +0200 Original-Received: from localhost ([::1]:39612 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lnGEo-0007zt-CP for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 30 May 2021 03:51:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36328) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lnGEC-0007zg-JX for help-gnu-emacs@gnu.org; Sun, 30 May 2021 03:51:20 -0400 Original-Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]:47008) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lnGE9-0002Av-Je for help-gnu-emacs@gnu.org; Sun, 30 May 2021 03:51:20 -0400 Original-Received: by mail-pg1-x52a.google.com with SMTP id n12so2743802pgs.13 for ; Sun, 30 May 2021 00:51:17 -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 :content-transfer-encoding; bh=NnUMPpSOL6+12gXxVBUha0Bne1WCONEiloHGGKRK35I=; b=G7x87TE4nAY7UUjhhwtgnqytX5+oZpwul+vNy6HbW29Vf1WT7pDsjfeELOnYtw/02l Ch0rFEQM3JOYJ+Ru/Qk+NfEAm63r0rWkRKIA0M732Wm4bOkLMLh/Xk3hprmLLQ7gH5j5 9liykf1dRbjTVe56rW3+5yIrA1/gzZzQFqWIrva3wI5m8RdJHPWJqvAQ5zmbVFqxat4p Fn0GHdSS3GjC822SDWhKHmacuC8DoavGJtBcChPPoF+5NUjqFmCcXhdVYJhHSgdQ0w1M zhc8U5IdMiUN/p9faLYeIZ5jMpHek2+bB2qXCj0IEYI9/QfwS1aH9tv9l+UkVnwBOVnZ Pwgw== 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:content-transfer-encoding; bh=NnUMPpSOL6+12gXxVBUha0Bne1WCONEiloHGGKRK35I=; b=ZqYhR9UxZU1J9nq0prsqZFEUkB1DxaR0Csd/MiMA9+jAcUMRpTiYtDxQFWIiSPSksP JWGfHMQa6kz/N0bGX41MtY6TXewpeBogg/rBaCMxm8MJbjEsUU2RdkEeOYlas5ZEyBPQ O3bcqCybMxU5cEq56n/WNLwn0khjjrSYcVUat/zx0PLiLSKThw+3zB7S50Q/3ifdYRJj 5Ywbdx16GEoEn+w+MDWxyUEgpYZ+igU4PQDM/DA7woRXL19sCzTkSW7Oh2UuZevno6Gy df80XiwMMZkK7AUebNDE2qwEYxJxacy3+CeUXLLgVJu009bAufNjlsZ8t5lbtvOHKigy Fhog== X-Gm-Message-State: AOAM5317AyJS9YInlZFIrITlRwzNN7JXKYOVYxL9h2tq1p95pWhZtWrU PsaJUhKp+liRnX+ZyngKTZ+qgfaqoGgaNcw8XJjuUodEXtc= X-Google-Smtp-Source: ABdhPJzvBpDBvQC+YWNUU6g+86tFArOpIDOHFpFJiOvP9H/CwYd1w+uSSmEv7kXlFPE82fXvSO1B8ab3DG/9qHx4V8k= X-Received: by 2002:a63:d213:: with SMTP id a19mr17371078pgg.28.1622361075585; Sun, 30 May 2021 00:51:15 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::52a; envelope-from=eduardoochs@gmail.com; helo=mail-pg1-x52a.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:130317 Archived-At: Hi Jean Louis, I did this, sudo apt-get install libpq-dev postgresql rm -Rfv ~/usrc/emacs-libpq/ cd ~/usrc/ git clone https://github.com/anse1/emacs-libpq cd ~/usrc/emacs-libpq/ cd ~/usrc/emacs-libpq/ make clean make \ EMACS=3D$HOME/bigsrc/emacs28/src/emacs \ EMACS_INCLUDE_DIR=3D$HOME/bigsrc/emacs28/src/ \ all check \ 2>&1 | tee om and "make check" failed with several errors like this: Test pq-async-notify-test condition: (error "FATAL: role \"edrx\" does not exist\12") What should I do? Cheers, E. http://angg.twu.net/#eev On Sun, 30 May 2021 at 04:07, Jean Louis wrote: > > * 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 requ= ired: > > ``` > outline-regexp =E2=87=92 "[* ]+" > (setq outline-regexp "[! ]+") > outline-heading-alist =E2=87=92 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: > > ;;;; =E2=86=9D 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 h= yperscopering_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 ORDE= R 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 hype= rscopering_usercreated =3D current_user ORDER BY hyperscopering_id DESC LIM= IT 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 =3D 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)) > ((=3D 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-575806656= 4440477891 > 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/