Re: capturing and filling

2023-04-06 Thread Max Nikulin

On 07/04/2023 11:40, Samuel Wales wrote:


On 4/6/23, Max Nikulin wrote:

Samuel, in your case, it is your requirement to have non-distracting
single-click capture.


... but one icon for prose/filling and one for lines/nonfilling would
be great for me.  or even the existing single icon for whichever one i
use most, with a right-click menu for other options.   maybe other
templates.


An extension can not add 2 buttons. It may define context menu for right 
click or it may open a popup with menu (implemented as an HTML page) on 
simple (left) click.


Till it is not implemented you may use an org-protocol handler that 
displays menu from e.g. a shell script:


printf 'Prose\nCode\n' |
zenity --list --title "Capture template" \
--text "Capture type" --column Template

or

zenity --question --title "Capture template" --text "Capture type" \
--ok-label Prose --cancel-label Code


A workaround is to define 2 capture template: for prose text and for
code. Browser extension should not add template=x query parameter to


i am guessing you mean s/should not/should/ here?


If template is not passed then script can just append &template=x to the 
URI, otherwise it may call e.g. sed to replace existing parameter.



  %(insert (shell-command-to-string "xclip -t text/html -o | pandoc
-f html -t org -"))


i selected one line and it printed that line.  i selected your above
lines and got Error: target text/html not available.


Select some text on a web page in Firefox (or similar application 
supporting rich text copy, e.g. libreoffice writer) and try


xclip -t TARGETS -o

I have realized that `insert' should not be added to template, the code 
above is more suitable for evaluation by M-:


Next revision (with escaped quote characters)

"* %:description
<%:link>

%(shell-command-to-string \"xclip -t text/html -o | pandoc -f html -t 
org -\")

"






Re: capturing and filling

2023-04-06 Thread Samuel Wales
hi max,

more below.

On 4/6/23, Max Nikulin  wrote:
> Samuel, in your case, it is your requirement to have non-distracting
> single-click capture.

... but one icon for prose/filling and one for lines/nonfilling would
be great for me.  or even the existing single icon for whichever one i
use most, with a right-click menu for other options.   maybe other
templates.

> A workaround is to define 2 capture template: for prose text and for
> code. Browser extension should not add template=x query parameter to

i was thinking that would be a great solution.  however, i cannot
implement it.  i was thinking elisp workaround might be more
straightforward.

i am guessing you mean s/should not/should/ here?

> org-protocol URI.
>
> Extension may determine if the captured text pre-formatting, however
> there are some complications. Besides  and  tags, there may
> be  and  elements with white-space: pre-wrap CSS property and
> similar. Selection may consist of several regions, each one with mix of
> regular and pre-formatted text.

i was thinking figuring it out from the selection and the html  would
be horrendously complex and brittle and error prone.  but i could be
wrong.

>
> Actually it is possible to convert selected text to Org markup. use
>
>  %(insert (shell-command-to-string "xclip -t text/html -o | pandoc
> -f html -t org -"))
>
> in your capture template. Possible caveats: headers, especially  may
> give undesired effect.

i selected one line and it printed that line.  i selected your above
lines and got Error: target text/html not available.

>
>
>


-- 
The Kafka Pandemic

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



Re: capturing and filling

2023-04-06 Thread Max Nikulin

On 07/04/2023 10:29, Samuel Wales wrote:

when i use the superb org-capture extension in firefox, there is only
one icon, so any decisions about formatting have to be
one-size-fits-all at capture time in elisp.


Samuel, in your case, it is your requirement to have non-distracting 
single-click capture.


I admit that the feature is not implemented in browser add-ons.

A workaround is to define 2 capture template: for prose text and for 
code. Browser extension should not add template=x query parameter to 
org-protocol URI.


Extension may determine if the captured text pre-formatting, however 
there are some complications. Besides  and  tags, there may 
be  and  elements with white-space: pre-wrap CSS property and 
similar. Selection may consist of several regions, each one with mix of 
regular and pre-formatted text.


Actually it is possible to convert selected text to Org markup. use

%(insert (shell-command-to-string "xclip -t text/html -o | pandoc 
-f html -t org -"))


in your capture template. Possible caveats: headers, especially  may 
give undesired effect.





capturing and filling

2023-04-06 Thread Samuel Wales
when i use the superb org-capture extension in firefox, there is only
one icon, so any decisions about formatting have to be
one-size-fits-all at capture time in elisp.  here are my ideas, but
not implementation.  the decisions i'd make are:

1.  fill long unfilled paragraphs vs. preserve verbatim lines

if i capture code, i don't want it filled.  if i capture prose that is
unfilled, as in a long line, i probably want it filled at capture.

heuristic: loop through every line.  if the line qualifies by some
sub-heuristic, and is more than 2x (window-width), then fill at
capture time, but only that line, not contiguous ones that do not meet
the sub-heuristic (different prefix etc.).

what does one do to loop through paragraphs?  is this a reasonable
heuristic?  anybody tried it?  this is all too much for me atm but i
thought i'd pu out the idea in case anybody has thought of these
things.

alternative: figure out and use an emacs minor mode that makes
unfilled paragraphs look like filled ones, including fill-column,
filling word boundary heuristics, fill prefix, etc.  this would still
interfere with diff and such.  it might be best reserved for this
purpose rather than ridding me of my m-q filling habit.  that would be
drastic.

2.  region on org heading vs. in body

heuristic: if selected text is zero length, i.e. nonexistent, then
link on org heading.  if it is short, "text -- [link]".  if long, then
i'm not sure which i like better: short part of first line on header
and then rest and then "-- [link]", or link on header.


-- 
The Kafka Pandemic

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



Re: [RFC] Backend vs. back-end (was: 2 'echo' bash instructions produce a table)

2023-04-06 Thread Samuel Wales
backend sounds good to me as a native speaker, for a term of art for
export modules or so, with defined api.  if you are talking about back
end code abstractly, i'd go for 2 words, but that's just me.  i
wouldn't rely on my sense for this one.

On 11/22/22, Ihor Radchenko  wrote:
> alain.coch...@unistra.fr writes:
>
>> PS 1: In the manual, I see "backend" and "back-end".  So it is an
>> issue similar to the "subtree/sub-tree" issue you fixed a few days
>> ago, to the "heading/headline" issue that was reported recently, and
>> to many similar cases I met in the past.  So I was wondering if there
>> could exist some (semi-)automatic way which would ensure that future
>> maintainers will not inadvertently re-introduce "sub-tree"
>> occurrences, or the like.  Perhaps some "accepted terminology" list
>> that would be checked upon?
>
> I looked into the manual. It has 197 instances of "back-end" and 24
> instances of "backend". In the code, "backend" is used almost exclusively
> in symbol names (except 5 instances), and "back-end" is used in the
> docstrings and comments.
>
> It is actually a bit confusing.
>
> I am looking at https://techterms.com/definition/backend, and it looks
> like "backend" is the correct word we need to use here. Am I missing
> something?
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 
>
>


-- 
The Kafka Pandemic

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



Re: [BUG] Agenda not sorting by priority THEN todo state (todo state ignored) [9.6.1 (9.6.1-??-fe92a3c @ /Users/polofsson/.emacs.d/.local/straight/build-28.2/org/)]

2023-04-06 Thread Samuel Wales
thank you.

On 4/6/23, Ihor Radchenko  wrote:
> Ihor Radchenko  writes:
>
>> See the attached fix making use of Samuel's suggestion.
>
> Applied, onto main.
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=8fab6eeef
> Fixed.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 
>


-- 
The Kafka Pandemic

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



Re: bug#59882: Multiple versions of Org in load-path problem

2023-04-06 Thread Stefan Monnier
> I have noticed that neither `package--reload-previously-loaded` nor code
> loading already compiled package unload the loaddefs file. E.g. I added

The state of our unloading support is not good enough to use it blindly,
indeed: it's too easy/common to have packages where `unload` leaves you
with an Emacs that has serious problems (including being unusable).

So, instead we limit ourselves to force-reloading files which tends to
be much more harmless (tho in theory of course it's just as bad).
It also tends to be sufficient.


Stefan




Re: bug#59882: Multiple versions of Org in load-path problem

2023-04-06 Thread Max Nikulin
On 18/12/2022 22:40, Stefan Monnier via Bug reports for GNU Emacs, the 
Swiss army knife of text editors wrote:

- "emacs -l org" to simulate a regular user session with some opened files.
- Update to Org-9.6 from ELPA.
- Close emacs and start it again "emacs -l org"

Result:
byte-code: Invalid function: org-assert-version


Hmm... there's code in `package.el` intended to avoid that problem, but
clearly it's failing here.  Could Someone™ investigate why that code
doesn't do its job.

The code in question is in `package--reload-previously-loaded`


Since I managed to reproduce the issue with emacs-28.2 built from source 
tree, I tried current master (30.0.50) as well. I used the following 
trick to shadow org-assert-version:


sed -i -e 's/org-assert-version/org-assert-version-old/g' lisp/org/*.el

I am unable to reproduce the "Invalid function: org-assert-version" 
issue. Org compilation finishes without warnings.


I have noticed that neither `package--reload-previously-loaded` nor code 
loading already compiled package unload the loaddefs file. E.g. I added 
org-stale-function marked as autoload. It is possible to get help for 
this function, but attempts to call this function causes "Autoloading 
file" error. Ideally emacs should completely forget about such functions 
when newer elpa package is installed.




[PATCH] Fix bug in orgtbl-self-insert-command when used with evil-escape

2023-04-06 Thread Aaron Zeng
There appears to be a bug in orgtbl-self-insert-command, which uses 
last-input-event instead of last-command-event.  self-insert-command itself 
uses the latter variable.

Reproduction steps:

1. Enable evil-mode and evil-escape-mode
2. Set `evil-escape-key-sequence' to "fd" (the default)
3. In an empty text-mode buffer with orgtbl-mode enabled:
   a. Press `f RET' slowly; this inserts f and then a newline
   b. Press `f RET` quickly; this inserts just two newlines

After step 3b, view-lossage contains:

 f ;; orgtbl-self-insert-command
   ;; orgtbl-hijacker-command-100

With the patch, the above steps correctly insert f and then a newline.

>From 8ae98a51a15bdd4d4c2014e7870ab36afd03562d Mon Sep 17 00:00:00 2001
From: "Aaron L. Zeng" 
Date: Mon, 3 Apr 2023 13:46:26 -0400
Subject: [PATCH 1/2] org-table: Refactor away unnecessary variable

* org-table.el (orgtbl-self-insert-command): Remove unnecessary
intermediate variable.  `(cdr nil)` is nil.

TINYCHANGE
---
 lisp/org-table.el | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/lisp/org-table.el b/lisp/org-table.el
index 97120fffd..f477d74a0 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -5408,11 +5408,9 @@ overwritten, and the table is not marked as requiring realignment."
 	(self-insert-command N))
 (setq org-table-may-need-update t)
 (let* (orgtbl-mode
-	   a
 	   (cmd (or (key-binding
 		 (or (and (listp function-key-map)
-			  (setq a (assoc last-input-event function-key-map))
-			  (cdr a))
+			  (cdr (assoc last-input-event function-key-map)))
 			 (vector last-input-event)))
 		'self-insert-command)))
   (call-interactively cmd)
-- 
2.30.2

>From 4ca188a09c2f628a03b5731b1725bd603620227a Mon Sep 17 00:00:00 2001
From: "Aaron L. Zeng" 
Date: Mon, 3 Apr 2023 13:53:57 -0400
Subject: [PATCH 2/2] org-table: Fix incorrect input when used with evil-escape

* org-table.el (org-self-insert-command): Use `last-command-event'
instead of `last-input-event'.  Using `last-input-event' causes
problems in the presence of `evil-escape'.  Consider a buffer that has
`orgtbl-mode' enabled while evil-escape is in use.  Assume the
evil-escape sequence is "fd".  Typing "f RET" will instead insert "RET
RET" into the buffer, since `last-input-event' is "RET", but
`last-command-event' is "f".

TINYCHANGE
---
 lisp/org-table.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/org-table.el b/lisp/org-table.el
index f477d74a0..e0cc84ed6 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -5410,8 +5410,8 @@ overwritten, and the table is not marked as requiring realignment."
 (let* (orgtbl-mode
 	   (cmd (or (key-binding
 		 (or (and (listp function-key-map)
-			  (cdr (assoc last-input-event function-key-map)))
-			 (vector last-input-event)))
+			  (cdr (assoc last-command-event function-key-map)))
+			 (vector last-command-event)))
 		'self-insert-command)))
   (call-interactively cmd)
   (if (and org-self-insert-cluster-for-undo
-- 
2.30.2



BUG: Org babel can't return a cons cell

2023-04-06 Thread General discussions about Org-mode.
Hello,
I've found a bug in org-babel. The simple code

#+begin_src scheme
  (cons 1 2)
#+end_src

Produces an error:

#+begin_quote
Debugger entered--Lisp error: (wrong-type-argument listp 2)
  org-babel-scheme--table-or-string("(1 . 2)")
  org-babel-execute:scheme("(cons 1 2)" ((:colname-names) (:rowname-names) 
(:result-params "replace") (:result-type . value) (:results . "replace") 
(:exports . "code") (:session . "none") (:cache . "no") (:noweb . "no") 
(:hlines . "no") (:tangle . "no")))
  org-babel-execute-src-block(nil ("scheme" "(cons 1 2)" ((:colname-names) 
(:rowname-names) (:result-params "replace") (:result-type . value) (:results . 
"replace") (:exports . "code") (:tangle . "no") (:hlines . "no") (:noweb . 
"no") (:cache . "no") (:session . "none")) "" nil 203 "(ref:%s)"))
  org-ctrl-c-ctrl-c(nil)
  funcall-interactively(org-ctrl-c-ctrl-c nil)
  command-execute(org-ctrl-c-ctrl-c)
#+end_quote

There is a fix I've found (thanks yantar92Orgcontr from
#org-m...@libera.chat)

#+begin_src elisp
(defun org-babel-scheme--table-or-string (results)
  "Convert RESULTS into an appropriate elisp value.
If the results look like a list or tuple, then convert them into an
Emacs-lisp table, otherwise return the results as a string."
  (let ((res (and results (org-babel-script-escape results
(cond ((proper-list-p res)
   (mapcar (lambda (el)
 (if (or (null el) (eq el 'null))
 org-babel-scheme-null-to
   el))
   res))
  (t res
#+end_src

should work on emacs older then Emacs 26 (proper-list-p not implemented here).

--
With best regards,
Igor Gajsin



Re: problem interaction between jinx-mode and org mode

2023-04-06 Thread Fraga, Eric
Hello Ihor,

On Thursday,  6 Apr 2023 at 12:04, Ihor Radchenko wrote:
> This is one long paragraph containing ~..., which is matching a possible
> ~code~ markup. org-element-code-parser tries to search the matching the
> closing "~", running regexp search until the end of the paragraph.

Thank you for confirming my guess.  Knowing this, I can work around this
in a number of ways but it did catch me by surprise!

Thanks for getting back quickly.

eric

-- 
: Eric S Fraga, with org release_9.6.1-341-g614b96 in Emacs 30.0.50


[PATCH] Handle block-type when checking `org-src-fontify-natively'

2023-04-06 Thread Nathaniel Nicandro

Hello,

I think I found a bug where the condition for `org-src-fontify-natively`
in `org-src-fontify-meta-lines-and-blocks-1` wasn't handling the block
type.  `org-src-fontify-natively` says it should fontify src blocks
only, but the condition didn't have that constraint.  Attached is a
patch that adds in the constraint.

>From 2f1342ad5b13f75387f6a26f0c68aac054903bcc Mon Sep 17 00:00:00 2001
From: Nathaniel Nicandro 
Date: Thu, 6 Apr 2023 08:49:20 -0500
Subject: [PATCH] Handle block-type when checking `org-src-fontify-natively`

* lisp/org.el (org-fontify-meta-lines-and-blocks-1): Only fontify
  natively for blocks of src type.
---
 lisp/org.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index a6b8a30..d6c5803 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5414,8 +5414,9 @@ (defun org-fontify-meta-lines-and-blocks-1 (limit)
 	 beg end-of-endline '(font-lock-fontified t font-lock-multiline t))
 	(org-remove-flyspell-overlays-in beg bol-after-beginline)
 	(org-remove-flyspell-overlays-in nl-before-endline end-of-endline)
-	(cond
-	 (org-src-fontify-natively
+(cond
+	 ((and org-src-fontify-natively
+   (string= block-type "src"))
 	  (save-match-data
 (org-src-font-lock-fontify-block (or lang "") block-start block-end))
 	  (add-text-properties bol-after-beginline block-end '(src-block t)))
-- 
2.39.1


-- 
Nathaniel


Re: bug#59882: Multiple versions of Org in load-path problem

2023-04-06 Thread Max Nikulin

On 03/02/2023 18:02, Ihor Radchenko wrote:


The problem seems to be real and appears to be some combination of
Debian/Ubuntu + Emacs.


It is not a Debian packaging issue. I have reproduced the "invalid 
function `org-assert-version'" bug using emacs built from emacs-28.2 git 
tag. It is important to execute "make install" and to launch emacs from 
from that directory.


I have no idea why behavior is different when emacs is launched from the 
build tree.


Environment: Debian-12 bookworm (frozen testing).

There is no problem when emacs is built by just "make" from debian 
sources with all patches applied. I admit that this experiment was not 
really pure since I did not use configure options from the 
debian/control file.




Re: problem interaction between jinx-mode and org mode

2023-04-06 Thread Ihor Radchenko
"Fraga, Eric"  writes:

> --8<---cut here---start->8---
> ┌ Debug: Placing hot node
> │   node = n29
> └ @ HeatExchangerNetworkDesign
> ~/s/research/julia/HeatExchangerNetworkDesign/src/HeatExchangerNetworkDesign.jl:1102
> ┌ Debug: Layout for node
> │   node = n18
> │   y = 6
> └ @ HeatExchangerNetworkDesign 
> --8<---cut here---end--->8---

This is one long paragraph containing ~..., which is matching a possible
~code~ markup. org-element-code-parser tries to search the matching the
closing "~", running regexp search until the end of the paragraph.

> The profiler output for CPU:
>
> --8<---cut here---start->8---
>47871  96%- jinx--check-pending
>47869  96% - jinx--check-region
>47861  96%  - jinx--flyspell-ignored-p
>47861  96%   - org-mode-flyspell-verify
>47837  96%- org--flyspell-object-check-p
>47837  96% - org-element-context
>46973  94%  - org-element--object-lex
>46022  92%   - org-element-code-parser

So, jinx--check-region is triggering org-element-context on every single
word. This will run regexp search N_words times, making Emacs do regexp
search until the end of the paragraph each time.

In the absence of object cache, this is indeed slow.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



problem interaction between jinx-mode and org mode

2023-04-06 Thread Fraga, Eric
Hello all,

I have just posted an issue on the jinx spell checking package's github
site:

https://github.com/minad/jinx/issues/35

There seems to be a strange interaction between jinx and orgmode when
the buffer has lines of the form:

--8<---cut here---start->8---
┌ Debug: Placing hot node
│   node = n29
└ @ HeatExchangerNetworkDesign 
~/s/research/julia/HeatExchangerNetworkDesign/src/HeatExchangerNetworkDesign.jl:1102
┌ Debug: Layout for node
│   node = n18
│   y = 6
└ @ HeatExchangerNetworkDesign 
--8<---cut here---end--->8---

lines which are the output of Julia's @debug macro, whose output uses
non-ASCII Unicode characters at the start of each line.  Emacs
essentially freezes for some seconds (10-20) every time I scroll (which
makes sense because jinx only spell-checks the visible part of the
buffer).

The profiler output for CPU:

--8<---cut here---start->8---
   47871  96%- jinx--check-pending
   47869  96% - jinx--check-region
   47861  96%  - jinx--flyspell-ignored-p
   47861  96%   - org-mode-flyspell-verify
   47837  96%- org--flyspell-object-check-p
   47837  96% - org-element-context
   46973  94%  - org-element--object-lex
   46022  92%   - org-element-code-parser
 340   0%- org-element--parse-generic-emphasis
 328   0% + rx-to-string
 859   1%   + org-element-italic-parser
--8<---cut here---end--->8---

and MEM:

--8<---cut here---start->8---
326,775,960  96% - timer-event-handler
326,674,976  96%  - apply
325,996,129  96%   - jinx--timer-handler
325,678,345  95%- jinx--check-pending
325,657,281  95% - jinx--check-region
325,636,601  95%  - jinx--flyspell-ignored-p
325,636,601  95%   - org-mode-flyspell-verify
325,072,246  95%- org--flyspell-object-check-p
325,072,246  95% - org-element-context
325,026,076  95%  - org-element--object-lex
215,616,248  63%   - org-element-italic-parser
211,670,968  62%- org-element--parse-generic-emphasis
211,670,968  62% - rx-to-string
186,054,064  54%  - rx--translate
186,054,064  54%   - rx--translate-form
181,758,312  53%- rx--translate-seq
155,393,544  45% - rx--translate
155,393,544  45%  - rx--translate-form
107,261,576  31%   - rx--translate-or
100,408,048  29%- mapcan
 99,194,744  29% + #
  2,524,984   0%  rx--translate
 45,311,856  13%   + rx--translate-not
  8,427,544   2% + rx--sequence
 10,559,024   3%  + rx--atomic-regexp
 83,089,056  24%   + org-element-code-parser
  4,458,332   1%   + org-element-verbatim-parser
342,616   0%+ org-log-into-drawer
--8<---cut here---end--->8---

Turning off jinx-mode in the org buffer restores normal behaviour.

I've not yet tried with emacs -Q, however, so it could be something in
my configuration... However, I do wonder whether it is the file name use
of "~" that may be causing problems with the rx?

Thank you,
eric

-- 
: Eric S Fraga, with org release_9.6.1-341-g614b96 in Emacs 30.0.50

[RFC] [feat] org-colview/org-columns: 'column view' moving rows up/down

2023-04-06 Thread Sławomir Grochowski
Dear All,

This is my first proposal & code submit. 
I will be very gratefull for you comments & feedback what can be done better.  

Recently I often use 'column view' feature. 
To my suprise in 'column view' user can't move rows up & down.
So I wrote a little code snippet to be able to do it, and I'm sharing it with 
you.

Questions:
1. Why user can't move rows up & down in 'column view'?
2. Is this was intentional design decision?

I think 'column view' is missing one the core feel & functionality of org-mode 
- moving rows (headings) up & down.
In my experiance with 'column view' & tables I shuffle a lot of columns & rows 
order.

In my point of view 'core fuctionalities of org-mode' are: 
1. moving 'things' headings, rows, columns
   1. horizontally (left-right)
   2. vertically (up-down)
2. cyclic visibility

Let's compare this functionality in 3 areas:  

|   | heading | table | column view |
|---+-+---+-|
| moving left-right | [X] | [X]   | [X] |
| moving up-down| [X] | [X]   | [ ] |
| cyclic visibility | [X] | NA| [X] |

Cyclic visibility does not apply to 'table' because it operate on simple data, 
which is not structured, nested.

'Column view' transform 'headings' into rows, and their properties into 
columns, creating a table.

'Column view' is a combination of 'table' & 'heading':
'Heading' gives a 'table' properties for columns and cyclic visibilty feature, 
because it provide nested structure.
'Table' gives a 'heading' a 'column view' on heading properties.

'Column view' is similar to 'table'. They operate on same actions & keybindings.

| | column view  | table|
|-+--+--|
| move column left-right  | [X]  | [X]  |
| move column left-right keys | meta left-right  | meta left-right  |
| move row up-down| [ ]  | [X]  |
| move row up-down keys   |  | meta up-down |
| add column  | [X]  | [X]  |
| add column keys | shift-meta right | shift-meta right |
| remove column   | [X]  | [X]  |
| remove column keys  | shift-meta left  | shift-meta left  |

I thnik it would be beneficial to have consistance interface in 'column view' 
and 'table'.

Based on that, I propose to add functionality to 'move row up/down' in 'column 
view' and set keybinding the same as in table above -> meta up/down.
Patch is in the attachment.

What others think about it? 

Regards,
Sławomir Grochowski
>From 1f0f2052b8dddf4982ab35267ed1564f2250784b Mon Sep 17 00:00:00 2001
From: Sławomir Grochowski 
Date: Mon, 3 Apr 2023 19:23:09 +0200
Subject: [PATCH] org-columns: add feat to move row up/down

---
 lisp/org-colview.el  | 22 +++
 testing/lisp/test-org-colview.el | 66 
 2 files changed, 88 insertions(+)

diff --git a/lisp/org-colview.el b/lisp/org-colview.el
index 92a3b473d..0971d5eef 100644
--- a/lisp/org-colview.el
+++ b/lisp/org-colview.el
@@ -209,6 +209,8 @@ See `org-columns-summary-types' for details.")
 (org-defkey org-columns-map ">" #'org-columns-widen)
 (org-defkey org-columns-map [(meta right)] #'org-columns-move-right)
 (org-defkey org-columns-map [(meta left)]  #'org-columns-move-left)
+(org-defkey org-columns-map [(meta down)]  #'org-columns-move-row-down)
+(org-defkey org-columns-map [(meta up)]  #'org-columns-move-row-up)
 (org-defkey org-columns-map [(shift meta right)] #'org-columns-new)
 (org-defkey org-columns-map [(shift meta left)]  #'org-columns-delete)
 (dotimes (i 10)
@@ -1003,6 +1005,26 @@ details."
 (org-columns-move-right)
 (backward-char 1)))
 
+(defun org-columns--move-row (&optional up)
+"Move table row. Calls `org-move-subtree-down' or `org-move-subtree-up'."
+(let ((inhibit-read-only t)
+  (col (current-column)))
+  (if up (org-move-subtree-up)
+(org-move-subtree-down))
+  (let ((org-columns-inhibit-recalculation t))
+(org-columns-redo)
+(move-to-column col
+
+(defun org-columns-move-row-down ()
+  "Move table row (subtree) down."
+  (interactive)
+  (org-columns--move-row))
+
+(defun org-columns-move-row-up ()
+  "Move table row (subtree) up."
+  (interactive)
+  (org-columns--move-row 'up))
+
 (defun org-columns-store-format ()
   "Store the text version of the current columns format.
 The format is stored either in the COLUMNS property of the node
diff --git a/testing/lisp/test-org-colview.el b/testing/lisp/test-org-colview.el
index 9daec18e2..fd02f054c 100644
--- a/testing/lisp/test-org-colview.el
+++ b/testing/lisp/test-org-colview.el
@@ -1010,6 +1010,72 @@
 	(list (get-char-property 1 'org-columns-value-modified)
 		  (get-char-property 2 'org-columns-value-modified))
 
+;; Each column is an

Re: [RFC] Backend vs. back-end (was: 2 'echo' bash instructions produce a table)

2023-04-06 Thread Ihor Radchenko
alain.coch...@unistra.fr writes:

>  > I looked further, and the situation is not as simple.
>  > https://grammarhow.com/backend-back-end-or-back-end/, for example,
>  > claims that only "back-end" is grammatically correct.
>  > 
>  > I am now thinking to do the following:
>  > 1. Use "backend" in the code symbols
>  > 2. Use "back-end" in docstrings and the manual.
>  > 
>  > Would it make sense?
>
>
> It is not clear to me why it would be a problem to use 'backend' in
> code symbols as well, but the only important thing for me as a user is
> that the terminology be consistent throughout the documentation.  So
> yes, it makes sense.
>
> The link you provide is very convincing.  Will it still hold in 5 or
> 10 year from now?  (see end of
> https://www-cs-faculty.stanford.edu/~knuth/email.html)

Well. This is a tricky subject.
5-10 years from now the grammar itself may change.
At the end, even Oxford Dictionary my link is referring to, when
defending that "backend" without hyphen is wrong, is not setting
standards, but just reflecting the existing ones.

If we look into
https://ell.stackexchange.com/questions/117383/what-is-the-correct-term-back-end-back-end-or-backend
and https://en.wikipedia.org/wiki/Frontend_and_backend, "backend" is
also used.

I am attaching Google trends stats for search term usage of "backend",
"back-end", and "back end".

It looks like "backend" is more popular at the end.

I will go for it everywhere unless there are objections.

P.S. It really feels a bit silly trying to weigh on this subject.


-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 


Re: [BUG] Agenda not sorting by priority THEN todo state (todo state ignored) [9.6.1 (9.6.1-??-fe92a3c @ /Users/polofsson/.emacs.d/.local/straight/build-28.2/org/)]

2023-04-06 Thread Ihor Radchenko
Ihor Radchenko  writes:

> See the attached fix making use of Samuel's suggestion.

Applied, onto main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=8fab6eeef
Fixed.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at