Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't restrict org outline path length #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mosquito-magnet
Copy link

This tries to address two issues by removing restriction of outline path length to window width in helm-org-agenda-files-headings:

  1. Truncating the outline paths seems counterproductive.
  2. Bug: The org outline path candidates for helm-org-agenda-files-headings get truncated to the width of the previously active window, not the helm-window.

Reasoning for 1.:
The leaf node is likely the most interesting part of the candidate, it shouldn't be cut off. In comparable scenarios like helm-find-files there is also no truncation.

Not truncating candidates will use the full helm window width, and users can use horizontal scrolling or wrapping (via helm-org-truncate-lines or helm-toggle-truncate-line) to inspect the full path if required.

Repro steps for 2.:

  • Start emacs, split window vertically
  • Open some org file and create entries that result in outline paths longer than the current window width
  • Ensure that org file is part of org-agenda-files
  • Call helm-org-agenda-files-headings
  • The helm candidate window should open below the 2 existing vertically split windows, using the full frame width
  • The candidates are truncated to match the org window width, not the helm window width

The reason seems to be that helm-window returns nil when helm-org--get-candidates-in-file is called, so the window-width call returns the width of the current window instead.

Behaviour seems similar to the now inaccessible issue 1294 in helm, if that is of any relevance. Still available currently via google webcache:
https://webcache.googleusercontent.com/search?q=cache:BPTMko9B-8kJ:https://github.com/emacs-helm/helm/issues/1294

  • Emacs versions tested with:
    GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30, cairo version 1.15.10) of 2020-09-19
  • Org versions tested with:
    Org version 9.4 from package org-plus-contrib version 20201005
  • helm versions tested with:
    3.6.2
  • helm-core versions tested with:
    20200905.1311

Limiting candidate length doesn't seem to be used in other sources, and
doesn't seem useful here. The leaf node is likely the most interesting
part of the candidate.

Also helm-window seems to be not yet created when calling
helm-org--get-candidates-in-file, trying to determine the width for it
will then determine it for the current window instead, which might be
much narrower.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant