emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG] Org publish makeindex doesn't work on symlinked path [9.6.4 ( @ /home/bence/src/org-mode/lisp/)]
@ 2023-04-16 13:56 Bence Fábián
  2023-04-17 11:06 ` Ihor Radchenko
  0 siblings, 1 reply; 5+ messages in thread
From: Bence Fábián @ 2023-04-16 13:56 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

When performing an `org-publish' if the `:base-directory' property
contians a symlink in its path, then the `theindex.inc' file is not
populated.

I created a repo to help reproduce the bug:
https://github.com/bencef/org-publish-symlink-repro

Please see version information below.

Best Regards,
Bence

------------------------------------------------------------------------



Emacs  : GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit,
cairo version 1.16.0, Xaw3d scroll bars)
Package: Org mode version 9.6.4 ( @ /home/bence/src/org-mode/lisp/)

current state:
==============
(setq
 org-link-elisp-confirm-function 'yes-or-no-p
 org-bibtex-headline-format-function '(closure
      (org-id-locations org-agenda-search-view-always-boolean
org-agenda-overriding-header t)
      (entry) (cdr (assq :title entry)))
 org-persist-after-read-hook '(org-element--cache-persist-after-read)
 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-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-mode-hook '((closure
 (org--rds reftex-docstruct-symbol org--single-lines-list-is-paragraph
org-element-greater-elements
  visual-fill-column-width org-clock-history org-agenda-current-date
org-with-time org-defdecode org-def
  org-read-date-inactive org-ans2 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-log-note-extra
org-log-note-purpose org-log-post-message
  org-last-inserted-timestamp org-last-changed-timestamp
org-entry-property-inherited-from org-state
  org-agenda-headline-snapshot-before-repeat org-agenda-buffer-name
org-agenda-start-on-weekday
  org-agenda-buffer-tmp-name org-priority-regexp org-mode-abbrev-table
org-mode-syntax-table
  org-element-cache-persistent buffer-face-mode-face org-tbl-menu
org-org-menu org-struct-menu org-entities
  org-last-state org-id-track-globally 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-emphasis-alist
org-emphasis-regexp-components
  org-export-registered-backends org-modules crm-separator
org-babel-load-languages org-id-overriding-file-name
  org-indent-indentation-per-level org-element--timestamp-regexp
org-element-cache-map-continue-from
  org-element-paragraph-separate org-agenda-buffer-name
org-inlinetask-min-level t)
 nil (add-hook 'change-major-mode-hook 'org-fold-show-all 'append 'local))
(closure
 (org-src-window-setup *this* org-babel-confirm-evaluate-answer-no
org-babel-tangle-uncomment-comments
  org-src-preserve-indentation org-src-lang-modes
org-edit-src-content-indentation org-babel-library-of-babel t)
 nil (add-hook 'change-major-mode-hook #'org-babel-show-result-all
'append 'local))
org-babel-result-hide-spec org-babel-hide-all-hashes)
 org-confirm-shell-link-function 'yes-or-no-p
 outline-isearch-open-invisible-function 'outline-isearch-open-invisible
 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-speed-command-hook '(org-speed-command-activate
org-babel-speed-command-activate)
 org-persist-directory "/run/user/1000/org-persist-oW4EqF"
 org-fold-core-isearch-open-function 'org-fold-core--isearch-reveal
 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-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) ("id" :follow org-id-open)
      ("eww" :follow org-eww-open :store org-eww-store-link)
      ("rmail" :follow org-rmail-open :store org-rmail-store-link)
      ("mhe" :follow org-mhe-open :store org-mhe-store-link)
      ("irc" :follow org-irc-visit :store org-irc-store-link :export
org-irc-export)
      ("info" :follow org-info-open :export org-info-export :store
org-info-store-link :insert-description
org-info-description-as-command)
      ("gnus" :follow org-gnus-open :store org-gnus-store-link)
      ("docview" :follow org-docview-open :export org-docview-export
:store org-docview-store-link)
      ("bibtex" :follow org-bibtex-open :store org-bibtex-store-link)
      ("bbdb" :follow org-bbdb-open :export org-bbdb-export :complete
org-bbdb-complete-link :store
org-bbdb-store-link)
      ("w3m" :store org-w3m-store-link) ("doi" :follow
org-link-doi-open :export org-link-doi-export)
      ("file+sys") ("file+emacs") ("shell" :follow org-link--open-shell)
      ("news" :follow (closure ((scheme . "news")) (url arg)
(browse-url (concat scheme ":" url) arg)))
      ("mailto" :follow (closure ((scheme . "mailto")) (url arg)
(browse-url (concat scheme ":" url) arg)))
      ("https" :follow (closure ((scheme . "https")) (url arg)
(browse-url (concat scheme ":" url) arg)))
      ("http" :follow (closure ((scheme . "http")) (url arg)
(browse-url (concat scheme ":" url) arg)))
      ("ftp" :follow (closure ((scheme . "ftp")) (url arg) (browse-url
(concat scheme ":" 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-metaup-hook '(org-babel-load-in-session-maybe)
 )


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

* Re: [BUG] Org publish makeindex doesn't work on symlinked path [9.6.4 ( @ /home/bence/src/org-mode/lisp/)]
  2023-04-16 13:56 [BUG] Org publish makeindex doesn't work on symlinked path [9.6.4 ( @ /home/bence/src/org-mode/lisp/)] Bence Fábián
@ 2023-04-17 11:06 ` Ihor Radchenko
  2023-04-19 14:28   ` Bence Fábián
  0 siblings, 1 reply; 5+ messages in thread
From: Ihor Radchenko @ 2023-04-17 11:06 UTC (permalink / raw)
  To: Bence Fábián; +Cc: emacs-orgmode

Bence Fábián <begnoc@gmail.com> writes:

> When performing an `org-publish' if the `:base-directory' property
> contians a symlink in its path, then the `theindex.inc' file is not
> populated.
>
> I created a repo to help reproduce the bug:
> https://github.com/bencef/org-publish-symlink-repro

I tried to reproduce starting from emacs -Q, and I am unable to.

I did
1. cd /tmp
2. git clone https://github.com/bencef/org-publish-symlink-repro
3. cd org-publish-symlink-repro
4. ln -sf /tmp/org-publish-symlink-repro/long/path/to ./shortcut 
5. emacs -Q /path/to/README.org
6. Open the second relative file link
7. C-c C-e C-f P x <TAB> <RET>

All the files are published correctly, including the index.

-- 
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] 5+ messages in thread

* Re: [BUG] Org publish makeindex doesn't work on symlinked path [9.6.4 ( @ /home/bence/src/org-mode/lisp/)]
  2023-04-17 11:06 ` Ihor Radchenko
