From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.devel Subject: systemd @ in filenames not supported by thing-at-point Date: Sat, 30 Jul 2016 03:35:10 +0200 Message-ID: <867fc3zz5d.fsf@student.uu.se> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1469842553 5900 80.91.229.3 (30 Jul 2016 01:35:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 30 Jul 2016 01:35:53 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jul 30 03:35:44 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bTJBn-0001dB-I1 for ged-emacs-devel@m.gmane.org; Sat, 30 Jul 2016 03:35:43 +0200 Original-Received: from localhost ([::1]:33821 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bTJBh-0000GI-KY for ged-emacs-devel@m.gmane.org; Fri, 29 Jul 2016 21:35:37 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45274) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bTJBZ-0000Es-OD for emacs-devel@gnu.org; Fri, 29 Jul 2016 21:35:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bTJBV-0007WE-Fa for emacs-devel@gnu.org; Fri, 29 Jul 2016 21:35:29 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:46973) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bTJBV-0007Sx-8b for emacs-devel@gnu.org; Fri, 29 Jul 2016 21:35:25 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1bTJBM-0001U6-4d for emacs-devel@gnu.org; Sat, 30 Jul 2016 03:35:16 +0200 Original-Received: from c-9ce1e655.08-680-7570702.cust.bredbandsbolaget.se ([85.230.225.156]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 30 Jul 2016 03:35:16 +0200 Original-Received: from embe8573 by c-9ce1e655.08-680-7570702.cust.bredbandsbolaget.se with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 30 Jul 2016 03:35:16 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: emacs-devel@gnu.org Original-Lines: 45 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-9ce1e655.08-680-7570702.cust.bredbandsbolaget.se Mail-Copies-To: never User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) Cancel-Lock: sha1:A7J2Q9X4IqQSE5IYmtl01+KkOj8= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:206235 Archived-At: I have this function to get to a file which is a path in a buffer: (defun find-file-at-line (&optional other-window) (interactive "P") (let ((possible-filename (thing-at-point 'filename t)) ; NO-PROPERTIES (find-fun (if other-window #'find-file-other-window #'find-file)) ) (if (and possible-filename (file-exists-p possible-filename)) (apply find-fun (list possible-filename)) (progn (forward-char 1) (find-file-at-line) )))) As you see, it relies on `thing-at-point' and "filename". However, with the lambasted systemd, files are sometimes include an "@", as in /lib/systemd/system/getty@.service I just now noticed that my function, or rather `thing-at-point', breaks on such paths because of this setting: (defvar thing-at-point-file-name-chars "-~/[:alnum:]_.${}#%,:" "Characters allowable in filenames.") (line 241 in /usr/share/emacs/24.4/lisp/thingatpt.el.gz ) Because "@" isn't included, it is considered a file name delimiter and the path returned is incorrectly /lib/systemd/system/getty - with this: (setq thing-at-point-file-name-chars "@-~/[:alnum:]_.${}#%,:") it works as expected. But I don't know if that will break something else? -- underground experts united .... http://user.it.uu.se/~embe8573 Emacs Gnus Blogomatic ......... http://user.it.uu.se/~embe8573/blogomatic - so far: 64 Blogomatic articles -