From unknown Wed Jun 18 00:21:05 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#78769 <78769@debbugs.gnu.org> To: bug#78769 <78769@debbugs.gnu.org> Subject: Status: 31.0.50; improve ffap-file-name-with-spaces Reply-To: bug#78769 <78769@debbugs.gnu.org> Date: Wed, 18 Jun 2025 07:21:05 +0000 retitle 78769 31.0.50; improve ffap-file-name-with-spaces reassign 78769 emacs submitter 78769 Madhu severity 78769 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 11 21:10:17 2025 Received: (at submit) by debbugs.gnu.org; 12 Jun 2025 01:10:17 +0000 Received: from localhost ([127.0.0.1]:54186 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uPWSO-0003j7-Eb for submit@debbugs.gnu.org; Wed, 11 Jun 2025 21:10:17 -0400 Received: from lists.gnu.org ([2001:470:142::17]:43490) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uPWSL-0003fP-6r for submit@debbugs.gnu.org; Wed, 11 Jun 2025 21:10:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uPWSF-0003UI-Br for bug-gnu-emacs@gnu.org; Wed, 11 Jun 2025 21:10:07 -0400 Received: from smtp2.ctinetworks.com ([205.166.61.237]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uPWSD-0007LI-8b for bug-gnu-emacs@gnu.org; Wed, 11 Jun 2025 21:10:07 -0400 X-ctinetworks-Watermark: 1750554600.882@oM3IL7NiICdx+i4cgYEEgg X-ctinetworks-Envelope-From: enometh@meer.net X-ctinetworks-SpamCheck: X-ctinetworks-VirusCheck: Found to be clean X-ctinetworks-Message-ID: A874FEC53.A7FD2 Received: from localhost (unknown [117.254.37.235]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: enometh@meer.net) by smtp2.ctinetworks.com (Postfix) with ESMTPSA id A874FEC53 for ; Wed, 11 Jun 2025 21:09:59 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.ctinetworks.com A874FEC53 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=meer.net; s=ctidkims1; t=1749690600; bh=3d3OhlZ1ZuuRjFWKIQ59HNHdJ/iSIAw4e37LK4XRybY=; h=Date:To:Subject:From:In-Reply-To:References:From; b=Plkdl0iKqAHI9yQ22TNV1X71lI+7wmOrR5z6fZgA3fumB9lFpA/JheMRn3hw5d8Ew rG8hN67o3s50fVZZ5tP+g5HKtgMWXl+CBeJKpK8etAVVait54Udj7VZ9cdy5/2L0R3 4qOOXOVQtsee25FD4apMKmzYM486OYJ/WGWHiuvw= Date: Thu, 12 Jun 2025 06:39:53 +0530 (IST) Message-Id: <20250612.063953.1116300144092858706.enometh@meer.net> To: bug-gnu-emacs@gnu.org Subject: 31.0.50; improve ffap-file-name-with-spaces From: Madhu In-Reply-To: <86bjqyhkad.fsf@gnu.org> References: <86bjqyhkad.fsf@gnu.org> X-Mailer: Mew version 6.9 on Emacs 31.0.50 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=205.166.61.237; envelope-from=enometh@meer.net; helo=smtp2.ctinetworks.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) This is with regard to: * Eli Zaretskii <86bjqyhkad.fsf@gnu.org> Wrote on Sun, 08 Jun 2025 08:30:50 +0300 >> Date: Sun, 08 Jun 2025 08:46:26 +0530 >> From: Madhu >> there is the "recently" (i.e. within living memory, or within 5 years) >> introduced ffap-file-name-with-spaces which helps but it breaks ffap on >> files with "~" patterns like "~/tmp/foo bar/var" patterns and generally >> breaks "~/tmp/". > > It's actually worse than that: Windows-style d:/foo/bar file names > (which AFAIU were the motivation for the change) are also broken when > this option is non-nil (and the test suite just codifies the incorrect > results!). > > Please submit a bug report about this semi-broken "feature". It must > be improved. The code paths were introduced in * commit f3afb23d26b948cfa095b221ca32090a2858e8f1 |Author: Jari Aalto |AuthorDate: Sat Aug 15 12:11:41 2020 +0200 |Commit: Lars Ingebrigtsen |CommitDate: Sat Aug 15 12:11:41 2020 +0200 | | Add support for ffap guessing at file names containing spaces | | * lisp/ffap.el (ffap-file-name-with-spaces): New variable (bug#8439). | (ffap-search-backward-file-end, ffap-search-forward-file-end) | (ffap-dir-separator-near-point): New functions. | (ffap-string-at-point): Use the variable and the new functions to | guess at files containing strings. After a bit of investigation, there are a couple of points. First I think my use case of completing unix file names and spaces can be supported without touching the existing code paths which use ffap-file-name-with-spaces: This simlply involves extending with the space character the car of the alist entry for `file' in ffap-string-at-point-mode-alist, when it is used in ffap-string-at-point (setq args (assq 'file ffap-string-at-point-mode-alist)) ;; => (file "--:\\\\${}+<>@-Z_[:alpha:]~*?#" "{<@" "@>;.,!:}") ;; note the first three characters of (car args) is just obscure ;; notation which expands to "-./0123456789:" ;; (apply 'string (loop for i from ?\- to ?\: collect i)) For testing, I propose introducing a new variable (defvar ffap-file-name-with-spaces-only t) and modifying the uses in ffap-string-at-point like this: ``` - (skip-chars-forward (car args)) + (skip-chars-forward (if ffap-file-name-with-spaces-only + (concat (car args) " ") + (car args))) ``` This seems to be enough for ffap on my local files Additional Proposed change 1a: "%" be added to (car args) - as this commoon in url-hexified filenames 2a. I haven't understand the windows related use cases of that ffap-file-name-with-spaces targeted, but fixing recognition of ~/dir/file patterns can be hard coded by fixing up the code which finds the `beg` point like this: ``` + (if (eql (char-after (1- (point))) ?~) + (goto-char (1- (point)))) ``` 2b. A possible improvement for for finding `end' point which seems to work on the few test cases I tried is like this: ``` - (when (and ffap-file-name-with-spaces + (when (and ffap-file-name-with-spaces ;nil + (setq dir-separator (ffap-dir-separator-near-point)) ``` With these changes the entire code for ffap-string-at-point looks like this. (Please let me know if you think I should just jave attached a diff, as most if it is unchanged. If you can try this definition with some ad-hoc testing and have any comments on how to go about this, I can follow up with specific test cases for these changes. ---Madhu ``` (defvar ffap-file-name-with-spaces-only t) (defun ffap-string-at-point (&optional mode) (let* (dir-separator (args (cdr (or (assq (or mode major-mode) ffap-string-at-point-mode-alist) (assq 'file ffap-string-at-point-mode-alist)))) (region-selected (use-region-p)) (pt (point)) (beg (if region-selected (region-beginning) (save-excursion (if (and ffap-file-name-with-spaces ;nil (memq mode '(nil file))) (when (setq dir-separator (ffap-dir-separator-near-point)) (while (re-search-backward (regexp-quote dir-separator) (line-beginning-position) t) (goto-char (match-beginning 0))) (cl-assert (looking-at "/")) (if (eql (char-after (1- (point))) ?~) (goto-char (1- (point)))) ) (progn (skip-chars-backward (if ffap-file-name-with-spaces-only (concat (car args) " ") (car args))) (skip-chars-forward (nth 1 args) pt))) (point)))) (end (if region-selected (region-end) (save-excursion (skip-chars-forward (if ffap-file-name-with-spaces-only (concat (car args) " ") (car args))) (skip-chars-backward (nth 2 args) pt) (when (and ffap-file-name-with-spaces ;nil (setq dir-separator (ffap-dir-separator-near-point)) (memq mode '(nil file))) (ffap-search-forward-file-end dir-separator) (ffap-search-backward-file-end dir-separator)) (point)))) (region-len (- (max beg end) (min beg end)))) ;; If the initial characters of the to-be-returned string are the ;; current major mode's comment starter characters, *and* are ;; not part of a comment, remove those from the returned string ;; (Bug#24057). ;; Example comments in `c-mode' (which considers lines beginning ;; with "//" as comments): ;; //tmp - This is a comment. It does not contain any path reference. ;; ///tmp - This is a comment. The "/tmp" portion in that is a path. ;; ////tmp - This is a comment. The "//tmp" portion in that is a path. (when (and ;; Proceed if no region is selected by the user. (null region-selected) ;; Check if END character is part of a comment. (save-excursion (nth 4 (syntax-ppss end)))) ;; Move BEG to beginning of comment (after the comment start ;; characters), or END, whichever comes first. (save-excursion (let ((state (syntax-ppss beg))) ;; (nth 4 (syntax-ppss)) will be nil for comment start chars. (unless (nth 4 state) (parse-partial-sexp beg end nil nil state :commentstop) (setq beg (point)))))) (if (and (natnump ffap-max-region-length) (< region-len ffap-max-region-length)) ; Bug#25243. (setf ffap-string-at-point-region (list beg end) ffap-string-at-point (buffer-substring-no-properties beg end)) (setf ffap-string-at-point-region (list 1 1) ffap-string-at-point "")))) ``` From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 12 02:19:56 2025 Received: (at 78769) by debbugs.gnu.org; 12 Jun 2025 06:19:56 +0000 Received: from localhost ([127.0.0.1]:55363 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uPbI3-0002DU-Fs for submit@debbugs.gnu.org; Thu, 12 Jun 2025 02:19:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34052) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uPbI0-0002DB-Oi for 78769@debbugs.gnu.org; Thu, 12 Jun 2025 02:19:53 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uPbHu-00060U-Ou; Thu, 12 Jun 2025 02:19:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=QCGc/ROXJPwCcEwUOruorp2Mhpz5cFoMeXEYRnAnEFo=; b=r0JBnDXGTl5g bXkqsNW0sSMkdlc1hJRPOt6Cpj0xHzKKkRfFzxjP9sA6CRgWWTLGqad+D28NiISqiOblNPDLbuT/i rKfwQ26nq5IK4xG82+QGWFsve+sqZzX5B6T2lgFc2dWV0poDrPotD1KhbQWyjysBXkBFiWfaEAgsz LR4h+bkcAZM1zz8+BczOI/vmse8pWmusa59wgF2wy73baK1z1aiYJ47/jePSK8RJ+dKUgsrfx1VQW 9a2ysZw86njENRjaIHsE3JuNIhHCBIgmgPeu3hr/wJWD1aJCGGgGI/vS09ynkfPBSbteW7O0AlVKW UuIEaKGCz8e4NsD+HkFXPw==; Date: Thu, 12 Jun 2025 09:19:31 +0300 Message-Id: <867c1hh47g.fsf@gnu.org> From: Eli Zaretskii To: Madhu In-Reply-To: <20250612.063953.1116300144092858706.enometh@meer.net> (bug-gnu-emacs@gnu.org) Subject: Re: bug#78769: 31.0.50; improve ffap-file-name-with-spaces References: <86bjqyhkad.fsf@gnu.org> <20250612.063953.1116300144092858706.enometh@meer.net> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 78769 Cc: 78769@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Thu, 12 Jun 2025 06:39:53 +0530 (IST) > From: Madhu via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > This is with regard to: > > * Eli Zaretskii <86bjqyhkad.fsf@gnu.org> > Wrote on Sun, 08 Jun 2025 08:30:50 +0300 > >> Date: Sun, 08 Jun 2025 08:46:26 +0530 > >> From: Madhu > >> there is the "recently" (i.e. within living memory, or within 5 years) > >> introduced ffap-file-name-with-spaces which helps but it breaks ffap on > >> files with "~" patterns like "~/tmp/foo bar/var" patterns and generally > >> breaks "~/tmp/". > > > > It's actually worse than that: Windows-style d:/foo/bar file names > > (which AFAIU were the motivation for the change) are also broken when > > this option is non-nil (and the test suite just codifies the incorrect > > results!). > > > > Please submit a bug report about this semi-broken "feature". It must > > be improved. > > The code paths were introduced in > * commit f3afb23d26b948cfa095b221ca32090a2858e8f1 > |Author: Jari Aalto > |AuthorDate: Sat Aug 15 12:11:41 2020 +0200 > |Commit: Lars Ingebrigtsen > |CommitDate: Sat Aug 15 12:11:41 2020 +0200 > | > | Add support for ffap guessing at file names containing spaces > | > | * lisp/ffap.el (ffap-file-name-with-spaces): New variable (bug#8439). > | (ffap-search-backward-file-end, ffap-search-forward-file-end) > | (ffap-dir-separator-near-point): New functions. > | (ffap-string-at-point): Use the variable and the new functions to > | guess at files containing strings. > > After a bit of investigation, there are a couple of points. > > First I think my use case of completing unix file names and spaces can > be supported without touching the existing code paths which use > ffap-file-name-with-spaces: > > This simlply involves extending with the space character the car of > the alist entry for `file' in ffap-string-at-point-mode-alist, when it > is used in ffap-string-at-point > > (setq args > (assq 'file ffap-string-at-point-mode-alist)) > > ;; => (file "--:\\\\${}+<>@-Z_[:alpha:]~*?#" "{<@" "@>;.,!:}") > > ;; note the first three characters of (car args) is just obscure > ;; notation which expands to "-./0123456789:" > ;; (apply 'string (loop for i from ?\- to ?\: collect i)) Thanks. I meanwhile installed on the master branch of the Emacs Git repository, 4 days ago, a change which should fix the problem you reported. If you are using the master branch, updating from Git should solve these problems for you. Could you please try the latest master branch and see if it solves this problem? From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 12 21:48:57 2025 Received: (at 78769) by debbugs.gnu.org; 13 Jun 2025 01:48:57 +0000 Received: from localhost ([127.0.0.1]:33972 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uPtXL-0007KL-Uq for submit@debbugs.gnu.org; Thu, 12 Jun 2025 21:48:56 -0400 Received: from smtp2.ctinetworks.com ([205.166.61.237]:54524) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uPtXI-0007Je-Kl for 78769@debbugs.gnu.org; Thu, 12 Jun 2025 21:48:54 -0400 X-ctinetworks-Watermark: 1750643331.94028@8DMdeSjSjqGFxhc7hEPJ9A X-ctinetworks-Envelope-From: enometh@meer.net X-ctinetworks-SpamCheck: X-ctinetworks-VirusCheck: Found to be clean X-ctinetworks-Message-ID: 51C56EC4A.AAD8B Received: from localhost (unknown [117.254.37.20]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: enometh@meer.net) by smtp2.ctinetworks.com (Postfix) with ESMTPSA id 51C56EC4A; Thu, 12 Jun 2025 21:48:50 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.ctinetworks.com 51C56EC4A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=meer.net; s=ctidkims1; t=1749779331; bh=5HhoRdSGn717ZQJOXmDRo0ZOF7ZVSbAGYDUbTMoUqQo=; h=Date:To:Cc:Subject:From:In-Reply-To:References:From; b=X4U0efEI1wiMKukjv0EnLPjwnyyKJcRaJZ3U5HSlFQeL8/MElKn3oY49wa/egfqtz DLUBR7Q7XRD2sBt8KnKAC22JlYxa7UQEOOC2Olq4TZLTnXIbouf86AVlFfY848XMl9 b1BUjolWItB1Q++ATZycEhNGuR0QVlKeo0AMUWo8= Date: Fri, 13 Jun 2025 07:18:52 +0530 (IST) Message-Id: <20250613.071852.668020991750747584.enometh@meer.net> To: eliz@gnu.org Subject: Re: bug#78769: 31.0.50; improve ffap-file-name-with-spaces From: Madhu In-Reply-To: <867c1hh47g.fsf@gnu.org> References: <86bjqyhkad.fsf@gnu.org> <20250612.063953.1116300144092858706.enometh@meer.net> <867c1hh47g.fsf@gnu.org> X-Mailer: Mew version 6.9 on Emacs 31.0.50 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 78769 Cc: 78769@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * Eli Zaretskii <867c1hh47g.fsf@gnu.org> Wrote on Thu, 12 Jun 2025 09:19:31 +0300 > Thanks. I meanwhile installed on the master branch of the Emacs Git > repository, 4 days ago, a change which should fix the problem you > reported. If you are using the master branch, updating from Git > should solve these problems for you. Could you please try the latest > master branch and see if it solves this problem? Yes, I applied the patch from commit ff8c0648fb4dd67bf and it fixes the problem mentioned on the help mailing list with the variable turned on. Thanks. That was quick. From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 13 02:45:00 2025 Received: (at 78769-done) by debbugs.gnu.org; 13 Jun 2025 06:45:00 +0000 Received: from localhost ([127.0.0.1]:37527 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uPy9r-0008V8-JX for submit@debbugs.gnu.org; Fri, 13 Jun 2025 02:44:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38912) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uPy9o-0008TQ-FE for 78769-done@debbugs.gnu.org; Fri, 13 Jun 2025 02:44:57 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uPy9i-00063x-RU; Fri, 13 Jun 2025 02:44:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=1Zul6WqBaYqcU2WF2mdHqpGdwZyifDqihLZZXib3gws=; b=ViUDAOMo++ND oGTatx99VwqD99fHfBSwLHBhmjzWUJzMw2LutpofBILn/hrkeI96xk6msNV7aDwmYuFWH0PuW+vvh vkjQsIpSDdqLwOgqB6J/NPo0DHlky6Tr3ENpgougxExGw9YRe9vqDIA6ND5Ge3SP1o2EqG2m6aSb/ T09hb5EkYRsIv7xVSwwj8VAgNdx7useBzDhS3HR9a0P8ydUO7/iePB+UDHxe/GpB5RTzNDz/mE7t6 0ICnoH9442w/INsrCkUS5sh4YFx1clUddzcA7j5YcoA/DSmV9+2FdqGpOBqFNc6fe4AJ+m6Pc/y4y LzIo4Z9NU8YGIBx9GoYInA==; Date: Fri, 13 Jun 2025 09:44:48 +0300 Message-Id: <86msacdtsv.fsf@gnu.org> From: Eli Zaretskii To: Madhu In-Reply-To: <20250613.071852.668020991750747584.enometh@meer.net> (message from Madhu on Fri, 13 Jun 2025 07:18:52 +0530 (IST)) Subject: Re: bug#78769: 31.0.50; improve ffap-file-name-with-spaces References: <86bjqyhkad.fsf@gnu.org> <20250612.063953.1116300144092858706.enometh@meer.net> <867c1hh47g.fsf@gnu.org> <20250613.071852.668020991750747584.enometh@meer.net> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 78769-done Cc: 78769-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Fri, 13 Jun 2025 07:18:52 +0530 (IST) > Cc: 78769@debbugs.gnu.org > From: Madhu > > * Eli Zaretskii <867c1hh47g.fsf@gnu.org> > Wrote on Thu, 12 Jun 2025 09:19:31 +0300 > > Thanks. I meanwhile installed on the master branch of the Emacs Git > > repository, 4 days ago, a change which should fix the problem you > > reported. If you are using the master branch, updating from Git > > should solve these problems for you. Could you please try the latest > > master branch and see if it solves this problem? > > Yes, I applied the patch from commit ff8c0648fb4dd67bf and it fixes > the problem mentioned on the help mailing list with the variable > turned on. Thanks. That was quick. The problem bothered me a lot, so I worked on it right away. Thanks for testing, I'm therefore closing this bug. From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 13 03:06:25 2025 Received: (at 78769-done) by debbugs.gnu.org; 13 Jun 2025 07:06:25 +0000 Received: from localhost ([127.0.0.1]:37563 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uPyUa-0004Iw-9K for submit@debbugs.gnu.org; Fri, 13 Jun 2025 03:06:25 -0400 Received: from smtp0.ctinetworks.com ([205.166.61.207]:59574) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uPyUW-0004IJ-Vp for 78769-done@debbugs.gnu.org; Fri, 13 Jun 2025 03:06:22 -0400 X-ctinetworks-Watermark: 1750662380.04923@j8Zd7fjgSFxUya7P/TrpqQ X-ctinetworks-Envelope-From: enometh@meer.net X-ctinetworks-SpamCheck: X-ctinetworks-VirusCheck: Found to be clean X-ctinetworks-Message-ID: 074F56446.A5C75 Received: from localhost (unknown [117.254.37.166]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: enometh@meer.net) by smtp0.ctinetworks.com (Postfix) with ESMTPSA id 074F56446; Fri, 13 Jun 2025 03:06:16 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp0.ctinetworks.com 074F56446 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=meer.net; s=ctidkims1; t=1749798377; bh=BSU0VQ00/gjRSXh+jKvYtkKCSnlarl3dL8SwnO/4458=; h=Date:To:Cc:Subject:From:In-Reply-To:References:From; b=D38ZVsosNVr8ztTIshhKxKLp3h/Mg1I/ZRcpXATNnX3JmiX8QyF9iYUPUQY6wpitx oQrUYu9PED2htycuOFhMW3MS/eMWdoLNKu4RIP2vmBFfMCSWGAHFwwWN+Yge6kii+u rpmMlT30YZpI+fXOXoxPYBSfyhSCgRxUmQz4of+o= Date: Fri, 13 Jun 2025 12:35:52 +0530 (IST) Message-Id: <20250613.123552.1269875385960614753.enometh@meer.net> To: eliz@gnu.org Subject: Re: bug#78769: 31.0.50; improve ffap-file-name-with-spaces From: Madhu In-Reply-To: <86msacdtsv.fsf@gnu.org> References: <867c1hh47g.fsf@gnu.org> <20250613.071852.668020991750747584.enometh@meer.net> <86msacdtsv.fsf@gnu.org> X-Mailer: Mew version 6.9 on Emacs 31.0.50 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 78769-done Cc: 78769-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * Eli Zaretskii <86msacdtsv.fsf@gnu.org> Wrote on Fri, 13 Jun 2025 09:44:48 +0300 > The problem bothered me a lot, so I worked on it right away. > > Thanks for testing, I'm therefore closing this bug. Thanks, it may be worth mentioning that setting ffap-file-name-with-spaces t has undsired effects on regular ffap. eg: ffap on the /etc/passwd on the line ``` /etc/passwd /etc/hosts ``` will return /etc not the full path. but this is a known limitation. [Unfortunately it is also a limitation in the other implementation I proposed, that of extending (assq 'file ffap-string-at-point-mode-alist) so that doesn't buy anything.] From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 13 03:21:49 2025 Received: (at 78769) by debbugs.gnu.org; 13 Jun 2025 07:21:50 +0000 Received: from localhost ([127.0.0.1]:37599 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uPyjU-0007JI-Dw for submit@debbugs.gnu.org; Fri, 13 Jun 2025 03:21:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51132) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uPyjR-0007Hg-5o for 78769@debbugs.gnu.org; Fri, 13 Jun 2025 03:21:46 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uPyjL-0003Lx-Jn; Fri, 13 Jun 2025 03:21:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=9KErbYrxOYgVI3eRSZvpleyY7bLQ2PAhyx6PKRSRKWk=; b=n/1rOY+C4MfrvRMlPKSo hPz3sJPa12pI70bNARWWM94K403hFr2qgrfmUk1V4JmisJeWk3TLqt5Ltwy8Dq9tsHb7JjEMmnGYU RJUdnlPzWQrwrppT5B2akgL8QXCfPcEPrWnVt3BXsN02TzcjWpzjW2ORJj/yz5kRtgE5feW2p34rf hJBip3H0GoQx1upqph5IGJVCukckSOAQrtVN2PhnT4wZ+yPZkTs8IPcoaWqAArvN4QOTArMFBd+zL E9volkt1aTQiQUcg57XywxikiUbO6mSDpUDVyaTUI3RRUd+V5SJqtMqrwHwgiB+BXLdyMWw02qtxO qNVGvp+9S1aftA==; Date: Fri, 13 Jun 2025 10:21:37 +0300 Message-Id: <86ldpwds3i.fsf@gnu.org> From: Eli Zaretskii To: Madhu In-Reply-To: <20250613.123552.1269875385960614753.enometh@meer.net> (message from Madhu on Fri, 13 Jun 2025 12:35:52 +0530 (IST)) Subject: Re: bug#78769: 31.0.50; improve ffap-file-name-with-spaces References: <867c1hh47g.fsf@gnu.org> <20250613.071852.668020991750747584.enometh@meer.net> <86msacdtsv.fsf@gnu.org> <20250613.123552.1269875385960614753.enometh@meer.net> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 78769 Cc: 78769@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Fri, 13 Jun 2025 12:35:52 +0530 (IST) > Cc: 78769-done@debbugs.gnu.org > From: Madhu > > * Eli Zaretskii <86msacdtsv.fsf@gnu.org> > Wrote on Fri, 13 Jun 2025 09:44:48 +0300 > > The problem bothered me a lot, so I worked on it right away. > > > > Thanks for testing, I'm therefore closing this bug. > > Thanks, it may be worth mentioning that setting > ffap-file-name-with-spaces t has undsired effects on regular ffap. eg: > ffap on the /etc/passwd on the line > > ``` > /etc/passwd /etc/hosts > ``` > > will return /etc not the full path. > > but this is a known limitation. > > [Unfortunately it is also a limitation in the other implementation I > proposed, that of extending > (assq 'file ffap-string-at-point-mode-alist) > so that doesn't buy anything.] I think this aspect is already in the doc string of the variable: Enabling this variable may lead to ‘find-file-at-point’ guessing wrong more often when trying to find a file name intermingled with normal text, but can be useful when working on systems that normally use spaces in file names (like Microsoft Windows and the like). From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 14 11:37:44 2025 Received: (at 78769) by debbugs.gnu.org; 14 Jun 2025 15:37:44 +0000 Received: from localhost ([127.0.0.1]:41138 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uQSwy-0007Wo-2N for submit@debbugs.gnu.org; Sat, 14 Jun 2025 11:37:44 -0400 Received: from smtp0.ctinetworks.com ([205.166.61.207]:49214) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uQSwv-0007Wf-Ql for 78769@debbugs.gnu.org; Sat, 14 Jun 2025 11:37:42 -0400 X-ctinetworks-Watermark: 1750779461.26996@3Xc04piHKjtn7okTBupEiA X-ctinetworks-Envelope-From: enometh@meer.net X-ctinetworks-SpamCheck: X-ctinetworks-VirusCheck: Found to be clean X-ctinetworks-Message-ID: 995F4644E.A64EB Received: from localhost (unknown [117.254.36.156]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: enometh@meer.net) by smtp0.ctinetworks.com (Postfix) with ESMTPSA id 995F4644E; Sat, 14 Jun 2025 11:37:39 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp0.ctinetworks.com 995F4644E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=meer.net; s=ctidkims1; t=1749915460; bh=2O+fAhWlgWSJRI6XvAbBSnWOZeWi3nSXyO3ODO/Q0zU=; h=Date:To:Cc:Subject:From:In-Reply-To:References:From; b=u003cdmvMd202fPlJOUUBgVjOnbQrRcKQOqqA/uKNjropxCGXmUIj6DzbVV5xewoQ n6LaMmqOOL5NSW+hvZI/rdH/MdDtcafD28Nr1Bt7i+zjzSMwXHZ9gZkRFqUNpHY+Yf v0BjOQBY6h7+cB247kjQuKIt2MYpF7QttZ9aHwpI= Date: Sat, 14 Jun 2025 21:07:38 +0530 (IST) Message-Id: <20250614.210738.51924346192378408.enometh@meer.net> To: eliz@gnu.org Subject: Re: bug#78769: 31.0.50; improve ffap-file-name-with-spaces From: Madhu In-Reply-To: <86ldpwds3i.fsf@gnu.org> References: <86msacdtsv.fsf@gnu.org> <20250613.123552.1269875385960614753.enometh@meer.net> <86ldpwds3i.fsf@gnu.org> X-Mailer: Mew version 6.9 on Emacs 31.0.50 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Score: 3.6 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * Eli Zaretskii <86ldpwds3i.fsf@gnu.org> Wrote on Fri, 13 Jun 2025 10:21:37 +0300 >> [Unfortunately it is also a limitation in the other implementation I >> proposed, that of extending [...] Content analysis details: (3.6 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [205.166.61.207 listed in sa-accredit.habeas.com] 3.6 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS [117.254.36.156 listed in zen.spamhaus.org] 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [205.166.61.207 listed in bl.score.senderscore.com] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record X-Debbugs-Envelope-To: 78769 Cc: 78769@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.6 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: * Eli Zaretskii <86ldpwds3i.fsf@gnu.org> Wrote on Fri, 13 Jun 2025 10:21:37 +0300 >> [Unfortunately it is also a limitation in the other implementation I >> proposed, that of extending [...] Content analysis details: (2.6 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [205.166.61.207 listed in sa-trusted.bondedsender.org] 3.6 RCVD_IN_SBL_CSS RBL: Received via a relay in Spamhaus SBL-CSS [117.254.36.156 listed in zen.spamhaus.org] 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. [205.166.61.207 listed in bl.score.senderscore.com] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager * Eli Zaretskii <86ldpwds3i.fsf@gnu.org> Wrote on Fri, 13 Jun 2025 10:21:37 +0300 >> [Unfortunately it is also a limitation in the other implementation I >> proposed, that of extending >> (assq 'file ffap-string-at-point-mode-alist) >> so that doesn't buy anything.] > I think this aspect is already in the doc string of the variable: Yes of course. I actually forgot to mention a different limitation of the existing implementation. If the file name doesn't have an extension you lose. with the spaces flag set eg. ffap on ~/.emacs or /etc/profile will only show the directories. (This limitation isn't there in the alternative I proposed), just a note. no changes to bug status. to make ffap use a prefix argument to set ffap-file-name-with-spaces is pretty hairy because ffap rebinds current-prefix-arg to nil. With newadvice it can look like this (defvar ffap-spaces-override nil) (defun find-file-at-point-munge-cpa-around-advice (orig-fn &optional file-name) (let ((ffap-spaces-override current-prefix-arg)) (funcall orig-fn file-name))) (defun ffap-string-at-point-force-spaces-around-advice (orig-fn &optional mode) (let ((ffap-file-name-with-spaces (if ffap-spaces-override t nil))) (funcall orig-fn mode))) (advice-add 'find-file-at-point :around 'find-file-at-point-munge-cpa-around-advice) (advice-add 'ffap-string-at-point :around 'ffap-string-at-point-force-spaces-around-advice) (when nil (advice-remove 'find-file-at-point :around 'find-file-at-point-munge-cpa-around-advice)) (when nil (advice-remove 'ffap-string-at-point 'ffap-string-at-point-force-spaces-around-advice)) ;; which gives one a headache