-
-
Notifications
You must be signed in to change notification settings - Fork 394
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
Helm-locate doesn't highlight the searched pattern in the results #2710
Comments
I can't reproduce here, the matches are highlighted. Here the source while using helm-locate:
From the helm-locate session, hit C-h d and paste the source here, thanks. |
Hi @thierryvolpiatto, here is the debugging information obtained from * Helm debug from `*helm locate*' buffer
** Local variables
#+begin_src elisp
((buffer-undo-list . t)
(cursor-type)
(buffer-display-time 26553 49487 654481 260000)
(left-margin-width . 0)
(buffer-display-count . 3)
(buffer-invisibility-spec . t)
(buffer-file-truename)
(point-before-scroll)
(buffer-auto-save-file-format . t)
(buffer-file-format)
(enable-multibyte-characters . t)
(mark-active)
(truncate-lines)
(local-abbrev-table .
[## 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0])
(header-line-format .
#(" C-j: helm-ff-kill-or-find-buffer-fname (keeping session) " 0 1
(face helm-header)
1 4
(face helm-header font-lock-face help-key-binding)
4 137
(face helm-header)))
(mode-line-format :propertize
(" " mode-line-buffer-identification " "
(:eval
(format "L%-3d"
(helm-candidate-number-at-point)))
nil " "
(:eval nil)
(:eval
(when nil
(let
((arg
(prefix-numeric-value
(or prefix-arg current-prefix-arg))))
(unless
(= arg 1)
(propertize
(format " [prefarg:%s]" arg)
'face 'helm-prefarg)))))
" "
(:eval
(with-helm-buffer
(helm-show-candidate-number
(car-safe helm-mode-line-string))))
" " helm--mode-line-string-real " "
(:eval
(make-string
(window-width)
32)))
keymap
(keymap
(mode-line keymap
(mouse-1 . ignore)
(down-mouse-1 . ignore)
(drag-mouse-1 . ignore)
(mouse-2 . ignore)
(down-mouse-2 . ignore)
(drag-mouse-2 . ignore)
(mouse-3 . ignore)
(down-mouse-3 . ignore)
(drag-mouse-3 . ignore))))
(mode-name . "Hmm")
(local-minor-modes font-lock-mode)
(major-mode . helm-major-mode)
(buffer-read-only)
(buffer-auto-save-file-name)
(buffer-saved-size . 0)
(buffer-backed-up)
(default-directory . "/etc/init.d/")
(buffer-file-name)
(delay-mode-hooks)
(current-input-method)
(delayed-mode-hooks)
(eldoc-mode-major-mode . helm-major-mode)
(font-lock-mode . t)
(char-property-alias-alist
(face font-lock-face))
(change-major-mode-hook font-lock-change-mode t)
(font-lock-mode-set-explicitly . t)
(font-lock-mode-major-mode . helm-major-mode)
(delayed-after-hook-functions)
(deactivate-mark . t)
(helm-source-filter)
(helm-display-function . helm-default-display-buffer)
(helm-selection-point . 8)
(scroll-margin . 0)
(helm-marked-candidates)
(helm--prompt . "pattern: ")
(helm-persistent-action-display-window)
(helm-async-outer-limit-hook #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_23>)
(helm-ff-transformer-show-only-basename)
(helm-visible-mark-overlays)
(helm-input-local . "mint")
(helm-mode-line-string "File(s)" "\\<helm-map>\\[helm-help]:Help \\[helm-select-action]:Act \\[helm-maybe-exit-minibuffer]/f1..f12:NthAct \\[helm-toggle-suspend-update]:Tog.suspend \\[helm-customize-group]:Conf"))
#+end_src
** Value1
#+begin_src elisp
((name . "Locate")
(init . helm-locate-initial-setup)
(action . helm-type-file-actions)
(persistent-action . helm-ff-kill-or-find-buffer-fname)
(persistent-help . "Show this file")
(help-message . helm-generic-file-help-message)
(requires-pattern . 3)
(candidate-transformer helm-skip-boring-files helm-w32-pathname-transformer)
(filtered-candidate-transformer . helm-highlight-files)
(action-transformer helm-transform-file-load-el helm-transform-file-browse-url helm-transform-file-cache)
(pattern-transformer . helm-locate-pattern-transformer)
(candidate-number-limit . 9999)
(redisplay . helm-locate-default-fuzzy-sort-fn)
(history . helm-file-name-history)
(mode-line "File(s)" "\\<helm-map>\\[helm-help]:Help \\[helm-select-action]:Act \\[helm-maybe-exit-minibuffer]/f1..f12:NthAct \\[helm-toggle-suspend-update]:Tog.suspend \\[helm-customize-group]:Conf")
(header-line .
#("C-j: helm-ff-kill-or-find-buffer-fname (keeping session)" 0 3
(font-lock-face help-key-binding face help-key-binding)))
(match-part .
#[257 "\302�\303\304���\305$\266\203\204�\0 \203�\0\304\306�\"\204�\0\307�!\207\207"
[helm-pattern helm-locate-fuzzy-match " -b\\'" nil string-match t "\\s-" helm-basename]
9 "\n\n(fn CANDIDATE)"])
(group . helm-locate)
(candidates-process . helm-locate-init))
#+end_src I use this minimal Emacs config: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Init straight
(defvar bootstrap-version)
(let ((bootstrap-file
(expand-file-name
"straight/repos/straight.el/bootstrap.el"
(or (bound-and-true-p straight-base-dir)
user-emacs-directory)))
(bootstrap-version 7))
(unless (file-exists-p bootstrap-file)
(with-current-buffer
(url-retrieve-synchronously
"https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el"
'silent 'inhibit-cookies)
(goto-char (point-max))
(eval-print-last-sexp)))
(load bootstrap-file nil 'nomessage))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Init Melpa
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(package-initialize)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Test some packages
;; helm
(use-package helm
:straight t
:config) |
Ta Quang Trung ***@***.***> writes:
1. ( ) text/plain (*) text/html
Hi @thierryvolpiatto, here is the debugging information obtained from C-h d:
* Helm debug from `*helm locate*' buffer
** Value1
#+begin_src elisp
((name . "Locate")
(init . helm-locate-initial-setup)
(action . helm-type-file-actions)
(persistent-action . helm-ff-kill-or-find-buffer-fname)
(persistent-help . "Show this file")
(help-message . helm-generic-file-help-message)
(requires-pattern . 3)
(candidate-transformer helm-skip-boring-files helm-w32-pathname-transformer)
(filtered-candidate-transformer . helm-highlight-files)
Here you should should have helm-fuzzy-highlight-matches, I tried with super minimal
config (even more minimal than emacs-helm.sh) from emacs -q:
(require 'helm)
(require 'helm-autoloads) ; Helm is installed from source here.
And still can't reproduce, I have
(filtered-candidate-transformer helm-highlight-files
helm-fuzzy-highlight-matches)
and matches are highlighted as expected.
Are you sure helm is updated?
(action-transformer helm-transform-file-load-el helm-transform-file-browse-url helm-transform-file-cache)
(pattern-transformer . helm-locate-pattern-transformer)
(candidate-number-limit . 9999)
(redisplay . helm-locate-default-fuzzy-sort-fn)
(history . helm-file-name-history)
#+end_src
I use this minimal Emacs config:
This is not a minimal config, please use ./emacs-helm.sh.
…--
Thierry
|
I think I found the culprit. It might be due to the below code in Lines 110 to 125 in 9fa8569
I commented out lines 120, 121 ;; (setf (slot-value source 'filtered-candidate-transformer)
;; 'helm-highlight-files) Then I guess that 2 lines 120 and 121 override the settings done previously in Lines 1169 to 1174 in 9fa8569
|
Ta Quang Trung ***@***.***> writes:
1. ( ) text/plain (*) text/html
I think I found the culprit. It might be due to the below code in helm-types.el
https://github.com/emacs-helm/helm/blob/9fa856925cfe5c0aa17826a6395f4837a587e940/helm-types.el#L110-L125
I commented out lines 120, 121
;; (setf (slot-value source 'filtered-candidate-transformer)
;; 'helm-highlight-files)
No it is not, if it was the case, everybody would be affected, but only
you is affected by this bug.
Did you try from emacs-helm.sh?
… Then helm-locate can highlight the matched patterns:
helm-locate-2.png (view on web)
I guess that 2 lines 120 and 121 override the settings done previously in helm-source?
https://github.com/emacs-helm/helm/blob/9fa856925cfe5c0aa17826a6395f4837a587e940/helm-source.el#L1162-L1166
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.*Message ID: ***@***.***>
tataquangtrung left a comment (emacs-helm/helm#2710)
I think I found the culprit. It might be due to the below code in helm-types.el
https://github.com/emacs-helm/helm/blob/9fa856925cfe5c0aa17826a6395f4837a587e940/helm-types.el#L110-L125
I commented out lines 120, 121
;; (setf (slot-value source 'filtered-candidate-transformer)
;; 'helm-highlight-files)
Then helm-locate can highlight the matched patterns:
helm-locate-2.png (view on web)
I guess that 2 lines 120 and 121 override the settings done previously in helm-source?
https://github.com/emacs-helm/helm/blob/9fa856925cfe5c0aa17826a6395f4837a587e940/helm-source.el#L1162-L1166
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.*Message ID: ***@***.***>
--
Thierry
|
I tried both using I tested on Emacs 29.1 and 29.4. |
Ta Quang Trung ***@***.***> writes:
I tested on Emacs 29.1 and 29.4.
Ah! That's it, could reproduce on 29, on 31.0.50 works as expected.
The problem is that for some reasons the helm-fuzzy-highlight-matches fn
is not added to filtered-candidate-transformer by eieio, probably an
inheritance problem or a race condition with cl-defmethod's
:after/before.
Ok, I can now start working on this, thanks.
…--
Thierry
|
This was needed in all previous Emacs versions, seems it is no more needed on emacs-29, thus it confuse eieio, OTOH emacs-31 is perfectly understanding this.
Should be fixed, let me know if it is now highlighting candidates. |
Ta Quang Trung ***@***.***> writes:
We probably send our mails at the same time :-)
I just upgraded my Emacs to 30.0.93 and how helm-locate can highlight the matching patterns correctly (see my screenshot).
Yes, 30.0.93 and 31 are probably behaving the same in most places
currently. Thanks to confirm.
It still baffles me why it doesn't work properly with Emacs 29.
This is an Eieio issue with classes, defmethods, inheritance etc... that
behave differently in different emacs versions, I would not be surprised
if the last commit that fixes this issue breaks e.g. emacs-28 or others,
will see, at least it is now working in 30.0.93 for you (I didn't test)
and in 29 and 31.
… helm-locate-3.png (view on web)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.*Message ID: ***@***.***>
tataquangtrung left a comment (emacs-helm/helm#2710)
I just upgraded my Emacs to 30.0.93 and how helm-locate can highlight the matching patterns correctly (see my screenshot).
It still baffles me why it doesn't work properly with Emacs 29.
helm-locate-3.png (view on web)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.*Message ID: ***@***.***>
--
Thierry
|
Thanks a lot for your effort! It's working as expected on Emacs 29.4 now. |
Ta Quang Trung ***@***.***> writes:
Thanks a lot for your effort!
It's working as expected on Emacs 29.4 now.
Great, thanks to confirm.
… —
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.*Message ID: ***@***.***>
tataquangtrung left a comment (emacs-helm/helm#2710)
Thanks a lot for your effort!
It's working as expected on Emacs 29.4 now.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.*Message ID: ***@***.***>
--
Thierry
|
What happened?
Hi,
I noticed that
helm-locate
doesn't highlight the searched pattern in the result.Below is the screenshot, where the searched pattern
mint
wasn't highlighted in the located file names.I debugged a bit and found out that the field
(filtered-candidate-transformer . helm-highlight-files)
ofhelm-source-locate
doesn't contain the transformerhelm-fuzzy-highlight-matches
like other Helm sources (see the attached image above).Is it a bug or an intended behavior of
helm-locate
?Can we support highlight matching patterns like in other Helm commands?
Thank you for spending time looking at this issue!
How to reproduce?
Run the command
helm-locate
, and typemint
and see the result.Helm Version
Master branch
Emacs Version
Emacs-29.1
OS
GNU/Linux
Relevant backtrace (if possible)
Minimal configuration
The text was updated successfully, but these errors were encountered: