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: Wed, 2 Jun 2021 06:43:35 +0300 Message-ID: References: <87pmx8p9gn.fsf@logand.com> 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="9088"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/2.0.7+183 (3d24855) (2021-05-28) Cc: help-gnu-emacs To: Eduardo Ochs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 02 05:50:35 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 1loHtq-00028u-MJ for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 02 Jun 2021 05:50:34 +0200 Original-Received: from localhost ([::1]:48954 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1loHtp-0003AS-Jj for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 01 Jun 2021 23:50:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50636) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1loHrb-0006kn-IS for help-gnu-emacs@gnu.org; Tue, 01 Jun 2021 23:48:15 -0400 Original-Received: from stw1.rcdrun.com ([217.170.207.13]:55033) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1loHrZ-00063w-J1 for help-gnu-emacs@gnu.org; Tue, 01 Jun 2021 23:48:15 -0400 Original-Received: from localhost ([::ffff:197.157.0.35]) (AUTH: PLAIN admin, TLS: TLS1.3,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 00000000000AE2D9.0000000060B6FF5B.000044C3; Tue, 01 Jun 2021 20:47:38 -0700 Mail-Followup-To: Eduardo Ochs , 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: -3 X-Spam_score: -0.4 X-Spam_bar: / X-Spam_report: (-0.4 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_SORBS_WEB=1.5, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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:130486 Archived-At: * Eduardo Ochs [2021-06-02 03:56]: > On Tue, 1 Jun 2021 at 13:32, Jean Louis wrote: > > > > You can use org-protocol and this extension: > > https://support.mozilla.org/1/firefox/88.0/Linux/en-US/extensions-pb > > > Hi Jean Louis, > > I am quite slow at following textual instructions like these, and at > converting them to executable steps (accompanied by links to the > relevant documentation). You've probably noticed that the sandboxed > tutorials of eev are an experiment in writing instructions in another > way - in which the steps are very easy to execute, there are lots of > hyperlinks to documentation, to source code, and to tests that explain > the data structures and the behaviours of individual functions... and > they are an attempt to find other people who like that style, and who > would want to experiment with writing their own documentation in that > way, too. > > I'll try to follow your instructions in the weekend. I am guessing > that they will take me many hours, because I know very little about > databases and SQL, and because org-capture and org-protocol also seems > to be quite complex beasts. org-protocol is about sending information from outside of Emacs to Emacs, normally people capture things in Org files, but because you can use any function, you can make your own to capture things into eev hyperlinks. Using browser for org-protocol is one of possible methods, one could use various outside programs or methods. First thing to do is to customize the variable: `org-protocol-protocol-alist' ----- See more of its description with C-h v: org-protocol-protocol-alist is a variable defined in ‘org-protocol.el’. Its value is (("Hyperscope Store Hyperlink" :protocol "store-link" :function hyperscope-org-protocol-store-link) ("Hyperscope Capture From Hyperlink" :protocol "capture" :function hyperscope-org-protocol-capture-link :kill-client t)) Original value was nil You can customize this variable. Register custom handlers for org-protocol. Each element of this list must be of the form: (module-name :protocol protocol :function func :kill-client nil) --------- "store-link" is just to store the link in this case, it should be quick; it will store title and hyperlink that browser is visiting; "capture" is to store the marked text in the browser and the hyperlink and title together; For you it could be this way: ---- (("Eev Store Hyperlink from Browser" :protocol "store-link" :function eev-org-protocol-store-link) ("Eev Capture From Browser" :protocol "capture" :function eev-org-protocol-capture-link :kill-client t)) --- Your function for "store-link" would be like this: (defun eev-org-protocol-store-link (query) (let* ((splitparts (org-protocol-parse-parameters query t)) (uri (org-protocol-sanitize-uri (plist-get splitparts :url))) (title (plist-get splitparts :title)) (my-file "~/my-eev-captured-hyperlinks.eev")) (with-temp-file (insert-file-contents my-file) (insert "\n" title "\n" "(find-firefox \"" uri "\")\n\n")))) Now when you use that extension I recommended (for others I don't know), you would quickly store the hyperlink in the file in the eev style just by clicking in the browser at right place. When this starts working, let me know, then we move to capturing more text then just the title and link. But same concept is used with the difference that you would open the capturing file for editing maybe. It would not be just click and go, it would be click, and Emacs buffer is opened for you to edit the captured text, title and hyperlink. -- 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/