emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG] Using org-table-next-line creates a new row when used on the header row [9.6.21 ( @ /Users/parhamdoustdar/.emacs.d/elpa/org-9.6.21/)]
@ 2024-03-13 13:54 Parham Doustdar
  2024-03-13 14:18 ` Ihor Radchenko
  0 siblings, 1 reply; 2+ messages in thread
From: Parham Doustdar @ 2024-03-13 13:54 UTC (permalink / raw)
  To: emacs-orgmode

Hi,
I’m facing an issue, and I’m not sure if it’s a bug, or a feature I don’t understand. I looked at the documentation for org tables, but couldn’t find anything that explicitly says I’m right or wrong.
If you run org-table-next-row on the very first line of a table that has a “horizontal rule”, it inserts a row above the horizontal rule, instead of skipping over it.
Steps to reproduce:
1. Open a buffer and turn on org-mode
2. Create a test table like this:
`| First column | Second column | C-c <RET>’
3. Move to the header line, that is, the very first line of the table and do `M-x org-table-next-row <RET>’
Note that a new line gets created under the very first line, and now the horizontal rule has moved to line number 3 of the table.
 What I expect to happen is for point to move to line 3 of the table, that is, the very first line under the horizontal rule.
Emacs  : GNU Emacs 29.1 (build 1, aarch64-apple-darwin23.1.0, Carbon Version 170 AppKit 2487.2)
 of 2023-11-20
Package: Org mode version 9.6.21 ( @ /Users/parhamdoustdar/.emacs.d/elpa/org-9.6.21/)

current state:
==============
(setq
 org-agenda-prefix-format '((agenda . "%?-12t% s %? b")
                            (todo . "%?-12t% s %? b") (tags . " % b")
                            (search . ""))
 org-link-elisp-confirm-function 'yes-or-no-p
 org-directory "~/org/"
 org-log-done 'time
 org-agenda-tags-todo-honor-ignore-options t
 org-agenda-custom-commands '(("i" "In-tray" tags "+intray/TODO"
                               ((org-agenda-overriding-header "In-tray")))
                              ("n" "Show what I should do now" tags
                               "SCHEDULED>\"<now>\"+SCHEDULED<\"<tomorrow>\"/TODO"
                               ((org-agenda-prefix-format
                                 
                                                                                     (list
                                                                                      
                                                                                      
                                                                                                               (cons 'tags "%t")
                                                                                      
                                                                                      
                                                                                                               )
                                 
                                                                                     )
                                
                                                                                    (org-agenda-overriding-header "Scheduled for the rest of the day")
                                
                                                                                    )
                               )
                              ("o" "Someday/maybe" tags "someday"
                               ((org-agenda-overriding-header "Someday/Maybe"))
                               )
                              )
 org-agenda-skip-scheduled-if-done t
 org-agenda-files '("~/org/projects/")
 org-persist-after-read-hook '(org-element--cache-persist-after-read)
 org-refile-targets '((org-agenda-files :tag . "tasklist")
                      ("~/org/someday.org" :level . 1))
 org-export-before-parsing-hook '(org-attach-expand-links)
 org-cycle-tab-first-hook '(org-babel-hide-result-toggle-maybe
                            org-babel-header-arg-expand)
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-odt-format-inlinetask-function 'org-odt-format-inlinetask-default-function
 org-ascii-format-drawer-function #[771 "\x01\207" [] 4 "\n\n(fn NAME CONTENTS WIDTH)"]
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-show-empty-lines
                  org-cycle-optimize-window-after-visibility-change
                  org-cycle-display-inline-images)
 org-persist-before-read-hook '(org-element--cache-persist-before-read)
 org-modules '(org-bbdb org-bibtex org-docview org-gnus org-info org-irc
               org-mhe org-rmail org-w3m org-drill)
 org-link-from-user-regexp "\\<parhamdoustdar@parhams-mbp\\.lan\\>\\|\\<Parham Doustdar\\>"
 org-mode-hook '((closure
                  (org--rds reftex-docstruct-symbol org-agenda-restrict-end
                   org-agenda-restrict-begin org-agenda-restrict
                   visual-fill-column-width org-clock-history
                   org-agenda-current-date org-with-time org-defdecode org-def
                   org-read-date-inactive org-ans1
                   org-columns-current-fmt-compiled org-clock-current-task
                   org-clock-effort org-agenda-skip-function
                   org-agenda-skip-comment-trees org-agenda-archives-mode
                   org-end-time-was-given org-time-was-given org-state
                   org-agenda-headline-snapshot-before-repeat
                   org-agenda-buffer-name org-agenda-start-on-weekday
                   org-agenda-buffer-tmp-name org-struct-menu org-last-state
                   org-clock-start-time texmathp-why remember-data-file
                   org-agenda-tags-todo-honor-ignore-options
                   calc-embedded-open-mode calc-embedded-open-formula
                   calc-embedded-close-formula align-mode-rules-list
                   org-indent-indentation-per-level org-agenda-buffer-name
                   org-inlinetask-min-level t)
                  nil
                  (add-hook 'change-major-mode-hook 'org-fold-show-all 'append
                   'local)
                  )
                 (closure (*this* org-babel-confirm-evaluate-answer-no t) nil
                  (add-hook 'change-major-mode-hook
                   #'org-babel-show-result-all 'append 'local)
                  )
                 (closure
                  (org-agenda-skip-regexp org-table-tab-recognizes-table.el
                   org-agenda-restriction-lock-overlay
                   org-agenda-overriding-restriction org-agenda-diary-file t)
                  nil (setq imenu-create-index-function 'org-imenu-get-tree))
                 #[0 "\301\211\x10\207"
                   [imenu-create-index-function org-imenu-get-tree] 2]
                 emacspeak-org-mode-setup
                 #[0 "\300\301\302\303\304$\207"
                   [add-hook change-major-mode-hook org-fold-show-all append
                    local]
                   5]
                 #[0 "\300\301\302\303\304$\207"
                   [add-hook change-major-mode-hook org-babel-show-result-all
                    append local]
                   5]
                 org-babel-result-hide-spec org-babel-hide-all-hashes)
 outline-minor-mode-hook '(emacspeak-outline-setup-keys)
 org-archive-subtree-add-inherited-tags t
 outline-mode-hook '(emacspeak-outline-setup-keys)
 org-agenda-time-grid '(nil (800 1000 1200 1400 1600 1800 2000) "......"
                        "----------------")
 org-latex-format-drawer-function #[514 "\207" [] 3 "\n\n(fn _ CONTENTS)"]
 org-latex-format-headline-function 'org-latex-format-headline-default-function
 org-confirm-shell-link-function 'yes-or-no-p
 org-html-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"]
 outline-isearch-open-invisible-function 'outline-isearch-open-invisible
 org-stuck-projects '("+tasklist" ("TODO" "WAITING") ("complete" "onhold") "")
 org-odt-format-headline-function 'org-odt-format-headline-default-function
 org-html-creator-string "<a href=\"https://www.gnu.org/software/emacs/\">Emacs</a> 29.1 (<a href=\"https://orgmode.org\">Org</a> mode 9.6.20)"
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
                     org-src-mode-configure-edit-buffer)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-tags-exclude-from-inheritance '("tasklist")
 org-todo-keywords '((type "TODO" "WAITING" "DONE"))
 org-speed-command-hook '(org-speed-command-activate
                          org-babel-speed-command-activate)
 org-html-format-inlinetask-function 'org-html-format-inlinetask-default-function
 org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default
 org-odt-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"]
 org-export-backends '(ascii html latex odt)
 org-confirm-babel-evaluate nil
 org-fold-core-isearch-open-function 'org-fold-core--isearch-reveal
 org-latex-format-inlinetask-function 'org-latex-format-inlinetask-default-function
 org-persist-before-write-hook '(org-element--cache-persist-before-write)
 org-tab-first-hook '(org-babel-hide-result-toggle-maybe
                      org-babel-header-arg-expand)
 org-agenda-todo-ignore-scheduled 'all
 org-link-shell-confirm-function 'yes-or-no-p
 org-babel-pre-tangle-hook '(save-buffer)
 org-agenda-loop-over-headlines-in-active-region nil
 org-occur-hook '(org-first-headline-recenter)
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-link-parameters '(("attachment" :follow org-attach-follow :complete
                        org-attach-complete-link)
                       ("nov" :follow nov-org-link-follow :store
                        nov-org-link-store)
                       ("e-media" :follow emacspeak-org-e-media-follow-url)
                       ("ebook" :follow emacspeak-eww-open-mark :store
                        org-ebook-store-link :display org-link)
                       ("amark" :follow org-amark-follow-link :store
                        org-amark-store-link :display org-link)
                       ("id" :follow org-id-open) ("file+sys") ("file+emacs")
                       ("shell" :follow org-link--open-shell)
                       ("news" :follow
                        #[514 "\301\300\302\x04Q\x02\"\207"
                          ["news" browse-url ":"] 6 "\n\n(fn URL ARG)"]
                        )
                       ("mailto" :follow
                        #[514 "\301\300\302\x04Q\x02\"\207"
                          ["mailto" browse-url ":"] 6 "\n\n(fn URL ARG)"]
                        )
                       ("https" :follow
                        #[514 "\301\300\302\x04Q\x02\"\207"
                          ["https" browse-url ":"] 6 "\n\n(fn URL ARG)"]
                        )
                       ("http" :follow
                        #[514 "\301\300\302\x04Q\x02\"\207"
                          ["http" browse-url ":"] 6 "\n\n(fn URL ARG)"]
                        )
                       ("ftp" :follow
                        #[514 "\301\300\302\x04Q\x02\"\207" ["ftp" browse-url ":"]
                          6 "\n\n(fn URL ARG)"]
                        )
                       ("help" :follow org-link--open-help :store
                        org-link--store-help)
                       ("file" :complete org-link-complete-file)
                       ("elisp" :follow org-link--open-elisp))
 org-html-format-headline-function 'org-html-format-headline-default-function
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-agenda-include-diary t
 org-export-creator-string "Emacs 29.1 (Org mode 9.6.20)"
 org-outline-path-complete-in-steps nil
 org-agenda-use-time-grid nil
 org-agenda-show-outline-path nil
 )



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [BUG] Using org-table-next-line creates a new row when used on the header row [9.6.21 ( @ /Users/parhamdoustdar/.emacs.d/elpa/org-9.6.21/)]
  2024-03-13 13:54 [BUG] Using org-table-next-line creates a new row when used on the header row [9.6.21 ( @ /Users/parhamdoustdar/.emacs.d/elpa/org-9.6.21/)] Parham Doustdar
@ 2024-03-13 14:18 ` Ihor Radchenko
  0 siblings, 0 replies; 2+ messages in thread
From: Ihor Radchenko @ 2024-03-13 14:18 UTC (permalink / raw)
  To: Parham Doustdar; +Cc: emacs-orgmode

Parham Doustdar <parham90@gmail.com> writes:

> If you run org-table-next-row on the very first line of a table that has a “horizontal rule”, it inserts a row above the horizontal rule, instead of skipping over it.

This is expected.
`org-table-next-row' is, by default, bound to <RET>.
When current row is the last row in the table <RET> will create a new
empty row.
When current row is before hline, <RET> again creates a new empty row -
useful when editing tables separated into several parts by hlines:

| a | b |
|---+---|
| 1 | 2 |
| 3 | 4<point> |
|---+---|
| X | Y |

In the above, <RET> conveniently extends the current table span between
hline separators.

Not a bug.
Canceled.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-03-13 14:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-13 13:54 [BUG] Using org-table-next-line creates a new row when used on the header row [9.6.21 ( @ /Users/parhamdoustdar/.emacs.d/elpa/org-9.6.21/)] Parham Doustdar
2024-03-13 14:18 ` Ihor Radchenko

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).