[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] scratch/hyperbole-merge-7.0.2b 450489e 13/23: Adjust tramp-file-n
From: |
Stefan Monnier |
Subject: |
[elpa] scratch/hyperbole-merge-7.0.2b 450489e 13/23: Adjust tramp-file-name-regexp to work with looking-at |
Date: |
Tue, 5 Feb 2019 16:11:20 -0500 (EST) |
branch: scratch/hyperbole-merge-7.0.2b
commit 450489ed67a192bde6504370f2fdf850c54ea7e4
Author: Mats Lidell <address@hidden>
Commit: Mats Lidell <address@hidden>
Adjust tramp-file-name-regexp to work with looking-at
Recent updates to tramp have introduced an ending match of empty
string that does not work together with looking-at as used in
hpath.
A promising alternative to this change would be to use file-remote-p
in combination with a regexp that finds a possible filename after
point. This would remove the dependency on the internal regexp in
tramp.
---
hpath.el | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/hpath.el b/hpath.el
index d26678d..9e076e9 100644
--- a/hpath.el
+++ b/hpath.el
@@ -4,7 +4,7 @@
;;
;; Orig-Date: 1-Nov-91 at 00:44:23
;;
-;; Copyright (C) 1991-2016 Free Software Foundation, Inc.
+;; Copyright (C) 1991-2016, 2018 Free Software Foundation, Inc.
;; See the "HY-COPY" file for license information.
;;
;; This file is part of GNU Hyperbole.
@@ -372,6 +372,15 @@ directories. The first one in which PATH is found is
used."
(or (file-exists-p rtn) (setq rtn nil)))
(or rtn path)))))
+(defun hpath:tramp-file-name-regexp ()
+ "Returns a modified tramp-file-name-regexp used for checking if
+point is at the beginning of a remote file name. Removes match
+to bol and remove match to empty string if present."
+ (let ((tramp-regexp (car (if (fboundp 'tramp-file-name-structure)
+ (tramp-file-name-structure)
+ tramp-file-name-structure))))
+ (substring-no-properties (replace-regexp-in-string "\\\\'" ""
tramp-regexp) 1)))
+
(defun hpath:remote-at-p ()
"Returns a remote pathname that point is within or nil.
See the `(emacs)Remote Files' info documentation for pathname format details.
@@ -385,10 +394,7 @@ Always returns nil if (hpath:remote-available-p) returns
nil."
(skip-chars-backward "^[ \t\n\r\f\"`'|\(\{<")
(cond
((and (eq remote-package 'tramp)
- ;; Remove match to bol in this regexp before testing.
- (looking-at (substring-no-properties (car (if (fboundp
'tramp-file-name-structure)
-
(tramp-file-name-structure)
-
tramp-file-name-structure)) 1)))
+ (looking-at (hpath:tramp-file-name-regexp)))
(match-string-no-properties 0))
((looking-at hpath:url-regexp)
(if (string-equal (match-string-no-properties
hpath:protocol-grpn) "ftp")
- [elpa] scratch/hyperbole-merge-7.0.2b b7beb76 02/23: Fixed hkey-throw temporary display of a buffer in a new frame, (continued)
- [elpa] scratch/hyperbole-merge-7.0.2b b7beb76 02/23: Fixed hkey-throw temporary display of a buffer in a new frame, Stefan Monnier, 2019/02/05
- [elpa] scratch/hyperbole-merge-7.0.2b 7efe2f2 03/23: Removed Koutliner use of filladapt mode; it can cause filling errors, Stefan Monnier, 2019/02/05
- [elpa] scratch/hyperbole-merge-7.0.2b 30600eb 04/23: Added extensive gitlab-reference ibtype; improved github-reference, Stefan Monnier, 2019/02/05
- [elpa] scratch/hyperbole-merge-7.0.2b 1568adb 07/23: Merge Mats TEXINFO_SRC Makefile changes, Stefan Monnier, 2019/02/05
- [elpa] scratch/hyperbole-merge-7.0.2b ad584fd 11/23: Use implicit button org-mode also for org derived modes, Stefan Monnier, 2019/02/05
- [elpa] scratch/hyperbole-merge-7.0.2b f446ee0 22/23: Fixed README.md typo that referred to HY-ABOUT instead of HY-NEWS., Stefan Monnier, 2019/02/05
- [elpa] scratch/hyperbole-merge-7.0.2b 45a0841 12/23: Add default search term for web searches, Stefan Monnier, 2019/02/05
- [elpa] scratch/hyperbole-merge-7.0.2b d4653c5 10/23: Require 2.0 of treemacs and use bury-buffer, Stefan Monnier, 2019/02/05
- [elpa] scratch/hyperbole-merge-7.0.2b c0bd503 05/23: Rebuild doc when doc sources have changed, Stefan Monnier, 2019/02/05
- [elpa] scratch/hyperbole-merge-7.0.2b 5892083 09/23: Use new treemacs 1.18 function treemacs-toggle-node, Stefan Monnier, 2019/02/05
- [elpa] scratch/hyperbole-merge-7.0.2b 450489e 13/23: Adjust tramp-file-name-regexp to work with looking-at,
Stefan Monnier <=
- [elpa] scratch/hyperbole-merge-7.0.2b 2e878cb 16/23: Initial commit of Windows path handling, Stefan Monnier, 2019/02/05
- [elpa] scratch/hyperbole-merge-7.0.2b d729726 21/23: Merge branch 'master' of github.com:rswgnu/hyperbole, Stefan Monnier, 2019/02/05
- [elpa] scratch/hyperbole-merge-7.0.2b 66106d3 08/23: Fixed issue with inhibit-hyperbole-messaging not be set properly, Stefan Monnier, 2019/02/05
- [elpa] scratch/hyperbole-merge-7.0.2b afe3db8 06/23: Added 'k' to klink ids exported to html;, Stefan Monnier, 2019/02/05
- [elpa] scratch/hyperbole-merge-7.0.2b 09e646e 17/23: Add implicit path button support for MSWindows paths, Stefan Monnier, 2019/02/05
- [elpa] scratch/hyperbole-merge-7.0.2b b02bf71 19/23: Merge branch 'master' of git.sv.gnu.org:/srv/git/hyperbole with changes, Stefan Monnier, 2019/02/05
- [elpa] scratch/hyperbole-merge-7.0.2b 6139ba6 20/23: Set theme jekyll-theme-cayman, Stefan Monnier, 2019/02/05
- [elpa] scratch/hyperbole-merge-7.0.2b bda4f2d 15/23: Merge remote-tracking branch 'hyperbole/master' into externals/hyperbole, Stefan Monnier, 2019/02/05
- [elpa] scratch/hyperbole-merge-7.0.2b f3d59c4 18/23: Large set of BW changes for V7.0.2b pre-release., Stefan Monnier, 2019/02/05
- [elpa] scratch/hyperbole-merge-7.0.2b c75213b 23/23: Merge remote-tracking branch 'hyperbole/master' into externals/hyperbole, Stefan Monnier, 2019/02/05