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

Format for helm-gtags-parse-file output. #170

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Format for helm-gtags-parse-file output. #170

wants to merge 5 commits into from

Conversation

jacekmigacz
Copy link
Contributor

Syohei-san.

I think current helm-output of helm-gtags-parse-file is unreadable:
before

I'm proposing another output format:
after
after2

Regards.

@jomi-se
Copy link

jomi-se commented Jun 5, 2017

I'm interested in this pull request as well.

In the same vein, I added a variable to toggle truncating lines. When using narrower frames, this can help make the buffer look less cluttered.

Would you consider adding it to your pull request?

0001-Add-variable-to-truncate-lines-in-helm-gtags-parse-f.txt

@jacekmigacz
Copy link
Contributor Author

@jomi-se
I'v applied your path on top of mine, but - for me - it doesn't do what is supposed to do.
Records for helm-gtags--buffer buffer are built inside helm-gtags--parse-file-candidate-transformer. I'm not sure how it works, but I'm sure that helm:truncate-lines doesn't strip the line numbers.

@jomi-se
Copy link

jomi-se commented Jul 3, 2017

@jacekmigacz

Cool ! But the patch doesn't have anything to do with stripping line numbers. It just adds a variable that is passed as helm:truncate-lines so that this value can be easily set only for helm-gtags buffers.

What this value does is enable/disable line-wrapping when the line is longer than the frame's width. With helm:truncate-lines at nil, lines wrap around as they do in your first 2 screenshots. With this patch you can customize a variable to truncate these lines instead.

@jacekmigacz
Copy link
Contributor Author

@jomi-se

Rigth. Not it makes sense.
But how about global switch for truncating a content of every helm-gtags buffer?
Is it something special about "parse file" that does not apply to the rest?

@jomi-se
Copy link

jomi-se commented Jul 5, 2017

@jacekmigacz That's a good idea. Looking at the code, most helm-gtags-* functions end up calling helm-gtags--common which is responsible for calling helm to create the helm-gtags-buffer.

helm-gtags-parse-fileis a special case which calls helmdirectly so I just added the option :truncate-lines helm-gtags-parse-file-truncate-lines.

But we could rename this variable to helm-gtags-buffer-truncate-lines and add it to the helmcall in helm-gtags--common as well, right?

@jacekmigacz
Copy link
Contributor Author

With recent helm updates, the helm-gtags-direct-helm-completing is broken.

Instead of calling helm-comp-read, completing-read-function is left not overwritten with completing-read-default.

@jacekmigacz
Copy link
Contributor Author

I'm not sure why is it failing, but looks it is not related with my changes...

Dependency helm failed to install: Package emacs-24.4 is unavailable

(match-string-no-properties 2 removed-file)
(match-string-no-properties 3 removed-file)))))
(setq helm-gtags--last-input (match-string 1 removed-file))
(format "%s:%s:%s"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems the original format ("%-25s %-5s %s") is better-looking than your format here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants