[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ivy-hydra 51fe2ce 097/395: counsel.el (counsel--recentf
From: |
Basil L. Contovounesios |
Subject: |
[elpa] externals/ivy-hydra 51fe2ce 097/395: counsel.el (counsel--recentf-get-xdg-recent-files): Decode utf-8 |
Date: |
Thu, 25 Feb 2021 08:31:39 -0500 (EST) |
branch: externals/ivy-hydra
commit 51fe2ce0ae118e378cebfc5e8d6c4f46bf048def
Author: Oleh Krehel <ohwoeowho@gmail.com>
Commit: Oleh Krehel <ohwoeowho@gmail.com>
counsel.el (counsel--recentf-get-xdg-recent-files): Decode utf-8
Re #2403
---
counsel.el | 23 ++++++++++++++++++-----
1 file changed, 18 insertions(+), 5 deletions(-)
diff --git a/counsel.el b/counsel.el
index 2616b71..fa1afd4 100644
--- a/counsel.el
+++ b/counsel.el
@@ -2254,6 +2254,14 @@
https://www.freedesktop.org/wiki/Specifications/desktop-bookmark-spec/."
(version< "25" emacs-version)
(counsel--recentf-get-xdg-recent-files))))
+(defun counsel--strip-prefix (prefix str)
+ (let ((l (length prefix)))
+ (when (string= (substring str 0 l) prefix)
+ (substring str l))))
+
+(declare-function dom-attr "dom")
+(declare-function dom-by-tag "dom")
+
(defun counsel--recentf-get-xdg-recent-files ()
"Get recent files as listed by XDG compliant programs.
@@ -2273,11 +2281,16 @@ provided by the libxml2 bindings and the \"dom\"
library."
nil
(mapcar
(lambda (bookmark-node)
- (let ((full-file-name (url-unhex-string
- (substring (dom-attr bookmark-node 'href)
- 7)))) ; Strip "file://"
- (when (file-exists-p full-file-name)
- full-file-name)))
+ (let ((local-path
+ (counsel--strip-prefix
+ "file://" (dom-attr bookmark-node 'href))))
+ (when local-path
+ (let ((full-file-name
+ (decode-coding-string
+ (url-unhex-string local-path)
+ 'utf-8)))
+ (when (file-exists-p full-file-name)
+ full-file-name)))))
(nreverse (dom-by-tag (with-temp-buffer
(insert-file-contents file-of-recent-files)
(libxml-parse-xml-region (point-min)
- [elpa] externals/ivy-hydra 40978ec 063/395: counsel.el (counsel-ag-base-command): Set default to --vimgrep, (continued)
- [elpa] externals/ivy-hydra 40978ec 063/395: counsel.el (counsel-ag-base-command): Set default to --vimgrep, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra e7146dc 066/395: counsel.el (counsel--compilation-errors-buffer): Simplify, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 148f84e 074/395: counsel.el (counsel-git): Work with utf-8 characters, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra bfefd69 075/395: counsel.el (counsel-git-occur): Fixup, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra b4d9286 080/395: ivy-test.el (ivy-read-sort-def): Add test, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 41bd988 082/395: ivy.el (ivy-alt-done): In an empty directory with no input return this directory, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 0f57db8 079/395: ivy.el (ivy--reset-state): Ensure default values are prepended, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra f8eb450 077/395: counsel.el (counsel-register): Fix for file registers in Emacs 27, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 7d94e67 087/395: Use the current prompt for shell history initial input, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra ce70661 095/395: counsel.el (counsel-grep-function): Simplfy and extend, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 51fe2ce 097/395: counsel.el (counsel--recentf-get-xdg-recent-files): Decode utf-8,
Basil L. Contovounesios <=
- [elpa] externals/ivy-hydra fb6db46 093/395: counsel.el (counsel-flycheck-occur): Add, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra e3a72a5 096/395: Add XDG recent files to counsel-recentf., Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 00e5e0d 099/395: Apply resize to window size change hook., Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 4875c7b 101/395: ivy.el (ivy-current-match): Add :extend t, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 5430e11 107/395: ivy.el (ivy-regex): Add, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra f40a465 117/395: ivy.el (ivy-avy-style): New defcustom, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra eb83a3c 110/395: ivy.el (ivy--update-minibuffer): Extract, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 5974f06 124/395: counsel.el (counsel-evil-marks): Improve, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra b8dd986 112/395: swiper.el (swiper-isearch-format-function): Fix for ivy-prescient, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 526c7aa 113/395: counsel-org-tag-action: message when a tag has been removed., Basil L. Contovounesios, 2021/02/25