emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bring up a screen giving option to open a series of orgmode files


From: Jean Louis
Subject: Re: Bring up a screen giving option to open a series of orgmode files
Date: Sat, 28 Nov 2020 20:59:34 +0300
User-agent: Mutt/2.0 (3d08634) (2020-11-07)

* Maxim Nikulin <manikulin@gmail.com> [2020-11-28 18:52]:
  :PROPERTIES:
  :CREATED:  [2020-11-28 Sat 19:55]
  :ID:       60f81bc3-5122-44d6-87b6-d8554fc6a6b4
  :END:
> 2020-11-27 Jean Louis wrote:
> > 
> > Now we have `evince' PDF viewer that can open PDF I think by page
> > number and by query but it cannot do the equivalent
> > `evince-store-link' so user has to think about the file name and page
> > number and so on.
> 
> However xpdf (evince predecessor in respect to PDF engine) allows to
> define custom bindings in config file, so store link could be
> implemented. It seems, the feature was lost on the way to
> user-friendly interface. Unsure but maybe store link could be
> configured for browser built-in PDF viewers.

Myself I was not aware of history of hyperlinks but when we look back
to Memex and Engelbart, it becomes clear that we wasted more than half
century without implementing what is useful.

Any viewer should have option to quickly construct a hyperlink and
store it somewhere with its annotation and other meta data so that
such can be reused by any other program. And viewer should have option
to directly access such reference from command line or by invoking it
from other program. Both the viewer author or party producing that
software and other software that hyperlinks by using some program are
benefiting from it.

Maybe evince and various PDF viewers and their maintainers can be
convinced to include those very simple functions. PDF often have meta
data usable for referencing, and if such does not exist then specific
page ID, query or match can be used. I will ask Evince maintainers and
other PDF viewer authors then mpv, mplayer and VLC as well.

As if I can open video at specific time to be played then why I cannot
obtain the hyperlink by watching video. Sounds not logical to me.

Hyperlinks captured should not be related to Org. They should have
their own URIs and Org should know how to interpret its URIs.

List of URI Schemes
https://en.wikipedia.org/wiki/List_of_URI_schemes

I know that Org is using something as file:something::12 but not sure
if it really supports for example PDF for page number, query or
match. It should.

It should support video by its specific start time to be played or
sound to be played all or by specific start time or time period.

In general many of those URI schemes should be built-in into Org. Most
of them are already built-in into Emacs but their handlers are
not. The development version of Emacs has now browse-url-handlers and
that allows for any URI to be opened within Emacs. Org mode is not
necessary, only goto-browse-mode.

> > We have browsers that each of them think for themselves. Each can
> > store bookmarks but hardly provide such to external programs.
> 
> I agree that bookmarks as they implemented in browser is something poor.
> Forget external programs in the context of modern browsers (either you like
> it or not). De facto, extensions should communicate with HTTP servers, to
> protect users, access to filesystem is not allowed any more.

Alright, only if it would be that secure, then this type of advise
would not be there:

How to Run a More Secure Browser
https://www.dragonflybsd.org/docs/handbook/RunSecureBrowser/

I do remember before 15 years how I could offer a website to be
accessed by user and I could choose either to fully block and freeze
user's computer or to access file system of the user. Those are
exploits, and if those exploits still exist or not we cannot know
until we know.  What is known by experience is that browsers are not
quite secure.

Example like this https://en.wikipedia.org/wiki/JailbreakMe may be
today in other forms activated on people's computers.

> However some API to manipulate bookmarks exists, do not know if it
> is really useful:
> https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/bookmarks

I have ceased using bookmarks in browsers. Org capture mechanism
allows bookmarking in a central system that may be managed by Emacs,
but as it is database it may be managed by simple command line tool
fzf and SQL or by awk and sed to choose a node or again Emacs on
command line, or Perl accessing the remote database or any other
language.

