Re: Org and Hyperbole

2022-06-22 Thread indieterminacy

On 23-06-2022 06:04, David Masterson wrote:

Samuel Wales  writes:


i am interested in whether hyperbole can inspire org.  or maybe spin
off stuff that is useful for org.


Hyperbole is loaded and activated in your .emacs file.  Therefore, it's
features are available in any file you work on (including Org
files). Many of the features may be useful to you as a replacement to a
feature in Org or something to work along side Org.  Dig into the
Hyperbole manual...


any buffer!

so it works inside emacs teminal emulators too!
--
Jonathan McHugh
indieterminacy@libre.brussels



Re: Org and Hyperbole

2022-06-22 Thread David Masterson
Samuel Wales  writes:

> i am interested in whether hyperbole can inspire org.  or maybe spin
> off stuff that is useful for org.

Hyperbole is loaded and activated in your .emacs file.  Therefore, it's
features are available in any file you work on (including Org
files). Many of the features may be useful to you as a replacement to a
feature in Org or something to work along side Org.  Dig into the
Hyperbole manual...


-- 
David Masterson



Re: Org and Hyperbole

2022-06-22 Thread David Masterson
Bill Burdick  writes:

> Sure:
>
> (defun bill/restore-calc-point (result)
>   (when bill/calc-point
> (goto-char bill/calc-point)
> (setq bill/calc-point nil))
>   result)
>
> (advice-add 'hmouse-function :filter-return 'bill/restore-calc-point)
>
> If my recalc function matches, it sets bill/restore-calc-point to a marker 
> like this:
>
> (setq bill/calc-point (make-marker))
>
> Since it's normally nil, the advice normally just ignores it.

Thanks.  I wanted to learn more about advising functions.

-- 
David Masterson



Re: Org and Hyperbole

2022-06-22 Thread Samuel Wales
i am interested in whether hyperbole can inspire org.  or maybe spin
off stuff that is useful for org.

i find org-link-minor-mode to be really useful.  limited,
but useful.  does tses too.

i use it in non-org files to link to other places in the same file, mostly.

also i insert the reverse link.  but i also use org id links to link
to org.  which, bidir is manual.  also external links.

idk about hyperbole, but i really like the idea of emacs being able to
link all types of files and maybe even file-less buffers all around.
bidirectionally.   also annotate, with and without modifying the
annotated file, with org as backend.

i like nonbreakable links.  org-id is great, might be useful in such a
pan-emacs setup via links similar to extensible syntax id marker links
so that it is nonbreakable and bidirectional and controllable, all
without manual maintenance.

those would also allow graph-theoretical stuff but i don't think i
need that.  except bidirectional links and lists of links, perhaps
traversable via emacs's standard next-error mechanism or something
similar.

i noticed something a bit peculiar recently.  i did org-store-link in
a non-org file and a properties drawer was created at top [maint].
idk if hte org-id system will remembver that indefinitely or not; file
moves might be an issue.

-- 
The Kafka Pandemic

A blog about science, health, human rights, and misopathy:
https://thekafkapandemic.blogspot.com



Re: Org and Hyperbole

2022-06-22 Thread Bill Burdick
I just wrote recalc today as a demo so people can extrapolate what they
might do with Hyperbole (calc was handy in my head since I wrote it for
Ober, the Java version of the Oberon environment).

WIth buttons that restore the point to where it was when you clicked, you
can make them operate on the current selection (it looks like Hyperbole
might not save the region though so maybe more function advice is needed
for that). This makes reusable "menu bars" possible:

   

(changing recalc to find the table at point instead of using the location
of the button).
Highlight a region and shift-middle-click on cut/copy/paste to do that
action on your selection.

This also lets you use button bars in other frames (acting even more like a
real menu bar).

Buttons could also parse contextual information in the button buffer
(and/or the active buffer), something like org-mode properties, that could
influence how the buttons behave. Other buttons could edit this information
to give you document-based behavior. For instance, a button-buffer (like
the menubar) could have behavioral information like this:

: 4
: left

Clicking "left" could toggle it between the different types of
justification (left, right, center, full) and clicking on  could
justify the current paragraph. Clicking  could change the
indentation of the current file (if it's a program, it could analyze for
the current indentation and then change it to the desired indentation).

Just thinking out loud here -- this is the sort of thing Ober did and
Hyperbole looks like a framework that makes it not too hard to do that for
Emacs.


-- Bill


On Wed, Jun 22, 2022 at 10:26 PM Bill Burdick 
wrote:

> No idea.
>
>
> -- Bill
>
>
> On Wed, Jun 22, 2022 at 10:23 PM David Masterson 
> wrote:
>
>> Bill Burdick  writes:
>>
>> > Here's a hyperbole-org integration that lets you use org-mode tables
>> > outside of org-mode files. Shift-middle-click a "recalc" button and it
>> > will recalculate the table right under it (this idea is from an old
>> > version of the Oberon environment I wrote in Java, by the way).
>> >
>> > Here's the code:
>> >
>> > (defun bill/calc (end)
>> >   (goto-char end)
>> >   (re-search-forward "\n")
>> >   (when (org-at-table-p)
>> > (org-table-analyze)
>> > (let* ((table-start (point))
>> >(rows (1- (length org-table-dlines)))
>> >(table-end (re-search-forward "\n" nil t rows))
>> >(inside (<= table-start action-key-depress-prev-point
>> table-end)))
>> >   (when inside
>> > (goto-char action-key-depress-prev-point)
>> > (org-table-maybe-eval-formula))
>> >   (goto-char table-start)
>> >   (call-interactively 'org-table-recalculate)
>> >   (org-table-align
>> >
>> > (defib recalc ()
>> >   "recalculate a table"
>> >   (save-excursion
>> > (let* ((pos (point))
>> >(eol (progn (re-search-forward "\n") (point)))
>> >(bol (progn (re-search-backward "\n" nil t 2) (1+ (point
>> >(start (progn (goto-char pos) (re-search-backward "<" bol
>> t)))
>> >(end (progn (goto-char pos) (re-search-forward ">" eol t
>> >   ;;(message "pos: %s, prev: %s" (point)
>> action-key-depress-prev-point)
>> >   (and start end (string-match " ].*" (buffer-substring
>> start end))
>> >(hact 'bill/calc end)
>> >
>> > Here's an example table you can put anywhere. Just shift-middle-click
>> > on it to recalculate the org-mode table. Also, if you type a formula
>> > (and keep the cursor on the same line) and then shift-click recalc,
>> > it'll handle the formula:
>> >
>> > 
>> > | a | 12 |
>> > | a |  5 |
>> > #+TBLFM: @1$2=3*4::@2$2=2+3
>>
>> Isn't this the minor mode orgtbl-mode ?
>>
>> --
>> David Masterson
>>
>


Re: Org and Hyperbole

2022-06-22 Thread David Masterson
Juan Manuel Macías  writes:

> Hi David, 
>
> David Masterson writes:
>
>> I haven't touched Hyperbole in ...decades...?  Even then, it was
>> complicated and full-featured (but I still keep it in my .emacs file).
>> My discussions with Bob Weiner were interesting at the time and I really
>> wanted to make use of it.
>>
>> As you've discovered, it integrates a lot of what Org has in, perhaps, a
>> tighter fashion (which makes it more complicated, but the pain might be
>> useful). The Smart Keys and Buttons are very similar to Org.  The
>> outliner (KOutline) is more powerful than Org, but not integrated with
>> export capabilities to other formats (I think there is a way of
>> exporting an outline to Org).  Something that Org does not have is
>> browsing capabilities for Object Oriented languages.  This is an add-on
>> (for C++ ?) in Hyperbole (search for OO-Browser).  Since I retired, I
>> don't do much programming, so Org's project management has been more
>> interesting to me.
>>
>> It's nice to see that it's actually still being developed by Bob.
>
> Thanks for all the interesting facts about hyperbole. I hadn't looked at
> the package source code info yet, and didn't know that this is all the
> work of one person. I also thought hyperbole was more recent...
>
> It certainly has some interesting stuff. In what way is KOutline more
> powerful than Org? Do you think there is any useful feature of KOutline
> that could be incorporated into Org?

KOutline has a much larger set of commands for working with outlines.
However, that's an example of complexity in that it's a lot to keep in
your head.  The permanent (hidden) ids make it possible to build (say) a
personal Wiki of information where rearranging the outline doesn't mess
up the links.

> So far I've been able to find a couple of practical uses for this
> package in my workflow. The whole window control system is very
> powerful, although it would have been better if it had been a single
> separate package, IMHO.

I tended to look at EXWM, but didn't get too far. I may look at
Hycontrol again...

> Implicit links have a lot of potential. For example, I've managed to
> define some buttons for LaTeX, which recognize LaTeX commands and
> environments and lead to the local TeX live documentation or
> tex.stackexchange.org. It's like giving a LaTeX document a sort of hover
> help. This could also be done in Org, by defining some patterns as
> implicit buttons to lead to Org info pages.

Have you looked at Hydra?  But Hyperbole's implicit links are better.

-- 
David Masterson



Re: Org and Hyperbole

2022-06-22 Thread Bill Burdick
Sure:

(defun bill/restore-calc-point (result)
  (when bill/calc-point
(goto-char bill/calc-point)
(setq bill/calc-point nil))
  result)

(advice-add 'hmouse-function :filter-return 'bill/restore-calc-point)

If my recalc function matches, it sets bill/restore-calc-point to a marker
like this:

(setq bill/calc-point (make-marker))

Since it's normally nil, the advice normally just ignores it.


-- Bill


On Wed, Jun 22, 2022 at 9:05 PM David Masterson 
wrote:

> Bill Burdick  writes:
>
> > Anywhere you use a link or button, you can probably use an emacs
> > command instead. I think maybe the value of links and buttons is that
> > they're explicit. It's a reminder in the text and you don't have to
> > learn it.
> >
> > One thing I noticed in my little "recalc" exercise is that Hyperbole
> > really really wants the cursor to stay on the button. I used function
> > advice to make the cursor stay where it was when you clicked the
> > button. This allows "menubars" to work, lists of buttons that can
> > operate on the text without warping the cursor to the buttons. This is
> > how Oberon and WIly work and I think Hyperbole (for my use cases
> > anyway) will benefit from this usage style.
>
> Could you provide an example of that function advice?
> --
> David Masterson
>


Re: Org and Hyperbole

2022-06-22 Thread Bill Burdick
No idea.


-- Bill


On Wed, Jun 22, 2022 at 10:23 PM David Masterson 
wrote:

> Bill Burdick  writes:
>
> > Here's a hyperbole-org integration that lets you use org-mode tables
> > outside of org-mode files. Shift-middle-click a "recalc" button and it
> > will recalculate the table right under it (this idea is from an old
> > version of the Oberon environment I wrote in Java, by the way).
> >
> > Here's the code:
> >
> > (defun bill/calc (end)
> >   (goto-char end)
> >   (re-search-forward "\n")
> >   (when (org-at-table-p)
> > (org-table-analyze)
> > (let* ((table-start (point))
> >(rows (1- (length org-table-dlines)))
> >(table-end (re-search-forward "\n" nil t rows))
> >(inside (<= table-start action-key-depress-prev-point
> table-end)))
> >   (when inside
> > (goto-char action-key-depress-prev-point)
> > (org-table-maybe-eval-formula))
> >   (goto-char table-start)
> >   (call-interactively 'org-table-recalculate)
> >   (org-table-align
> >
> > (defib recalc ()
> >   "recalculate a table"
> >   (save-excursion
> > (let* ((pos (point))
> >(eol (progn (re-search-forward "\n") (point)))
> >(bol (progn (re-search-backward "\n" nil t 2) (1+ (point
> >(start (progn (goto-char pos) (re-search-backward "<" bol t)))
> >(end (progn (goto-char pos) (re-search-forward ">" eol t
> >   ;;(message "pos: %s, prev: %s" (point)
> action-key-depress-prev-point)
> >   (and start end (string-match " ].*" (buffer-substring
> start end))
> >(hact 'bill/calc end)
> >
> > Here's an example table you can put anywhere. Just shift-middle-click
> > on it to recalculate the org-mode table. Also, if you type a formula
> > (and keep the cursor on the same line) and then shift-click recalc,
> > it'll handle the formula:
> >
> > 
> > | a | 12 |
> > | a |  5 |
> > #+TBLFM: @1$2=3*4::@2$2=2+3
>
> Isn't this the minor mode orgtbl-mode ?
>
> --
> David Masterson
>


Re: Org and Hyperbole

2022-06-22 Thread David Masterson
Bill Burdick  writes:

> Here's a hyperbole-org integration that lets you use org-mode tables
> outside of org-mode files. Shift-middle-click a "recalc" button and it
> will recalculate the table right under it (this idea is from an old
> version of the Oberon environment I wrote in Java, by the way).
>
> Here's the code:
>
> (defun bill/calc (end)
>   (goto-char end)
>   (re-search-forward "\n")
>   (when (org-at-table-p)
> (org-table-analyze)
> (let* ((table-start (point))
>(rows (1- (length org-table-dlines)))
>(table-end (re-search-forward "\n" nil t rows))
>(inside (<= table-start action-key-depress-prev-point table-end)))
>   (when inside
> (goto-char action-key-depress-prev-point)
> (org-table-maybe-eval-formula))
>   (goto-char table-start)
>   (call-interactively 'org-table-recalculate)
>   (org-table-align
>
> (defib recalc ()
>   "recalculate a table"
>   (save-excursion
> (let* ((pos (point))
>(eol (progn (re-search-forward "\n") (point)))
>(bol (progn (re-search-backward "\n" nil t 2) (1+ (point
>(start (progn (goto-char pos) (re-search-backward "<" bol t)))
>(end (progn (goto-char pos) (re-search-forward ">" eol t
>   ;;(message "pos: %s, prev: %s" (point) action-key-depress-prev-point)
>   (and start end (string-match " ].*" (buffer-substring start 
> end))
>(hact 'bill/calc end)
>
> Here's an example table you can put anywhere. Just shift-middle-click
> on it to recalculate the org-mode table. Also, if you type a formula
> (and keep the cursor on the same line) and then shift-click recalc,
> it'll handle the formula:
>
> 
> | a | 12 |
> | a |  5 |
> #+TBLFM: @1$2=3*4::@2$2=2+3

Isn't this the minor mode orgtbl-mode ?

-- 
David Masterson



Re: Org and Hyperbole

2022-06-22 Thread David Masterson
Bill Burdick  writes:

> Anywhere you use a link or button, you can probably use an emacs
> command instead. I think maybe the value of links and buttons is that
> they're explicit. It's a reminder in the text and you don't have to
> learn it.
>
> One thing I noticed in my little "recalc" exercise is that Hyperbole
> really really wants the cursor to stay on the button. I used function
> advice to make the cursor stay where it was when you clicked the
> button. This allows "menubars" to work, lists of buttons that can
> operate on the text without warping the cursor to the buttons. This is
> how Oberon and WIly work and I think Hyperbole (for my use cases
> anyway) will benefit from this usage style.

Could you provide an example of that function advice?
-- 
David Masterson



Re: Org and Hyperbole

2022-06-22 Thread Bill Burdick
Anywhere you use a link or button, you can probably use an emacs command
instead. I think maybe the value of links and buttons is that they're
explicit. It's a reminder in the text and you don't have to learn it.

One thing I noticed in my little "recalc" exercise is that Hyperbole really
really wants the cursor to stay on the button. I used function advice to
make the cursor stay where it was when you clicked the button. This allows
"menubars" to work, lists of buttons that can operate on the text without
warping the cursor to the buttons. This is how Oberon and WIly work and I
think Hyperbole (for my use cases anyway) will benefit from this usage
style.


-- Bill


On Wed, Jun 22, 2022 at 6:15 PM Russell Adams 
wrote:

> On Mon, Jun 20, 2022 at 05:26:30PM +0200, Russell Adams wrote:
> > Is there some keen feature I'm missing? What's the use case for
> > Hyperbole if you're already an Org-mode user?
>
> Watching the replies, I've noticed it all seems to come back to
> hyperlinking / hot button support across Emacs modes. Almost sounds
> like Apple's Hypercard is evoked in the responses.
>
> I rarely use Org's own links, much less links between documents so
> maybe I'm not the target audience.
>
> --
> Russell Adamsrlad...@adamsinfoserv.com
> https://www.adamsinfoserv.com/
>
>


Re: [PATCH] New remote resource download policy

2022-06-22 Thread Max Nikulin

On 22/06/2022 17:01, Timothy wrote:



+(defun org–confirm-resource-safe (uri)
+  “Ask the user if URI should be considered safe, returning non-nil if so.”
+(unless noninteractive
+  (let ((buf (get-buffer-create “*Org Remote Resource*”)))


I see your intention to add something fancy to the dialog. May `org-mks’ be
reused instead to avoid proliferation variants of rather similar UI code?


Well, the thing here is that I’m explicitly trying to mimic the
file-local-variable dialog, and since a general form isn’t exposed by Emacs, a
little bit of proliferation seems like the best option to me.


From my point of view the result is rather close (prompt should be 
adjusted):


(let ((uri "https://orgmode.org;))
  (org-mks
   nil
   (format "An org-mode document would like to download %s, which is 
not considered safe.


Do you want to download this?"
   (propertize uri 'face '(:inherit org-link :weight normal)))
   nil ; prompt
   `((,(propertize "!" 'face 'success)
  "download this resource, and permanantly mark it as safe.")
 (,(propertize "y" 'face 'warning)
  "to download this resource, just this once.")
 (,(propertize "n" 'face 'error)
  "skip this resource."




Re: Proposal: 'executable' org-capture-templaes

2022-06-22 Thread Max Nikulin

On 22/06/2022 19:13, Arthur Miller wrote:

Max Nikulin writes:

Menu should and application should be separated in my eyes. Menu is just a
graphical/audio? presentation of selectable choice to the user. As such it
should display choices, let user pick a choice, and return to the application
the picked choice. Compare to completing-read, or org-mks. I don't think we
should mingle application states and menu states.


By state I mean some structure opaque to menu package. It just receives 
it from caller as an optional argument and (when given) later passes it 
to handler. Maybe it is alien approach in LISP, but in C (where closures 
are impossible) it is a widely used technique. Functions having callback 
argument usually have another void* one that is later passed as an 
argument of the callback function in addition to other data.


(org-buffer-menu
 '(("a" "Option A" (1))
   ("b" "Option B" (2)))
 :handler
 (lambda (entry state)
  (message "value %S state %S" (nth 2 entry) state))
 :state
 '(1 2 3))

Menu caller does not care whether some buffer is created to present 
menu. Menu has no idea what state may contain, it just passes it to the 
handler. When menu is implemented as a buffer with keymap then state is 
stored as a buffer-local variable.


As to your current implementation of org-select, I do not like that it 
is responsibility of caller to create different buffer names to enable 
multiple instances of menu. I would prefer to control single/multiple 
instances through a boolean argument of org-select.


Arthur, I see that I should response to more your comments. However I am 
unable to identify source of disagreement, likely it is some different 
assumptions. That is why I decided to concentrate on a couple of 
questions in this message.





Re: Org and Hyperbole

2022-06-22 Thread Russell Adams
On Mon, Jun 20, 2022 at 05:26:30PM +0200, Russell Adams wrote:
> Is there some keen feature I'm missing? What's the use case for
> Hyperbole if you're already an Org-mode user?

Watching the replies, I've noticed it all seems to come back to
hyperlinking / hot button support across Emacs modes. Almost sounds
like Apple's Hypercard is evoked in the responses.

I rarely use Org's own links, much less links between documents so
maybe I'm not the target audience.

--
Russell Adamsrlad...@adamsinfoserv.com
https://www.adamsinfoserv.com/



Re: Org and Hyperbole

2022-06-22 Thread Juan Manuel Macías
Hi Jonathan, sorry for my late response,

indieterminacy writes:

> I recommend Hyperbole, though I must confess Ive been using Orgmode a 
> lot less since Ive been focusing on the format GemText.
>
> I should recommend the use of the function defil, for people who like 
> regexes and want to operate differing contexts (to launch via the ACTION 
> operator). Its mid-grade compared to the more simpler approach and the 
> more complex eLisp approach.

Thank you very much for all the very interesting information about hyperbole!

I am liking the idea of implicit buttons more and more, and I see a few
applications of this concept that I can find very practical. To play
around with the defil function, which you recommend in your email, I've
tried defining some 'contextual help' for LaTeX and Org. Specifically for
Org it has occurred to me to convert some keywords into implicit buttons
that point to the info pages. Something like this:

#+begin_src emacs-lisp
  (defil org-attr-latex
"#+" ":" "attr_latex\\|caption"
(let ((el (org-element-at-point)))
  (cond ((eq (org-element-type el) 'src-block)
 (lambda (x)
   (info "(org)Source blocks in LaTeX export")))
((eq (org-element-type el) 'table)
 (lambda (x)
   (info "(org)Tables in LaTeX export")))
((eq (org-element-type el) 'plain-list)
 (lambda (x)
   (info "(org)Plain lists in LaTeX export")))
((eq (org-element-type el) 'paragraph)
 (lambda (x)
   (info "(org)Images in LaTeX export")))
((eq (org-element-type el) 'verse-block)
 (lambda (x)
   (info "(org)Verse blocks in LaTeX export")))
((eq (org-element-type el) 'special-block)
 (lambda (x)
   (info "(org)Special blocks in LaTeX export")))
((eq (org-element-type el) 'example-block)
 (lambda (x)
   (info "(org)Example blocks in LaTeX export")))
((eq (org-element-type el) 'quote-block)
 (lambda (x)
   (info "(org)Quote blocks in LaTeX export"))

  (defil org-attr-html
"#+" ":" "attr_html\\|caption"
(let ((el (org-element-at-point)))
  (cond ((eq (org-element-type el) 'table)
 (lambda (x)
   (info "(org)Tables in HTML export")))
((eq (org-element-type el) 'paragraph)
 (lambda (x)
   (info "(org)Images in HTML export"))


  (defil org-options-kw "#+" ":" "options"
(lambda (x)
  (info "(org)Export Settings")
  (occur "‘OPTIONS’")))
#+end_src

I've also discovered the defib function, which allows you to define
implicit buttons using predicates, instead of just using regular
expressions and delimiters.

Best regards,

Juan Manuel 



Re: Org and Hyperbole

2022-06-22 Thread Bill Burdick
Here's a hyperbole-org integration that lets you use org-mode tables
outside of org-mode files. Shift-middle-click a "recalc" button and it will
recalculate the table right under it (this idea is from an old version of
the Oberon environment I wrote in Java, by the way).

Here's the code:

(defun bill/calc (end)
  (goto-char end)
  (re-search-forward "\n")
  (when (org-at-table-p)
(org-table-analyze)
(let* ((table-start (point))
   (rows (1- (length org-table-dlines)))
   (table-end (re-search-forward "\n" nil t rows))
   (inside (<= table-start action-key-depress-prev-point
table-end)))
  (when inside
(goto-char action-key-depress-prev-point)
(org-table-maybe-eval-formula))
  (goto-char table-start)
  (call-interactively 'org-table-recalculate)
  (org-table-align

(defib recalc ()
  "recalculate a table"
  (save-excursion
(let* ((pos (point))
   (eol (progn (re-search-forward "\n") (point)))
   (bol (progn (re-search-backward "\n" nil t 2) (1+ (point
   (start (progn (goto-char pos) (re-search-backward "<" bol t)))
   (end (progn (goto-char pos) (re-search-forward ">" eol t
  ;;(message "pos: %s, prev: %s" (point) action-key-depress-prev-point)
  (and start end (string-match " ].*" (buffer-substring start
end))
   (hact 'bill/calc end)

Here's an example table you can put anywhere. Just shift-middle-click on it
to recalculate the org-mode table. Also, if you type a formula (and keep
the cursor on the same line) and then shift-click recalc, it'll handle the
formula:


| a | 12 |
| a |  5 |
#+TBLFM: @1$2=3*4::@2$2=2+3


-- Bill


On Wed, Jun 22, 2022 at 1:38 PM Juan Manuel Macías 
wrote:

> Hi David,
>
> David Masterson writes:
>
> > I haven't touched Hyperbole in ...decades...?  Even then, it was
> > complicated and full-featured (but I still keep it in my .emacs file).
> > My discussions with Bob Weiner were interesting at the time and I really
> > wanted to make use of it.
> >
> > As you've discovered, it integrates a lot of what Org has in, perhaps, a
> > tighter fashion (which makes it more complicated, but the pain might be
> > useful). The Smart Keys and Buttons are very similar to Org.  The
> > outliner (KOutline) is more powerful than Org, but not integrated with
> > export capabilities to other formats (I think there is a way of
> > exporting an outline to Org).  Something that Org does not have is
> > browsing capabilities for Object Oriented languages.  This is an add-on
> > (for C++ ?) in Hyperbole (search for OO-Browser).  Since I retired, I
> > don't do much programming, so Org's project management has been more
> > interesting to me.
> >
> > It's nice to see that it's actually still being developed by Bob.
>
> Thanks for all the interesting facts about hyperbole. I hadn't looked at
> the package source code info yet, and didn't know that this is all the
> work of one person. I also thought hyperbole was more recent...
>
> It certainly has some interesting stuff. In what way is KOutline more
> powerful than Org? Do you think there is any useful feature of KOutline
> that could be incorporated into Org?
>
> So far I've been able to find a couple of practical uses for this
> package in my workflow. The whole window control system is very
> powerful, although it would have been better if it had been a single
> separate package, IMHO.
>
> Implicit links have a lot of potential. For example, I've managed to
> define some buttons for LaTeX, which recognize LaTeX commands and
> environments and lead to the local TeX live documentation or
> tex.stackexchange.org. It's like giving a LaTeX document a sort of hover
> help. This could also be done in Org, by defining some patterns as
> implicit buttons to lead to Org info pages.
>
> Best regards,
>
> Juan Manuel
>
>


Re: [PATCH] Re: [BUG] Adding note to heading without newline at the end

2022-06-22 Thread Tor Kringeland
Ihor Radchenko  writes:

> Confirmed.
>
> Samuel, do you want to try fixing this?
> It should be fairly easy to debug.

Nice.  But these are distinct bugs, it seems like.  The one you sent a
patch for earlier fixes the former bug (which is also present in Org
9.5).  While my original problem is only present in Org 9.6.


Re: Proposal: 'executable' org-capture-templaes

2022-06-22 Thread Arthur Miller
Max Nikulin  writes:

> On 21/06/2022 11:07, Ihor Radchenko wrote:
>> Max Nikulin writes:
>> The other question is altering the org-capture code.
>> I think that it is too early to discuss org-capture part just yet.
>> Lets first finalize the generic library itself and discuss the
>> appropriate adjustments to
>> org-capture/org-agenda/org-export/org-todo/etc code later.
>
> From my point of view changing menu without adjusting calling logic is a kind 
> of
> trade-off with uncertain net result. New UI may significantly affect different
> user expectations. It seems this is the point of our disagreement. You tend to
> consider menu in isolation trying to postpone the question concerning
> interaction of code running before menu creation and handlers of menu items
> (they are not belong to the same call stack any more).
>
> What I am really afraid is words like:
>
>> Sure. That somewhere can be buffer-local variable inside the capture
>> menu buffer. Or global variable. Or closure. How is it relevant to the
>> capture menu?

Yepp, it can't saved in a buffer-local before the buffer is created.

> I am trying to avoid implementation of menu that would make passing state to
> handlers unreliable or prohibitively complicated.

Menu should and application should be separated in my eyes. Menu is just a
graphical/audio? presentation of selectable choice to the user. As such it
should display choices, let user pick a choice, and return to the application
the picked choice. Compare to completing-read, or org-mks. I don't think we
should mingle application states and menu states.

However, there is a slight complication compared to completing-read or org-mks
in regard that those are used to make only one selection and exit, while this
menu is supposed to be used that way, or to be used in a way that it survives
multiple selections.

To me this seems as clearly per menu entry behaviour. For exmaple in org-agenda
menu, some actions will make menu exit, while some will keep the menu alive (for
example '*'). One solution is to have some flag passed per entry to signal to
the menu to kill itself upon selection. The other one, the easier, is to let the
applicaiton code handle the menu kill. I took the second one to minimize on
number of flags that needs to be passed and documented, but I agree it is not
the cleanest way, so I can change to use a flag if it is considered a better
option.

> Global variables are certainly not an option because such approach does not
> allow several instances of menu created in parallel.

Yes, please, lets try to minimize number of globals. Actually I would be
happiest with a functional approach where everything is communicated via
function arguments and return values.

> To use buffer-local variables some support from the side of menu library is
> required. Buffer does not exist when menu function is called. So either some
> callback should be passed to menu to be invoked when a new buffer is created 
> for
> menu or that buffer should be returned from the menu creating function. Unsure
> if (current-buffer) would be a reliable approach.
>
> Closures should work, but would be it convenient enough?

We are using list to pass both menus and menu entries. Application can stick in
some args used by the menu. 

> Maybe some intermediate layer should be introduced to make alternative
> implementation of menu (transient, completing read, etc.) easier.

I don't think it is the topic and scope of this menu. It would be another layer
on its own, and definitely another project, I think.

> I believe, discussing design of menu without evaluation if it is suitable to
> features that should use it (capture, agenda, etc.), there is a risk to create
> unreasonable restrictions on further steps.

I definitely agree. Designing a good API is hard. I personally always think that
frameworks should not be designed in advance. I am more of a pragmatic, and
prefer to see actual working use-cases and design a framework after the
experience, not try to desing a framework by guessing the potential
use-cases. That is why I said that I am not interested in turning this into a
framework. I have try to design here something that can be used to implement
existing org-capture, org-agenda & co on top of it.

> That is why I consider the following aspects of menu design as essential ones:
> - A clearly determined way to pass some state from a function that requests
>  creation of menu to handlers of menu items.

Menu entries (lists)

> - When a non-blocking technique to wait user decision is used, multiple
>   instances of the same menu should be allowed.

Still have to be worked on.

> - Defined extension points for alternative implementations to avoid code
>   duplication and divergence of behavior.

That would be some framework layer.

> My fear is that if such points are ignored in the beginning, it may become
> impossible later.

It's lisp, anything is possible ^^ ;-).

No, but serioiusly, there is not much of extension 

Re: org-table in comment environments

2022-06-22 Thread Uwe Brauer
>>> "IR" == Ihor Radchenko  writes:

> Uwe Brauer  writes:
>>> I recommend to hide such table inside drawer and set
>>> org-export-with-drawers appropriately.
>> 
>> Thanks, any type of drawer in particular?

> Feel free to consult the docstring of org-export-with-drawers


That seems to work

#+OPTIONS: d:(not "mytest")
:mytest:

| name  | test |
|---+--|
| stud1 |   10 |

:END:

Uwe 

-- 
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine. 


smime.p7s
Description: S/MIME cryptographic signature


Re: org-table in comment environments

2022-06-22 Thread Ihor Radchenko
Uwe Brauer  writes:

>> I recommend to hide such table inside drawer and set
>> org-export-with-drawers appropriately.
>
> Thanks, any type of drawer in particular?

Feel free to consult the docstring of org-export-with-drawers

Best,
Ihor



Re: Org and Hyperbole

2022-06-22 Thread Juan Manuel Macías
Hi David, 

David Masterson writes:

> I haven't touched Hyperbole in ...decades...?  Even then, it was
> complicated and full-featured (but I still keep it in my .emacs file).
> My discussions with Bob Weiner were interesting at the time and I really
> wanted to make use of it.
>
> As you've discovered, it integrates a lot of what Org has in, perhaps, a
> tighter fashion (which makes it more complicated, but the pain might be
> useful). The Smart Keys and Buttons are very similar to Org.  The
> outliner (KOutline) is more powerful than Org, but not integrated with
> export capabilities to other formats (I think there is a way of
> exporting an outline to Org).  Something that Org does not have is
> browsing capabilities for Object Oriented languages.  This is an add-on
> (for C++ ?) in Hyperbole (search for OO-Browser).  Since I retired, I
> don't do much programming, so Org's project management has been more
> interesting to me.
>
> It's nice to see that it's actually still being developed by Bob.

Thanks for all the interesting facts about hyperbole. I hadn't looked at
the package source code info yet, and didn't know that this is all the
work of one person. I also thought hyperbole was more recent...

It certainly has some interesting stuff. In what way is KOutline more
powerful than Org? Do you think there is any useful feature of KOutline
that could be incorporated into Org?

So far I've been able to find a couple of practical uses for this
package in my workflow. The whole window control system is very
powerful, although it would have been better if it had been a single
separate package, IMHO.

Implicit links have a lot of potential. For example, I've managed to
define some buttons for LaTeX, which recognize LaTeX commands and
environments and lead to the local TeX live documentation or
tex.stackexchange.org. It's like giving a LaTeX document a sort of hover
help. This could also be done in Org, by defining some patterns as
implicit buttons to lead to Org info pages.

Best regards,

Juan Manuel 



Re: [PATCH] New remote resource download policy

2022-06-22 Thread Timothy
Hi Max,

>> — a/lisp/org-attach.el
>> +++ b/lisp/org-attach.el
>> @@ -525,7 +525,11 @@ (defun org-attach-attach (file  visit-dir 
>> method)
>> [snip]
>> +(if (or (not noninteractive) (org–should-fetch-remote-resource-p 
>> file))
>
> I am confused by (not noninteractive). Does it mean that interactive call is
> enough to bypass protection? It may have sense it at this step there is no
> ambiguity what resources is fetched. On the other hand I am unsure concerning 
> a
> case when `org-attach-attach’ is a part of a larger command.

The idea here is that when this is done interactively the user will be aware of
the URL this is being applied to, and so it isn’t a risk. Let me know if this
assumption doesn’t hold.

>> +(defcustom org-download-remote-resources ’prompt
>
> The name sounds like some function.

Mmm. I could add `-policy' to that variable name perhaps.

>> +(defun org–confirm-resource-safe (uri)
>> +  “Ask the user if URI should be considered safe, returning non-nil if so.”
>> +(unless noninteractive
>> +  (let ((buf (get-buffer-create “*Org Remote Resource*”)))
>
> I see your intention to add something fancy to the dialog. May `org-mks’ be
> reused instead to avoid proliferation variants of rather similar UI code?

Well, the thing here is that I’m explicitly trying to mimic the
file-local-variable dialog, and since a general form isn’t exposed by Emacs, a
little bit of proliferation seems like the best option to me.

>> +;; Set up the contents of the *Local Variables* buffer.
>
> I am in doubts concerning “once”. I tried “y” in a file having to “#+include:”
> of the same file. I did not get question for second include. I did not get
> prompt for this file anymore at all, even during next export. I modified the
> remote file, but stale content appeared during export. So the file was really
> downloaded once, but it is hardly in agreement with my expectations. Behavior 
> is
> unrelated to this patch, concerning wording I am not sure, but I have no a
> better variant.

Ok, that is not the intended behaviour. I’ll see if I can work out what’s going
on here. Oh, and I should change that comment to “Set up the contents of the 
*Org
Remote Resource* buffer.”.

>> +  (propertize “n” ’face ’error)
>> +  “ to skip this resource.”)
>
> From “skip” I do not expect aborting of export.

Hmm, the “skip” action isn’t determined by the “is it safe” functions, but some
wording that doesn’t sound completely safe at least would be good.

> I have an idea but unsure if it should be implemented. Consider
> `org-remote-resources-policy’ custom variable that is a list of pairs
> (url-regexp . policy) for fine grain tuning instead of 2 variables. The price 
> is
> more complicated structure, so higher chance of user error.

My initial reaction is that this feels like overkill.

All the best,
Timothy


Re: Implementing ox-beamer property support in ox-latex.

2022-06-22 Thread Fraga, Eric
On Tuesday, 21 Jun 2022 at 14:14, bob--- via "General discussions about 
Org-mode." wrote:
> The problem that I encountered was that you can't easily "close" environments.
> The example below shows what I mean:

You would probably find things easier using special blocks, e.g.

--8<---cut here---start->8---
* First section
** First subsection
Some text before the definition.
#+begin_definition
This is a definition
#+end_definition
Some text behind the definition.
** Subsection
This is a new subsection.
--8<---cut here---end--->8---

-- 
: Eric S Fraga, with org release_9.5.3-507-g4f0f24 in Emacs 29.0.50


Re: [PATCH] New remote resource download policy

2022-06-22 Thread Timothy
Hi Robert,

> Timothy> +(defcustom org-download-remote-resources ’prompt
>
> ’prompted when downloading unsafe resources’
>
> maybe?
>
> Does this need a ’prompt-always option? I guess thatʼs what you get
> with the default value of `org-safe-remote-resources’, but maybe it
> makes sense to be explicit?

That isn’t the behaviour. `prompt' doesn’t /always/ prompt, just when the 
resource
in question is not considered safe according to `org--safe-remote-resource-p'.

So, `prompt-always' would be something else, but one can easily make prompt 
behave
that way by setting `org-safe-remote-resources' to nil, so I don’t think it
warrants an extra option.

All the best,
Timothy


Re: Beamer export: Executing LaTeX between two frames

2022-06-22 Thread Fraga, Eric
On Tuesday, 21 Jun 2022 at 10:01, M. ‘quintus’ Gülker wrote:
> I am working on a presentation for a conference (using org-mode and its
> beamer export) and want to exchange the entire background for a specific
> frame with an image. This is possible with Beamer, see

This is a bit hacky but see attached file.  The trick is to end the
previous frame explicitly, create the frame with the desired background,
and then start explicitly a new frame but which is not shown in
presentation mode.

The ending of the previous frame is fragile as there may be other
environments that should be closed so you will have to be careful.

Hope this helps.

-- 
: Eric S Fraga, with org release_9.5.3-507-g4f0f24 in Emacs 29.0.50


b.org
Description: b.org


Re: org-table in comment environments

2022-06-22 Thread Uwe Brauer
>>> "IR" == Ihor Radchenko  writes:

> Uwe Brauer  writes:
>> I have a org-table in a comment environment, since I don't want to
>> export it.
>> 
>> However you can I edit the table using org-table commands, orgtbl-mode
>> is ignored, so what shall I do?
>> 
>> That seems as a stupid question, but I can't find its obvious answer.

> Everything inside comment is considered verbatim.

> I recommend to hide such table inside drawer and set
> org-export-with-drawers appropriately.


Thanks, any type of drawer in particular?

Uwe 




-- 
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine. 


smime.p7s
Description: S/MIME cryptographic signature