alphapapa / org-ql

A searching tool for Org-mode, including custom query languages, commands, saved searches and agenda-like views, etc.
GNU General Public License v3.0
1.4k stars 110 forks source link

Feat/add table name #349

Closed OZoneGuy closed 3 days ago

OZoneGuy commented 1 year ago

Added a new option to the dynamic block to set the table name.

NOTE: this also contains changes from #348. Forgot to reset the branch when creating it :/

alphapapa commented 8 months ago

Sorry, but I will have to ask you to disentangle this and #348, as they both contain some of the same changes. Magit should make it easy enough; I'd suggest making a new branch and cherry-picking the changes, then pushing the new branch to this PR's reference.

OZoneGuy commented 8 months ago

Ah, looks like I forgot about this PR. Will make the changes soon. Do you prefer rebasing the changes, or are merge/revert commits ok?

alphapapa commented 8 months ago

It's always easiest to deal with a commit near the tip of the branch it's to be merged into, so rebasing is preferred. Sometimes I do the rebasing myself if necessary, but if you can, please do.

jirijakes commented 4 days ago

Thanks, @OZoneGuy, this would be useful!

Alternative solution might be to preserve lines starting with #+ during rendering, if that is possible.

In org-colview this is achieved by copying such lines from previous content, see https://git.savannah.gnu.org/cgit/emacs/org-mode.git/tree/lisp/org-colview.el#n1666 :

(let ((content-lines (org-split-string (plist-get params :content) "\n")) recalc)
  ;; Insert affiliated keywords before the table.
  (when content-lines
    (while (string-match-p "\\`[ \t]*#\\+" (car content-lines))
      (insert (string-trim-left (pop content-lines)) "\n")))
OZoneGuy commented 3 days ago

I am no longer using this tool and don't have time to work on this. If you wish, you are welcome to clone this and work on it.