When things are stored in the database access can be anyhow. I am also
thinking to devise way to store activation methods in the database
itself and not in the program accessing database.

> > Almost none browser can store specific paragraph based
> bookmark. They > rely mostly on anchors as finely specified
> greed. Bookmarks could be > by HTML page number or query or
> paragraph.  In principle, any paragraph could be addressed using
> XPath
> https://developer.mozilla.org/en-US/docs/Web/XPath/Introduction_to_using_XPath_in_JavaScript
> but it is extremely fragile since link will be likely invalid after
> web site redesign or modification of the text.

I am keeping references, thank you. It looks like low level API. It
does not matter for modifications as some documents are pretty static
and their revisions could have different URLs. Example is
documentation, books, instructions. In my personal case it can be
mineral processing information.

>From the above link on XPath I have not figured out yet how to
generate a hyperlink to specific paragraph. I may spend days until I
figure it out.

> There is no interface for end users but web developers use it for UI
> tests if there is no more reliable option.  There was text search
> addressing initiative "Scroll to text"
> https://github.com/WICG/scroll-to-text-fragment/ The problem that
> URLs have no room for such extension points and some web sites abuse
> #anchors to determine what content should be shown, so addressing of
> particular element is not possible at all.

This system solves the problem and there is the underlying Javascript
library.

Hypothes.is Annotate the web, with anyone, anywhere.
https://web.hypothes.is/

I wish to solve the problem in providing annotiation in little bit
different way:

- hyperlink is activated from Org file or any other file or system

- on my side the hyperdocument is created and its hyperlink points to
  the unique ID while unique ID points to hyperdocument in question
  and also decides how such should be displayed, activated, etc.

  At this point I would like to have something like XPath, but that
  also means I have to invoke Javascript which then renders many
  browsers not usable. In general system like I envision should work
  equally well on the any browser, like Emacs eww or Lynx or just any
  browser.

  I am also not implementing complex things, no complex templates or
  similar.

- if something has to be annotated then hyperscope dynamic knowledge
  repository would invoke fetching, annotating, marking, generating
  and uploading the HTML page that would then show:

  - the title
    
  - annotations
    
  - text being annotated as published from database
    
  - original text below annotations as published originally but with
    stripped HTML, Javascript and other cruft.

  - hyperlink to original text

  - maybe, if browser allows it, frame of the original WWW page

  - web based password protection if necessary

Annotations and such hyperdocument with annotations of a specific
paragraph on other page, could be as well invoked from Org file
directly.

** Heading could have property below:
   ANNOTATION: [[annotate:URL:query-begin:query-end:][title of annotation]]

Annotation here could be long or paragraph or multiple paragraphs.