@ 2023-04-19 14:28   ` Bence Fábián
  2023-04-20  8:33     ` Bence Fábián
  0 siblings, 1 reply; 5+ messages in thread
From: Bence Fábián @ 2023-04-19 14:28 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

Hi Igor,

> 5. emacs -Q /path/to/README.org
> 6. Open the second relative file link

When I do this then when I push `C-x C-f' I see that I'm in the
non-symlinked path.
And that shows up in the source block evaluation as well.

In fact even if I do
```
emacs -Q /tmp/org-publish-symlink-repro/shortcut/something/index.org
```
I end up in the "real" directory.  I'm not sure what's governing this
behavior in emacs.
What I suspect now is the culprit is that the linked directory is on a
different BTRFS subvolume.
In my original case.

Can you try changing the line
```
  (let ((base-dir default-directory))
```
to
```
  (let ((base-dir "/tmp/org-publish-symlink-repro/shortcut/something/"))
```
and see what happens then?

BR,
Bence

On Mon, Apr 17, 2023 at 1:04 PM Ihor Radchenko <yantar92@posteo.net> wrote:
>
> Bence Fábián <begnoc@gmail.com> writes:
>
> > When performing an `org-publish' if the `:base-directory' property
> > contians a symlink in its path, then the `theindex.inc' file is not
> > populated.
> >
> > I created a repo to help reproduce the bug:
> > https://github.com/bencef/org-publish-symlink-repro
>
> I tried to reproduce starting from emacs -Q, and I am unable to.
>
> I did
> 1. cd /tmp
> 2. git clone https://github.com/bencef/org-publish-symlink-repro
> 3. cd org-publish-symlink-repro
> 4. ln -sf /tmp/org-publish-symlink-repro/long/path/to ./shortcut
> 5. emacs -Q /path/to/README.org
> 6. Open the second relative file link
> 7. C-c C-e C-f P x <TAB> <RET>
>
> All the files are published correctly, including the index.
>
> --
> 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] 5+ messages in thread

* Re: [BUG] Org publish makeindex doesn't work on symlinked path [9.6.4 ( @ /home/bence/src/org-mode/lisp/)]
  2023-04-19 14:28   ` Bence Fábián
@ 2023-04-20  8:33     ` Bence Fábián
  2023-04-20  8:40       ` Ihor Radchenko
  0 siblings, 1 reply; 5+ messages in thread
From: Bence Fábián @ 2023-04-20  8:33 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

Hi all,

Upon further reflection I came to the following conclusions:

There are multiple things at play here (I refrain from using the word "issue"):
- emacs resolving or not resolving true path upon visiting files.
  This is not at all org-related.
- org-publish calling `file-truename' inconsistently during the
publishing process.
  This might or might not be an issue.  I leave it up to your discretion.

The trivial solution to my problem:
instead of
    (let ((base-dir default-directory)) ...)
use
    (let ((base-dir (file-truename default-directory))) ...)

I'll leave the repo on my github "As is" for future reference.

BR,
Bence


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

* Re: [BUG] Org publish makeindex doesn't work on symlinked path [9.6.4 ( @ /home/bence/src/org-mode/lisp/)]
  2023-04-20  8:33     ` Bence Fábián
@ 2023-04-20  8:40       ` Ihor Radchenko
  0 siblings, 0 replies; 5+ messages in thread
From: Ihor Radchenko @ 2023-04-20  8:40 UTC (permalink / raw)
  To: Bence Fábián; +Cc: emacs-orgmode

Bence Fábián <begnoc@gmail.com> writes:

> - org-publish calling `file-truename' inconsistently during the
> publishing process.

May you check which places are not calling `file-truename'?
We should certainly be consistent here, either by preferring relative
paths to the true paths.

-- 
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] 5+ messages in thread

end of thread, other threads:[~2023-04-20  9:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-16 13:56 [BUG] Org publish makeindex doesn't work on symlinked path [9.6.4 ( @ /home/bence/src/org-mode/lisp/)] Bence Fábián
2023-04-17 11:06 ` Ihor Radchenko
2023-04-19 14:28   ` Bence Fábián
2023-04-20  8:33     ` Bence Fábián
2023-04-20  8:40       ` 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).