* bug#24606: 25.1.50; (thing-at-point 'filename) doesn't recognize names with @
@ 2016-10-04 7:18 Tino Calancha
2016-10-04 8:02 ` Eli Zaretskii
0 siblings, 1 reply; 3+ messages in thread
From: Tino Calancha @ 2016-10-04 7:18 UTC (permalink / raw)
To: 24606; +Cc: tino.calancha
X-Debbugs-CC: Emanuel Berg <embe8573@student.uu.se>
X-Debbugs-CC: tino.calancha@gmail.com
Problem reported by Emanuel Berg in:
https://lists.gnu.org/archive/html/emacs-devel/2016-07/msg01219.html
emacs -Q:
(let ((str "/lib/systemd/system/getty@.service")
res)
(with-temp-buffer
(insert str)
(let ((thing-at-point-file-name-chars "-@~/[:alnum:]_.${}#%,:"))
(push `(thing-at-point-patched . ,(thing-at-point 'filename)) res))
(push `(thing-at-point . ,(thing-at-point 'filename)) res)) res)
=> ((thing-at-point . ".service") (thing-at-point-patched . "/lib/systemd/system/getty@.service"))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
From 3a4a8c7245a4b4713a92cd77e75a375cf366a825 Mon Sep 17 00:00:00 2001
From: Emanuel Berg <embe8573@student.uu.se>
Date: Tue, 4 Oct 2016 16:10:44 +0900
Subject: [PATCH] thing-at-point: Add @ as a valid character for file names
Reported in:
https://lists.gnu.org/archive/html/emacs-devel/2016-07/msg01219.html
* lisp/thingatpt.el (thing-at-point-file-name-chars): Add @ (Bug#24606).
---
lisp/thingatpt.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lisp/thingatpt.el b/lisp/thingatpt.el
index 9920fa0..704dc69 100644
--- a/lisp/thingatpt.el
+++ b/lisp/thingatpt.el
@@ -244,7 +244,7 @@ thing-at-point-bounds-of-list-at-point
;; Filenames
-(defvar thing-at-point-file-name-chars "-~/[:alnum:]_.${}#%,:"
+(defvar thing-at-point-file-name-chars "-@~/[:alnum:]_.${}#%,:"
"Characters allowable in filenames.")
(put 'filename 'end-op
--
2.9.3
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
In GNU Emacs 25.1.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.22.0)
of 2016-10-04 built on calancha-pc
Repository revision: 74b4f13842f3119f98797ea76d9be42457b330e1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* bug#24606: 25.1.50; (thing-at-point 'filename) doesn't recognize names with @
2016-10-04 7:18 bug#24606: 25.1.50; (thing-at-point 'filename) doesn't recognize names with @ Tino Calancha
@ 2016-10-04 8:02 ` Eli Zaretskii
2020-08-19 11:55 ` Lars Ingebrigtsen
0 siblings, 1 reply; 3+ messages in thread
From: Eli Zaretskii @ 2016-10-04 8:02 UTC (permalink / raw)
To: Tino Calancha; +Cc: 24606
> From: Tino Calancha <tino.calancha@gmail.com>
> Date: Tue, 4 Oct 2016 16:18:48 +0900 (JST)
> Cc: tino.calancha@gmail.com
>
> >From 3a4a8c7245a4b4713a92cd77e75a375cf366a825 Mon Sep 17 00:00:00 2001
> From: Emanuel Berg <embe8573@student.uu.se>
> Date: Tue, 4 Oct 2016 16:10:44 +0900
> Subject: [PATCH] thing-at-point: Add @ as a valid character for file names
>
> Reported in:
> https://lists.gnu.org/archive/html/emacs-devel/2016-07/msg01219.html
> * lisp/thingatpt.el (thing-at-point-file-name-chars): Add @ (Bug#24606).
> ---
> lisp/thingatpt.el | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lisp/thingatpt.el b/lisp/thingatpt.el
> index 9920fa0..704dc69 100644
> --- a/lisp/thingatpt.el
> +++ b/lisp/thingatpt.el
> @@ -244,7 +244,7 @@ thing-at-point-bounds-of-list-at-point
>
> ;; Filenames
>
> -(defvar thing-at-point-file-name-chars "-~/[:alnum:]_.${}#%,:"
> +(defvar thing-at-point-file-name-chars "-@~/[:alnum:]_.${}#%,:"
> "Characters allowable in filenames.")
On a typical Posix system, a file name can include any character
except '/' and a null character. So I'm not sure we should add every
character that some user somewhere needs.
How many others here need this character be in a file name, for
thing-at-point purposes? Maybe we should ask on emacs-devel before
deciding.
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#24606: 25.1.50; (thing-at-point 'filename) doesn't recognize names with @
2016-10-04 8:02 ` Eli Zaretskii
@ 2020-08-19 11:55 ` Lars Ingebrigtsen
0 siblings, 0 replies; 3+ messages in thread
From: Lars Ingebrigtsen @ 2020-08-19 11:55 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 24606, Tino Calancha
Eli Zaretskii <eliz@gnu.org> writes:
> On a typical Posix system, a file name can include any character
> except '/' and a null character. So I'm not sure we should add every
> character that some user somewhere needs.
>
> How many others here need this character be in a file name, for
> thing-at-point purposes? Maybe we should ask on emacs-devel before
> deciding.
That was three years ago, with no followup.
I don't think adding @ here is particularly vital -- you used to never
see that character in file names, but lately it seems to have become
more popular? I bump into file names like that from time to time now.
So I've applied the patch -- it's hard to see how it'd introduce any
regressions, and it's slightly useful.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-08-19 11:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-04 7:18 bug#24606: 25.1.50; (thing-at-point 'filename) doesn't recognize names with @ Tino Calancha
2016-10-04 8:02 ` Eli Zaretskii
2020-08-19 11:55 ` Lars Ingebrigtsen
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).