Now when user clicks on `annotate' hyperlink, Emacs Lisp program could
then:

- verify on local file system if the HTML file is supposed to exist

- obtain heading title

- obtain title of annotation

- fetch the URL

- strip it from HTML and Javascript, etc

- find query-begin and query-end and markup the paragraph with some
  background color

- insert the heading of HTML file, annotations, the full original
  text, upload the file and generate the URL

  Alternative is not to do anything with original hyperlink but just
  to annotate such on a separate WWW page.

- URL would be static and never changing according to:
  https://www.w3.org/Provider/Style/URI

- URL would point to unique ID like example.com/1/2/3/324

- then send the URL to the person to which one is referencing. As
  annotations in local file for oneself is already there. If this all
  sounds complicated in reality is just some seconds of computer
  generating such HTML.

Any similar system is definitely necessary if one wish to share notes
or text with people online on the fly. It could be used for static
full website generation, but it is rather meant for sharing single
documents or annotations.

In general Org needs: "Share a note system"

The function below I am using for some years already to send an Org
heading to other person. It uses other functions such as automatic
choice of a person and gives audible announcement to people around the
staff member. Audible announcement of some computing functions helps
in coordination with present people, it is automated sharing by using
audio.

(defun rcd/org-send-assigned-task ()
  "Sends assigned task to designated individual as Org"
  (interactive)
  (let* ((member-data (rcd-org-extract-assigned-member-email-data))
         (id (if member-data (first member-data) nil))
         (signature (if (equal (type-of (symbol-value (fifth member-data))) 
'cons)
                        (third (symbol-value (fifth member-data))) ""))
         (file (rcd-org-subtree-to-file signature))
         (subject (rcd/org-find-headline))
         (esubject (escape-% subject))
         (ask (unless id (y-or-n-p "No assignment found. Do you want to send it 
by email?")))
         (name (if id (third member-data)))
         ;; (name (if ask (read-from-minibuffer "Name:") name))
         (voice (format "The task '%s' is being sent to '%s'" subject name))
         (email (if id (if (equal (type-of (fourth member-data)) 'cons)
                           (car (fourth member-data))
                         (fourth member-data))))
         (email (if ask (cf-search-email (read-from-minibuffer "Search for 
email: ")) email))
         (really (y-or-n-p (format "Do you really want to send it to: %s?" (if 
ask email name)))))
    (if (and really (or id ask))
      (if (string-match "@" email)
        (progn
          ;; (message (escape-% subject))
          (speak voice)
          (mutt-send-file name email esubject file))
        (message "No email specified"))
      (message "Aborted sending."))))

the above function that automatically searches for valid email
addresses among several, for person to which task is assigned, and
that chooses right signature amont several for different
organizations, may be simplified to this:

(defun my-org-send-heading ()
  "Sends heading by email"
  (interactive)
  (let* ((heading (org-with-wide-buffer
                   (org-back-to-heading t)
                   (let ((case-fold-search nil))
                     (when (looking-at org-complex-heading-regexp)
                       (match-string-no-properties 4)))))
         (subtree (org-copy-subtree)))
    (compose-mail-other-window nil heading)
    (rfc822-goto-eoh)
    (forward-line 1)
    (insert (pop kill-ring))
    (mail-position-on-field "to")))

then by invoking M-x my-org-send-heading user can quickly open up the
Emacs built-in sendmail interface with prepared message. Then email
address may be selected and email sent.

This type of integrations with people I miss in Org. My surprise was
big when I realized that Org is there with features to manage tasks
but does not offer feature to "send the task". User is supposed to
compose the email, kill and yank, copy and paste. All those small
things mean that more time and effort is spent.

Tasks or notes should be quickly shareable or be capable of being sent
to different objects and places:

- to speak loud by computer the heading and text under
  heading. Instead of people reading, people may also listen if they
  are close to loudspeakers. I am using `festival' as it has built-in
  Emacs package that allows pretty nice speech. {M-x org-heading-speak-it}

- to be shared by email easily and that with the favorite email
  client. Not just Emacs. 

- to be sent by SMS by using kdeconnect, gnokii or twilio or other
  systems by using something like {M-x org-heading-to-sms} where
  subsequently proper contact would be chosen.

- to be sent by XMPP messenger or other types of messengers. User
  should be able to simply do {M-x org-heading-to-xmpp} where
  subsequent group or target conversant would be chosen.

- to be posted on Fediverss social networking or other social networks
  without user pressing many keys. If the Fediverse or social account
  has been defined already, then one command like
  {M-x org-heading-pleroma} or {M-x org-heading-mastodon} should be
  enough for heading to be posted and formatted appropriately.

- to be prepared quickly as PDF and sent to the printer. If task is
  assigned to person, why then operator of Org file need to: open Org
  export, decide to narrow export to the selected heading, choose the
  PDF, open PDF, print PDF. Those are many repetitive actions. Instead
  user should be able to invoke a command: M-x org-print-heading and
  finished. The printer prints it. Or fax faxes it.

Jean

  




reply via email to

[Prev in Thread] Current Thread [Next in Thread]