From unknown Sat Aug 16 18:47:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#24057: 25.1.50; ffap interprets comments beginning with "//" as file path Resent-From: Kaushal Modi Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 22 Jul 2016 23:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 24057 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 24057@debbugs.gnu.org X-Debbugs-Original-To: "bug-gnu-emacs@gnu.org" Received: via spool by submit@debbugs.gnu.org id=B.14692284262932 (code B ref -1); Fri, 22 Jul 2016 23:01:01 +0000 Received: (at submit) by debbugs.gnu.org; 22 Jul 2016 23:00:26 +0000 Received: from localhost ([127.0.0.1]:34085 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQjQf-0000lD-Mk for submit@debbugs.gnu.org; Fri, 22 Jul 2016 19:00:26 -0400 Received: from eggs.gnu.org ([208.118.235.92]:52266) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQjQd-0000ky-K6 for submit@debbugs.gnu.org; Fri, 22 Jul 2016 19:00:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQjQW-0006es-Nr for submit@debbugs.gnu.org; Fri, 22 Jul 2016 19:00:18 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, HTML_MESSAGE,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:46612) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQjQW-0006em-Ke for submit@debbugs.gnu.org; Fri, 22 Jul 2016 19:00:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43202) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQjQU-00052f-Mm for bug-gnu-emacs@gnu.org; Fri, 22 Jul 2016 19:00:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQjQR-0006dF-Vv for bug-gnu-emacs@gnu.org; Fri, 22 Jul 2016 19:00:13 -0400 Received: from mail-oi0-x243.google.com ([2607:f8b0:4003:c06::243]:32796) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQjQR-0006d0-Oz for bug-gnu-emacs@gnu.org; Fri, 22 Jul 2016 19:00:11 -0400 Received: by mail-oi0-x243.google.com with SMTP id l9so11614701oih.0 for ; Fri, 22 Jul 2016 16:00:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=T6zJDp9fZdmbUtPRF2nwgDcJu19oG9twDso4oOCbBzs=; b=Fseww2wSCLzu2Pg3kp2XRbuf58uTiGYedkqeeRw3zZBuUB1U3tR/rGHkGNSROTxLkk Qqp9y9v43sCvVD0eWtsNiRic3r/Dy1ZncLkA+kKlIWT3zRK8pQAFjtBFD+6Uggg6FblP Td61Vs405lbVz7m//IcmfkH+8IiBkKhMifBpbIAUyoLjA+rL8/uUMs5x0IeCfTSWkyb+ W5NK5b93nc21Gqxfydsz0z8njLSVkDSgkkqcInlLBcHqi+5rHvbKRlfeG1BPqw2P6lcB EgXAT/CPf/DIxTJGnxru4N+zCBmTURundvG8EiDVmDpuHkfTm0hY19spFLk3scPjGzk9 sZdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=T6zJDp9fZdmbUtPRF2nwgDcJu19oG9twDso4oOCbBzs=; b=jIt0GSJKMqdSTG1NMRt4bG14fBCh6rcJ4I+c4HrmO4Pr58nvKu/FwQKHnZ4VRZkNIx 8X4XRKEAmGhboqRDfiG1WOu/EJBJnwfurqWEjfRew2aX9uR1GYc8gaq8G9sXdgO+0Atf GNDGCOHiPqNtPG/CNe7/QPcsg/OAmMVKlRV64j0IJ8sV2yRPsgrZTbeqnECsmrxj0sbe YFsXHyVI7HPYo/vslVSMVt8u7EIUsS+csRy2issn2tu5el+zNyOKwnh4BN+8sUXOlhl5 vKYk2QAPD0fLI2it5GZr5tgYn8lsy/nNDMfH6UNMa0rEhczj9Xm5Vmw3qM80GPXKzYYD Qh2A== X-Gm-Message-State: AEkooutlNZrsrB8B2aCM6fnzZwJDFiDJ6N2RGtZP71rxvHy7r27iLEd1jo/zkPol6OnEWez1Im+QuJPq+ywZuA== X-Received: by 10.202.234.5 with SMTP id i5mr3477771oih.98.1469228410587; Fri, 22 Jul 2016 16:00:10 -0700 (PDT) MIME-Version: 1.0 From: Kaushal Modi Date: Fri, 22 Jul 2016 23:00:00 +0000 Message-ID: Content-Type: multipart/alternative; boundary=001a113d380681d09505384165b9 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) 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: -4.0 (----) --001a113d380681d09505384165b9 Content-Type: text/plain; charset=UTF-8 Hi all, I lived with this bug for a long time and then I lived with a patched ffap-string-at-point for a long time :) The bug is that if (1) a major mode uses "//" as comment start chars, and (2) ido-mode is enabled, and (3) ffap feature is enabled, and (4) user does C-x C-f on a comment like "//foo" attempt is made to access "//foo" path. It's a very corner case bug, but I hit is very often as I work most of the time in a major mode that uses "//" to comment lines (verilog-mode). Here is the recipe to reproduce this in emacs -Q: (1) emacs -Q (2) Evaluate: (progn (c-mode) (insert "//This is a comment") (ido-mode) (setq ido-use-filename-at-point 'guess) (re-search-backward "//" (line-beginning-position))) (3) Hit "C-x C-f" You will see that emacs is trying to look for a path "//This"! This must not happen. The proposed fix adds a little intelligence to skip the comment start chars in the string stored to ffap-string-at-point var. Here is the proposed patch generated ignoring white space. I will post a proper git formatted patch in a follow up email. ===== diff --git a/lisp/ffap.el b/lisp/ffap.el index 7013e6e..ba62012 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el @@ -1097,29 +1097,50 @@ ffap-string-at-point (defun ffap-string-at-point (&optional mode) "Return a string of characters from around point. + MODE (defaults to value of `major-mode') is a symbol used to look up string syntax parameters in `ffap-string-at-point-mode-alist'. + If MODE is not found, we use `file' instead of MODE. + If the region is active, return a string from the region. -Sets the variable `ffap-string-at-point' and the variable -`ffap-string-at-point-region'." + +If the point is in a comment, ensure that the returned string does not contain +the comment start characters (especially for major modes that have '//' as +comment start characters). + +Sets variables `ffap-string-at-point' and `ffap-string-at-point-region'. " (let* ((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 (use-region-p) + (beg (if region-selected (region-beginning) (save-excursion (skip-chars-backward (car args)) (skip-chars-forward (nth 1 args) pt) (point)))) - (end (if (use-region-p) + ;; If point is in a comment like "//abc" (in `c-mode'), and a + ;; region is not selected, return the position of 'a'. + (comment-start-pos (unless region-selected + (save-excursion + (goto-char beg) + (comment-search-forward + (line-end-position) :noerror) + (point)))) + (end (if region-selected (region-end) (save-excursion (skip-chars-forward (car args)) (skip-chars-backward (nth 2 args) pt) (point))))) + (when (and comment-start-pos + (> end comment-start-pos)) + (setq beg comment-start-pos)) + ;; (message "comment-start-pos = %d end = %d beg = %d" + ;; comment-start-pos end beg) (setq ffap-string-at-point (buffer-substring-no-properties (setcar ffap-string-at-point-region beg) ===== In GNU Emacs 25.1.50.10 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.23) of 2016-07-22 built on ... Repository revision: 03f32876210f3dd68c71baa210e523c3b7581758 Windowing system distributor 'The X.Org Foundation', version 11.0.60900000 System Description: Red Hat Enterprise Linux Workstation release 6.6 (Santiago) Configured using: 'configure --with-modules --prefix=/home/kmodi/usr_local/apps/6/emacs/master 'CPPFLAGS=-fgnu89-inline -I/home/kmodi/usr_local/6/include -I/usr/include/freetype2 -I/usr/include' 'CFLAGS=-ggdb3 -O0' 'CXXFLAGS=-ggdb3 -O0' 'LDFLAGS=-L/home/kmodi/usr_local/6/lib -L/home/kmodi/usr_local/6/lib64 -ggdb3'' Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK2 X11 MODULES Important settings: value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=none locale-coding-system: utf-8-unix -- Kaushal Modi --001a113d380681d09505384165b9 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi all,

I lived with this bu= g for a long time and then I lived with a patched ffap-string-at-point for = a long time :)

The bug is that if=C2=A0
=
(1) a major mode uses "//" as comment start chars,= and
(2) ido-mode is enabled, and
(3) ffap feature is e= nabled, and
(4) user does C-x C-f on a comment like "//foo&q= uot;

attempt is made to access "//foo" p= ath.

It's a very corner case bug, but I hit is= very often as I work most of the time in a major mode that uses "//&q= uot; to comment lines (verilog-mode).

Here is the = recipe to reproduce this in emacs -Q:

(1) emacs -Q=
(2) Evaluate:

(progn
=C2= =A0 (c-mode)
=C2=A0 (insert "//This is a comment")
=C2=A0 (ido-mode)
=C2=A0 (setq ido-use-filename-at-point &#= 39;guess)
=C2=A0 (re-search-backward "//" (line-beginni= ng-position)))

(3) Hit "C-x C-f"

You will see that emacs is trying to look for a pat= h "//This"!

This must not happen.
<= div>
The proposed fix adds a little intelligence to skip the = comment start chars in the string stored to ffap-string-at-point var.
=

Here is the proposed patch generated ignoring white spa= ce. I will post a proper git formatted patch in a follow up email.

=3D=3D=3D=3D=3D

diff --git a= /lisp/ffap.el b/lisp/ffap.el
index 7013e6e..ba62012 100644
<= div>--- a/lisp/ffap.el
+++ b/lisp/ffap.el
@@ -1097,29 += 1097,50 @@ ffap-string-at-point
=C2=A0
=C2=A0(defun ffa= p-string-at-point (&optional mode)
=C2=A0 =C2=A0"Return = a string of characters from around point.
+
=C2=A0MODE = (defaults to value of `major-mode') is a symbol used to look up
=C2=A0string syntax parameters in `ffap-string-at-point-mode-alist'.=
+
=C2=A0If MODE is not found, we use `file' instea= d of MODE.
+
=C2=A0If the region is active, return a st= ring from the region.
-Sets the variable `ffap-string-at-point= 9; and the variable
-`ffap-string-at-point-region'."
+
+If the point is in a comment, ensure that the returned = string does not contain
+the comment start characters (especially= for major modes that have '//' as
+comment start charact= ers).
+
+Sets variables `ffap-string-at-point' and = `ffap-string-at-point-region'. "
=C2=A0 =C2=A0(let* ((ar= gs
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(cdr
=C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (or (assq (or mode major-mode) ffap-str= ing-at-point-mode-alist)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 (assq 'file ffap-string-at-point-mode-alist))))
=
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 (region-selected (use-region-p))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (pt (point))
- (beg (if (use-region= -p)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 (beg (if region-selected
<= div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(r= egion-beginning)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0(save-excursion
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(skip-chars-backward (car args))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(ski= p-chars-forward (nth 1 args) pt)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(point))))
- (end (if (use-region-p)<= /div>
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; If point is in a comment like &q= uot;//abc" (in `c-mode'), and a
+ =C2=A0 =C2=A0 =C2=A0 = =C2=A0 ;; region is not selected, return the position of 'a'.
=
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 (comment-start-pos (unless region-select= ed
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(save-excursion
+ = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(goto-char beg)
+ =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(comment-search-forward
+ =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (line-end-position) :noerror)
+ = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(point))))
+ =C2=A0 =C2=A0 = =C2=A0 =C2=A0 (end (if region-selected
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(region-end)
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(save-excursion
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= (skip-chars-forward (car args))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(skip-chars-backward (nth 2 args) pt)=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0(point)))))
+ =C2=A0 =C2=A0(when (and comment-start-pos
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (> end comment= -start-pos))
+ =C2=A0 =C2=A0 =C2=A0(setq beg comment-start-pos))<= /div>
+ =C2=A0 =C2=A0;; (message "comment-start-pos =3D %d end =3D= %d beg =3D %d"
+ =C2=A0 =C2=A0;; =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0comment-start-pos end beg)
=C2=A0 =C2=A0 =C2=A0(setq ff= ap-string-at-point
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(buff= er-substring-no-properties
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 (setcar ffap-string-at-point-region beg)

=3D=3D=3D=3D=3D


In GNU Emacs 25.1.= 50.10 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.23)
=C2=A0of 2= 016-07-22 built on ...
Repository revision: 03f32876210f3dd68c71b= aa210e523c3b7581758
Windowing system distributor 'The X.Org F= oundation', version 11.0.60900000
System Description: Red Hat Enterprise= Linux Workstation release 6.6 (Santiago)

Configur= ed using:
=C2=A0'configure --with-modules
=C2=A0--p= refix=3D/home/kmodi/usr_local/apps/6/emacs/master
=C2=A0'CPPF= LAGS=3D-fgnu89-inline -I/home/kmodi/usr_local/6/include
=C2=A0-I/= usr/include/freetype2 -I/usr/include' 'CFLAGS=3D-ggdb3 -O0'
=C2=A0'CXXFLAGS=3D-ggdb3 -O0' 'LDFLAGS=3D-L/home/kmodi/u= sr_local/6/lib
=C2=A0-L/home/kmodi/usr_local/6/lib64 -ggdb3'&= #39;

Configured features:
XPM JPEG TIFF = GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS
NOTIFY AC= L LIBSELINUX GNUTLS LIBXML2 FREETYPE LIBOTF XFT ZLIB
TOOLKIT_SCRO= LL_BARS GTK2 X11 MODULES

Important settings:
=
=C2=A0 value of $LANG: en_US.UTF-8
=C2=A0 value of $XMODIFIE= RS: @im=3Dnone
=C2=A0 locale-coding-system: utf-8-unix
=
--

Kaushal Modi

--001a113d380681d09505384165b9-- From unknown Sat Aug 16 18:47:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#24057: 25.1.50; ffap interprets comments beginning with "//" as file path References: In-Reply-To: Resent-From: Kaushal Modi Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 22 Jul 2016 23:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24057 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 24057@debbugs.gnu.org Cc: Juri Linkov , cyd@gnu.org Received: via spool by 24057-submit@debbugs.gnu.org id=B24057.14692291253975 (code B ref 24057); Fri, 22 Jul 2016 23:13:01 +0000 Received: (at 24057) by debbugs.gnu.org; 22 Jul 2016 23:12:05 +0000 Received: from localhost ([127.0.0.1]:34096 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQjbx-000123-5z for submit@debbugs.gnu.org; Fri, 22 Jul 2016 19:12:05 -0400 Received: from mail-oi0-f68.google.com ([209.85.218.68]:36831) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQjbv-00011a-Qo for 24057@debbugs.gnu.org; Fri, 22 Jul 2016 19:12:04 -0400 Received: by mail-oi0-f68.google.com with SMTP id d204so11621598oig.3 for <24057@debbugs.gnu.org>; Fri, 22 Jul 2016 16:12:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:cc; bh=YYY4v8XS/HAJwf93xY1LiUWtBh14okzUmTmigGaPUQI=; b=T/TEW+taoCOhWAYgl8qVlUtsPSOEd3NscOQzGatiicqfmSjSrHebYOm75aS55PhPvA P2Wf4RcAdLyxFP7UQIkbmpURwIFdA0cZ6dJx/BrfRHrYSBYyYkRwK5ThrjUf/I3kRx7t 8+IPNq+iyee37smy3sbxHoaxNvbAiIHcqJJQvYXX8jHCG4MmcncMj+Vajyt9DxHsQD4S d0D6MM9RMaxcoFm/dbyT0bSS2tdQYrcgefkhrmZI5K8Z/PNmK6zAS71b/UmygoiHq50C i7INi9i7X7oYpoCJAiGJZG+TpZRCNc4yqhWlWAylpjTcHeMKSGKiBslsnyazwURJh+4G s3Og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=YYY4v8XS/HAJwf93xY1LiUWtBh14okzUmTmigGaPUQI=; b=SOFhAGxjHjiTpNrXrvpZp3DBj194XOcoLOmNBuuhKdVwhIhajqnoMC/CT+1nIxbz7q nUea2yFb3aSt9VG0rOE1N/a7ZC3vlCuFBjCx0OC1nOwbWhE0JbK5+cI55/KMRKty83tS 03sbkeEwku3ZYTag2V0UBj5VTGa+VSAlyHJo7WfGxjybTrU/0YTqIDFrLpOK9T/dE8sx /9cz19ux+SJZwAI/x9BT/MsnspXytSMIppRUSdugOjAciE+dCt6O++zTERm4MQHtHbq5 tz1nohrmDSIdA/nZIkt2zqgsqEOO//Aq524pUrHnBqMNDWX6cNR7WOVHFMbMBQ6ywmTb DFxw== X-Gm-Message-State: AEkoousOSL7i3Peg4tPSVggyFQBVEgXXJykmYAM8quZRj1gdjaLShfrQUwgKmKpI4SAEvnC39dOyASl2M7Qxmw== X-Received: by 10.157.7.202 with SMTP id 68mr3590206oto.133.1469229117949; Fri, 22 Jul 2016 16:11:57 -0700 (PDT) MIME-Version: 1.0 From: Kaushal Modi Date: Fri, 22 Jul 2016 23:11:47 +0000 Message-ID: Content-Type: multipart/alternative; boundary=94eb2c031310ab4eab0538418fed X-Spam-Score: -0.7 (/) 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.7 (/) --94eb2c031310ab4eab0538418fed Content-Type: text/plain; charset=UTF-8 I am copying the last 3 committers on this section of the code to review this patch. Patch follows: >From a9e94ba5789d2b1d524120efecd3f9ab9af641cc Mon Sep 17 00:00:00 2001 From: Kaushal Modi Date: Fri, 22 Jul 2016 18:58:29 -0400 Subject: [PATCH] Do not include comment start chars in ffap string * lisp/ffap.el (ffap-string-at-point): If the point is in a comment, ensure that the returned string does not contain the comment start characters (especially for major modes that have '//' as comment start characters). Otherwise, in a major mode like c-mode, with `ido-mode' enabled and `ido-use-filename-at-point' set to `guess', doing "C-x C-f" on a "//foo" comment will initiate an attempt to access a path "//foo" (Bug#24057). --- lisp/ffap.el | 63 ++++++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 42 insertions(+), 21 deletions(-) diff --git a/lisp/ffap.el b/lisp/ffap.el index 7013e6e..ba62012 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el @@ -1097,33 +1097,54 @@ ffap-string-at-point (defun ffap-string-at-point (&optional mode) "Return a string of characters from around point. + MODE (defaults to value of `major-mode') is a symbol used to look up string syntax parameters in `ffap-string-at-point-mode-alist'. + If MODE is not found, we use `file' instead of MODE. + If the region is active, return a string from the region. -Sets the variable `ffap-string-at-point' and the variable -`ffap-string-at-point-region'." + +If the point is in a comment, ensure that the returned string does not contain +the comment start characters (especially for major modes that have '//' as +comment start characters). + +Sets variables `ffap-string-at-point' and `ffap-string-at-point-region'. " (let* ((args - (cdr - (or (assq (or mode major-mode) ffap-string-at-point-mode-alist) - (assq 'file ffap-string-at-point-mode-alist)))) - (pt (point)) - (beg (if (use-region-p) - (region-beginning) - (save-excursion - (skip-chars-backward (car args)) - (skip-chars-forward (nth 1 args) pt) - (point)))) - (end (if (use-region-p) - (region-end) - (save-excursion - (skip-chars-forward (car args)) - (skip-chars-backward (nth 2 args) pt) - (point))))) + (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 + (skip-chars-backward (car args)) + (skip-chars-forward (nth 1 args) pt) + (point)))) + ;; If point is in a comment like "//abc" (in `c-mode'), and a + ;; region is not selected, return the position of 'a'. + (comment-start-pos (unless region-selected + (save-excursion + (goto-char beg) + (comment-search-forward + (line-end-position) :noerror) + (point)))) + (end (if region-selected + (region-end) + (save-excursion + (skip-chars-forward (car args)) + (skip-chars-backward (nth 2 args) pt) + (point))))) + (when (and comment-start-pos + (> end comment-start-pos)) + (setq beg comment-start-pos)) + ;; (message "comment-start-pos = %d end = %d beg = %d" + ;; comment-start-pos end beg) (setq ffap-string-at-point - (buffer-substring-no-properties - (setcar ffap-string-at-point-region beg) - (setcar (cdr ffap-string-at-point-region) end))))) + (buffer-substring-no-properties + (setcar ffap-string-at-point-region beg) + (setcar (cdr ffap-string-at-point-region) end))))) (defun ffap-string-around () ;; Sometimes useful to decide how to treat a string. -- 2.9.2 -- Kaushal Modi --94eb2c031310ab4eab0538418fed Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I am copying the last 3 committers on this section of= the code to review this patch.

Patch follows:

=
From a9e94ba5789d2b1d524120efecd3f9ab9af641cc Mon Sep 17 00= :00:00 2001
From: Kaushal Modi <kaushal.modi@gmail.com>
Date: Fri, 22 Jul 2016= 18:58:29 -0400
Subject: [PATCH] Do not include comment start cha= rs in ffap string

* lisp/ffap.el (ffap-string-at-p= oint): If the point is in a comment,
ensure that the returned str= ing does not contain the comment start
characters (especially for= major modes that have '//' as comment start
characters).=

Otherwise, in a major mode like c-mode, with `ido= -mode' enabled and
`ido-use-filename-at-point' set to `gu= ess', doing "C-x C-f" on a "//foo"
commen= t will initiate an attempt to access a path "//foo" (Bug#24057).<= /div>
---
=C2=A0lisp/ffap.el | 63 +++++++++++++++++++++++++++= +++++++++++++--------------------
=C2=A01 file changed, 42 insert= ions(+), 21 deletions(-)

diff --git a/lisp/ffap.el= b/lisp/ffap.el
index 7013e6e..ba62012 100644
--- a/lis= p/ffap.el
+++ b/lisp/ffap.el
@@ -1097,33 +1097,54 @@ ff= ap-string-at-point
=C2=A0
=C2=A0(defun ffap-string-at-p= oint (&optional mode)
=C2=A0 =C2=A0"Return a string of c= haracters from around point.
+
=C2=A0MODE (defaults to = value of `major-mode') is a symbol used to look up
=C2=A0stri= ng syntax parameters in `ffap-string-at-point-mode-alist'.
+<= /div>
=C2=A0If MODE is not found, we use `file' instead of MODE.
+
=C2=A0If the region is active, return a string from the= region.
-Sets the variable `ffap-string-at-point' and the va= riable
-`ffap-string-at-point-region'."
+
+If the point is in a comment, ensure that the returned string does n= ot contain
+the comment start characters (especially for major mo= des that have '//' as
+comment start characters).
+
+Sets variables `ffap-string-at-point' and `ffap-string-= at-point-region'. "
=C2=A0 =C2=A0(let* ((args
= - =C2=A0(c= dr
- =C2=A0 (or (assq (or mode major-mode) ffap-string-at-point-mode-alist)=
- =C2=A0 =C2=A0 =C2=A0 (assq 'file ffap-string-at-point-mode-alist))))=
- (pt (point))
- (beg (if (use-region-p)
- =C2=A0(region-beginning)
=
- (sa= ve-excursion
- =C2=A0(skip-chars-backward (car args))
- =C2=A0(skip-chars= -forward (nth 1 args) pt)
- =C2=A0(point))))
- (end (if (use-region-p)
- =C2=A0(region-end)
- (save-excursion
- =C2=A0(skip-chars-forward (car ar= gs))
- = =C2=A0(skip-chars-backward (nth 2 args) pt)
- =C2=A0(point)))))
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(cdr
+ =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 (or (assq (or mode major-mode) ffap-string-at-point-m= ode-alist)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (as= sq 'file ffap-string-at-point-mode-alist))))
+ =C2=A0 =C2=A0 = =C2=A0 =C2=A0 (region-selected (use-region-p))
+ =C2=A0 =C2=A0 = =C2=A0 =C2=A0 (pt (point))
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 (beg (if= region-selected
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0(region-beginning)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0(save-excursion
+ =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(skip-chars-backward (car args= ))
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0(skip-chars-forward (nth 1 args) pt)
+ =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(point))))
+ =C2=A0 =C2= =A0 =C2=A0 =C2=A0 ;; If point is in a comment like "//abc" (in `c= -mode'), and a
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; region is not= selected, return the position of 'a'.
+ =C2=A0 =C2=A0 = =C2=A0 =C2=A0 (comment-start-pos (unless region-selected
+ =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0(save-excursion
+ =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0(goto-char beg)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0(comment-search-forward
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 (line-end-position) :noerror)
+ =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0(point))))
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 (end (i= f region-selected
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0(region-end)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0(save-excursion
+ =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(skip-chars-forward (car args))
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(sk= ip-chars-backward (nth 2 args) pt)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(point)))))
+ =C2=A0 =C2=A0(whe= n (and comment-start-pos
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 (> end comment-start-pos))
+ =C2=A0 =C2=A0 =C2=A0(s= etq beg comment-start-pos))
+ =C2=A0 =C2=A0;; (message "comm= ent-start-pos =3D %d end =3D %d beg =3D %d"
+ =C2=A0 =C2=A0;= ; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0comment-start-pos end beg)
= =C2=A0 =C2=A0 =C2=A0(setq ffap-string-at-point
- =C2=A0(buffer-substring-no= -properties
- =C2=A0 (setcar ffap-string-at-point-region beg)
- =C2=A0 (set= car (cdr ffap-string-at-point-region) end)))))
+ =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0(buffer-substring-no-properties
+ =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 (setcar ffap-string-at-point-region beg)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (setcar (cdr ffap-string-at-point-reg= ion) end)))))
=C2=A0
=C2=A0(defun ffap-string-around ()=
=C2=A0 =C2=A0;; Sometimes useful to decide how to treat a string= .
--=C2=A0
2.9.2

--

Kaushal Modi

--94eb2c031310ab4eab0538418fed-- From unknown Sat Aug 16 18:47:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#24057: 25.1.50; ffap interprets comments beginning with "//" as file path Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 23 Jul 2016 01:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24057 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Kaushal Modi Cc: 24057@debbugs.gnu.org Received: via spool by 24057-submit@debbugs.gnu.org id=B24057.146923721021981 (code B ref 24057); Sat, 23 Jul 2016 01:27:01 +0000 Received: (at 24057) by debbugs.gnu.org; 23 Jul 2016 01:26:50 +0000 Received: from localhost ([127.0.0.1]:34109 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQliM-0005iT-95 for submit@debbugs.gnu.org; Fri, 22 Jul 2016 21:26:50 -0400 Received: from mail-it0-f49.google.com ([209.85.214.49]:37345) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQliL-0005iF-9y for 24057@debbugs.gnu.org; Fri, 22 Jul 2016 21:26:49 -0400 Received: by mail-it0-f49.google.com with SMTP id f6so61586514ith.0 for <24057@debbugs.gnu.org>; Fri, 22 Jul 2016 18:26:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=+fd/VGzjEiJu4VNfmI53H+rqgdRwcv2jZX4VFZOfX5g=; b=wYWUE8eN0h+tWUKZcU8oKZluB2xv68M6iVnwJtpbYPlsZ0gGpU0OHAQjnBFi0CFutq ol0kqoUzBhQq802wmnQZhe5pridLRTeDF9uXR4mO68ErMx7aOPPky/XI99CpavoIAEcH MVLTnZB5TNUC/QLu4fnge+iQDXoegL8v9npL19rDVwjtslGJ+G1xwzfH0JuG1WhCGNgw UMzwoLh7fcMLc5nHWBNsh1aPJKe56QlB8NEjpA8IVJC/ysDrrWRcRVpqoDoYfWE4V10E lsTF6jj+CgresxhzrJBVi+XtR1v5V10y4cgYZQ5WVq0RF5tCLMFsxww1ss6FNBPhROzA cCuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=+fd/VGzjEiJu4VNfmI53H+rqgdRwcv2jZX4VFZOfX5g=; b=TQMnfrHx/J25IkvQvPCC3HRjyrbraAAjrNau/ZewUR+H3sm1E6evNGuK+wScUfi4Io vn7jXnopvueavYgMc4cw0Xotzz5O1GwSCZ2Ae95HP0ss92fAz4sUUETCucBcNrH6d7lG LVBBugZ/39RhiATjXrbDiyjeit9ucAydRm4wEpUQHPx1sRZrXEeqqDfE9J54Lt56znHd lGyT/M4gpeALI6FMgkpON8kzjwnUkC8EZExGPuh4ackk8z+jUjlljmy6dFvyVpelzdwa 4XxxF4ET+GuN3FAWB2yKR3nK5S3CD4r0NZ1szU44d22uVrzwNSZblaIxoQV0VVk5N2/T CJNw== X-Gm-Message-State: AEkoouvsQR2vk2GpMhh2TCtMAftb6tfbNgFBvH724FHgGO+9FE+6DaODDZy/RazcZTbW4A== X-Received: by 10.36.71.67 with SMTP id t64mr7869194itb.0.1469237203781; Fri, 22 Jul 2016 18:26:43 -0700 (PDT) Received: from zony (206-188-64-44.cpe.distributel.net. [206.188.64.44]) by smtp.googlemail.com with ESMTPSA id l195sm4380984itl.17.2016.07.22.18.26.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Jul 2016 18:26:43 -0700 (PDT) From: npostavs@users.sourceforge.net References: Date: Fri, 22 Jul 2016 21:26:45 -0400 In-Reply-To: (Kaushal Modi's message of "Fri, 22 Jul 2016 23:00:00 +0000") Message-ID: <871t2lcffu.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.93 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) 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.7 (/) Kaushal Modi writes: > Hi all, > > I lived with this bug for a long time and then I lived with a patched ffap-string-at-point for a long time :) > > The bug is that if > > (1) a major mode uses "//" as comment start chars, and > (2) ido-mode is enabled, and > (3) ffap feature is enabled, and > (4) user does C-x C-f on a comment like "//foo" > > attempt is made to access "//foo" path. Is possibly a dup of #7229 and/or #8990? From unknown Sat Aug 16 18:47:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#24057: 25.1.50; ffap interprets comments beginning with "//" as file path Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 23 Jul 2016 07:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24057 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Kaushal Modi Cc: 24057@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 24057-submit@debbugs.gnu.org id=B24057.146925924129628 (code B ref 24057); Sat, 23 Jul 2016 07:35:01 +0000 Received: (at 24057) by debbugs.gnu.org; 23 Jul 2016 07:34:01 +0000 Received: from localhost ([127.0.0.1]:34151 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQrRh-0007hh-G2 for submit@debbugs.gnu.org; Sat, 23 Jul 2016 03:34:01 -0400 Received: from eggs.gnu.org ([208.118.235.92]:49141) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQrRf-0007hP-Iy for 24057@debbugs.gnu.org; Sat, 23 Jul 2016 03:33:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQrRX-0001dd-ER for 24057@debbugs.gnu.org; Sat, 23 Jul 2016 03:33:54 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_40,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:49562) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQrRX-0001dP-B8; Sat, 23 Jul 2016 03:33:51 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2345 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bQrRU-0005Hv-P7; Sat, 23 Jul 2016 03:33:49 -0400 Date: Sat, 23 Jul 2016 10:34:00 +0300 Message-Id: <83lh0sx0yf.fsf@gnu.org> From: Eli Zaretskii In-reply-to: (message from Kaushal Modi on Fri, 22 Jul 2016 23:00:00 +0000) References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -6.3 (------) 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: -6.3 (------) > From: Kaushal Modi > Date: Fri, 22 Jul 2016 23:00:00 +0000 > > (1) a major mode uses "//" as comment start chars, and > (2) ido-mode is enabled, and > (3) ffap feature is enabled, and > (4) user does C-x C-f on a comment like "//foo" > > attempt is made to access "//foo" path. I see no reason to assume that file names cannot appear in comments. > (3) Hit "C-x C-f" > > You will see that emacs is trying to look for a path "//This"! > > This must not happen. I could agree with a user option to disable this behavior, but disabling it unconditionally is IMO a mistake. Thanks. From unknown Sat Aug 16 18:47:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#24057: 25.1.50; ffap interprets comments beginning with "//" as file path Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 23 Jul 2016 07:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24057 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: npostavs@users.sourceforge.net Cc: 24057@debbugs.gnu.org, kaushal.modi@gmail.com Reply-To: Eli Zaretskii Received: via spool by 24057-submit@debbugs.gnu.org id=B24057.146925951330059 (code B ref 24057); Sat, 23 Jul 2016 07:39:02 +0000 Received: (at 24057) by debbugs.gnu.org; 23 Jul 2016 07:38:33 +0000 Received: from localhost ([127.0.0.1]:34162 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQrW4-0007oj-JA for submit@debbugs.gnu.org; Sat, 23 Jul 2016 03:38:32 -0400 Received: from eggs.gnu.org ([208.118.235.92]:49933) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQrW3-0007oY-Jb for 24057@debbugs.gnu.org; Sat, 23 Jul 2016 03:38:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQrVv-0002TB-FM for 24057@debbugs.gnu.org; Sat, 23 Jul 2016 03:38:26 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:49603) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQrVv-0002Sv-Bm; Sat, 23 Jul 2016 03:38:23 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2348 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bQrVt-0001za-Da; Sat, 23 Jul 2016 03:38:21 -0400 Date: Sat, 23 Jul 2016 10:38:32 +0300 Message-Id: <83h9bgx0qv.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <871t2lcffu.fsf@users.sourceforge.net> (npostavs@users.sourceforge.net) References: <871t2lcffu.fsf@users.sourceforge.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -6.3 (------) 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: -6.3 (------) > From: npostavs@users.sourceforge.net > Date: Fri, 22 Jul 2016 21:26:45 -0400 > Cc: 24057@debbugs.gnu.org > > Is possibly a dup of #7229 and/or #8990? Yes, please merge all those. From unknown Sat Aug 16 18:47:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#24057: 25.1.50; ffap interprets comments beginning with "//" as file path Resent-From: Kaushal Modi Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 23 Jul 2016 11:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24057 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 24057@debbugs.gnu.org, Noam Postavsky Received: via spool by 24057-submit@debbugs.gnu.org id=B24057.146927502026796 (code B ref 24057); Sat, 23 Jul 2016 11:57:02 +0000 Received: (at 24057) by debbugs.gnu.org; 23 Jul 2016 11:57:00 +0000 Received: from localhost ([127.0.0.1]:34225 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQvYC-0006y8-0u for submit@debbugs.gnu.org; Sat, 23 Jul 2016 07:57:00 -0400 Received: from mail-oi0-f42.google.com ([209.85.218.42]:33264) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQvY8-0006xt-14 for 24057@debbugs.gnu.org; Sat, 23 Jul 2016 07:56:58 -0400 Received: by mail-oi0-f42.google.com with SMTP id j185so196394546oih.0 for <24057@debbugs.gnu.org>; Sat, 23 Jul 2016 04:56:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=bdg68gClYbnkUttQL4X5UhqKAQTdelLam4zBe2uHhmc=; b=ZDkxyn14KEX0pJfbKVadA85E9qn4vagIo6mQEURRnBHSfMce4qXP5Clqk+tVo++5ec HW7pDVN224cpC/uczzrIJKHuaY88oU+hhXWDu6OySW0lDATjlwB9ldMOBYHxQI9WEuZo A3svm2IzulZhtkbuqr4Jy5w2EPFslAPI0+vKipogvXUm8DY1Qc+zPuyhkyCUDmASZhpg BrMIUADnxIRuDXzkjnvwRGQTX6kkHBjDPsYjyAgAlE2h+s3B7mP3C3wQNJyNnPoxHLhc trZnLJHgUMlxaOly97ct7D8GrmoinrJYCQAVNV6Mk5k2NP2RlJheOuDKh3iBEWbwBRWw r63A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=bdg68gClYbnkUttQL4X5UhqKAQTdelLam4zBe2uHhmc=; b=m9Ewl+ajT3J326ukStwIAfmOBj/2R/7xjNn4cgmJN/ntZwDMsiyY32AKXjHTH5++q+ mQP8QU9vk88N/OHuuxM0cm0CB9De2TKbPXOCsRrqkn/X0KinEZ0KAVPdTEU7KRQFlSsc BiKMnzCEZIcEFigdBInzHMJQGj+odwy3uNwWxuScTv1+g21ZMZUpc2hRCxHAPp8A1XAR Sl/o8UGJ5esVfknh1QB02MbyD/0FhAbxqBGDVnntabnDdx8/mDL2IUlvqVrRhTocwLuY 0peHCG1mev+Vx1AEsIJVyNAQA500KlcB5kuRF9xd4RGTSqhMJ80e1m1HQZDx8BvPwxhM qGvg== X-Gm-Message-State: AEkooutryecW3xmgp27cbU83t+VUzk+1zOUntf6U3HwIlvXpM95O22k6a1yAtd9DVe3FID2sG37CYCqRidvfbg== X-Received: by 10.202.234.5 with SMTP id i5mr4824606oih.98.1469275010078; Sat, 23 Jul 2016 04:56:50 -0700 (PDT) MIME-Version: 1.0 References: <83lh0sx0yf.fsf@gnu.org> In-Reply-To: <83lh0sx0yf.fsf@gnu.org> From: Kaushal Modi Date: Sat, 23 Jul 2016 11:56:40 +0000 Message-ID: Content-Type: multipart/alternative; boundary=001a113d38060d9c8b05384c3f49 X-Spam-Score: -0.7 (/) 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.7 (/) --001a113d38060d9c8b05384c3f49 Content-Type: text/plain; charset=UTF-8 On Sat, Jul 23, 2016 at 3:34 AM Eli Zaretskii wrote: > I see no reason to assume that file names cannot appear in comments. > I have already tested with these use cases and now it seems to do-the-right-thing: In the below table, 'x' represents the point (the cursor would be on the character to its right). The second column shows the value that ffap-string-at-point is set to on doing C-x C-f (with the ido setup explained in the first email). |-----------------------------------+---------------------------------| | Example string in `c-mode' buffer | Returned `ffap-string-at-point' | |-----------------------------------+---------------------------------| | x//tmp | "tmp" | | //xtmp | "tmp" | | x////tmp | "tmp" | | ////xtmp | "tmp" | | x// //tmp | "" | | // //xtmp | "//tmp" | |-----------------------------------+---------------------------------| To try this out, paste the below in a new buffer and M-x c-mode. //tmp ////tmp // //tmp Now do C-x C-f with cursor at those 6 different points and you will see that an attempt to read /tmp happens only in the case of "// //tmp" when the point is anywhere in the "//tmp" portion following "// ". I could agree with a user option to disable this behavior, but > disabling it unconditionally is IMO a mistake. > Of course, if this patch returns in unintended ffap-string-at-point, I will add a defcustom to enable this behavior. -- Kaushal Modi --001a113d38060d9c8b05384c3f49 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Sat, Jul 23= , 2016 at 3:34 AM Eli Zaretskii <eliz@gn= u.org> wrote:
I see no reaso= n to assume that file names cannot appear in comments.
=C2=A0
I have already tested with these use cases and now it see= ms to do-the-right-thing:

In the below table, '= ;x' represents the point (the cursor would be on the character to its r= ight).
The second column shows the value that ffap-string-at-poin= t is set to on doing C-x C-f (with the ido setup explained in the first ema= il).


= |-----------------------------------+---------------------------------|
| Example string in `c-mode' buf= fer | Returned `ffap-string-at-point' |
|-----------------------------------+---------------------------= ------|
| x//tmp =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0| "tmp" =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |
| //xtmp =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| "tmp" =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 |
| x////tmp =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0| "tmp" =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |
| ////xtmp =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| "tmp" =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 |
| x// //tmp =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | &qu= ot;" =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|
| // //xtmp =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | "//tmp" =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |
|-----------------------------------+------= ---------------------------|


To try this out, past= e the below in a new buffer and M-x c-mode.

//tmp
////tmp
// //tmp

Now do C-x C-f with cursor at those 6 different points and y= ou will see that an attempt to read /tmp happens only in the case of "= // //tmp" when the point is anywhere i= n the "//tmp" portion following "// ".


I could agree with a user option to disable this behavior, but
disabling it unconditionally is IMO a mistake.

Of course, if this patch returns in unintended ffap-string-at-point= , I will add a defcustom to enable this behavior.=C2=A0
--

Kaushal Modi

--001a113d38060d9c8b05384c3f49-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 23 08:02:10 2016 Received: (at control) by debbugs.gnu.org; 23 Jul 2016 12:02:10 +0000 Received: from localhost ([127.0.0.1]:34244 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQvdC-0000HG-3p for submit@debbugs.gnu.org; Sat, 23 Jul 2016 08:02:10 -0400 Received: from mail-io0-f182.google.com ([209.85.223.182]:35860) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQvdA-0000Gg-4l for control@debbugs.gnu.org; Sat, 23 Jul 2016 08:02:08 -0400 Received: by mail-io0-f182.google.com with SMTP id b62so126263270iod.3 for ; Sat, 23 Jul 2016 05:02:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=2F+Jf2GvYycK8HCkkz/TcIkIb82CdQstmLSRZTGCpds=; b=CfGQ8oxBKMA0NTLJDGixf7Q+Z3MP/8RpdJGQFB+SAtpGe97BCiFmIW/3Hb2Jcty+Xt 3s8q46HVeaS+m61MA5XZate92x2ieh+IzhwzAfbaelqhxLMnOej8kq9yffQXxJVC9lI3 6+kmHSCn8LtD1OKEmx2cS75iGufkKAm+9IwB/smQBS9e5+arobpxoJrfIQVC9qYvmngJ 5HQskWw8d101MNp/PFxUeMkCfEBc6/n3j9PiCKorWTIDMsZ7zGfNq2L3dBT+Mgo95AwE 1ZKVNzB4ytwTtYORjVAbJaS7p9cYxHIdCdTz1WmigmoX/4v+l9Fk3FM9fKcp0cImK/BG eEZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=2F+Jf2GvYycK8HCkkz/TcIkIb82CdQstmLSRZTGCpds=; b=l85/19quPLz/RVjsffSyS9U3rIDVw+ntNi9k8nHoq9HlFly8bVHcHA6nWh1slNQUq+ Fbxg4lzClzVVmpNmXX6PAxQAZGJEL/QQNtJaE2PRE+rGfPUw9AqGEpBBTiu1kkqJ+vmc kUpnS3krpLpgr5j2X7Phk1ZRJ+vPINgKqfGZbdF7pk01So7qbrRIP+I8keCnHbaLvx5i +X/7gZ94JREhbLusSC8weXqoSlmEB+xlA6ZuT1dOskSsVFOKYYGxdMbhdl+mpCBoIExx kl2KO/Cfs0jOWPKvDxr2ZmlHPFEaLqB/SZ+C1TgFJG5IyFs0TnF16ybdfO28dj2fCOl6 bSpw== X-Gm-Message-State: AEkoous6oy+HvDHEjx3jCdIhEdConicYiF7MlNyV6u60Pt/rr5HhYCC4xbfVzXtioIGEKw== X-Received: by 10.107.34.72 with SMTP id i69mr10260563ioi.13.1469275322321; Sat, 23 Jul 2016 05:02:02 -0700 (PDT) Received: from zony (206-188-64-44.cpe.distributel.net. [206.188.64.44]) by smtp.googlemail.com with ESMTPSA id o15sm6964267ith.2.2016.07.23.05.02.01 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 23 Jul 2016 05:02:01 -0700 (PDT) From: npostavs@users.sourceforge.net To: control@debbugs.gnu.org Subject: Re: bug#24057: 25.1.50; ffap interprets comments beginning with "//" as file path References: <871t2lcffu.fsf@users.sourceforge.net> <83h9bgx0qv.fsf@gnu.org> Date: Sat, 23 Jul 2016 08:02:04 -0400 In-Reply-To: <83h9bgx0qv.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 23 Jul 2016 10:38:32 +0300") Message-ID: <87twfgbm0z.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.93 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: control 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.7 (/) severity 24057 minor merge 7229 8990 24057 quit Eli Zaretskii writes: >> From: npostavs@users.sourceforge.net >> Date: Fri, 22 Jul 2016 21:26:45 -0400 >> Cc: 24057@debbugs.gnu.org >> >> Is possibly a dup of #7229 and/or #8990? > > Yes, please merge all those. From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 23 08:13:40 2016 Received: (at control) by debbugs.gnu.org; 23 Jul 2016 12:13:40 +0000 Received: from localhost ([127.0.0.1]:34274 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQvoK-0000Z7-Ln for submit@debbugs.gnu.org; Sat, 23 Jul 2016 08:13:40 -0400 Received: from mail-oi0-f42.google.com ([209.85.218.42]:34411) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQvoI-0000Yp-Eu for control@debbugs.gnu.org; Sat, 23 Jul 2016 08:13:38 -0400 Received: by mail-oi0-f42.google.com with SMTP id l65so196534074oib.1 for ; Sat, 23 Jul 2016 05:13:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=lkjsnp0o1zM8ZhDCuJOY9JgMCjxIL507W4m8bfDcrTk=; b=g2QdG/FmePGwibA/ixK3Y8NLcUYnhYSvt/+adk5KsfD7+9Hz54FbyEXe8/McqnLPYJ Wi9y9yCi/oBqk30kqjFjHvFG0mIIEANAOVS4sshsC6ZGW/35zpnX0Jne4DcmNqDG0fuq h2T36vJ9PXCxe0lxoZxy+WGb7vLc8yAUI3rCcy7ydxhEQajHSAMc/DeUttyQXxJSnso/ bMcpTtcg9xuf5WM24CMNHSa+vMpOvZ+xIV9nt1X9YMNcnAduJAvhLQJ+xJgKuZdT8zA0 SKvQG9mOwtWJVJOu9GnEcttE1DhvzZBj0socYCVOoof3mF7wyMKgsUueL488zezPCRoi 6Xxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=lkjsnp0o1zM8ZhDCuJOY9JgMCjxIL507W4m8bfDcrTk=; b=LSEGCHkhfLpeZHDsIOu1Ml0XI1B2V4OxVmTE2iiOSR3K/E5V2IziAJfp9lLqm5Te/f 0L9nb6aKufmQJmME2vINIJCirMrX9DZWl3VD4O+ltHG3TReSfrLYq7yl6xLPDzqtgqOV EhtWr/65CjB1k5Jd7RJEUM8aBjQ9WXVj6P3cF4/75KEs2qFcWgxT6/SRXNfYiScnrcFf ITym83FkCeThOtp26l9UbaBBfAQk8GcLJzSMojdtv6z06eCJL9j+1+V7Tre0+c3fxKR1 o6zYyTdoPR45qJZtp2V6KFh4BsBzf1S1Q44VTaUfsazpW8meMhhwsij799qCdTjIwuuY 5Jwg== X-Gm-Message-State: AEkooutaY13B8AKv6gxwzK5RQW8F/ZtSRv/6tV+XcrB1e8T3ZEtQgopPSPKzBT43qrm8VgFwqUuJ/lb1QfgeLw== X-Received: by 10.202.74.80 with SMTP id x77mr4857772oia.125.1469276012910; Sat, 23 Jul 2016 05:13:32 -0700 (PDT) MIME-Version: 1.0 From: Kaushal Modi Date: Sat, 23 Jul 2016 12:13:23 +0000 Message-ID: Subject: To: "control@debbugs.gnu.org" Content-Type: multipart/alternative; boundary=001a11c17c02d3a19205384c7af7 X-Spam-Score: 1.3 (+) 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: severity 8990 minor severity 7229 minor severity 24057 minor merge 7229 8990 24057 quit # Noam, looks like we were toggling the severities at the same time # Hopefully, this finally does the merge :) [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.218.42 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (kaushal.modi[at]gmail.com) -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.218.42 listed in wl.mailspike.net] 0.0 HTML_MESSAGE BODY: HTML included in message 2.0 BLANK_SUBJECT Subject is present but empty -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders 0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid X-Debbugs-Envelope-To: control 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.3 (+) 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: severity 8990 minor severity 7229 minor severity 24057 minor merge 7229 8990 24057 quit # Noam, looks like we were toggling the severities at the same time # Hopefully, this finally does the merge :) [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.218.42 listed in wl.mailspike.net] -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.218.42 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (kaushal.modi[at]gmail.com) 0.0 HTML_MESSAGE BODY: HTML included in message 2.0 BLANK_SUBJECT Subject is present but empty -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders 0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid --001a11c17c02d3a19205384c7af7 Content-Type: text/plain; charset=UTF-8 severity 8990 minor severity 7229 minor severity 24057 minor merge 7229 8990 24057 quit # Noam, looks like we were toggling the severities at the same time # Hopefully, this finally does the merge :) -- Kaushal Modi --001a11c17c02d3a19205384c7af7 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
severity=C2=A08990 minor
severity=C2=A07229 minor
severity=C2=A024057=C2=A0minor=C2=A0=C2=A0
merge=C2=A07229 8990 24057
quit

=
# Noam, looks like we were t= oggling the severities at the same time
# Hopefully, this finally does the merge :)<= /div>

=
--

Kaushal Modi

--001a11c17c02d3a19205384c7af7-- From unknown Sat Aug 16 18:47:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#24057: 25.1.50; ffap interprets comments beginning with "//" as file path Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 23 Jul 2016 13:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24057 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Kaushal Modi Cc: 24057@debbugs.gnu.org, npostavs@users.sourceforge.net Reply-To: Eli Zaretskii Received: via spool by 24057-submit@debbugs.gnu.org id=B24057.146927915213300 (code B ref 24057); Sat, 23 Jul 2016 13:06:01 +0000 Received: (at 24057) by debbugs.gnu.org; 23 Jul 2016 13:05:52 +0000 Received: from localhost ([127.0.0.1]:34285 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQwcq-0003SS-0N for submit@debbugs.gnu.org; Sat, 23 Jul 2016 09:05:52 -0400 Received: from eggs.gnu.org ([208.118.235.92]:41427) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQwco-0003SD-Ew for 24057@debbugs.gnu.org; Sat, 23 Jul 2016 09:05:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQwcg-0002Ez-AC for 24057@debbugs.gnu.org; Sat, 23 Jul 2016 09:05:45 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:52310) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQwcU-0002Dk-Vy; Sat, 23 Jul 2016 09:05:31 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2738 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bQwcU-0007mH-2g; Sat, 23 Jul 2016 09:05:30 -0400 Date: Sat, 23 Jul 2016 16:05:41 +0300 Message-Id: <83shv0v716.fsf@gnu.org> From: Eli Zaretskii In-reply-to: (message from Kaushal Modi on Sat, 23 Jul 2016 11:56:40 +0000) References: <83lh0sx0yf.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -6.3 (------) 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: -6.3 (------) > From: Kaushal Modi > Date: Sat, 23 Jul 2016 11:56:40 +0000 > Cc: 24057@debbugs.gnu.org, Noam Postavsky > > I see no reason to assume that file names cannot appear in comments. > > I have already tested with these use cases and now it seems to do-the-right-thing: > > In the below table, 'x' represents the point (the cursor would be on the character to its right). > The second column shows the value that ffap-string-at-point is set to on doing C-x C-f (with the ido setup > explained in the first email). > > |-----------------------------------+---------------------------------| > | Example string in `c-mode' buffer | Returned `ffap-string-at-point' | > |-----------------------------------+---------------------------------| > | x//tmp | "tmp" | > | //xtmp | "tmp" | > | x////tmp | "tmp" | > | ////xtmp | "tmp" | > | x// //tmp | "" | > | // //xtmp | "//tmp" | > |-----------------------------------+---------------------------------| > > To try this out, paste the below in a new buffer and M-x c-mode. > > //tmp > ////tmp > // //tmp > > Now do C-x C-f with cursor at those 6 different points and you will see that an attempt to read /tmp happens > only in the case of "// //tmp" when the point is anywhere in the "//tmp" portion following "// ". Did you try this on some system where "//tmp" is a valid file name, which is different from "/tmp"? From unknown Sat Aug 16 18:47:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#24057: 25.1.50; ffap interprets comments beginning with "//" as file path Resent-From: Kaushal Modi Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 23 Jul 2016 13:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24057 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 24057@debbugs.gnu.org, npostavs@users.sourceforge.net Received: via spool by 24057-submit@debbugs.gnu.org id=B24057.146928020614868 (code B ref 24057); Sat, 23 Jul 2016 13:24:02 +0000 Received: (at 24057) by debbugs.gnu.org; 23 Jul 2016 13:23:26 +0000 Received: from localhost ([127.0.0.1]:34289 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQwtq-0003rk-JB for submit@debbugs.gnu.org; Sat, 23 Jul 2016 09:23:26 -0400 Received: from mail-oi0-f43.google.com ([209.85.218.43]:34710) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQwtp-0003rV-55 for 24057@debbugs.gnu.org; Sat, 23 Jul 2016 09:23:25 -0400 Received: by mail-oi0-f43.google.com with SMTP id l65so197876614oib.1 for <24057@debbugs.gnu.org>; Sat, 23 Jul 2016 06:23:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=WA8zW1JbS31OrtI9PFukPC9UHOe5G2B/LNj69BgZK9A=; b=teAkVEEYhIt2cDFq8oD2ns/DTqVzSIqeJA9kVf7CKMhHAxN5jdD0G7dwRv+onEcLa8 TMnb5UMLZCM0p+6lexrtGC/sYVF2vNUCsifxdC5RwRWKHRopKmFuNRqTmBIZv57H+2fH XhD2iiY6ynDZCdHbHcyUh6HEnnOyQKtKrdnEBGYGTCiyLlgJovdUQ1KKf5fEFjFsen2c 8Es8LZqt0CIuR66LPx7345h1H9HieKVJqKZXJN8N6KyaEQv0c2mPc6xQVo3IEwhALerb lmo7O5GPdup6EZhE+Rp+gTS2J4tbinIUvRyyxkMARBm2p55C9qV2pHgql1qhTGiDMCRx ivLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=WA8zW1JbS31OrtI9PFukPC9UHOe5G2B/LNj69BgZK9A=; b=YBeK5O7/0AAfLxyoYBgPqbJHWhKhXq7pL2RpK1Nd4c+kLVPrItcUYbcW3TB5k1vsmN OE0lXnS0hjUOJd0fbq5E5nL6zOi8Pk3DH/bl6Cr1FWqkoaKpF7sqjRhcsM3ezPWOBw5B zOETN7CZfCK6E4+JdT2VhDGtg9caYW1XvS2Yev9iJUuHfhJjcbyfUSlXSOJipon6TDzZ xn1Ir6627xLFSxMO1Mu97HYu6UWeYNMxREom+1Q44/2ShvtmIpB59Pjdf42iwyKONdUj +cOAPGTVCaGYS7IoOaerAXWYt4siFiaa7YKB3TaM4XP9rY4OSBOKyO8yn30oqUTKttN/ Wv7Q== X-Gm-Message-State: AEkoouuM25F7Y28DiGrjmv+6dIS4RVE+Xc+/scPZ3OOtipwTOtypQHWYAXoOdxQZVr8rqEbZJuEM4PevRu0ZAw== X-Received: by 10.157.35.28 with SMTP id j28mr5343967otb.165.1469280198449; Sat, 23 Jul 2016 06:23:18 -0700 (PDT) MIME-Version: 1.0 References: <83lh0sx0yf.fsf@gnu.org> <83shv0v716.fsf@gnu.org> In-Reply-To: <83shv0v716.fsf@gnu.org> From: Kaushal Modi Date: Sat, 23 Jul 2016 13:23:08 +0000 Message-ID: Content-Type: multipart/alternative; boundary=001a113dd5dc4ddfa105384d74d4 X-Spam-Score: -0.7 (/) 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.7 (/) --001a113dd5dc4ddfa105384d74d4 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Sat, Jul 23, 2016 at 9:05 AM Eli Zaretskii wrote: > Did you try this on some system where "//tmp" is a valid file name, > which is different from "/tmp"? > I have never dealt with such files. My brief attempt just to try creating such a file failed: km=C2=B2~/temp/:> touch '//abc' touch: cannot touch `//abc': Permission denied km=C2=B2~/temp/:> touch '\/\/abc' touch: cannot touch `\\/\\/abc': No such file or directory Can you show how to recreate the issue that you are thinking? Or can you try recreating the problem on your system with this patch? Or, should this patch anyways go in the master, and we let the emacs-devel give us feedback if this results in anything unexpected? I have used this patch in my config for few years now without any issue. --=20 Kaushal Modi --001a113dd5dc4ddfa105384d74d4 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Sat, Jul 23= , 2016 at 9:05 AM Eli Zaretskii <eliz@gn= u.org> wrote:
Did you try th= is on some system where "//tmp" is a valid file name,
which is different from "/tmp"?

I have never dealt with such files.

My brief at= tempt just to try creating such a file failed:

km= =C2=B2~/temp/:> touch '//abc' =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0
touch= : cannot touch `//abc': Permission denied
km=C2=B2~/te= mp/:> touch '\/\/abc' =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0=C2=A0
touch: cannot touch `\\/\\/abc': No such file or= directory

Can you show how to recreate the issue = that you are thinking?
Or can you try recreating the problem on y= our system with this patch?

Or, should this patch = anyways go in the master, and we let the emacs-devel give us feedback if th= is results in anything unexpected?

I have used thi= s patch in my config for few years now without any issue.
=C2=A0<= /div>
--

Kaushal Modi

--001a113dd5dc4ddfa105384d74d4-- From unknown Sat Aug 16 18:47:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#24057: 25.1.50; ffap interprets comments beginning with "//" as file path Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 23 Jul 2016 14:00:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24057 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Kaushal Modi Cc: 24057@debbugs.gnu.org, npostavs@users.sourceforge.net Reply-To: Eli Zaretskii Received: via spool by 24057-submit@debbugs.gnu.org id=B24057.146928238418759 (code B ref 24057); Sat, 23 Jul 2016 14:00:03 +0000 Received: (at 24057) by debbugs.gnu.org; 23 Jul 2016 13:59:44 +0000 Received: from localhost ([127.0.0.1]:34967 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQxSy-0004sU-IZ for submit@debbugs.gnu.org; Sat, 23 Jul 2016 09:59:44 -0400 Received: from eggs.gnu.org ([208.118.235.92]:48653) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQxSw-0004sI-QE for 24057@debbugs.gnu.org; Sat, 23 Jul 2016 09:59:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQxSm-0002v4-HR for 24057@debbugs.gnu.org; Sat, 23 Jul 2016 09:59:37 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:52688) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQxSX-0002oY-AV; Sat, 23 Jul 2016 09:59:17 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2764 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bQxSW-0005qD-7N; Sat, 23 Jul 2016 09:59:16 -0400 Date: Sat, 23 Jul 2016 16:59:27 +0300 Message-Id: <83poq4v4jk.fsf@gnu.org> From: Eli Zaretskii In-reply-to: (message from Kaushal Modi on Sat, 23 Jul 2016 13:23:08 +0000) References: <83lh0sx0yf.fsf@gnu.org> <83shv0v716.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -6.3 (------) 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: -6.3 (------) > From: Kaushal Modi > Date: Sat, 23 Jul 2016 13:23:08 +0000 > Cc: 24057@debbugs.gnu.org, npostavs@users.sourceforge.net > > Did you try this on some system where "//tmp" is a valid file name, > which is different from "/tmp"? > > I have never dealt with such files. > > My brief attempt just to try creating such a file failed: > > km²~/temp/:> touch '//abc' > touch: cannot touch `//abc': Permission denied > km²~/temp/:> touch '\/\/abc' > touch: cannot touch `\\/\\/abc': No such file or directory > > Can you show how to recreate the issue that you are thinking? You need to be on a system that supports that. Windows is one of them; not sure if there are any others left nowadays. > Or can you try recreating the problem on your system with this patch? I didn't try. > Or, should this patch anyways go in the master, and we let the emacs-devel give us feedback if this results in > anything unexpected? It should definitely go to master only. From unknown Sat Aug 16 18:47:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#24057: 25.1.50; ffap interprets comments beginning with "//" as file path Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 23 Jul 2016 18:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24057 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 24057@debbugs.gnu.org, Kaushal Modi Received: via spool by 24057-submit@debbugs.gnu.org id=B24057.146929696420354 (code B ref 24057); Sat, 23 Jul 2016 18:03:01 +0000 Received: (at 24057) by debbugs.gnu.org; 23 Jul 2016 18:02:44 +0000 Received: from localhost ([127.0.0.1]:35131 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bR1G7-0005IE-Tn for submit@debbugs.gnu.org; Sat, 23 Jul 2016 14:02:44 -0400 Received: from mail-oi0-f48.google.com ([209.85.218.48]:33719) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bR1G6-0005I1-8Y for 24057@debbugs.gnu.org; Sat, 23 Jul 2016 14:02:42 -0400 Received: by mail-oi0-f48.google.com with SMTP id j185so203601414oih.0 for <24057@debbugs.gnu.org>; Sat, 23 Jul 2016 11:02:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=ucS8pSN2sAJajog1bPeP3wpd5B4YG3aOuhTFmH3XJM0=; b=QAnI1GxWL5SFzLpzcmP+lvvxVyvKtonvVCy1jd2fknvB0CjlIV1CE48m1HnedsBTkG 9XjE5jtxO0i3MOz1S05CHdYh58TNLL3TnguSo9EHyr3VQM7oODPXLs0icKm8STVYwizg p581QlYFcyBUbvZzGgH2jwzFMzjWmpQmP8LOe339J2z4KOHazdyou+SczTdKFQhDrdLU 0SgnNCldi029Do74QqkDIXLO+gLgdbSHGeeUwpmZpMtkEwlcL1x4/ZuPejWeU+PZOh7B uYDVHRAtGKRRO78vjVVL13I4qyaDBC/0fJfadcfXdzvuP7LuLawMA0HFltIKCGc022X0 kO6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=ucS8pSN2sAJajog1bPeP3wpd5B4YG3aOuhTFmH3XJM0=; b=fPiuHu7sSv0OvaBN+Knt/OaOYHHFdglk9kvMHyLebc+EpHi4QSLOOD5w9QrQo73Kkl WX3VBNFja/kWV4Q+i3EeETJlln90v5uccxFLRVwf0shLV1DZOnrQmJtGDFbHwEiZgQfn 0U/fiqovLltGfNzfSg96wViJoYxKKZxkdBP/Fv148YULCfp/YAKYyZDLo0vks3eSjn0/ Qwar8teuQek9fk0/zLXe9Wec9qpS2q/bn9wXwj47dwOdAxZcwlBSZyGEE7/HJSI2NVY2 UEjw6fYMVQCKxyKpZ+VS5Lwn0RpEbb26S5KHrfjdW8OZeUZmTpB8Ck4ZHPXjY85VizKg QmDQ== X-Gm-Message-State: AEkoouvyKwbESUS0zQCH0sig3BduZ5phH3tUrB0RiY4fG2zG2hCRH7g7iGn1ix4UMvUBkAIQU6FNKE1HAZwmlg== X-Received: by 10.202.199.199 with SMTP id x190mr4762503oif.35.1469296956645; Sat, 23 Jul 2016 11:02:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.7.161 with HTTP; Sat, 23 Jul 2016 11:02:36 -0700 (PDT) In-Reply-To: <83poq4v4jk.fsf@gnu.org> References: <83lh0sx0yf.fsf@gnu.org> <83shv0v716.fsf@gnu.org> <83poq4v4jk.fsf@gnu.org> From: Noam Postavsky Date: Sat, 23 Jul 2016 14:02:36 -0400 X-Google-Sender-Auth: hNl4qTHf4fsJWpnOLR_9Jz0spmc Message-ID: Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -0.7 (/) 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.7 (/) On Sat, Jul 23, 2016 at 9:59 AM, Eli Zaretskii wrote: >> Did you try this on some system where "//tmp" is a valid file name, >> which is different from "/tmp"? > You need to be on a system that supports that. Windows is one of > them; not sure if there are any others left nowadays. How does it work? C:\Users\npostavs>echo foo > //tmp The specified path is invalid. In Emacs: Saving file //tmp... Directory `//' does not exist; create? (y or n) y basic-save-buffer-2: //: no such directory This is on a newly-upgraded-to-Windows-10 box, Emacs 24.5 From unknown Sat Aug 16 18:47:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#24057: 25.1.50; ffap interprets comments beginning with "//" as file path Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 23 Jul 2016 18:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24057 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Noam Postavsky Cc: 24057@debbugs.gnu.org, kaushal.modi@gmail.com Reply-To: Eli Zaretskii Received: via spool by 24057-submit@debbugs.gnu.org id=B24057.146929805121963 (code B ref 24057); Sat, 23 Jul 2016 18:21:02 +0000 Received: (at 24057) by debbugs.gnu.org; 23 Jul 2016 18:20:51 +0000 Received: from localhost ([127.0.0.1]:35140 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bR1Xe-0005iB-S7 for submit@debbugs.gnu.org; Sat, 23 Jul 2016 14:20:51 -0400 Received: from eggs.gnu.org ([208.118.235.92]:60852) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bR1Xc-0005hx-Po for 24057@debbugs.gnu.org; Sat, 23 Jul 2016 14:20:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bR1XS-0006NY-Mn for 24057@debbugs.gnu.org; Sat, 23 Jul 2016 14:20:43 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:55160) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bR1XS-0006NP-J7; Sat, 23 Jul 2016 14:20:38 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2909 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bR1XQ-0000NB-A6; Sat, 23 Jul 2016 14:20:37 -0400 Date: Sat, 23 Jul 2016 21:20:42 +0300 Message-Id: <837fccusg5.fsf@gnu.org> From: Eli Zaretskii In-reply-to: (message from Noam Postavsky on Sat, 23 Jul 2016 14:02:36 -0400) References: <83lh0sx0yf.fsf@gnu.org> <83shv0v716.fsf@gnu.org> <83poq4v4jk.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -6.3 (------) 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: -6.3 (------) > From: Noam Postavsky > Date: Sat, 23 Jul 2016 14:02:36 -0400 > Cc: Kaushal Modi , 24057@debbugs.gnu.org > > On Sat, Jul 23, 2016 at 9:59 AM, Eli Zaretskii wrote: > >> Did you try this on some system where "//tmp" is a valid file name, > >> which is different from "/tmp"? > > You need to be on a system that supports that. Windows is one of > > them; not sure if there are any others left nowadays. > > How does it work? > > C:\Users\npostavs>echo foo > //tmp > The specified path is invalid. > > In Emacs: > > Saving file //tmp... > Directory `//' does not exist; create? (y or n) y > basic-save-buffer-2: //: no such directory > > This is on a newly-upgraded-to-Windows-10 box, Emacs 24.5 It's a UNC notation. Normally used for network shares. If you want to use this locally, you will need to create a share first. Valid UNC file/directory names look like //machine/share. From unknown Sat Aug 16 18:47:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#24057: 25.1.50; ffap interprets comments beginning with "//" as file path Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 23 Jul 2016 18:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24057 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Noam Postavsky Cc: 24057@debbugs.gnu.org, kaushal.modi@gmail.com Reply-To: Eli Zaretskii Received: via spool by 24057-submit@debbugs.gnu.org id=B24057.146929816422168 (code B ref 24057); Sat, 23 Jul 2016 18:23:01 +0000 Received: (at 24057) by debbugs.gnu.org; 23 Jul 2016 18:22:44 +0000 Received: from localhost ([127.0.0.1]:35144 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bR1ZU-0005lU-7H for submit@debbugs.gnu.org; Sat, 23 Jul 2016 14:22:44 -0400 Received: from eggs.gnu.org ([208.118.235.92]:32946) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bR1ZS-0005lG-74 for 24057@debbugs.gnu.org; Sat, 23 Jul 2016 14:22:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bR1ZI-0006cs-5y for 24057@debbugs.gnu.org; Sat, 23 Jul 2016 14:22:37 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_20,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:55175) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bR1ZI-0006cY-2g; Sat, 23 Jul 2016 14:22:32 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2910 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bR1ZD-0000Sv-Py; Sat, 23 Jul 2016 14:22:30 -0400 Date: Sat, 23 Jul 2016 21:22:29 +0300 Message-Id: <8360rwusd6.fsf@gnu.org> From: Eli Zaretskii In-reply-to: (message from Noam Postavsky on Sat, 23 Jul 2016 14:02:36 -0400) References: <83lh0sx0yf.fsf@gnu.org> <83shv0v716.fsf@gnu.org> <83poq4v4jk.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -6.3 (------) 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: -6.3 (------) > From: Noam Postavsky > Date: Sat, 23 Jul 2016 14:02:36 -0400 > Cc: Kaushal Modi , 24057@debbugs.gnu.org > > How does it work? > > C:\Users\npostavs>echo foo > //tmp > The specified path is invalid. Oh, and of course you cannot use forward slashes in CMD, you need to use backslashes instead, as in \\tmp\foo. From unknown Sat Aug 16 18:47:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#24057: 25.1.50; ffap interprets comments beginning with "//" as file path Resent-From: Kaushal Modi Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 23 Jul 2016 21:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24057 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 24057@debbugs.gnu.org, npostavs@users.sourceforge.net Received: via spool by 24057-submit@debbugs.gnu.org id=B24057.146931072516365 (code B ref 24057); Sat, 23 Jul 2016 21:53:02 +0000 Received: (at 24057) by debbugs.gnu.org; 23 Jul 2016 21:52:05 +0000 Received: from localhost ([127.0.0.1]:35181 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bR4q5-0004Fs-Kx for submit@debbugs.gnu.org; Sat, 23 Jul 2016 17:52:05 -0400 Received: from mail-oi0-f44.google.com ([209.85.218.44]:34961) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bR4q3-0004FN-2h for 24057@debbugs.gnu.org; Sat, 23 Jul 2016 17:52:04 -0400 Received: by mail-oi0-f44.google.com with SMTP id l72so207709935oig.2 for <24057@debbugs.gnu.org>; Sat, 23 Jul 2016 14:52:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Wey6hOT/PyOGi5cLLME2maepeKRYnBOns6IQJolHMgc=; b=O0lvGVAq2/vM5E+z0V739yU4MHcUjLpVoZjlaEXvkVBzeW5171pF8cHTYJvbKD+GjT iw8M/GyeFK9y4Dtr0IXFRwoGNwliMF3OvljAHMBasUeNFWYr639JipPyG/Ylsye/hYbK wDsShTKR2rYPP2LW1cE23uZh4NILfdlHb+uSM/EuM3ukfi+QUZmD7Elx6kbjDS5NkMvT TCw0zkBz+ptT3v+Xa9f6LcjYXFDw+PY4Wwg47Vx/J2wzy8MckKyrMEmIne4rT0oMFjR+ zSUXY0c2XP/W41uyOgDK4aiqVvn13nQ/6+pc5Kl/Uqh6TRTLYvDMDkbhfp9nWIF/EqML KdZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Wey6hOT/PyOGi5cLLME2maepeKRYnBOns6IQJolHMgc=; b=Kk69QSzbzpIrAC3kP/2arsljj7aif4pnOiDcUz8l96L8ZZh+ApoMt68Zt5693ntpmy aa0V6mpIaWgaLAcxdNp0mUWp4Jpi8NSy0OqZfW4bjY3NgnASJLRcLU1oMN0CggDG141t xULPs2vvk3BYmeJDMojT6UwXX7nYP/4h+7czrVBf6RZvoveMzJVvI31THsirgTLizWDy 3l0l/Cfq1vGjvSRPMHZFm+191Y0khNG0mVCUKemn/UFXleKCyrgdaqVZEYPKCj51wOtx LOmwf1VFa6+3mg24MKZwvbjZHn+TNQGtTYCzg+09mhClwJ37L53D+rKy0VjsLYKwMU1f SX+A== X-Gm-Message-State: AEkoouvoszf3RQgelUI/5cR8Q7PuSKQXg+Re7FasWHoWau1tgoTibx30RChFTy0Cmwxo5zzm2xivTZiJZPiSlA== X-Received: by 10.157.7.202 with SMTP id 68mr6140952oto.133.1469310717347; Sat, 23 Jul 2016 14:51:57 -0700 (PDT) MIME-Version: 1.0 References: <83lh0sx0yf.fsf@gnu.org> <83shv0v716.fsf@gnu.org> <83poq4v4jk.fsf@gnu.org> In-Reply-To: <83poq4v4jk.fsf@gnu.org> From: Kaushal Modi Date: Sat, 23 Jul 2016 21:51:47 +0000 Message-ID: Content-Type: multipart/alternative; boundary=94eb2c0313105f4dac0538548f41 X-Spam-Score: -0.7 (/) 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.7 (/) --94eb2c0313105f4dac0538548f41 Content-Type: text/plain; charset=UTF-8 On Sat, Jul 23, 2016 at 9:59 AM Eli Zaretskii wrote: > You need to be on a system that supports that. Windows is one of > them; not sure if there are any others left nowadays. > > > Or can you try recreating the problem on your system with this patch? > > I didn't try. > Can you please try it out and see if this patch causes any issue with such paths? I believe that if you have "// //share/foo", it should still work fine. > > Or, should this patch anyways go in the master, and we let the > emacs-devel give us feedback if this results in > > anything unexpected? > > It should definitely go to master only. > Correct, I meant to emphasize that the patch be committed without a defcustom to begin with .. and then we can add the defcustom if needed. -- Kaushal Modi --94eb2c0313105f4dac0538548f41 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Sat, Jul 23= , 2016 at 9:59 AM Eli Zaretskii <eliz@gn= u.org> wrote:
You need to be= on a system that supports that.=C2=A0 Windows is one of
them; not sure if there are any others left nowadays.

> Or can you try recreating the problem on your system with this patch?<= br>
I didn't try.

Can you please try it= out and see if this patch causes any issue with such paths? I believe that= if you have "// //share/foo", it should still work fine.
=C2=A0
> Or, should this patch anyways go in the master, and we let the emacs-d= evel give us feedback if this results in
> anything unexpected?

It should definitely go to master only.

Correct, I meant to emphasize that the patch be committed without a defcus= tom to begin with .. and then we can add the defcustom if needed.=C2=A0
--

Kaushal Modi

--94eb2c0313105f4dac0538548f41-- From unknown Sat Aug 16 18:47:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#24057: 25.1.50; ffap interprets comments beginning with "//" as file path Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 Jul 2016 14:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24057 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Kaushal Modi Cc: 24057@debbugs.gnu.org, npostavs@users.sourceforge.net Reply-To: Eli Zaretskii Received: via spool by 24057-submit@debbugs.gnu.org id=B24057.146936982621064 (code B ref 24057); Sun, 24 Jul 2016 14:18:02 +0000 Received: (at 24057) by debbugs.gnu.org; 24 Jul 2016 14:17:06 +0000 Received: from localhost ([127.0.0.1]:35935 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bRKDK-0005Tg-89 for submit@debbugs.gnu.org; Sun, 24 Jul 2016 10:17:06 -0400 Received: from eggs.gnu.org ([208.118.235.92]:36783) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bRKDI-0005Ny-Ip for 24057@debbugs.gnu.org; Sun, 24 Jul 2016 10:17:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bRKD9-00071s-Iz for 24057@debbugs.gnu.org; Sun, 24 Jul 2016 10:16:59 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:36995) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bRKCw-00070M-1y; Sun, 24 Jul 2016 10:16:42 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3390 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bRKCu-0006Uj-0V; Sun, 24 Jul 2016 10:16:40 -0400 Date: Sun, 24 Jul 2016 17:16:53 +0300 Message-Id: <83wpkbt92i.fsf@gnu.org> From: Eli Zaretskii In-reply-to: (message from Kaushal Modi on Sat, 23 Jul 2016 21:51:47 +0000) References: <83lh0sx0yf.fsf@gnu.org> <83shv0v716.fsf@gnu.org> <83poq4v4jk.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -6.3 (------) 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: -6.3 (------) > From: Kaushal Modi > Date: Sat, 23 Jul 2016 21:51:47 +0000 > Cc: 24057@debbugs.gnu.org, npostavs@users.sourceforge.net > > You need to be on a system that supports that. Windows is one of > them; not sure if there are any others left nowadays. > > > Or can you try recreating the problem on your system with this patch? > > I didn't try. > > Can you please try it out and see if this patch causes any issue with such paths? I believe that if you have "// > //share/foo", it should still work fine. I tried with a comment that begins like this: ////share/foo and I don't think the proposed behavior will be correct in all cases. The problem is that comment-search-forward moves all the way past the leading 4 slashes, instead of only 2. While I can understand why the comment-start sequence should not be considered a potential file name, the stuff that follows it -- in this case, //share/foo -- should IMO be allowed to be a file name. Thanks. From unknown Sat Aug 16 18:47:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#24057: 25.1.50; ffap interprets comments beginning with "//" as file path Resent-From: Kaushal Modi Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 25 Jul 2016 02:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24057 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 24057@debbugs.gnu.org, npostavs@users.sourceforge.net Received: via spool by 24057-submit@debbugs.gnu.org id=B24057.146941317323017 (code B ref 24057); Mon, 25 Jul 2016 02:20:01 +0000 Received: (at 24057) by debbugs.gnu.org; 25 Jul 2016 02:19:33 +0000 Received: from localhost ([127.0.0.1]:36182 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bRVUT-0005zA-5I for submit@debbugs.gnu.org; Sun, 24 Jul 2016 22:19:33 -0400 Received: from mail-oi0-f46.google.com ([209.85.218.46]:33673) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bRVUP-0005yv-II for 24057@debbugs.gnu.org; Sun, 24 Jul 2016 22:19:32 -0400 Received: by mail-oi0-f46.google.com with SMTP id j185so233761389oih.0 for <24057@debbugs.gnu.org>; Sun, 24 Jul 2016 19:19:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=tUQQ2HsfrBZlX6LLgTY2Kmg7Q8AxvWdbDO8dTyvFt+I=; b=VtewTh2TmafgJQ33zvsgQ9fN3Joflqn91snYOemSk8A8/f2EF0YrDvnyLW+DHYDz3c VlGd3OhhOEqJD3GohEAqgOWSdiI7pl6sCzDRF5/00CcoMHnAPNEG4l735jCyUH80fHvt dGVPotQd7FYh22FXrzAHB0WbovGSOLb5358yY0IHiC/Lr1WSoWaQlvXltgEedjjy5yhu hG0IVFk/xAHCCZhvmnWC6HupbPncvXvT9A7k/5EfULqsSpNQKY6QqwRZilol8g8cFjR5 Z/IpiU1/A7+LiGDDiyRUXa8cams+HuW0yU5NoD58sw9bNrGxsutMBJezlO5kdpsiN5z1 RnBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tUQQ2HsfrBZlX6LLgTY2Kmg7Q8AxvWdbDO8dTyvFt+I=; b=ObZG6G6TbtomHRAQn51pr1cpUu2WP7KsNvGBrVq3QtMYWe1WMIDkfkRwCqRiQQkj5S /ZxWFteQCsG9nPWBvF8XiaJlymbIRV6Ci1b49J9aTpTDaHQBwUSkcw8MKDOqdN+A2kPc HECmc2DZkdrEJXjGm4FbiYYQkabUkWlByz5/awe8okMlIPEyNu+sG+qQ/YqhNGqKMvFP flEt454SHBGvoyRPFOBjfdUulsubZUGjGzO+oW/O/2/zIWl+a+xfSDuUV0GBFPrnAVN6 PUyhFdWovQu6BmcIhhHLsTo44p0LaHwTKK/EUk0sUN7p6d2TKHf1MgnHeWj910kxo9y8 n7Fg== X-Gm-Message-State: AEkoouu743l+Pk7avDMl4qzSaRNTktetjS2Dk/XP6uSxeHkRMRx03DdSZAza60/9LhLQ7Lltxk+KWLm9GFqt2Q== X-Received: by 10.202.234.5 with SMTP id i5mr8312040oih.98.1469413163556; Sun, 24 Jul 2016 19:19:23 -0700 (PDT) MIME-Version: 1.0 References: <83lh0sx0yf.fsf@gnu.org> <83shv0v716.fsf@gnu.org> <83poq4v4jk.fsf@gnu.org> <83wpkbt92i.fsf@gnu.org> In-Reply-To: <83wpkbt92i.fsf@gnu.org> From: Kaushal Modi Date: Mon, 25 Jul 2016 02:19:13 +0000 Message-ID: Content-Type: multipart/alternative; boundary=001a113d3806a466f505386c6980 X-Spam-Score: -0.7 (/) 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.7 (/) --001a113d3806a466f505386c6980 Content-Type: text/plain; charset=UTF-8 On Sun, Jul 24, 2016 at 10:17 AM Eli Zaretskii wrote: > I tried with a comment that begins like this: > > ////share/foo > > and I don't think the proposed behavior will be correct in all cases. > The problem is that comment-search-forward moves all the way past the > leading 4 slashes, instead of only 2. That is expected, as I posted in a table earlier: |-----------------------------------+---------------------------------| | Example string in `c-mode' buffer | Returned `ffap-string-at-point' | |-----------------------------------+---------------------------------| | x//tmp | "tmp" | | //xtmp | "tmp" | | x////tmp | "tmp" | | ////xtmp | "tmp" | | x// //tmp | "" | | // //xtmp | "//tmp" | |-----------------------------------+---------------------------------| The problem with that is .. what is a user has a decorative comment like: ///I would like to ///share foo It is not possible to know if the user liked to use "//" or "///" or "////" or .. as the comment prefix. Also it is not possible to know if the user meant "/share" or "//share". So the best way to make the user's intent clear is by preceding the path with a space. I can also create a patch with this info in the NEWS. "// /share" -> User means "/share" "// //share" -> User means "//share" "/// /share" -> User means "/share" "/// //share" -> User means "//share" "//share" -> User means "share" "///share" -> User means "share" "////share" -> User means "share" "/////share" -> User means "share" Also thinking that the user meant "//share" in "////share" does not make much sense. It's very confusing to count the number of slashes in there. What is the user has "/////share" (5 slashes)? Where would we want the ffap-string-at-point to guess the comment-starter<>comment boundary then? We would rather have the user put a space to make it less confusing to read the comment and also much simpler to implement the ffap parsing and much less error prone. While I can understand why the > comment-start sequence should not be considered a potential file name, > the stuff that follows it -- in this case, //share/foo -- should IMO > be allowed to be a file name. > With the current state of ffap-string-at-point, it creates erroneous behavior for many people including me. But with the patch, if a user needs to put a path like "//share" in a comment for a major mode using "//" as comment prefix, all they need to do is use a space to separate the two. Also I think that it is very unlikely that someone would have a confusing comment like "////share" where the user meant "//share" (or "/share"). -- Kaushal Modi --001a113d3806a466f505386c6980 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Sun, Jul 24= , 2016 at 10:17 AM Eli Zaretskii <eliz@g= nu.org> wrote:
I tried with = a comment that begins like this:

=C2=A0 ////share/foo

and I don't think the proposed behavior will be correct in all cases. The problem is that comment-search-forward moves all the way past the
leading 4 slashes, instead of only 2.=C2=A0

That is expected, as I posted in a table earlier:

|-----------= ------------------------+---------------------------------|
| Example st= ring in `c-mode' buffer | Returned `ffap-string-at-point' |<= /div>
|---= --------------------------------+---------------------------------|<= /div>
| x/= /tmp =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0| "tmp" =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |
| //xtm= p =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0| "tmp" =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |
<= div style=3D"color:rgb(33,33,33);font-family:"helvetica neue",hel= vetica,arial,sans-serif;font-size:13px">| x////tmp= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0| "tmp" =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |
| ////xtmp =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0| "tmp" =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |
| x// //tmp =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |= "" =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|
| // //xtmp =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | &q= uot;//tmp" =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 |
|----------------= -------------------+---------------------------------|

The problem with that= is .. what is a user has a decorative comment like:

///I would like to
///share foo

It is= not possible to know if the user liked to use "//" or "///&= quot; or "////" or .. as the comment prefix. Also it is not possi= ble to know if the user meant "/share" or "//share".

So the best way to make the user's intent clear = is by preceding the path with a space. I can also create a patch with this = info in the NEWS.

"// /share" -> User= means "/share"
"// //share" -> User = means "//share"
"/// /share" -> User means= "/share"
"/// //share" -> User means &quo= t;//share"

"//share" -> User mea= ns "share"
"///share" -> User means "= share"
"////share" -> User means "share""/////share" -&= gt; User means "share"

Also thinking that the user meant "= //share" in "////share" does not make much sense. It's v= ery confusing to count the number of slashes in there. What is the user has= "/////share" (5 slashes)? Where = would we want the ffap-string-at-point to guess the comment-starter<>= comment boundary then? We would rather have the user put a space to make it= less confusing to read the comment and also much simpler to implement the = ffap parsing and much less error prone.=C2=A0

While I= can understand why the
comment-start sequence should not be considered a potential file name,
the stuff that follows it -- in this case, //share/foo -- should IMO
be allowed to be a file name.

With the = current state of ffap-string-at-point, it creates erroneous behavior for ma= ny people including me. But with the patch, if a user needs to put a path l= ike "//share" in a comment for a major mode using "//" = as comment prefix, all they need to do is use a space to separate the two. = Also I think that it is very unlikely that someone would have a confusing c= omment like "////share" where the user meant "//share" = (or "/share").
--

Kausha= l Modi

--001a113d3806a466f505386c6980-- From unknown Sat Aug 16 18:47:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#24057: 25.1.50; ffap interprets comments beginning with "//" as file path Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 25 Jul 2016 17:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24057 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Kaushal Modi Cc: 24057@debbugs.gnu.org, npostavs@users.sourceforge.net Reply-To: Eli Zaretskii Received: via spool by 24057-submit@debbugs.gnu.org id=B24057.146946620112779 (code B ref 24057); Mon, 25 Jul 2016 17:04:02 +0000 Received: (at 24057) by debbugs.gnu.org; 25 Jul 2016 17:03:21 +0000 Received: from localhost ([127.0.0.1]:37136 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bRjHl-0003K3-7N for submit@debbugs.gnu.org; Mon, 25 Jul 2016 13:03:21 -0400 Received: from eggs.gnu.org ([208.118.235.92]:39183) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bRjHi-0003Jq-T7 for 24057@debbugs.gnu.org; Mon, 25 Jul 2016 13:03:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bRjHZ-0003Xx-NU for 24057@debbugs.gnu.org; Mon, 25 Jul 2016 13:03:13 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:53422) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bRjHN-0003XB-Ha; Mon, 25 Jul 2016 13:02:57 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1063 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bRjHK-0000rX-47; Mon, 25 Jul 2016 13:02:55 -0400 Date: Mon, 25 Jul 2016 20:02:36 +0300 Message-Id: <83mvl5tzv7.fsf@gnu.org> From: Eli Zaretskii In-reply-to: (message from Kaushal Modi on Mon, 25 Jul 2016 02:19:13 +0000) References: <83lh0sx0yf.fsf@gnu.org> <83shv0v716.fsf@gnu.org> <83poq4v4jk.fsf@gnu.org> <83wpkbt92i.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -6.3 (------) 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: -6.3 (------) > From: Kaushal Modi > Date: Mon, 25 Jul 2016 02:19:13 +0000 > Cc: 24057@debbugs.gnu.org, npostavs@users.sourceforge.net > > I tried with a comment that begins like this: > > ////share/foo > > and I don't think the proposed behavior will be correct in all cases. > The problem is that comment-search-forward moves all the way past the > leading 4 slashes, instead of only 2. > > That is expected, as I posted in a table earlier: If I understood you correctly, the table you posted didn't cover systems which support UNC file names, so you asked me to try on such a system. The above was my response to your request. > The problem with that is .. what is a user has a decorative comment like: > > ///I would like to > ///share foo > > It is not possible to know if the user liked to use "//" or "///" or "////" or .. as the comment prefix. Also it is not possible to know if the user meant "/share" or "//share". IMO, it isn't Emacs's place to second-guess the user in a way that prohibits valid use cases. > So the best way to make the user's intent clear is by preceding the path with a space. When there's whitespace between the comment leader and the rest, the problem I'm talking about doesn't exist. > Also thinking that the user meant "//share" in "////share" does not make much sense. It's very confusing to count the number of slashes in there. What is the user has "/////share" (5 slashes)? Where would we want the ffap-string-at-point to guess the comment-starter<>comment boundary then? If you want to code a backward-compatible solution, then skipping the comment-start regexp should do, I think. Where it stops, ffap should start looking for valid file names. > With the current state of ffap-string-at-point, it creates erroneous behavior for many people including me. But with the patch, if a user needs to put a path like "//share" in a comment for a major mode using "//" as comment prefix, all they need to do is use a space to separate the two. Also I think that it is very unlikely that someone would have a confusing comment like "////share" where the user meant "//share" (or "/share"). I see your point. My point is that when we introduce backward-incompatible behavior, which makes previously valid use cases invalid, such incompatible behavior should initially be opt-in, even if it looks to you that the previous behavior made no sense. I have enough gray hair to testify how such decisions in the past turned out to be annoyances for some users. Later, usually years later, we could collect user experience and decide to make this the default behavior. So if you disagree with my suggestion to skip comment-start instead of using comment-search-forward, the behavior you propose should IMO be off by default. Thanks. From unknown Sat Aug 16 18:47:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#24057: 25.1.50; ffap interprets comments beginning with "//" as file path Resent-From: Kaushal Modi Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 25 Jul 2016 17:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24057 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 24057@debbugs.gnu.org, npostavs@users.sourceforge.net Received: via spool by 24057-submit@debbugs.gnu.org id=B24057.146946684813696 (code B ref 24057); Mon, 25 Jul 2016 17:15:02 +0000 Received: (at 24057) by debbugs.gnu.org; 25 Jul 2016 17:14:08 +0000 Received: from localhost ([127.0.0.1]:37141 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bRjSC-0003Yp-B0 for submit@debbugs.gnu.org; Mon, 25 Jul 2016 13:14:08 -0400 Received: from mail-oi0-f53.google.com ([209.85.218.53]:36046) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bRjSB-0003YU-6a for 24057@debbugs.gnu.org; Mon, 25 Jul 2016 13:14:07 -0400 Received: by mail-oi0-f53.google.com with SMTP id w18so261427287oiw.3 for <24057@debbugs.gnu.org>; Mon, 25 Jul 2016 10:14:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9leNOgrZ8bY7ssVWJksgG8gB/ryxKdmEDhD9zRTTZh8=; b=XpGUcQfbwaAktKRB+9IdcUSdei/aHBpwtElxFarDZlkiDXHlsgVs8LwW3jhjdty5Qs juPks7M5MO5aHGlfi32XyxOxDvQF6nRik12nSA44rhIgr+KFh8W7hOm/OI18YVerrJGv dDbR8xD5bAGjiDt0WRe6GqT91BA4L2AQEdhQlJYtpGKaCTV3jCifV8Lb7zMduVrQN9GG x4Nadgdly4K7ALQjBEs8sqtvARnz8WL5QLrhqLEEPJJ07IBnlzSbBEOmnDKrl16j7P4U 23K1MEsCqQAywdkBJR5mBIvKYxL/vZqi4ZH6bBmJqGA+uv1GftQGmSunU0J4iQVjWTfa UNTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9leNOgrZ8bY7ssVWJksgG8gB/ryxKdmEDhD9zRTTZh8=; b=EtujzVcEf6T5ziEyuJe/mnLMz9uD3KTEdOY8Up/cqNyhFOQbj+z2Obin+jx4pdknyi EmOS1YIXxqhlXt9+3hCEpdxiQBbeDgDW0tq9fP2DvdKpZfPmmL9FEfm9Pkn4ERBYP6G3 SzfOJESSUrBb3oMlCpYxhNPajvLffxAwYz212NYLdjgUURK3uPCX2yCvaSMm58291J56 0b1W/iaXT4t9nYotXg3c9x+LSuBS3NYkMb1qg3rIFcflob1Qo2WyzhV0M+Ib5rCZCZWK o3ndW2iOzHvjxfPz+6zetuHyKfyXPUjMHspqGP4Aeki98MUz1ZiPoM5Sr6YHaUQ6gHB7 BhNg== X-Gm-Message-State: AEkoous5Bh0osLBBRFqnFFg/cDqBlfPSXGd70qpSx/VD9ZjNbto8E4wytJELdB4h3tSrIfYWAe8kXzqmDTME/Q== X-Received: by 10.157.17.169 with SMTP id v38mr9518482otf.11.1469466841351; Mon, 25 Jul 2016 10:14:01 -0700 (PDT) MIME-Version: 1.0 References: <83lh0sx0yf.fsf@gnu.org> <83shv0v716.fsf@gnu.org> <83poq4v4jk.fsf@gnu.org> <83wpkbt92i.fsf@gnu.org> <83mvl5tzv7.fsf@gnu.org> In-Reply-To: <83mvl5tzv7.fsf@gnu.org> From: Kaushal Modi Date: Mon, 25 Jul 2016 17:13:51 +0000 Message-ID: Content-Type: multipart/alternative; boundary=94eb2c1917a016a6bd053878e9b3 X-Spam-Score: -0.7 (/) 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.7 (/) --94eb2c1917a016a6bd053878e9b3 Content-Type: text/plain; charset=UTF-8 On Mon, Jul 25, 2016 at 1:03 PM Eli Zaretskii wrote: > If I understood you correctly, the table you posted didn't cover > systems which support UNC file names, so you asked me to try on such a > system. The above was my response to your request. > Thanks. AFAIU, ffap-string-at-point basically deals with just parsing the string and does not check if a path is valid. So the "////tmp" example in the table should apply to any use case. > > The problem with that is .. what is a user has a decorative comment like: > > > > ///I would like to > > ///share foo > > > > It is not possible to know if the user liked to use "//" or "///" or > "////" or .. as the comment prefix. Also it is not possible to know if the > user meant "/share" or "//share". > > IMO, it isn't Emacs's place to second-guess the user in a way that > prohibits valid use cases. > OK. > > So the best way to make the user's intent clear is by preceding the path > with a space. > > When there's whitespace between the comment leader and the rest, the > problem I'm talking about doesn't exist. > Thanks for confirming that. > Also thinking that the user meant "//share" in "////share" does not make > much sense. It's very confusing to count the number of slashes in there. > What is the user has "/////share" (5 slashes)? Where would we want the > ffap-string-at-point to guess the comment-starter<>comment boundary then? > > If you want to code a backward-compatible solution, then skipping the > comment-start regexp should do, I think. Where it stops, ffap should > start looking for valid file names. > I thought about the comment-start variable, but for c-mode C-h v comment-start gives "/* " and C-h v comment-start-skip gives "\\(//+\\|/\\*+\\)\\s *" So it will take "/" followed by 1 or more "/" as comment start. > > With the current state of ffap-string-at-point, it creates erroneous > behavior for many people including me. But with the patch, if a user needs > to put a path like "//share" in a comment for a major mode using "//" as > comment prefix, all they need to do is use a space to separate the two. > Also I think that it is very unlikely that someone would have a confusing > comment like "////share" where the user meant "//share" (or "/share"). > > I see your point. Thanks. > My point is that when we introduce > backward-incompatible behavior, which makes previously valid use cases > invalid, such incompatible behavior should initially be opt-in, even > if it looks to you that the previous behavior made no sense. I have > enough gray hair to testify how such decisions in the past turned out > to be annoyances for some users. Later, usually years later, we could > collect user experience and decide to make this the default behavior. > If the new behavior is not made the default then we will never know if it causes user annoyance. So if you disagree with my suggestion to skip comment-start instead of > using comment-search-forward, the behavior you propose should IMO be > off by default. > If that's the only way forward, I will add a defcustom in the next patch. But it doesn't feel right. A defcustom is being created for a very corner case. Even if I agree with that, it does not feel right to set its default value so that the buggy behavior is retained by default just to backward compatibility sake. How about we add the defcustom and set the default value so that this bug is fixed. And we wait for people using the master branch to report any issues caused by this. Also we let emacs-devel know that this defcustom is going in. -- Kaushal Modi --94eb2c1917a016a6bd053878e9b3 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Mon, Jul 25= , 2016 at 1:03 PM Eli Zaretskii <eliz@gn= u.org> wrote:
If I understoo= d you correctly, the table you posted didn't cover
systems which support UNC file names, so you asked me to try on such a
system.=C2=A0 The above was my response to your request.

Thanks. AFAIU, ffap-string-at-point basically deals with = just parsing the string and does not check if a path is valid. So the "= ;////tmp" example in the table should apply to any use case.
=C2=A0
> The problem with that is .. what is a user has a decorative comment li= ke:
>
> ///I would like to
> ///share foo
>
> It is not possible to know if the user liked to use "//" or = "///" or "////" or .. as the comment prefix. Also it is= not possible to know if the user meant "/share" or "//share= ".

IMO, it isn't Emacs's place to second-guess the user in a way that<= br> prohibits valid use cases.

OK.=C2=A0
=C2=A0
> So the best way to make the user's intent clear is by preceding th= e path with a space.

When there's whitespace between the comment leader and the rest, the problem I'm talking about doesn't exist.

<= /div>
Thanks for confirming that.=C2=A0

> Also thinking that the user meant "//share" in "////sha= re" does not make much sense. It's very confusing to count the num= ber of slashes in there. What is the user has "/////share" (5 sla= shes)? Where would we want the ffap-string-at-point to guess the comment-st= arter<>comment boundary then?

If you want to code a backward-compatible solution, then skipping the
comment-start regexp should do, I think.=C2=A0 Where it stops, ffap should<= br> start looking for valid file names.

I t= hought about the comment-start variable, but for c-mode=C2=A0
C-h v comment-start gives=C2=A0"/* " and=C2=A0
<= div>C-h v comment-start-skip gives=C2=A0"\\(//+\\|/\\*+\\)\\s *"<= /div>

So it will take "/" followed by 1 or mor= e "/" as comment start.
=C2=A0
> With the current state of ffap-string-at-point, it creates erroneous b= ehavior for many people including me. But with the patch, if a user needs t= o put a path like "//share" in a comment for a major mode using &= quot;//" as comment prefix, all they need to do is use a space to sepa= rate the two. Also I think that it is very unlikely that someone would have= a confusing comment like "////share" where the user meant "= //share" (or "/share").

I see your point.=C2=A0

Thanks.
= =C2=A0
My point is that when we introdu= ce
backward-incompatible behavior, which makes previously valid use cases
invalid, such incompatible behavior should initially be opt-in, even
if it looks to you that the previous behavior made no sense.=C2=A0 I have enough gray hair to testify how such decisions in the past turned out
to be annoyances for some users.=C2=A0 Later, usually years later, we could=
collect user experience and decide to make this the default behavior.

If the new behavior is not made the default = then we will never know if it causes user annoyance.=C2=A0

So if you disagree with my suggestion to skip comment-start instead of
using comment-search-forward, the behavior you propose should IMO be
off by default.

If that's the only = way forward, I will add a defcustom in the next patch. But it doesn't f= eel right. A defcustom is being created for a very corner case. Even if I a= gree with that, it does not feel right to set its default value so that the= buggy behavior is retained by default just to backward compatibility sake.=

How about we add the defcustom and set the defaul= t value so that this bug is fixed. And we wait for people using the master = branch to report any issues caused by this. Also we let emacs-devel know th= at this defcustom is going in.=C2=A0
-- <= br>

Kaushal Modi

--94eb2c1917a016a6bd053878e9b3-- From unknown Sat Aug 16 18:47:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#24057: 25.1.50; ffap interprets comments beginning with "//" as file path Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 25 Jul 2016 17:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24057 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Kaushal Modi Cc: 24057@debbugs.gnu.org, npostavs@users.sourceforge.net Reply-To: Eli Zaretskii Received: via spool by 24057-submit@debbugs.gnu.org id=B24057.146946749114661 (code B ref 24057); Mon, 25 Jul 2016 17:25:02 +0000 Received: (at 24057) by debbugs.gnu.org; 25 Jul 2016 17:24:51 +0000 Received: from localhost ([127.0.0.1]:37145 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bRjcZ-0003oP-Ie for submit@debbugs.gnu.org; Mon, 25 Jul 2016 13:24:51 -0400 Received: from eggs.gnu.org ([208.118.235.92]:45280) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bRjcY-0003o8-0P for 24057@debbugs.gnu.org; Mon, 25 Jul 2016 13:24:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bRjcN-000052-VC for 24057@debbugs.gnu.org; Mon, 25 Jul 2016 13:24:44 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:53692) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bRjcC-0008US-6t; Mon, 25 Jul 2016 13:24:28 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1079 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bRjc9-0002Tx-Oh; Mon, 25 Jul 2016 13:24:26 -0400 Date: Mon, 25 Jul 2016 20:24:12 +0300 Message-Id: <83invttyv7.fsf@gnu.org> From: Eli Zaretskii In-reply-to: (message from Kaushal Modi on Mon, 25 Jul 2016 17:13:51 +0000) References: <83lh0sx0yf.fsf@gnu.org> <83shv0v716.fsf@gnu.org> <83poq4v4jk.fsf@gnu.org> <83wpkbt92i.fsf@gnu.org> <83mvl5tzv7.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -6.3 (------) 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: -6.3 (------) > From: Kaushal Modi > Date: Mon, 25 Jul 2016 17:13:51 +0000 > Cc: 24057@debbugs.gnu.org, npostavs@users.sourceforge.net > > So if you disagree with my suggestion to skip comment-start instead of > using comment-search-forward, the behavior you propose should IMO be > off by default. > > If that's the only way forward, I will add a defcustom in the next patch. But it doesn't feel right. A defcustom is > being created for a very corner case. Even if I agree with that, it does not feel right to set its default value so > that the buggy behavior is retained by default just to backward compatibility sake. Not sure which behavior you call "buggy". I'm okay with unconditionally skipping the comment leader string, such as "//" in C/C++ case. If you want to skip more than that, I think skipping the rest should be optional, defaulting to off. How's that "buggy"? > How about we add the defcustom and set the default value so that this bug is fixed. And we wait for people > using the master branch to report any issues caused by this. Also we let emacs-devel know that this > defcustom is going in. I don't want us to introduce backward-incompatible behavior, except when strictly necessary. In this case, skipping the initial "//" is necessary, but skipping more slashes is not. Thanks. From unknown Sat Aug 16 18:47:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#24057: 25.1.50; ffap interprets comments beginning with "//" as file path Resent-From: Kaushal Modi Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 25 Jul 2016 18:15:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24057 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 24057@debbugs.gnu.org, npostavs@users.sourceforge.net Received: via spool by 24057-submit@debbugs.gnu.org id=B24057.146947045519373 (code B ref 24057); Mon, 25 Jul 2016 18:15:01 +0000 Received: (at 24057) by debbugs.gnu.org; 25 Jul 2016 18:14:15 +0000 Received: from localhost ([127.0.0.1]:37166 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bRkOM-00052O-St for submit@debbugs.gnu.org; Mon, 25 Jul 2016 14:14:15 -0400 Received: from mail-oi0-f53.google.com ([209.85.218.53]:34032) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bRkOK-000529-2N for 24057@debbugs.gnu.org; Mon, 25 Jul 2016 14:14:13 -0400 Received: by mail-oi0-f53.google.com with SMTP id l65so263440111oib.1 for <24057@debbugs.gnu.org>; Mon, 25 Jul 2016 11:14:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=mvvF2PMsypGvKWBh6DEFgBb19QwGRrfJgRM2WKFb8pA=; b=HL0c4dMdtMjwdRUW2nX3zTptgGTlSeN9xZrbnM+bsoFI90X/hW9VdtnNx2XJJJmXkV ge/LRd+LzEAQmHf4+l4uf97oL1dRCiEFAq+bg5BHS/r8l7zDRIiAqt+jnU4Rip9nT1x4 j/C2tdh0gTxTquKlUw4Ea8nZRmwnRdq6nG8+OF/UZFgZ1/XQpH295T7wy7iKCmlnIdLt 6MgseCaC4TOhf77yopcSm7EJd5rb/pkcrtvFZCS3d6fubjbhgE5P7QJlFSmuqZLx7QPc PElDSjNhjb/JH8/80dSYoVc2BWiRLn0YUFLNRuDRA3ERT+umqkC5CAZdqlTZZpdV0wc9 Dj2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=mvvF2PMsypGvKWBh6DEFgBb19QwGRrfJgRM2WKFb8pA=; b=UZF8/vBTOVVay5p+u/U+IwhJ+xDfj2yubha2y1JZm3IOMR1h+Mq88q3XLVJgUHQSM+ nsryom49Ts4/Y9CT2263JtFCNBiOKjarcNDqSJlG5cu8TLSaqy+EErn/Xi/JTH/CvGyU CI0LEy6CYth/j420MxtQckjjzjs1ngpVkJpSHLCGW+AFjJaBoirD7UAaqPevaHzjMOHN 0viLePmhDEnf+2vmdCvk6uxPBv/Yt7kROGVNt5vW4IO6cg8qde2yyve4WWsK6jaEp17B TCXwitvpenQD1XxXfI3nFBd8UgpWgIrrXHhTGIXxx6nz8yXJs0vZ8s8kHpVWeqggQQHn 2vhw== X-Gm-Message-State: AEkooutkw2BD85Bh56S3AAqYhbwEgkBWI5tCAUlxYGvxJsBcoPFMEwXrSiqi3J9r+ED2f1xCBXuSlgQSxbeFyg== X-Received: by 10.202.8.210 with SMTP id 201mr9121772oii.107.1469470446455; Mon, 25 Jul 2016 11:14:06 -0700 (PDT) MIME-Version: 1.0 References: <83lh0sx0yf.fsf@gnu.org> <83shv0v716.fsf@gnu.org> <83poq4v4jk.fsf@gnu.org> <83wpkbt92i.fsf@gnu.org> <83mvl5tzv7.fsf@gnu.org> <83invttyv7.fsf@gnu.org> In-Reply-To: <83invttyv7.fsf@gnu.org> From: Kaushal Modi Date: Mon, 25 Jul 2016 18:13:56 +0000 Message-ID: Content-Type: multipart/alternative; boundary=94eb2c12f1d6f82c02053879bfdb X-Spam-Score: -0.7 (/) 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.7 (/) --94eb2c12f1d6f82c02053879bfdb Content-Type: text/plain; charset=UTF-8 On Mon, Jul 25, 2016 at 1:24 PM Eli Zaretskii wrote: > Not sure which behavior you call "buggy". I'm okay with > unconditionally skipping the comment leader string, such as "//" in > C/C++ case. If you want to skip more than that, I think skipping the > rest should be optional, defaulting to off. How's that "buggy"? > Thanks for the clarification. I thought that you were suggesting to have a defcustom that would either use or not use comment-search-forward in ffap-string-at-point with the default set such that the old (current) behavior of not skipping the comment starter at all is retained. I refer to this "not skipping the comment starter at all" behavior as buggy. > > How about we add the defcustom and set the default value so that this > bug is fixed. And we wait for people > > using the master branch to report any issues caused by this. Also we let > emacs-devel know that this > > defcustom is going in. > > I don't want us to introduce backward-incompatible behavior, except > when strictly necessary. In this case, skipping the initial "//" is > necessary, but skipping more slashes is not. > Understood. In that case, the code will have to be made more complex... Here's a quick attempt .. Can you please have a look at it? (defun modi/ffap-string-at-point (&optional mode) "Return a string of characters from around point. MODE (defaults to value of `major-mode') is a symbol used to look up string syntax parameters in `ffap-string-at-point-mode-alist'. If MODE is not found, we use `file' instead of MODE. If the region is active,return a string from the region. If the point is in a comment, ensure that the returned string does not contain the comment start characters (especially for major modes that have '//' as comment start characters). Sets variables `ffap-string-at-point' and `ffap-string-at-point-region'. " (let* ((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 (skip-chars-backward (car args)) (skip-chars-forward (nth 1 args) pt) (point)))) (end (if region-selected (region-end) (save-excursion (skip-chars-forward (car args)) (skip-chars-backward (nth 2 args) pt) (point)))) beg-temp) ;; Ensure that if "//" is a valid comment starter in the current major ;; mode, then that is removed from the returned string. (when (and (null region-selected) ;; Check if the first character is '/' and not part of the ;; comment (save-excursion (goto-char beg) (and (looking-at "/") (null (nth 4 (syntax-ppss))))) ;; Check if the second character is '/' and also not part of ;; the comment (setq beg-temp (+ 1 beg)) (if (> end beg-temp) (save-excursion (goto-char beg-temp) (and (looking-at "/") (null (nth 4 (syntax-ppss))))) nil)) ;; Check if the third character *is* part of the comment (setq beg-temp (+ 2 beg)) (if (> end beg-temp) (save-excursion (goto-char beg-temp) (when (nth 4 (syntax-ppss)) (setq beg beg-temp))))) (message "beg = %d beg-temp = %S end = %d " beg beg-temp end) (prog1 (setq ffap-string-at-point (buffer-substring-no-properties (setcar ffap-string-at-point-region beg) (setcar (cdr ffap-string-at-point-region) end))) (message "dbg: %S" ffap-string-at-point) ))) (advice-add 'ffap-string-at-point :override #'modi/ffap-string-at-point) -- Kaushal Modi --94eb2c12f1d6f82c02053879bfdb Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Mon, Jul 25= , 2016 at 1:24 PM Eli Zaretskii <eliz@gnu.org> wrote:
Not sure which behavior you call "buggy".=C2=A0 I'm okay= with
unconditionally skipping the comment leader string, such as "//" = in
C/C++ case.=C2=A0 If you want to skip more than that, I think skipping the<= br> rest should be optional, defaulting to off.=C2=A0 How's that "bugg= y"?

Thanks for the clarification. I though= t that you were suggesting to have a defcustom that would either use or not= use comment-search-forward in ffap-string-at-point with the default set su= ch that the old (current) behavior of not skipping the comment starter at a= ll is retained. I refer to this "not skipping the comment starter at a= ll" behavior as buggy.
=C2=A0
> How about we add the defcustom and set the default value so that this = bug is fixed. And we wait for people
> using the master branch to report any issues caused by this. Also we l= et emacs-devel know that this
> defcustom is going in.

I don't want us to introduce backward-incompatible behavior, except
when strictly necessary.=C2=A0 In this case, skipping the initial "//&= quot; is
necessary, but skipping more slashes is not.

Understood. In that case, the code will have to be made more comp= lex...

Here's a quick attempt .. Can you pleas= e have a look at it?

=C2=A0(defun modi/ffap-s= tring-at-point (&optional mode)
=C2=A0 =C2=A0 =C2=A0 "Re= turn a string of characters from around point.

MOD= E (defaults to value of `major-mode') is a symbol used to look up
=
string syntax parameters in `ffap-string-at-point-mode-alist'.

If MODE is not found, we use `file' instead of MO= DE.

If the region is active,return a string from t= he region.

If the point is in a comment, ensure th= at the returned string does not contain
the comment start charact= ers (especially for major modes that have '//' as
comment= start characters).

Sets variables `ffap-string-at= -point' and `ffap-string-at-point-region'. "
=C2=A0 = =C2=A0 =C2=A0 (let* ((args
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 (cdr
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0(or (assq (or mode major-mode) ffap-string-at-point-mode-alist)
=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(= assq 'file ffap-string-at-point-mode-alist))))
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(region-selected (use-region-p))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(pt (point))
= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(beg (if region-selected
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 (region-beginning)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (save-excursion
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (skip-chars-= backward (car args))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (skip-chars-forward (nth 1 args) pt)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 (point))))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0(end (if region-selected
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (region-end)
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (save-excurs= ion
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 (skip-chars-forward (car args))
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (skip-chars-= backward (nth 2 args) pt)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (point))))
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0beg-temp)
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 ;; Ensure that if "//" is a valid comment starter in the c= urrent major
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; mode, then that is re= moved from the returned string.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (when= (and (null region-selected)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;; Check if the first character is '/= ' and not part of the
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;; comment
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(save-excursion
= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0(goto-char beg)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(and (looking-at "/")
= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 (null (nth 4 (syntax-ppss)))))
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;; Check if the seco= nd character is '/' and also not part of
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;; the comment
=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(= setq beg-temp (+ 1 beg))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(if (> end beg-temp)
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(s= ave-excursion
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(goto-char beg-temp)
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0(and (looking-at "/")
=C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 (null (nth 4 (syntax-ppss)))))
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0nil))
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; Check if the third character *is* part o= f the comment
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (setq beg-temp (= + 2 beg))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (if (> end beg-te= mp)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (save-excurs= ion
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (goto= -char beg-temp)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 (when (nth 4 (syntax-ppss))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (setq beg beg-temp)))))
=C2=A0= =C2=A0 =C2=A0 =C2=A0 (message "beg =3D %d beg-temp =3D %S end =3D %d = "
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0beg beg-temp end)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (prog1
<= div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (setq ffap-string-at-point
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (buf= fer-substring-no-properties
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(setcar ffap-string-at-point-region beg)<= /div>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0(setcar (cdr ffap-string-at-point-region) end)))
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 (message "dbg: %S" ffap-string-at-point)=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 )))
=C2=A0 =C2=A0 (= advice-add 'ffap-string-at-point :override #'modi/ffap-string-at-po= int)
--

Kaushal = Modi

--94eb2c12f1d6f82c02053879bfdb-- From unknown Sat Aug 16 18:47:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#24057: 25.1.50; ffap interprets comments beginning with "//" as file path Resent-From: Kaushal Modi Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 25 Jul 2016 20:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24057 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 24057@debbugs.gnu.org, npostavs@users.sourceforge.net Received: via spool by 24057-submit@debbugs.gnu.org id=B24057.14694779254982 (code B ref 24057); Mon, 25 Jul 2016 20:19:02 +0000 Received: (at 24057) by debbugs.gnu.org; 25 Jul 2016 20:18:45 +0000 Received: from localhost ([127.0.0.1]:37219 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bRmKr-0001II-7X for submit@debbugs.gnu.org; Mon, 25 Jul 2016 16:18:45 -0400 Received: from mail-it0-f54.google.com ([209.85.214.54]:37860) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bRmKp-0001I6-Iz for 24057@debbugs.gnu.org; Mon, 25 Jul 2016 16:18:44 -0400 Received: by mail-it0-f54.google.com with SMTP id f6so116466023ith.0 for <24057@debbugs.gnu.org>; Mon, 25 Jul 2016 13:18:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+/9IxKc8EyuUuCP3tNP3FS27ieNxgooHHiE8Awi/YD8=; b=Yim1YwdxTexwE3UcKrrwTLszokrydWodAWq1CW+jZleA2I6XNjyttAMs84+u8oqvqU UcKwb16ZrL0NHoq6uA9KrJoW9gnKKQwYzu49PXTkHBVVkOcidV07I5NvIGWz6p7fhcsM CFy73mCKYYWbsNddslmNLxnUTE7e7GsLuAuIMbo978Mp7czTA5fkEBh9AFsfQ3SOHYqp gpjRf5g0D1BI66vKw8TLAOPpkk9JDO5k6hZmPqigLIODVfLFnRaYyY9ud+HNRyutuJyb L26ugISyhBQGvFGSgzgdyG/3k1BXijLfR/Hf45wptLPX5DPtIHx6alv0/MCjsC8Qo0d3 mzDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+/9IxKc8EyuUuCP3tNP3FS27ieNxgooHHiE8Awi/YD8=; b=Sy6OyiMjeSmoPFPub1v0rxiq5NZzYb2Y+zUwMDZqlPqhgFNxGQQ/PHDnBEMtFzERW6 Lqtjnpt7JV8WfrViXg8cfWVzUENsJJPrAlLabaLOaYSC+1c0tlRReVs2zkD8xwc1D+TW XNN1Mcx5H7D5oUO/6LdY3VzhiYnQhpue1Sj9/YRTB1Dvz43cVO29BkdH20gqGlf6IIu9 do4+OWYvb++H2O0gPL8LjGNlnVU0rBhCrnkN+LS1DKY4SscMI46L7w63kU2wtfwvKsCa EQJ+Pa5R3AWcoIuJSQicVd4T0/NrFHuBmGMBCOthfDBJIdpNnldUiXbLqGfIiNYxjuqh u67A== X-Gm-Message-State: AEkoouvLDjS2yYVbrpaMV1Hr7ct0KBOT2fSX0UaOzsIwGs4+GOD1Pd03CEHwiZaL944+PWH/kICWsGd6aNJyhA== X-Received: by 10.202.199.149 with SMTP id x143mr10925563oif.50.1469477917927; Mon, 25 Jul 2016 13:18:37 -0700 (PDT) MIME-Version: 1.0 References: <83lh0sx0yf.fsf@gnu.org> <83shv0v716.fsf@gnu.org> <83poq4v4jk.fsf@gnu.org> <83wpkbt92i.fsf@gnu.org> <83mvl5tzv7.fsf@gnu.org> <83invttyv7.fsf@gnu.org> In-Reply-To: From: Kaushal Modi Date: Mon, 25 Jul 2016 20:18:27 +0000 Message-ID: Content-Type: multipart/alternative; boundary=001a1134fc8c4dae9a05387b7d8e X-Spam-Score: -0.7 (/) 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.7 (/) --001a1134fc8c4dae9a05387b7d8e Content-Type: text/plain; charset=UTF-8 Here a git formatted patch .. it's an optimized, generic version of the snippet in my previous email. It's now "/" agnostic. Here's the new table of expected values of ffap-string-at-point: (x indicates the (point)) |-----------------------------------+---------------------------------| | Example string in `c-mode' buffer | Returned `ffap-string-at-point' | |-----------------------------------+---------------------------------| | x//tmp | "tmp" | | //xtmp | "tmp" | | x///tmp | "/tmp" | | //x/tmp | "/tmp" | | x////tmp | "//tmp" | | ////xtmp | "//tmp" | | x// //tmp | "" | | // x/tmp | "/tmp" | | // x//tmp | "//tmp" | |-----------------------------------+---------------------------------| ===== Patch follows >From 5e000cebb993a8cdccdf5e67f6b0eb66b4a267d8 Mon Sep 17 00:00:00 2001 From: Kaushal Modi Date: Mon, 25 Jul 2016 16:08:50 -0400 Subject: [PATCH] Do not include comment start chars in ffap string * lisp/ffap.el (ffap-string-at-point): If the point is in a comment, ensure that the returned string does not contain the comment start characters (especially for major modes that have '//' as comment start characters). Otherwise, in a major mode like c-mode, with `ido-mode' enabled and `ido-use-filename-at-point' set to `guess', doing "C-x C-f" on a "//foo" comment will initiate an attempt to access a path "//foo" (Bug#24057). --- lisp/ffap.el | 87 +++++++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 65 insertions(+), 22 deletions(-) diff --git a/lisp/ffap.el b/lisp/ffap.el index 7013e6e..8708a17 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el @@ -1097,33 +1097,76 @@ ffap-string-at-point (defun ffap-string-at-point (&optional mode) "Return a string of characters from around point. + MODE (defaults to value of `major-mode') is a symbol used to look up string syntax parameters in `ffap-string-at-point-mode-alist'. + If MODE is not found, we use `file' instead of MODE. -If the region is active, return a string from the region. -Sets the variable `ffap-string-at-point' and the variable -`ffap-string-at-point-region'." + +If the region is active,return a string from the region. + +If the point is in a comment, ensure that the returned string does not contain +the comment start characters (especially for major modes that have '//' as +comment start characters). + +Sets variables `ffap-string-at-point' and `ffap-string-at-point-region'. " (let* ((args - (cdr - (or (assq (or mode major-mode) ffap-string-at-point-mode-alist) - (assq 'file ffap-string-at-point-mode-alist)))) - (pt (point)) - (beg (if (use-region-p) - (region-beginning) - (save-excursion - (skip-chars-backward (car args)) - (skip-chars-forward (nth 1 args) pt) - (point)))) - (end (if (use-region-p) - (region-end) - (save-excursion - (skip-chars-forward (car args)) - (skip-chars-backward (nth 2 args) pt) - (point))))) + (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 + (skip-chars-backward (car args)) + (skip-chars-forward (nth 1 args) pt) + (point)))) + (end (if region-selected + (region-end) + (save-excursion + (skip-chars-forward (car args)) + (skip-chars-backward (nth 2 args) pt) + (point)))) + (beg-new beg)) + ;; (message "ffap-string-at-point dbg: beg = %d end = %d" 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 + (goto-char end) + (nth 4 (syntax-ppss)))) + (save-excursion + ;; Increment BEG till point at BEG is in a comment too. + ;; (nth 4 (syntax-ppss)) will be null for comment start + ;; characters (for example, for the "//" characters in + ;; `c-mode' line comments). + (setq beg (catch 'break + (while (< beg-new end) + (goto-char beg-new) + (if (nth 4 (syntax-ppss)) ; in a comment + (throw 'break beg-new) + (setq beg-new (1+ beg-new)))) + end)))) ; Set BEG to END if no throw happens + ;; (message "ffap-string-at-point dbg: beg = %d beg-new = %d" + ;; beg beg-new) (setq ffap-string-at-point - (buffer-substring-no-properties - (setcar ffap-string-at-point-region beg) - (setcar (cdr ffap-string-at-point-region) end))))) + (buffer-substring-no-properties + (setcar ffap-string-at-point-region beg) + (setcar (cdr ffap-string-at-point-region) end))) + ;; (message "ffap-string-at-point dbg: ffap-string-at-point = %S" + ;; ffap-string-at-point) + ffap-string-at-point)) (defun ffap-string-around () ;; Sometimes useful to decide how to treat a string. -- 2.9.2 -- Kaushal Modi --001a1134fc8c4dae9a05387b7d8e Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Here a git formatted patch .. it's an optimized, gener= ic version of the snippet in my previous email. It's now "/" = agnostic.

Here's the new table of expected values of= ffap-string-at-point:
(x indicates the (point))

|-----------------------------------= +---------------------------------|
| Example string in `c-mode' buffer | Returned `ffap-string-at-point= ' |
|------------------------= -----------+---------------------------------|
| x//tmp =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| "tmp" =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 |
| //xtmp =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0| "tmp" =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |
| x///tmp =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | "/tmp" =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0|
| //x/tmp =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 | "/tmp" =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|
| x////tmp =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| "//tmp" =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |
| ////xtmp =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| "//tmp&qu= ot; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 |
| x// //tmp =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 | "" =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|
| // x/tmp =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| "/tmp" =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0|
| // x//tmp =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 | "//tmp" =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |
|-----------------------------------+---------------------------------|=

=3D=3D=3D=3D=3D Patch follows
<= div>
From 5e000cebb993a8cdccdf5e67f6b0eb66b4a267d8 Mon S= ep 17 00:00:00 2001
From: Kaushal Modi <kaushal.modi@gmail.com>
Date: Mon, 25 = Jul 2016 16:08:50 -0400
Subject: [PATCH] Do not include comment s= tart chars in ffap string

* lisp/ffap.el (ffap-str= ing-at-point): If the point is in a comment,
ensure that the retu= rned string does not contain the comment start
characters (especi= ally for major modes that have '//' as comment start
char= acters).

Otherwise, in a major mode like c-mode, w= ith `ido-mode' enabled and
`ido-use-filename-at-point' se= t to `guess', doing "C-x C-f" on a "//foo"
comment will initiate an attempt to access a path "//foo" (Bug#= 24057).
---
=C2=A0lisp/ffap.el | 87 +++++++++++++++++++= ++++++++++++++++++++++++++---------------
=C2=A01 file changed, 6= 5 insertions(+), 22 deletions(-)

diff --git a/lisp= /ffap.el b/lisp/ffap.el
index 7013e6e..8708a17 100644
-= -- a/lisp/ffap.el
+++ b/lisp/ffap.el
@@ -1097,33 +1097,= 76 @@ ffap-string-at-point
=C2=A0
=C2=A0(defun ffap-str= ing-at-point (&optional mode)
=C2=A0 =C2=A0"Return a str= ing of characters from around point.
+
=C2=A0MODE (defa= ults to value of `major-mode') is a symbol used to look up
= =C2=A0string syntax parameters in `ffap-string-at-point-mode-alist'.
+
=C2=A0If MODE is not found, we use `file' instead o= f MODE.
-If the region is active, return a string from the region= .
-Sets the variable `ffap-string-at-point' and the variable<= /div>
-`ffap-string-at-point-region'."
+
+= If the region is active,return a string from the region.
+
<= div>+If the point is in a comment, ensure that the returned string does not= contain
+the comment start characters (especially for major mode= s that have '//' as
+comment start characters).
+
+Sets variables `ffap-string-at-point' and `ffap-string-at= -point-region'. "
=C2=A0 =C2=A0(let* ((args
-<= span class=3D"Apple-tab-span" style=3D"white-space:pre"> =C2=A0(cdr=
- =C2=A0 (or (assq (or mode major-mode) ffap-string-at-point-mode-alist)
- = =C2=A0 =C2=A0 =C2=A0 (assq 'file ffap-string-at-point-mode-alist))))
- = (pt (point))
- (beg (if (use-region-p)
- =C2=A0(region-beginning)
- (save= -excursion
- =C2=A0(skip-chars-backward (car args))
- =C2=A0(skip-chars-f= orward (nth 1 args) pt)
- =C2=A0(point))))
- (end (if (use-region-p)
=
- = =C2=A0(region-end)
- (save-excursion
- =C2=A0(skip-chars-forward (car args= ))
- =C2=A0(skip-chars-backward (nth 2 args) pt)
- =C2=A0(point)))))
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(cdr
+ =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 (or (assq (or mode major-mode) ffap-string-at-point-mo= de-alist)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (ass= q 'file ffap-string-at-point-mode-alist))))
+ =C2=A0 =C2=A0 = =C2=A0 =C2=A0 (region-selected (use-region-p))
+ =C2=A0 =C2=A0 = =C2=A0 =C2=A0 (pt (point))
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 (beg (if= region-selected
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0(region-beginning)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0(save-excursion
+ =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(skip-chars-backward (car args= ))
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0(skip-chars-forward (nth 1 args) pt)
+ =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(point))))
+ =C2=A0 =C2= =A0 =C2=A0 =C2=A0 (end (if region-selected
+ =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(region-end)
+ =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(save-excursion
+= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(skip-chars-= forward (car args))
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0(skip-chars-backward (nth 2 args) pt)
+ =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(point))))
=
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 (beg-new beg))
+ =C2=A0 =C2=A0= ;; (message "ffap-string-at-point dbg: beg =3D %d end =3D %d" beg= end)
+ =C2=A0 =C2=A0;; If the initial characters of the to-be-re= turned string are the
+ =C2=A0 =C2=A0;; current major mode's = comment starter characters, *and* are not
+ =C2=A0 =C2=A0;; part = of a comment, remove those from the returned string
+ =C2=A0 =C2= =A0;; (Bug#24057).
+ =C2=A0 =C2=A0;; Example comments in `c-mode&= #39; (which considers lines beginning
+ =C2=A0 =C2=A0;; with &quo= t;//" as comments):
+ =C2=A0 =C2=A0;; =C2=A0//tmp - This is = a comment. It does not contain any path reference.
+ =C2=A0 =C2= =A0;; =C2=A0///tmp - This is a comment. The "/tmp" portion in tha= t is a path.
+ =C2=A0 =C2=A0;; =C2=A0////tmp - This is a comment.= The "//tmp" portion in that is a path.
+ =C2=A0 =C2=A0= (when (and
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; Proceed if no = region is selected by the user.
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 (null region-selected)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;= ; Check if END character is part of a comment.
+ =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 (save-excursion
+ =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 (goto-char end)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 (nth 4 (syntax-ppss))))
+ =C2=A0 =C2=A0 =C2=A0(save= -excursion
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0;; Increment BEG till poi= nt at BEG is in a comment too.
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0;; (n= th 4 (syntax-ppss)) will be null for comment start
+ =C2=A0 =C2= =A0 =C2=A0 =C2=A0;; characters (for example, for the "//" charact= ers in
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0;; `c-mode' line comments= ).
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0(setq beg (catch 'break
=
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0(while (< beg-new end)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(goto-char beg-new)
+ = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0(if (nth 4 (syntax-ppss)) ; in a comment
+ =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(t= hrow 'break beg-new)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(setq beg-new (1+ beg-new))))<= /div>
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0end)))) ; Set BEG to END if no throw happens
+ =C2=A0 =C2= =A0;; (message "ffap-string-at-point dbg: beg =3D %d beg-new =3D %d&qu= ot;
+ =C2=A0 =C2=A0;; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0beg beg-n= ew)
=C2=A0 =C2=A0 =C2=A0(setq ffap-string-at-point
- =C2=A0(buffe= r-substring-no-properties
- =C2=A0 (setcar ffap-string-at-point-region be= g)
- =C2=A0 (setcar (cdr ffap-string-at-point-region) end)))))
+ = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(buffer-substring-no-properties
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (setcar ffap-string-at-point-region b= eg)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (setcar (cdr ffap-string= -at-point-region) end)))
+ =C2=A0 =C2=A0;; (message "ffap-st= ring-at-point dbg: ffap-string-at-point =3D %S"
+ =C2=A0 =C2= =A0;; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ffap-string-at-point)
+ = =C2=A0 =C2=A0ffap-string-at-point))
=C2=A0
=C2=A0(defun= ffap-string-around ()
=C2=A0 =C2=A0;; Sometimes useful to decide= how to treat a string.
--=C2=A0
2.9.2

--

Kaushal Modi

--001a1134fc8c4dae9a05387b7d8e-- From unknown Sat Aug 16 18:47:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#24057: 25.1.50; ffap interprets comments beginning with "//" as file path Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 26 Jul 2016 14:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24057 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Kaushal Modi Cc: 24057@debbugs.gnu.org, npostavs@users.sourceforge.net Reply-To: Eli Zaretskii Received: via spool by 24057-submit@debbugs.gnu.org id=B24057.146954413727409 (code B ref 24057); Tue, 26 Jul 2016 14:43:01 +0000 Received: (at 24057) by debbugs.gnu.org; 26 Jul 2016 14:42:17 +0000 Received: from localhost ([127.0.0.1]:38232 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bS3Yj-00077x-13 for submit@debbugs.gnu.org; Tue, 26 Jul 2016 10:42:17 -0400 Received: from eggs.gnu.org ([208.118.235.92]:46329) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bS3Yd-00077d-1m for 24057@debbugs.gnu.org; Tue, 26 Jul 2016 10:42:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bS3YT-0001bl-Vi for 24057@debbugs.gnu.org; Tue, 26 Jul 2016 10:42:01 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_20,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:40691) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bS3YI-0001Zn-MN; Tue, 26 Jul 2016 10:41:46 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1675 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bS3YH-0000qb-0G; Tue, 26 Jul 2016 10:41:45 -0400 Date: Tue, 26 Jul 2016 17:41:33 +0300 Message-Id: <83eg6gtqaq.fsf@gnu.org> From: Eli Zaretskii In-reply-to: (message from Kaushal Modi on Mon, 25 Jul 2016 20:18:27 +0000) References: <83lh0sx0yf.fsf@gnu.org> <83shv0v716.fsf@gnu.org> <83poq4v4jk.fsf@gnu.org> <83wpkbt92i.fsf@gnu.org> <83mvl5tzv7.fsf@gnu.org> <83invttyv7.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -6.3 (------) 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: -6.3 (------) > From: Kaushal Modi > Date: Mon, 25 Jul 2016 20:18:27 +0000 > Cc: 24057@debbugs.gnu.org, npostavs@users.sourceforge.net > > Here a git formatted patch .. it's an optimized, generic version of the > snippet in my previous email. It's now "/" agnostic. Thanks. Most of the patch looks like whitespace changes? > + (setq beg (catch 'break > + (while (< beg-new end) > + (goto-char beg-new) > + (if (nth 4 (syntax-ppss)) ; in a comment > + (throw 'break beg-new) > + (setq beg-new (1+ beg-new)))) > + end)))) ; Set BEG to END if no throw happens Is there any problem with a more conventional while loop that stops when syntax-ppss has its 5th element non-nil? Why did you need to use throw and catch here? From unknown Sat Aug 16 18:47:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#24057: 25.1.50; ffap interprets comments beginning with "//" as file path Resent-From: Kaushal Modi Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 26 Jul 2016 15:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24057 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 24057@debbugs.gnu.org, npostavs@users.sourceforge.net Received: via spool by 24057-submit@debbugs.gnu.org id=B24057.146954593230195 (code B ref 24057); Tue, 26 Jul 2016 15:13:01 +0000 Received: (at 24057) by debbugs.gnu.org; 26 Jul 2016 15:12:12 +0000 Received: from localhost ([127.0.0.1]:38268 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bS41h-0007qt-1b for submit@debbugs.gnu.org; Tue, 26 Jul 2016 11:12:12 -0400 Received: from mail-it0-f41.google.com ([209.85.214.41]:34929) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bS41b-0007q8-VE for 24057@debbugs.gnu.org; Tue, 26 Jul 2016 11:12:07 -0400 Received: by mail-it0-f41.google.com with SMTP id u186so115911720ita.0 for <24057@debbugs.gnu.org>; Tue, 26 Jul 2016 08:12:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=N8TxUvGOlPJ7EefyST/uEZ22csysGzZu93sWqutSkMs=; b=oCgDk9kyvTkMLplBbrt7upSvvj6GYTea+JERIX/zK1G2fzkyj7iPW21JvQ6yAyq/Ue jG1BH1FY4r3gMlUvxjXh2Lg4ex8AKd1+nuVJGtGQtzsKczUbFc7IeVqhFukXMyPVftlt 865ykfJGNjhEjBXXziJBfiVuoP2w6DQMyGi7a6t1PKJPCbWphcDA0iqd+h9pg72+QhmZ rfXcTR1p+EEfq8gVVbcfyPnyt5Y+SDkeOyLSDOjWKM6uuzivXv+vbkT9oDIqYwiS7zbS vVRpMsKeCfegbA3nKkU+CY7mGrkLDmEtaNaZ0mWEEGwkT08poa0lfNhGFANOm4IJ7HO0 +9Tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=N8TxUvGOlPJ7EefyST/uEZ22csysGzZu93sWqutSkMs=; b=dWAnargwoOW0cggKNChKZ++qeQWQm7s5on2VvzxSjVt57NqiaFUZwO7oQyuJsb31pn thMMygV/p/8sQKLozaWg42+WfHBP8fiOEtUyrUJPauDvM//et56nC0js3GgSaylUVqCW /d+C+vrmTaUFqwUNxhwgmRzaWd1r9wr4sZy4G99X0Ln4Iw1tcbe5DX5VkXZ5TDi6otIm NKOO98nFH59gEAVileztdPwodSru6TZuE3jQLLF8IDcBi5KmBdgDsz/n2/cH4ATPOuKv syxpYz/sUpMzJxlFtFTQo+XkiIAueh+d66Zsup+1Sbebncn8FO8sUfxiYcjyOCsT0V4j 3bWg== X-Gm-Message-State: AEkoouvqh/fmoefE49hVJtmXl392QhUqWwjBojC1dB02HUVc8Vaw2UFVLrAljIR6aDsk2Y+n+p2zI5sZOLe0Ow== X-Received: by 10.202.8.210 with SMTP id 201mr11540338oii.107.1469545915575; Tue, 26 Jul 2016 08:11:55 -0700 (PDT) MIME-Version: 1.0 References: <83lh0sx0yf.fsf@gnu.org> <83shv0v716.fsf@gnu.org> <83poq4v4jk.fsf@gnu.org> <83wpkbt92i.fsf@gnu.org> <83mvl5tzv7.fsf@gnu.org> <83invttyv7.fsf@gnu.org> <83eg6gtqaq.fsf@gnu.org> In-Reply-To: <83eg6gtqaq.fsf@gnu.org> From: Kaushal Modi Date: Tue, 26 Jul 2016 15:11:45 +0000 Message-ID: Content-Type: multipart/alternative; boundary=94eb2c12f1d64776ad05388b52c2 X-Spam-Score: -0.7 (/) 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.7 (/) --94eb2c12f1d64776ad05388b52c2 Content-Type: text/plain; charset=UTF-8 On Tue, Jul 26, 2016 at 10:42 AM Eli Zaretskii wrote: > > Here a git formatted patch .. it's an optimized, generic version of the > > snippet in my previous email. It's now "/" agnostic. > > Thanks. Most of the patch looks like whitespace changes? > I selected the whole defun and did auto-ident (C-M-\). The submitted patch was a result of that. I thought it's a good idea to update the indentation of the whole function. May be the lisp-indent-function changed since this function was updated last time? In any case, here is the patch ignoring whitespace changes. Note of caution that the indentation will look messed up when you merge this patch: ===== diff --git a/lisp/ffap.el b/lisp/ffap.el index 7013e6e..d1bca04 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el @@ -1097,33 +1097,73 @@ ffap-string-at-point (defun ffap-string-at-point (&optional mode) "Return a string of characters from around point. + MODE (defaults to value of `major-mode') is a symbol used to look up string syntax parameters in `ffap-string-at-point-mode-alist'. + If MODE is not found, we use `file' instead of MODE. + If the region is active,return a string from the region. -Sets the variable `ffap-string-at-point' and the variable -`ffap-string-at-point-region'." + +If the point is in a comment, ensure that the returned string does not contain +the comment start characters (especially for major modes that have '//' as +comment start characters). + +Sets variables `ffap-string-at-point' and `ffap-string-at-point-region'. " (let* ((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 (use-region-p) + (beg (if region-selected (region-beginning) (save-excursion (skip-chars-backward (car args)) (skip-chars-forward (nth 1 args) pt) (point)))) - (end (if (use-region-p) + (end (if region-selected (region-end) (save-excursion (skip-chars-forward (car args)) (skip-chars-backward (nth 2 args) pt) - (point))))) + (point)))) + (beg-new beg)) + ;; (message "ffap-string-at-point dbg: beg = %d end = %d" 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 + (goto-char end) + (nth 4 (syntax-ppss)))) + (save-excursion + ;; Increment BEG till point at BEG is in a comment too. + ;; (nth 4 (syntax-ppss)) will be nil for comment start characters + ;; (for example, for the "//" characters in `c-mode' line comments). + (setq beg (catch 'break + (while (< beg-new end) + (goto-char beg-new) + (if (nth 4 (syntax-ppss)) ; in a comment + (throw 'break beg-new) + (setq beg-new (1+ beg-new)))) + end)))) ; Set BEG to END if no throw happens + ;; (message "ffap-string-at-point dbg: beg = %d beg-new = %d" beg beg-new) (setq ffap-string-at-point (buffer-substring-no-properties (setcar ffap-string-at-point-region beg) - (setcar (cdr ffap-string-at-point-region) end))))) + (setcar (cdr ffap-string-at-point-region) end))) + ;; (message "ffap-string-at-point dbg: ffap-string-at-point = %S" + ;; ffap-string-at-point) + ffap-string-at-point)) (defun ffap-string-around () ;; Sometimes useful to decide how to treat a string. ===== > + (setq beg (catch 'break > > + (while (< beg-new end) > > + (goto-char beg-new) > > + (if (nth 4 (syntax-ppss)) ; in a comment > > + (throw 'break beg-new) > > + (setq beg-new (1+ beg-new)))) > > + end)))) ; Set BEG to END if no throw happens > > Is there any problem with a more conventional while loop that stops > when syntax-ppss has its 5th element non-nil? Why did you need to use > throw and catch here? > Throw and catch just feels more intuitive to me. This construct also sets beg to end if no throw happens. It's just a difference of style; feel free to refactor it. -- Kaushal Modi --94eb2c12f1d64776ad05388b52c2 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Tue, Jul 26= , 2016 at 10:42 AM Eli Zaretskii <eliz@g= nu.org> wrote:
> Here a g= it formatted patch .. it's an optimized, generic version of the
> snippet in my previous email. It's now "/" agnostic.

Thanks.=C2=A0 Most of the patch looks like whitespace changes?

I selected the whole defun and did auto-ident (C-M-= \). The submitted patch was a result of that. I thought it's a good ide= a to update the indentation of the whole function. May be the lisp-indent-f= unction changed since this function was updated last time?

In any case, here is the patch ignoring whitespace changes. Note o= f caution that the indentation will look messed up when you merge this patc= h:

=3D=3D=3D=3D=3D

diff --git a/lisp/ffap.el b/lisp/ffap= .el
index 7013e6e..d1bca04 100644
--- a/lisp/ffap.el
+++ b/lisp/ffap.el
@@ -1097,33 +1097,73 @@ ffap-string-at= -point
=C2=A0
=C2=A0(defun ffap-string-at-point (&o= ptional mode)
=C2=A0 =C2=A0"Return a string of characters fr= om around point.
+
=C2=A0MODE (defaults to value of `ma= jor-mode') is a symbol used to look up
=C2=A0string syntax pa= rameters in `ffap-string-at-point-mode-alist'.
+
= =C2=A0If MODE is not found, we use `file' instead of MODE.
+<= /div>
=C2=A0If the region is active,return a string from the region.
-Sets the variable `ffap-string-at-point' and the variable
-`ffap-string-at-point-region'."
+
+If t= he point is in a comment, ensure that the returned string does not contain<= /div>
+the comment start characters (especially for major modes that ha= ve '//' as
+comment start characters).
+
<= div>+Sets variables `ffap-string-at-point' and `ffap-string-at-point-re= gion'. "
=C2=A0 =C2=A0(let* ((args
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(cdr
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 (or (assq (or mode major-mode) ffap-string-at-point-mode-alis= t)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (assq = 'file ffap-string-at-point-mode-alist))))
+ =C2=A0 =C2=A0 =C2= =A0 =C2=A0 (region-selected (use-region-p))
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 (pt (point))
- (beg (if (use-region-p)
+ =C2=A0 = =C2=A0 =C2=A0 =C2=A0 (beg (if region-selected
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(region-beginning)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(save-e= xcursion
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0(skip-chars-backward (car args))
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(skip-chars-forward (nt= h 1 args) pt)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0(point))))
- (end (if (use-region-p)
+ =C2=A0= =C2=A0 =C2=A0 =C2=A0 (end (if region-selected
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(region-end)
= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(save-excursi= on
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0(skip-chars-forward (car args))
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(skip-chars-backward (nth 2 ar= gs) pt)
- =C2=A0(point)))))
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0(point))))
+ =C2=A0 =C2=A0 =C2=A0 =C2= =A0 (beg-new beg))
+ =C2=A0 =C2=A0;; (message "ffap-string-a= t-point dbg: beg =3D %d end =3D %d" beg end)
+ =C2=A0 =C2=A0= ;; If the initial characters of the to-be-returned string are the
+ =C2=A0 =C2=A0;; current major mode's comment starter characters, *an= d* are not part
+ =C2=A0 =C2=A0;; of a comment, remove those from= the returned string (Bug#24057).
+ =C2=A0 =C2=A0;; Example comme= nts in `c-mode' (which considers lines beginning with
+ =C2= =A0 =C2=A0;; "//" as comments):
+ =C2=A0 =C2=A0;; =C2= =A0//tmp - This is a comment. It does not contain any path reference.
=
+ =C2=A0 =C2=A0;; =C2=A0///tmp - This is a comment. The "/tmp&quo= t; portion in that is a path.
+ =C2=A0 =C2=A0;; =C2=A0////tmp - T= his is a comment. The "//tmp" portion in that is a path.
+ =C2=A0 =C2=A0(when (and
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = ;; Proceed if no region is selected by the user.
+ =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 (null region-selected)
+ =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 ;; Check if END character is part of a comment.
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (save-excursion
+ =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (goto-char end)
+ =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (nth 4 (syntax-ppss))))
+ =C2=A0 = =C2=A0 =C2=A0(save-excursion
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0;; Incr= ement BEG till point at BEG is in a comment too.
+ =C2=A0 =C2=A0 = =C2=A0 =C2=A0;; (nth 4 (syntax-ppss)) will be nil for comment start charact= ers
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0;; (for example, for the "/= /" characters in `c-mode' line comments).
+ =C2=A0 =C2= =A0 =C2=A0 =C2=A0(setq beg (catch 'break
+ =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(while (< beg-new en= d)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0(goto-char beg-new)
+ =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(if (nth 4 (syntax-ppss= )) ; in a comment
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(throw 'break beg-new)
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0(setq beg-new (1+ beg-new))))
+ =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0end)))) ; Set BEG to= END if no throw happens
+ =C2=A0 =C2=A0;; (message "ffap-st= ring-at-point dbg: beg =3D %d beg-new =3D %d" beg beg-new)
= =C2=A0 =C2=A0 =C2=A0(setq ffap-string-at-point
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0(buffer-substring-no-properties
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (setcar ffap-string-at-point-region beg)=
- =C2=A0 (setcar (cdr ffap-string-at-point-region) end)))))
+ = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (setcar (cdr ffap-string-at-point-region= ) end)))
+ =C2=A0 =C2=A0;; (message "ffap-string-at-point db= g: ffap-string-at-point =3D %S"
+ =C2=A0 =C2=A0;; =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0ffap-string-at-point)
+ =C2=A0 =C2=A0ffap= -string-at-point))
=C2=A0
=C2=A0(defun ffap-string-arou= nd ()
=C2=A0 =C2=A0;; Sometimes useful to decide how to treat a s= tring.
= =3D=3D=3D=3D=3D=C2=A0

> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 (setq beg (catch 'break
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= (while (< beg-new end)
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 (goto-char beg-new)
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 (if (nth 4 (syntax-ppss)) ; in a comment
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 (throw 'break beg-new)
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 (setq beg-new (1+ beg-new))))
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= end)))) ; Set BEG to END if no throw happens

Is there any problem with a more conventional while loop that stops
when syntax-ppss has its 5th element non-nil?=C2=A0 Why did you need to use=
throw and catch here?

Throw and catch j= ust feels more intuitive to me. This construct also sets beg to end if no t= hrow happens.
It's just a difference of style; feel free to r= efactor it.
--

Kaushal Modi

--94eb2c12f1d64776ad05388b52c2-- From unknown Sat Aug 16 18:47:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#24057: 25.1.50; ffap interprets comments beginning with "//" as file path Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 17 Mar 2017 02:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24057 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Kaushal Modi Cc: Eli Zaretskii , 24057@debbugs.gnu.org Received: via spool by 24057-submit@debbugs.gnu.org id=B24057.148971656511346 (code B ref 24057); Fri, 17 Mar 2017 02:10:02 +0000 Received: (at 24057) by debbugs.gnu.org; 17 Mar 2017 02:09:25 +0000 Received: from localhost ([127.0.0.1]:59480 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cohKX-0002wv-4O for submit@debbugs.gnu.org; Thu, 16 Mar 2017 22:09:25 -0400 Received: from mail-it0-f46.google.com ([209.85.214.46]:35617) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cohKW-0002wh-6o for 24057@debbugs.gnu.org; Thu, 16 Mar 2017 22:09:24 -0400 Received: by mail-it0-f46.google.com with SMTP id m27so9087543iti.0 for <24057@debbugs.gnu.org>; Thu, 16 Mar 2017 19:09:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=3FP344AXAXeXuOwouVTyMaBjZe2Iq8/NVzZIHN9F5jk=; b=PdLUZpwM7qILhverjkoyqdTAvQy0i6Ek7bfCC/an/7BqF9NS2xPH1eRS1fbsDyv21s xNNwYiGVaa2UO02Nvo26yosqPh105jpQfGoh9aeCslp98bPPX6W7z9CBIvThpuMbZ0oC K5ROMGQTRa6b30WC8A2BlmzQVk7wt+Znev9oKXArgOLsR5ZHEY1LQb1QEN5tVYBb8Xqi cQ2ltxKXWjj+DsR5NpWO00vGqWrcga3pqvHVY2Q+jU/TLAnGzEskiW1NB3bHtl4R/wOP YQTZ17YshEZUdDRyW4KFHEdMpwjZ/xMe7jL9i+ClsNYOxb4MPxJ0i+BGueUWXBtnWghT hqXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=3FP344AXAXeXuOwouVTyMaBjZe2Iq8/NVzZIHN9F5jk=; b=jg7Lamz2B+3EmBfA0eNtiQN+jYlX6pOcZV88yTtZ/FrFdckztsFRzj7czutskf1zKq hkDy1bkVpgAbv1ODs9I02/DfpBZknjmguPq4F+sWw9rSjy6VVhpVkUjEZp5ITcWzh2kZ l2k7xmPPWNb3HBtjtjeD+UjNhijw1Z3npJpgfUSTFc9XjFvaOmz76+pI8eNtN0N8dHFg M0nzK+a62TG48yXQnIJlMfQWoFzd/u9RHE3G+1hR/s85pRcDGcsOE/inNNY0vVHD8nEr hLoqcbAUMuFdyBJULhppGHoJ+p4KRWa3Qu2cH5Ht+Jh/Rh9VCdE6poQ6Ne6Z49LW4b3O aKyA== X-Gm-Message-State: AFeK/H271MRIMqp+AmvUU9b+Vy2JzAdo7bPtaVrKstDG9a4JvusbHJQL9HgN2FNdSEQBfA== X-Received: by 10.107.142.139 with SMTP id q133mr12166971iod.99.1489716558576; Thu, 16 Mar 2017 19:09:18 -0700 (PDT) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id l79sm454642itb.24.2017.03.16.19.09.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 16 Mar 2017 19:09:17 -0700 (PDT) From: npostavs@users.sourceforge.net References: <83lh0sx0yf.fsf@gnu.org> <83shv0v716.fsf@gnu.org> <83poq4v4jk.fsf@gnu.org> <83wpkbt92i.fsf@gnu.org> <83mvl5tzv7.fsf@gnu.org> <83invttyv7.fsf@gnu.org> Date: Thu, 16 Mar 2017 22:10:37 -0400 In-Reply-To: (Kaushal Modi's message of "Mon, 25 Jul 2016 20:18:27 +0000") Message-ID: <874lys64bm.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.2 (/) 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.2 (/) Kaushal Modi writes: > * lisp/ffap.el (ffap-string-at-point): If the point is in a comment, > ensure that the returned string does not contain the comment start > characters (especially for major modes that have '//' as comment start > characters). > Why is there a blank line here? > Otherwise, in a major mode like c-mode, with `ido-mode' enabled and > `ido-use-filename-at-point' set to `guess', doing "C-x C-f" on a "//foo" > comment will initiate an attempt to access a path "//foo" (Bug#24057). > --- > + ;; (message "ffap-string-at-point dbg: beg = %d end = %d" beg end) This can be removed. > + ;; Check if END character is part of a comment. > + (save-excursion > + (goto-char end) > + (nth 4 (syntax-ppss)))) This could be just (nth 4 (syntax-ppss end)). > + (save-excursion > + ;; Increment BEG till point at BEG is in a comment too. > + ;; (nth 4 (syntax-ppss)) will be null for comment start > + ;; characters (for example, for the "//" characters in > + ;; `c-mode' line comments). > + (setq beg (catch 'break > + (while (< beg-new end) > + (goto-char beg-new) > + (if (nth 4 (syntax-ppss)) ; in a comment > + (throw 'break beg-new) > + (setq beg-new (1+ beg-new)))) > + end)))) ; Set BEG to END if no throw happens This could be just ;; Move BEG to beginning of comment (after the comment start ;; characters), or END, whichever comes first. (let ((state (syntax-ppss beg))) (unless (nth 4 state) (parse-partial-sexp beg end nil nil state t) (setq beg (point)))) > + ;; (message "ffap-string-at-point dbg: beg = %d beg-new = %d" > + ;; beg beg-new) > + ;; (message "ffap-string-at-point dbg: ffap-string-at-point = %S" > + ;; ffap-string-at-point) These can be removed. From unknown Sat Aug 16 18:47:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#24057: 25.1.50; ffap interprets comments beginning with "//" as file path Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 17 Mar 2017 02:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24057 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Kaushal Modi Cc: Eli Zaretskii , 24057@debbugs.gnu.org Received: via spool by 24057-submit@debbugs.gnu.org id=B24057.148971671311562 (code B ref 24057); Fri, 17 Mar 2017 02:12:02 +0000 Received: (at 24057) by debbugs.gnu.org; 17 Mar 2017 02:11:53 +0000 Received: from localhost ([127.0.0.1]:59484 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cohMv-00030Q-Ha for submit@debbugs.gnu.org; Thu, 16 Mar 2017 22:11:53 -0400 Received: from mail-it0-f42.google.com ([209.85.214.42]:35580) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cohMu-00030D-Db for 24057@debbugs.gnu.org; Thu, 16 Mar 2017 22:11:52 -0400 Received: by mail-it0-f42.google.com with SMTP id m27so9131584iti.0 for <24057@debbugs.gnu.org>; Thu, 16 Mar 2017 19:11:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=wFfauDZpnbRYdHNex/SEUvBAzAXVXuPFZqWmXuVcjNA=; b=M+iXw2gK72Yy/vKcXTDDkUgs+8D7zQLz+Tgh/GBb0ck/Sa4c6OP3HLcGhFqMTwi5J9 SQYwEfoEPB9Wra3PnGyycfNOwcptlWFxhap+CCJbjZC/f9RamKlT/VauSit26Ku/+lbq qs2o1zxUSx9wCKBDXDbEtNrL5vmu1zOO9ADP0ughAOVrncttph8FsqrGJHik8JJ3wqM3 lM9tEfsRSskzEfh2XtWNNptF2eNPPwudh8ILZD7f2r02mMDSHptJMwvWDq3/efwjT4vb ySdAVJyPEcxkYjuHlgcEeCgWzZMcoEZ+vGLd2HqcGRl1ykXADOuLxiUGQSg1i0e5e4Ll xNvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=wFfauDZpnbRYdHNex/SEUvBAzAXVXuPFZqWmXuVcjNA=; b=oXGquyS1JzspYh5hgzANuQvq/Tth+DDrWr82/ZavpWdsByXPc6Envru+s+0NTgJiD8 Miv1iWj8e+uSUjIWbBd99Aq63HCyF6cBRJ/BEdFbjhpH0mijLgHPO1SXcqM9IjSj38yw G2gK+gHJ42EW+bVEQCTc3UbbVmOUOEFGsvRFU2beylbTMHtLFezpC9zXrF0rH2AhIOzp ijCtD+ZTB4RE/8Isrhmmo/28Wow27WW0uLsnnM9PPFMCCrS00ChE8cMy4ThSsEoWkHgp dw9vtzVWU1OhgZR51hjeH5SK1/8tdvQiq3S/fLuRL/8vGROB+C70ZeP5Ea6dWw7ImLtW ftjA== X-Gm-Message-State: AFeK/H0ZKlYXYuzvRM6jdZM0WqypUNgnEilh/wUGG+Bc4AS1xFS4fwtgU8VF7hRGFyV03g== X-Received: by 10.36.173.90 with SMTP id a26mr750890itj.27.1489716707099; Thu, 16 Mar 2017 19:11:47 -0700 (PDT) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id w133sm471876itf.2.2017.03.16.19.11.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 16 Mar 2017 19:11:46 -0700 (PDT) From: npostavs@users.sourceforge.net References: <83lh0sx0yf.fsf@gnu.org> <83shv0v716.fsf@gnu.org> <83poq4v4jk.fsf@gnu.org> <83wpkbt92i.fsf@gnu.org> <83mvl5tzv7.fsf@gnu.org> <83invttyv7.fsf@gnu.org> <874lys64bm.fsf@users.sourceforge.net> Date: Thu, 16 Mar 2017 22:13:06 -0400 In-Reply-To: <874lys64bm.fsf@users.sourceforge.net> (npostavs@users.sourceforge.net's message of "Thu, 16 Mar 2017 22:10:37 -0400") Message-ID: <871stw647h.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.7 (/) 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.7 (/) npostavs@users.sourceforge.net writes: > >> + ;; Check if END character is part of a comment. >> + (save-excursion >> + (goto-char end) >> + (nth 4 (syntax-ppss)))) > > This could be just (nth 4 (syntax-ppss end)). Sorry, that should be (save-excursion (nth 4 (syntax-ppss end))) From unknown Sat Aug 16 18:47:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#24057: 25.1.50; ffap interprets comments beginning with "//" as file path Resent-From: Kaushal Modi Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 17 Mar 2017 22:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24057 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: npostavs@users.sourceforge.net Cc: Eli Zaretskii , 24057@debbugs.gnu.org Received: via spool by 24057-submit@debbugs.gnu.org id=B24057.148978898613385 (code B ref 24057); Fri, 17 Mar 2017 22:17:02 +0000 Received: (at 24057) by debbugs.gnu.org; 17 Mar 2017 22:16:26 +0000 Received: from localhost ([127.0.0.1]:32997 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cp0Ac-0003Tp-BF for submit@debbugs.gnu.org; Fri, 17 Mar 2017 18:16:26 -0400 Received: from mail-pg0-f48.google.com ([74.125.83.48]:34628) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cp0Aa-0003Ta-6P for 24057@debbugs.gnu.org; Fri, 17 Mar 2017 18:16:24 -0400 Received: by mail-pg0-f48.google.com with SMTP id 21so16187813pgg.1 for <24057@debbugs.gnu.org>; Fri, 17 Mar 2017 15:16:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=2jUo6fcQyo7blp+gzHr76ntoBtUAqABT108Njk4BdEg=; b=Tx/DXhj4rDvZ3wMV/86W0PVC9RUwAKU7cEYNNerOAvR8evT5QhxngpW3GWlCfvOlCX A3i8c+Xy5DTQzMKS5RZJ/36H6afN42OwFZChQqX7ZaawgQPUVwc0NzdxKxPVKjcUSLDR NCTbcNVI/KlFHeDRUgtlk9yvDnQPUHTPUEX3mhYEKWe+/ClC6WAZAmZGM8ZEHB9jf0wb Rtz0anW6fVx62aEd3L6qpU8r71lYE9ThDAaYvFQ9dA/4Z+XvgVFBMzJ+BopwrrLG3n2e CWJ+LW+Vyp69OL3zYep0+O2WJgFIgxF7N28dgM6oTD0teau1VBWu7zX7cr+mznYNLmFr JFDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=2jUo6fcQyo7blp+gzHr76ntoBtUAqABT108Njk4BdEg=; b=VPpMzCtWguZMhbfcgcVFkbWmsXjXiNIFVzCk8kYA8yqg1FlJQPLYgajy21h7tWFBta 2/LEDv+wwkYVccjquKPJ+jACJNzXZnrOcZ6DEiBN+M+DdzptDrfLde0n8TNS1JF4d5yF X2XWA4h2ivh++GfVnhWHjhRJHNcA9w2/o8g5+O3YxpExmeW+18pumb9Al13ttbTxmnDr DXCS17PSwy52YATvlJbzFQk3O1+9ZhBIiEBmTKK+JYk5JXYKzi2BNIrNBYHbur9QJt5h wHljriG+8CrD0RDKxr+n82VaUEmCe7yoQGWL/fMpopq/drhTnsn5Eu4yRxHeu3Gb+CLx EynA== X-Gm-Message-State: AFeK/H3pKx2MIrZBiuygFEZn4ImYI1TAvemGDjNvUMUtOJ3dVCB7lh1fso1xgRMMiYZWBsP/oI6RQDPu30E7Zw== X-Received: by 10.99.44.66 with SMTP id s63mr10184603pgs.139.1489788977824; Fri, 17 Mar 2017 15:16:17 -0700 (PDT) MIME-Version: 1.0 References: <83lh0sx0yf.fsf@gnu.org> <83shv0v716.fsf@gnu.org> <83poq4v4jk.fsf@gnu.org> <83wpkbt92i.fsf@gnu.org> <83mvl5tzv7.fsf@gnu.org> <83invttyv7.fsf@gnu.org> <874lys64bm.fsf@users.sourceforge.net> In-Reply-To: <874lys64bm.fsf@users.sourceforge.net> From: Kaushal Modi Date: Fri, 17 Mar 2017 22:16:07 +0000 Message-ID: Content-Type: multipart/mixed; boundary=001a113e48bcd07b0e054af4866c X-Spam-Score: -2.3 (--) 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.3 (--) --001a113e48bcd07b0e054af4866c Content-Type: multipart/alternative; boundary=001a113e48bcd07b0b054af4866a --001a113e48bcd07b0b054af4866a Content-Type: text/plain; charset=UTF-8 Hi Noam, Thanks for the detailed review. My comments are inline below. Also I have attached a new patch re-based to the current master, and applying all your suggestions. On Thu, Mar 16, 2017 at 10:09 PM wrote: > Kaushal Modi writes: > > > * lisp/ffap.el (ffap-string-at-point): If the point is in a comment, > > ensure that the returned string does not contain the comment start > > characters (especially for major modes that have '//' as comment start > > characters). > > > > Why is there a blank line here? > Is it is convention to not format the commit summaries into multiple paragraphs? I reread http://git.savannah.gnu.org/cgit/emacs.git/plain/CONTRIBUTE but didn't find any mention on that. But I have removed that newline from the patch that I attach with this email. > > Otherwise, in a major mode like c-mode, with `ido-mode' enabled and > > `ido-use-filename-at-point' set to `guess', doing "C-x C-f" on a "//foo" > > comment will initiate an attempt to access a path "//foo" (Bug#24057). > > --- > > > + ;; (message "ffap-string-at-point dbg: beg = %d end = %d" beg end) > > This can be removed. > Understood, the patch was still not in final stages.. The attached patch does not have any debug statements. > > + ;; Check if END character is part of a comment. > > + (save-excursion > > + (goto-char end) > > + (nth 4 (syntax-ppss)))) > > This could be just (nth 4 (syntax-ppss end)). > Thanks. TIL that syntax-ppss as POS as optional arg. Also retaining the save-excursion as you correct yourself in the followup email. > > + (save-excursion > > + ;; Increment BEG till point at BEG is in a comment too. > > + ;; (nth 4 (syntax-ppss)) will be null for comment start > > + ;; characters (for example, for the "//" characters in > > + ;; `c-mode' line comments). > > + (setq beg (catch 'break > > + (while (< beg-new end) > > + (goto-char beg-new) > > + (if (nth 4 (syntax-ppss)) ; in a comment > > + (throw 'break beg-new) > > + (setq beg-new (1+ beg-new)))) > > + end)))) ; Set BEG to END if no throw happens > > This could be just > > ;; Move BEG to beginning of comment (after the comment start > ;; characters), or END, whichever comes first. > (let ((state (syntax-ppss beg))) > (unless (nth 4 state) > (parse-partial-sexp beg end nil nil state t) > (setq beg (point)))) > Thanks! I did not know about parse-partial-sexp. Here too, I need to retain the save-excursion, else the point will move after the comment start chars if it is at the BOL in c-mode on a line like //tmp > > + ;; (message "ffap-string-at-point dbg: beg = %d beg-new = %d" > > + ;; beg beg-new) > > > + ;; (message "ffap-string-at-point dbg: ffap-string-at-point = %S" > > + ;; ffap-string-at-point) > > These can be removed. > Done! Review review the attached. Thanks! -- Kaushal Modi --001a113e48bcd07b0b054af4866a Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Noam,

Thanks for the detailed review= . My comments are inline below.

Also I have attached a new patch re-= based to the current master, and applying all your suggestions.
<= br>
On Thu, Mar 16, 2017 at 10:0= 9 PM <npostavs@users.s= ourceforge.net> wrote:
Kaush= al Modi <kaushal.modi@gmail.com> writes:

> * lisp/ffap.el (ffap-string-at-point): If the point is in a comment, > ensure that the returned string does not contain the comment start
> characters (especially for major modes that have '//' as comme= nt start
> characters).
>

Why is there a blank line here?
Is it is convention to not format the commit summaries into mu= ltiple paragraphs? I reread http://git.savannah.gnu.org/cgit/emacs.git/plain/C= ONTRIBUTE=C2=A0but didn't find any mention on that. But I have remo= ved that newline from the patch that I attach with this email.=C2=A0
<= div>=C2=A0
> Otherwise, in a major mode like c-mode, with `ido-mode' enabled an= d
> `ido-use-filename-at-point' set to `guess', doing "C-x C-= f" on a "//foo"
> comment will initiate an attempt to access a path "//foo" (B= ug#24057).
> ---

> +=C2=A0 =C2=A0 ;; (message "ffap-string-at-point dbg: beg =3D %d = end =3D %d" beg end)

This can be removed.

Understood, the patch was still not in final stages.. The attached patch = does not have any debug statements.
=C2=A0
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;; Check if END character is= part of a comment.
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(save-excursion
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(goto-char end)
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(nth 4 (syntax-ppss))= ))

This could be just (nth 4 (syntax-ppss end)).

Thanks. TIL that syntax-ppss as POS as optional = arg. Also retaining the save-excursion as you correct yourself in the follo= wup email.
=C2=A0
> +=C2=A0 =C2=A0 =C2=A0 (save-excursion
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; Increment BEG till point at BEG is in = a comment too.
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; (nth 4 (syntax-ppss)) will be null for= comment start
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; characters (for example, for the "= ;//" characters in
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; `c-mode' line comments).
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 (setq beg (catch 'break
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= (while (< beg-new end)
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 (goto-char beg-new)
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 (if (nth 4 (syntax-ppss)) ; in a comment
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 (throw 'break beg-new)
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 (setq beg-new (1+ beg-new))))
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= end)))) ; Set BEG to END if no throw happens

This could be just

=C2=A0 =C2=A0 ;; Move BEG to beginning of comment (after the comment start<= br class=3D"gmail_msg"> =C2=A0 =C2=A0 ;; characters), or END, whichever comes first.
=C2=A0 =C2=A0 (let ((state (syntax-ppss beg)))
=C2=A0 =C2=A0 =C2=A0 (unless (nth 4 state)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (parse-partial-sexp beg end nil nil state t) =C2=A0 =C2=A0 =C2=A0 =C2=A0 (setq beg (point))))

Thanks! I did not know about parse-partial-se= xp. Here too, I need to retain the save-excursion, else the point will move= after the comment start chars if it is at the BOL in c-mode on a line like=

=C2=A0 =C2=A0 //tmp

=C2= =A0
> +=C2=A0 =C2=A0 ;; (message "ffap-string-at-point dbg: beg =3D %d = beg-new =3D %d"
> +=C2=A0 =C2=A0 ;;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 beg beg-new)

> +=C2=A0 =C2=A0 ;; (message "ffap-string-at-point dbg: ffap-string= -at-point =3D %S"
> +=C2=A0 =C2=A0 ;;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ffap-string-at-poi= nt)

These can be removed.

Done!

Review review the attached. Thanks!=C2=A0=
--

Kaushal Modi

--001a113e48bcd07b0b054af4866a-- --001a113e48bcd07b0e054af4866c Content-Type: application/octet-stream; name="0001-Do-not-include-comment-start-chars-in-ffap-string.patch" Content-Disposition: attachment; filename="0001-Do-not-include-comment-start-chars-in-ffap-string.patch" Content-Transfer-Encoding: base64 Content-ID: <15ade52e8f327af84df1> X-Attachment-Id: 15ade52e8f327af84df1 RnJvbSBlZGE3YTk2YjY2ZjY5MzdlMDk0YjBkNzYzNjRjNjcxMTk4NGRiMjU0IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBLYXVzaGFsIE1vZGkgPGthdXNoYWwubW9kaUBnbWFpbC5jb20+ CkRhdGU6IEZyaSwgMTcgTWFyIDIwMTcgMTg6MDM6MjMgLTA0MDAKU3ViamVjdDogW1BBVENIXSBE byBub3QgaW5jbHVkZSBjb21tZW50IHN0YXJ0IGNoYXJzIGluIGZmYXAgc3RyaW5nCgoqIGxpc3Av ZmZhcC5lbCAoZmZhcC1zdHJpbmctYXQtcG9pbnQpOiBJZiB0aGUgcG9pbnQgaXMgaW4gYSBjb21t ZW50LAplbnN1cmUgdGhhdCB0aGUgcmV0dXJuZWQgc3RyaW5nIGRvZXMgbm90IGNvbnRhaW4gdGhl IGNvbW1lbnQgc3RhcnQKY2hhcmFjdGVycyAoZXNwZWNpYWxseSBmb3IgbWFqb3IgbW9kZXMgdGhh dCBoYXZlICcvLycgYXMgY29tbWVudCBzdGFydApjaGFyYWN0ZXJzKS4gT3RoZXJ3aXNlLCBpbiBh IG1ham9yIG1vZGUgbGlrZSBjLW1vZGUsIHdpdGggYGlkby1tb2RlJwplbmFibGVkIGFuZCBgaWRv LXVzZS1maWxlbmFtZS1hdC1wb2ludCcgc2V0IHRvIGBndWVzcycsIGRvaW5nICJDLXgKQy1mIiBv biBhICIvL2ZvbyIgY29tbWVudCB3aWxsIGluaXRpYXRlIGFuIGF0dGVtcHQgdG8gYWNjZXNzIGEg cGF0aAoiLy9mb28iIChCdWcjMjQwNTcpLgoKQ28tYXV0aG9yZWQtYnk6IE5vYW0gUG9zdGF2c2t5 IDxucG9zdGF2c0BnbWFpbC5jb20+Ci0tLQogbGlzcC9mZmFwLmVsIHwgNDEgKysrKysrKysrKysr KysrKysrKysrKysrKysrKysrKysrKysrKystLS0KIDEgZmlsZSBjaGFuZ2VkLCAzOCBpbnNlcnRp b25zKCspLCAzIGRlbGV0aW9ucygtKQoKZGlmZiAtLWdpdCBhL2xpc3AvZmZhcC5lbCBiL2xpc3Av ZmZhcC5lbAppbmRleCBkNzIyMmJmYjY4Li5hMTUwODNmNGZhIDEwMDY0NAotLS0gYS9saXNwL2Zm YXAuZWwKKysrIGIvbGlzcC9mZmFwLmVsCkBAIC0xMTEwLDMyICsxMTEwLDY3IEBAIGZmYXAtc3Ry aW5nLWF0LXBvaW50CiAKIChkZWZ1biBmZmFwLXN0cmluZy1hdC1wb2ludCAoJm9wdGlvbmFsIG1v ZGUpCiAgICJSZXR1cm4gYSBzdHJpbmcgb2YgY2hhcmFjdGVycyBmcm9tIGFyb3VuZCBwb2ludC4K KwogTU9ERSAoZGVmYXVsdHMgdG8gdmFsdWUgb2YgYG1ham9yLW1vZGUnKSBpcyBhIHN5bWJvbCB1 c2VkIHRvIGxvb2sgdXAKIHN0cmluZyBzeW50YXggcGFyYW1ldGVycyBpbiBgZmZhcC1zdHJpbmct YXQtcG9pbnQtbW9kZS1hbGlzdCcuCisKIElmIE1PREUgaXMgbm90IGZvdW5kLCB3ZSB1c2UgYGZp bGUnIGluc3RlYWQgb2YgTU9ERS4KKwogSWYgdGhlIHJlZ2lvbiBpcyBhY3RpdmUsIHJldHVybiBh IHN0cmluZyBmcm9tIHRoZSByZWdpb24uCi1TZXQgdGhlIHZhcmlhYmxlIGBmZmFwLXN0cmluZy1h dC1wb2ludCcgYW5kIHRoZSB2YXJpYWJsZQorCitJZiB0aGUgcG9pbnQgaXMgaW4gYSBjb21tZW50 LCBlbnN1cmUgdGhhdCB0aGUgcmV0dXJuZWQgc3RyaW5nIGRvZXMgbm90Citjb250YWluIHRoZSBj b21tZW50IHN0YXJ0IGNoYXJhY3RlcnMgKGVzcGVjaWFsbHkgZm9yIG1ham9yIG1vZGVzIHRoYXQK K2hhdmUgJy8vJyBhcyBjb21tZW50IHN0YXJ0IGNoYXJhY3RlcnMpLgorCitTZXQgdGhlIHZhcmlh YmxlcyBgZmZhcC1zdHJpbmctYXQtcG9pbnQnIGFuZAogYGZmYXAtc3RyaW5nLWF0LXBvaW50LXJl Z2lvbicuCisKIFdoZW4gdGhlIHJlZ2lvbiBpcyBhY3RpdmUgYW5kIGxhcmdlciB0aGFuIGBmZmFw LW1heC1yZWdpb24tbGVuZ3RoJywKIHJldHVybiBhbiBlbXB0eSBzdHJpbmcsIGFuZCBzZXQgYGZm YXAtc3RyaW5nLWF0LXBvaW50LXJlZ2lvbicgdG8gJygxIDEpLiIKICAgKGxldCogKChhcmdzCiAJ ICAoY2RyCiAJICAgKG9yIChhc3NxIChvciBtb2RlIG1ham9yLW1vZGUpIGZmYXAtc3RyaW5nLWF0 LXBvaW50LW1vZGUtYWxpc3QpCiAJICAgICAgIChhc3NxICdmaWxlIGZmYXAtc3RyaW5nLWF0LXBv aW50LW1vZGUtYWxpc3QpKSkpCisgICAgICAgICAocmVnaW9uLXNlbGVjdGVkICh1c2UtcmVnaW9u LXApKQogCSAocHQgKHBvaW50KSkKLQkgKGJlZyAoaWYgKHVzZS1yZWdpb24tcCkKKyAgICAgICAg IChiZWcgKGlmIHJlZ2lvbi1zZWxlY3RlZAogCQkgIChyZWdpb24tYmVnaW5uaW5nKQogCQkoc2F2 ZS1leGN1cnNpb24KIAkJICAoc2tpcC1jaGFycy1iYWNrd2FyZCAoY2FyIGFyZ3MpKQogCQkgIChz a2lwLWNoYXJzLWZvcndhcmQgKG50aCAxIGFyZ3MpIHB0KQogCQkgIChwb2ludCkpKSkKLQkgKGVu ZCAoaWYgKHVzZS1yZWdpb24tcCkKKyAgICAgICAgIChlbmQgKGlmIHJlZ2lvbi1zZWxlY3RlZAog CQkgIChyZWdpb24tZW5kKQogCQkoc2F2ZS1leGN1cnNpb24KIAkJICAoc2tpcC1jaGFycy1mb3J3 YXJkIChjYXIgYXJncykpCiAJCSAgKHNraXAtY2hhcnMtYmFja3dhcmQgKG50aCAyIGFyZ3MpIHB0 KQogCQkgIChwb2ludCkpKSkKICAgICAgICAgIChyZWdpb24tbGVuICgtIChtYXggYmVnIGVuZCkg KG1pbiBiZWcgZW5kKSkpKQorCisgICAgOzsgSWYgdGhlIGluaXRpYWwgY2hhcmFjdGVycyBvZiB0 aGUgdG8tYmUtcmV0dXJuZWQgc3RyaW5nIGFyZSB0aGUKKyAgICA7OyBjdXJyZW50IG1ham9yIG1v ZGUncyBjb21tZW50IHN0YXJ0ZXIgY2hhcmFjdGVycywgKmFuZCogYXJlCisgICAgOzsgbm90IHBh cnQgb2YgYSBjb21tZW50LCByZW1vdmUgdGhvc2UgZnJvbSB0aGUgcmV0dXJuZWQgc3RyaW5nCisg ICAgOzsgKEJ1ZyMyNDA1NykuCisgICAgOzsgRXhhbXBsZSBjb21tZW50cyBpbiBgYy1tb2RlJyAo d2hpY2ggY29uc2lkZXJzIGxpbmVzIGJlZ2lubmluZworICAgIDs7IHdpdGggIi8vIiBhcyBjb21t ZW50cyk6CisgICAgOzsgIC8vdG1wIC0gVGhpcyBpcyBhIGNvbW1lbnQuIEl0IGRvZXMgbm90IGNv bnRhaW4gYW55IHBhdGggcmVmZXJlbmNlLgorICAgIDs7ICAvLy90bXAgLSBUaGlzIGlzIGEgY29t bWVudC4gVGhlICIvdG1wIiBwb3J0aW9uIGluIHRoYXQgaXMgYSBwYXRoLgorICAgIDs7ICAvLy8v dG1wIC0gVGhpcyBpcyBhIGNvbW1lbnQuIFRoZSAiLy90bXAiIHBvcnRpb24gaW4gdGhhdCBpcyBh IHBhdGguCisgICAgKHdoZW4gKGFuZAorICAgICAgICAgICA7OyBQcm9jZWVkIGlmIG5vIHJlZ2lv biBpcyBzZWxlY3RlZCBieSB0aGUgdXNlci4KKyAgICAgICAgICAgKG51bGwgcmVnaW9uLXNlbGVj dGVkKQorICAgICAgICAgICA7OyBDaGVjayBpZiBFTkQgY2hhcmFjdGVyIGlzIHBhcnQgb2YgYSBj b21tZW50LgorICAgICAgICAgICAoc2F2ZS1leGN1cnNpb24KKyAgICAgICAgICAgICAobnRoIDQg KHN5bnRheC1wcHNzIGVuZCkpKSkKKyAgICAgIDs7IE1vdmUgQkVHIHRvIGJlZ2lubmluZyBvZiBj b21tZW50IChhZnRlciB0aGUgY29tbWVudCBzdGFydAorICAgICAgOzsgY2hhcmFjdGVycyksIG9y IEVORCwgd2hpY2hldmVyIGNvbWVzIGZpcnN0LgorICAgICAgKHNhdmUtZXhjdXJzaW9uCisgICAg ICAgIChsZXQgKChzdGF0ZSAoc3ludGF4LXBwc3MgYmVnKSkpCisgICAgICAgICAgOzsgKG50aCA0 IChzeW50YXgtcHBzcykpIHdpbGwgYmUgbmlsIGZvciBjb21tZW50IHN0YXJ0IGNoYXJzCisgICAg ICAgICAgKHVubGVzcyAobnRoIDQgc3RhdGUpCisgICAgICAgICAgICAocGFyc2UtcGFydGlhbC1z ZXhwIGJlZyBlbmQgbmlsIG5pbCBzdGF0ZSA6Y29tbWVudHN0b3ApCisgICAgICAgICAgICAoc2V0 cSBiZWcgKHBvaW50KSkpKSkpCisKICAgICAoaWYgKGFuZCAobmF0bnVtcCBmZmFwLW1heC1yZWdp b24tbGVuZ3RoKQogICAgICAgICAgICAgICg8IHJlZ2lvbi1sZW4gZmZhcC1tYXgtcmVnaW9uLWxl bmd0aCkpIDsgQnVnIzI1MjQzLgogICAgICAgICAoc2V0ZiBmZmFwLXN0cmluZy1hdC1wb2ludC1y ZWdpb24gKGxpc3QgYmVnIGVuZCkKLS0gCjIuMTEuMAoK --001a113e48bcd07b0e054af4866c-- From unknown Sat Aug 16 18:47:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#24057: 25.1.50; ffap interprets comments beginning with "//" as file path Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 17 Mar 2017 23:30:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24057 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Kaushal Modi Cc: Eli Zaretskii , 24057@debbugs.gnu.org Received: via spool by 24057-submit@debbugs.gnu.org id=B24057.148979335520290 (code B ref 24057); Fri, 17 Mar 2017 23:30:04 +0000 Received: (at 24057) by debbugs.gnu.org; 17 Mar 2017 23:29:15 +0000 Received: from localhost ([127.0.0.1]:33028 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cp1J5-0005HC-IG for submit@debbugs.gnu.org; Fri, 17 Mar 2017 19:29:15 -0400 Received: from mail-it0-f66.google.com ([209.85.214.66]:35019) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cp1J3-0005Gz-W7 for 24057@debbugs.gnu.org; Fri, 17 Mar 2017 19:29:14 -0400 Received: by mail-it0-f66.google.com with SMTP id y18so6880761itc.2 for <24057@debbugs.gnu.org>; Fri, 17 Mar 2017 16:29:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=k/rzczOZHR2rcFgXgjr7YHsb32/JAqP5RLgV/HLC/O0=; b=LWQHDS61A2BAtT0f80dloqydFw6Jc5Y0xbClAqjAd32pU3FBMrp7fdA/kZTBSgb7HV z+L8eZ6HGJBeSx755gdo4uR9dLfpOeafcuwQf4sWKzruUNVJ+paTZhvEBrztMsSozAQ8 Uli9WnxvRipoYM0olKyeu7g2r8+7sWQXPz4yFRT9mLmHHVQXuY4xGQ3e3l1UjpaCNSPg PUUuHjhhMFKJOiU7w+SVP1igy+T4Dvd7SP6jEqUo+8kwlFS/ti9OkVUox/PwEoAhMUPz 5RS2Gzt+Xfdalu9GWdDejrLggmkwA7FqwIwBKnG7CD4l/FGW0ve6ftXxMpcdl/L3ozm0 sRwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=k/rzczOZHR2rcFgXgjr7YHsb32/JAqP5RLgV/HLC/O0=; b=EoNboQVoqCzzOutWswlXjBL1M+cQymAQoM2aC2Lc/eXsPzK2Jlb5GPBu3HRhyTBV0q p841Kp5LncTDo3FejHTPh5+XbfmosDwj8nek1ywBIyM9xo65WoFR0GklB9Om4brdQy10 czwVQRC011jnWmV1cFySW8gjiRd3KoE7ordknEUopCYNRI6QppN9yfIeojWFPU2jlFJC rDACypSDiS+iUwo1nFX4X//QXKll2RJ3Dn8spUAkUKIi0xurzZSl2aFSS5GiMACDOo6b K52peOqD4hTmTtJ044vhyDI8zTglsAPBbG7wlHqI4csshBknhdhfZXKNUEhADFfbgveU HloA== X-Gm-Message-State: AFeK/H2lx4+8lV8C2zdzNqsU+arKPC/ByqiouLDSIt9cJCamzL6X6qt98QYfgQjZOS1q3g== X-Received: by 10.107.188.69 with SMTP id m66mr16461316iof.137.1489793348133; Fri, 17 Mar 2017 16:29:08 -0700 (PDT) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id c91sm5087662iod.18.2017.03.17.16.29.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Mar 2017 16:29:07 -0700 (PDT) From: npostavs@users.sourceforge.net References: <83lh0sx0yf.fsf@gnu.org> <83shv0v716.fsf@gnu.org> <83poq4v4jk.fsf@gnu.org> <83wpkbt92i.fsf@gnu.org> <83mvl5tzv7.fsf@gnu.org> <83invttyv7.fsf@gnu.org> <874lys64bm.fsf@users.sourceforge.net> Date: Fri, 17 Mar 2017 19:30:28 -0400 In-Reply-To: (Kaushal Modi's message of "Fri, 17 Mar 2017 22:16:07 +0000") Message-ID: <87var74h2j.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.7 (/) 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.7 (/) Kaushal Modi writes: > Is it is convention to not format the commit summaries into multiple > paragraphs? I reread > http://git.savannah.gnu.org/cgit/emacs.git/plain/CONTRIBUTE but didn't find > any mention on that. But I have removed that newline from the patch that I > attach with this email. Oh, then I don't understand why you separated that sentence into its own paragraph, it seemed like a continuation of the same idea. (In general, paragraphs should go before the ChangeLog entries, because that format doesn't allow for multiple paragraphs in the same entry (AFAIK)). > characters (especially for major modes that have '//' as comment start > characters). Otherwise, in a major mode like c-mode, with `ido-mode' ^^^ There should be double space between sentences though. > > Thanks! I did not know about parse-partial-sexp. Here too, I need to retain > the save-excursion, else the point will move after the comment start chars > if it is at the BOL in c-mode on a line like Oops, right. (I would consider just putting a single save-excursion around the 'when', but it doesn't hugely matter either way (and Drew would probably not like the single save-excursion version ;) [1]).) [1]: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=25777#38 From unknown Sat Aug 16 18:47:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#24057: 25.1.50; ffap interprets comments beginning with "//" as file path Resent-From: Kaushal Modi Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 18 Mar 2017 01:30:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24057 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: npostavs@users.sourceforge.net Cc: Eli Zaretskii , 24057@debbugs.gnu.org Received: via spool by 24057-submit@debbugs.gnu.org id=B24057.148980054631622 (code B ref 24057); Sat, 18 Mar 2017 01:30:03 +0000 Received: (at 24057) by debbugs.gnu.org; 18 Mar 2017 01:29:06 +0000 Received: from localhost ([127.0.0.1]:33082 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cp3B4-0008Dx-Et for submit@debbugs.gnu.org; Fri, 17 Mar 2017 21:29:06 -0400 Received: from mail-pf0-f173.google.com ([209.85.192.173]:32844) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cp3B2-0008DQ-Cq for 24057@debbugs.gnu.org; Fri, 17 Mar 2017 21:29:04 -0400 Received: by mail-pf0-f173.google.com with SMTP id e129so5518892pfh.0 for <24057@debbugs.gnu.org>; Fri, 17 Mar 2017 18:29:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=tPQiSj7nYyvGFVCYU3Ewk+vqv6wYq8XpIeAQJPZ8hzM=; b=b4FAJf6z3T72chvIRbrnkxxt+Vr1Gat/5Oybjoyr2nMkKEPoI6zk9VayyQl2puE54r /WqkIL6tXfnS2I9tSj2VWBUtn+Yr/ZN9/N8z0eZe1iGso0SWbrss2yizUWUMSMsxg7nE +QxZaRHGNFpT1LCI0P0sNj10nMgWtAosY106w1ycR1eRWvgWjgVJ9OLvKQhkRP9oIxtu c571BfIwSdGaFAIrk4aMHK2G32xYUIA2g7WNDI+7Bwpb5MfInCLZZilhykPGTsHEYcme SByJrvUvLKsMMNFl8CtuThyEM/HbrdNHov1xcxUBLmNtogTbk4wa9JMRNSzSJ/zZUIsJ 99Yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tPQiSj7nYyvGFVCYU3Ewk+vqv6wYq8XpIeAQJPZ8hzM=; b=QMkGuDRDJCUzoialN/LWvcjwpJzM0a2zxxG6oT8qVJgLWwZTUnT+kZlCFBqO2NCNKx ciiYE8lRsCFDljSv7/5vNnt8AzzCKjmEJm7BPRsFBY3eptXWQLUKIy6fQ4OSc61aaDmm boHmmxy3iPNylbhliukfoJmIzqPzfwsr6Yh/cGFrmQCli4JpxOinNgRditdfi3r8AnJF KJc9e0fMf9o+BFjl/yFx0yuhHHyk0rkXWcklF/Md3yB7ZcNm+V5S7d0XJ1YGJHY1tD1K GC20wPh6T9VmIHwh/vj81aPT0QhBz3BJO/pm1X2z6VP/A6GdzVg9eXWXJYUjYsk0cF3p y69A== X-Gm-Message-State: AFeK/H1cygcPhyLg4h1KRJSNmYPtCYrLezgRhI4l1XcLo6RHEfWTj/6YkYDdudvLrSwjAgs25D4Jy99x8S041Q== X-Received: by 10.98.139.78 with SMTP id j75mr19831156pfe.122.1489800538274; Fri, 17 Mar 2017 18:28:58 -0700 (PDT) MIME-Version: 1.0 References: <83lh0sx0yf.fsf@gnu.org> <83shv0v716.fsf@gnu.org> <83poq4v4jk.fsf@gnu.org> <83wpkbt92i.fsf@gnu.org> <83mvl5tzv7.fsf@gnu.org> <83invttyv7.fsf@gnu.org> <874lys64bm.fsf@users.sourceforge.net> <87var74h2j.fsf@users.sourceforge.net> In-Reply-To: <87var74h2j.fsf@users.sourceforge.net> From: Kaushal Modi Date: Sat, 18 Mar 2017 01:28:46 +0000 Message-ID: Content-Type: multipart/mixed; boundary=f403045ccbb0dfe122054af737d7 X-Spam-Score: -2.3 (--) 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.3 (--) --f403045ccbb0dfe122054af737d7 Content-Type: multipart/alternative; boundary=f403045ccbb0dfe11d054af737d5 --f403045ccbb0dfe11d054af737d5 Content-Type: text/plain; charset=UTF-8 On Fri, Mar 17, 2017 at 7:29 PM wrote: > > Oh, then I don't understand why you separated that sentence into its own > paragraph, it seemed like a continuation of the same idea. (In general, > paragraphs should go before the ChangeLog entries, because that format > doesn't allow for multiple paragraphs in the same entry (AFAIK)). > It's alright. I have kept the whole thing as a single paragraph. > > characters (especially for major modes that have '//' as comment start > > characters). Otherwise, in a major mode like c-mode, with `ido-mode' > ^^^ > > There should be double space between sentences though. > The attached patch has this fixed. Btw if you don't mind explaining: - How did you detect that minor missing space? Do you have a minor mode? Or do you have a check function? - Being used to using single spaces at end of sentences, I always forget adding double spaces. Is there a robust way to ensure that sentences always end in double spaces in commit messages and in the docstrings? > > > > Thanks! I did not know about parse-partial-sexp. Here too, I need to > retain > > the save-excursion, else the point will move after the comment start > chars > > if it is at the BOL in c-mode on a line like > > Oops, right. (I would consider just putting a single save-excursion > around the 'when', but it doesn't hugely matter either way (and Drew > would probably not like the single save-excursion version ;) [1]).) > > [1]: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=25777#38 It did actually occur to merge the two save-excursions, but for code clarity, I kept them separate. I did not want to merge the save-excursion in the "condition" part with the "action" part in (when (condition) action) The attached patch has the double space fixed in the commit message. Thanks. -- Kaushal Modi --f403045ccbb0dfe11d054af737d5 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Fri, Mar 17= , 2017 at 7:29 PM <npo= stavs@users.sourceforge.net> wrote:

Oh, then I don't understand why you separated that sentence into its ow= n
paragraph, it seemed like a continuation of the same idea.=C2=A0 (In genera= l,
paragraphs should go before the ChangeLog entries, because that format
doesn't allow for multiple paragraphs in the same entry (AFAIK)).

It's alright. I have= kept the whole thing as a single paragraph.
=C2=A0
> characters (especially for major modes that have '//' as comme= nt start
> characters). Otherwise, in a major mode like c-mode, with `ido-mode= 9;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0^^^

There should be double space between sentences though.

The attached patch has this fixed.

Btw if you don't mind explaining:
- How = did you detect that minor missing space? Do you have a minor mode? Or do yo= u have a check function?
- Being used to using single spaces at e= nd of sentences, I always forget adding double spaces. Is there a robust wa= y to ensure that sentences always end in double spaces in commit messages a= nd in the docstrings?

=C2=A0
>
> Thanks! I did not know about parse-partial-sexp. Here too, I need to r= etain
> the save-excursion, else the point will move after the comment start c= hars
> if it is at the BOL in c-mode on a line like

Oops, right.=C2=A0 (I would consider just putting a single save-excursion around the 'when', but it doesn't hugely matter either way (and= Drew
would probably not like the single save-excursion version ;) [1]).)

[1]: https://debbugs.gnu= .org/cgi/bugreport.cgi?bug=3D25777#38

I= t did actually occur to merge the two save-excursions, but for code clarity= , I kept them separate. I did not want to merge the save-excursion in the &= quot;condition" part with the "action" part in=C2=A0

=C2=A0 =C2=A0 (when (condition)
=C2=A0 =C2=A0 = =C2=A0 action)
=C2=A0 =C2=A0=C2=A0
=C2=A0The attached p= atch has the double space fixed in the commit message.

=
Thanks.=C2=A0
--

Kaushal Modi

--f403045ccbb0dfe11d054af737d5-- --f403045ccbb0dfe122054af737d7 Content-Type: application/octet-stream; name="0001-Do-not-include-comment-start-chars-in-ffap-string.patch" Content-Disposition: attachment; filename="0001-Do-not-include-comment-start-chars-in-ffap-string.patch" Content-Transfer-Encoding: base64 Content-ID: <15adf02f29d27af84df1> X-Attachment-Id: 15adf02f29d27af84df1 RnJvbSBjZjYxZmExMWRkMGUwYTczNTNjNjk3OTU3YTE2ZWMxODJiMTg4ZmE5IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBLYXVzaGFsIE1vZGkgPGthdXNoYWwubW9kaUBnbWFpbC5jb20+ CkRhdGU6IEZyaSwgMTcgTWFyIDIwMTcgMTg6MDM6MjMgLTA0MDAKU3ViamVjdDogW1BBVENIXSBE byBub3QgaW5jbHVkZSBjb21tZW50IHN0YXJ0IGNoYXJzIGluIGZmYXAgc3RyaW5nCgoqIGxpc3Av ZmZhcC5lbCAoZmZhcC1zdHJpbmctYXQtcG9pbnQpOiBJZiB0aGUgcG9pbnQgaXMgaW4gYSBjb21t ZW50LAplbnN1cmUgdGhhdCB0aGUgcmV0dXJuZWQgc3RyaW5nIGRvZXMgbm90IGNvbnRhaW4gdGhl IGNvbW1lbnQgc3RhcnQKY2hhcmFjdGVycyAoZXNwZWNpYWxseSBmb3IgbWFqb3IgbW9kZXMgdGhh dCBoYXZlICcvLycgYXMgY29tbWVudCBzdGFydApjaGFyYWN0ZXJzKS4gIE90aGVyd2lzZSwgaW4g YSBtYWpvciBtb2RlIGxpa2UgYy1tb2RlLCB3aXRoIGBpZG8tbW9kZScKZW5hYmxlZCBhbmQgYGlk by11c2UtZmlsZW5hbWUtYXQtcG9pbnQnIHNldCB0byBgZ3Vlc3MnLCBkb2luZyAiQy14CkMtZiIg b24gYSAiLy9mb28iIGNvbW1lbnQgd2lsbCBpbml0aWF0ZSBhbiBhdHRlbXB0IHRvIGFjY2VzcyBh IHBhdGgKIi8vZm9vIiAoQnVnIzI0MDU3KS4KCkNvLWF1dGhvcmVkLWJ5OiBOb2FtIFBvc3RhdnNr eSA8bnBvc3RhdnNAZ21haWwuY29tPgotLS0KIGxpc3AvZmZhcC5lbCB8IDQxICsrKysrKysrKysr KysrKysrKysrKysrKysrKysrKysrKysrKysrLS0tCiAxIGZpbGUgY2hhbmdlZCwgMzggaW5zZXJ0 aW9ucygrKSwgMyBkZWxldGlvbnMoLSkKCmRpZmYgLS1naXQgYS9saXNwL2ZmYXAuZWwgYi9saXNw L2ZmYXAuZWwKaW5kZXggZDcyMjJiZmI2OC4uYTE1MDgzZjRmYSAxMDA2NDQKLS0tIGEvbGlzcC9m ZmFwLmVsCisrKyBiL2xpc3AvZmZhcC5lbApAQCAtMTExMCwzMiArMTExMCw2NyBAQCBmZmFwLXN0 cmluZy1hdC1wb2ludAogCiAoZGVmdW4gZmZhcC1zdHJpbmctYXQtcG9pbnQgKCZvcHRpb25hbCBt b2RlKQogICAiUmV0dXJuIGEgc3RyaW5nIG9mIGNoYXJhY3RlcnMgZnJvbSBhcm91bmQgcG9pbnQu CisKIE1PREUgKGRlZmF1bHRzIHRvIHZhbHVlIG9mIGBtYWpvci1tb2RlJykgaXMgYSBzeW1ib2wg dXNlZCB0byBsb29rIHVwCiBzdHJpbmcgc3ludGF4IHBhcmFtZXRlcnMgaW4gYGZmYXAtc3RyaW5n LWF0LXBvaW50LW1vZGUtYWxpc3QnLgorCiBJZiBNT0RFIGlzIG5vdCBmb3VuZCwgd2UgdXNlIGBm aWxlJyBpbnN0ZWFkIG9mIE1PREUuCisKIElmIHRoZSByZWdpb24gaXMgYWN0aXZlLCByZXR1cm4g YSBzdHJpbmcgZnJvbSB0aGUgcmVnaW9uLgotU2V0IHRoZSB2YXJpYWJsZSBgZmZhcC1zdHJpbmct YXQtcG9pbnQnIGFuZCB0aGUgdmFyaWFibGUKKworSWYgdGhlIHBvaW50IGlzIGluIGEgY29tbWVu dCwgZW5zdXJlIHRoYXQgdGhlIHJldHVybmVkIHN0cmluZyBkb2VzIG5vdAorY29udGFpbiB0aGUg Y29tbWVudCBzdGFydCBjaGFyYWN0ZXJzIChlc3BlY2lhbGx5IGZvciBtYWpvciBtb2RlcyB0aGF0 CitoYXZlICcvLycgYXMgY29tbWVudCBzdGFydCBjaGFyYWN0ZXJzKS4KKworU2V0IHRoZSB2YXJp YWJsZXMgYGZmYXAtc3RyaW5nLWF0LXBvaW50JyBhbmQKIGBmZmFwLXN0cmluZy1hdC1wb2ludC1y ZWdpb24nLgorCiBXaGVuIHRoZSByZWdpb24gaXMgYWN0aXZlIGFuZCBsYXJnZXIgdGhhbiBgZmZh cC1tYXgtcmVnaW9uLWxlbmd0aCcsCiByZXR1cm4gYW4gZW1wdHkgc3RyaW5nLCBhbmQgc2V0IGBm ZmFwLXN0cmluZy1hdC1wb2ludC1yZWdpb24nIHRvICcoMSAxKS4iCiAgIChsZXQqICgoYXJncwog CSAgKGNkcgogCSAgIChvciAoYXNzcSAob3IgbW9kZSBtYWpvci1tb2RlKSBmZmFwLXN0cmluZy1h dC1wb2ludC1tb2RlLWFsaXN0KQogCSAgICAgICAoYXNzcSAnZmlsZSBmZmFwLXN0cmluZy1hdC1w b2ludC1tb2RlLWFsaXN0KSkpKQorICAgICAgICAgKHJlZ2lvbi1zZWxlY3RlZCAodXNlLXJlZ2lv bi1wKSkKIAkgKHB0IChwb2ludCkpCi0JIChiZWcgKGlmICh1c2UtcmVnaW9uLXApCisgICAgICAg ICAoYmVnIChpZiByZWdpb24tc2VsZWN0ZWQKIAkJICAocmVnaW9uLWJlZ2lubmluZykKIAkJKHNh dmUtZXhjdXJzaW9uCiAJCSAgKHNraXAtY2hhcnMtYmFja3dhcmQgKGNhciBhcmdzKSkKIAkJICAo c2tpcC1jaGFycy1mb3J3YXJkIChudGggMSBhcmdzKSBwdCkKIAkJICAocG9pbnQpKSkpCi0JIChl bmQgKGlmICh1c2UtcmVnaW9uLXApCisgICAgICAgICAoZW5kIChpZiByZWdpb24tc2VsZWN0ZWQK IAkJICAocmVnaW9uLWVuZCkKIAkJKHNhdmUtZXhjdXJzaW9uCiAJCSAgKHNraXAtY2hhcnMtZm9y d2FyZCAoY2FyIGFyZ3MpKQogCQkgIChza2lwLWNoYXJzLWJhY2t3YXJkIChudGggMiBhcmdzKSBw dCkKIAkJICAocG9pbnQpKSkpCiAgICAgICAgICAocmVnaW9uLWxlbiAoLSAobWF4IGJlZyBlbmQp IChtaW4gYmVnIGVuZCkpKSkKKworICAgIDs7IElmIHRoZSBpbml0aWFsIGNoYXJhY3RlcnMgb2Yg dGhlIHRvLWJlLXJldHVybmVkIHN0cmluZyBhcmUgdGhlCisgICAgOzsgY3VycmVudCBtYWpvciBt b2RlJ3MgY29tbWVudCBzdGFydGVyIGNoYXJhY3RlcnMsICphbmQqIGFyZQorICAgIDs7IG5vdCBw YXJ0IG9mIGEgY29tbWVudCwgcmVtb3ZlIHRob3NlIGZyb20gdGhlIHJldHVybmVkIHN0cmluZwor ICAgIDs7IChCdWcjMjQwNTcpLgorICAgIDs7IEV4YW1wbGUgY29tbWVudHMgaW4gYGMtbW9kZScg KHdoaWNoIGNvbnNpZGVycyBsaW5lcyBiZWdpbm5pbmcKKyAgICA7OyB3aXRoICIvLyIgYXMgY29t bWVudHMpOgorICAgIDs7ICAvL3RtcCAtIFRoaXMgaXMgYSBjb21tZW50LiBJdCBkb2VzIG5vdCBj b250YWluIGFueSBwYXRoIHJlZmVyZW5jZS4KKyAgICA7OyAgLy8vdG1wIC0gVGhpcyBpcyBhIGNv bW1lbnQuIFRoZSAiL3RtcCIgcG9ydGlvbiBpbiB0aGF0IGlzIGEgcGF0aC4KKyAgICA7OyAgLy8v L3RtcCAtIFRoaXMgaXMgYSBjb21tZW50LiBUaGUgIi8vdG1wIiBwb3J0aW9uIGluIHRoYXQgaXMg YSBwYXRoLgorICAgICh3aGVuIChhbmQKKyAgICAgICAgICAgOzsgUHJvY2VlZCBpZiBubyByZWdp b24gaXMgc2VsZWN0ZWQgYnkgdGhlIHVzZXIuCisgICAgICAgICAgIChudWxsIHJlZ2lvbi1zZWxl Y3RlZCkKKyAgICAgICAgICAgOzsgQ2hlY2sgaWYgRU5EIGNoYXJhY3RlciBpcyBwYXJ0IG9mIGEg Y29tbWVudC4KKyAgICAgICAgICAgKHNhdmUtZXhjdXJzaW9uCisgICAgICAgICAgICAgKG50aCA0 IChzeW50YXgtcHBzcyBlbmQpKSkpCisgICAgICA7OyBNb3ZlIEJFRyB0byBiZWdpbm5pbmcgb2Yg Y29tbWVudCAoYWZ0ZXIgdGhlIGNvbW1lbnQgc3RhcnQKKyAgICAgIDs7IGNoYXJhY3RlcnMpLCBv ciBFTkQsIHdoaWNoZXZlciBjb21lcyBmaXJzdC4KKyAgICAgIChzYXZlLWV4Y3Vyc2lvbgorICAg ICAgICAobGV0ICgoc3RhdGUgKHN5bnRheC1wcHNzIGJlZykpKQorICAgICAgICAgIDs7IChudGgg NCAoc3ludGF4LXBwc3MpKSB3aWxsIGJlIG5pbCBmb3IgY29tbWVudCBzdGFydCBjaGFycworICAg ICAgICAgICh1bmxlc3MgKG50aCA0IHN0YXRlKQorICAgICAgICAgICAgKHBhcnNlLXBhcnRpYWwt c2V4cCBiZWcgZW5kIG5pbCBuaWwgc3RhdGUgOmNvbW1lbnRzdG9wKQorICAgICAgICAgICAgKHNl dHEgYmVnIChwb2ludCkpKSkpKQorCiAgICAgKGlmIChhbmQgKG5hdG51bXAgZmZhcC1tYXgtcmVn aW9uLWxlbmd0aCkKICAgICAgICAgICAgICAoPCByZWdpb24tbGVuIGZmYXAtbWF4LXJlZ2lvbi1s ZW5ndGgpKSA7IEJ1ZyMyNTI0My4KICAgICAgICAgKHNldGYgZmZhcC1zdHJpbmctYXQtcG9pbnQt cmVnaW9uIChsaXN0IGJlZyBlbmQpCi0tIAoyLjExLjAKCg== --f403045ccbb0dfe122054af737d7-- From unknown Sat Aug 16 18:47:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#24057: 25.1.50; ffap interprets comments beginning with "//" as file path Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 18 Mar 2017 15:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24057 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Kaushal Modi Cc: Eli Zaretskii , 24057@debbugs.gnu.org Received: via spool by 24057-submit@debbugs.gnu.org id=B24057.148985159430878 (code B ref 24057); Sat, 18 Mar 2017 15:40:02 +0000 Received: (at 24057) by debbugs.gnu.org; 18 Mar 2017 15:39:54 +0000 Received: from localhost ([127.0.0.1]:34084 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cpGSQ-00081x-CZ for submit@debbugs.gnu.org; Sat, 18 Mar 2017 11:39:54 -0400 Received: from mail-it0-f54.google.com ([209.85.214.54]:37384) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cpGSL-00081Y-Mk; Sat, 18 Mar 2017 11:39:49 -0400 Received: by mail-it0-f54.google.com with SMTP id g138so56701480itb.0; Sat, 18 Mar 2017 08:39:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=J6A9wUUHNaK+YgRKaWj+nogcM5waUwdj3Z5SJrgCzy0=; b=tIMLEEQLiDIHZOTEZCVhUZ2D8kdkLovBp3VK6Faa+jZW6xP0SGW4RPRaPLwRJmRHzT wxAfhjmSH9rm9exanEdAnIP1x6dPaA5WreAmxcFXT0tPxNzzJWuNMRYS/dwgP+ITlqWS HPZqaDLfie4NvUv+lQCZigG6NMVqhZN+VxIaTl3Wc4kcLvulLHvdDLBImtwpYml3ATNf Lm7GquG6F8soQkQ+6nBEHX3IN3kYwbSdHy+BFU5IDxGJqwdAsyS168xDHYonBwc9O7c7 Wiu6zEDSbhaTU8wnXVdAhwTahuqLmkU90PmQQqcC5NqHSTljX6qs8R7+SvF5/WAb0t0n F6lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=J6A9wUUHNaK+YgRKaWj+nogcM5waUwdj3Z5SJrgCzy0=; b=FzKEg+cjm+giaDTMHTvW7XsGgarj37IjlOkbAhNUkQazRKkX1e18axjSUjm2os3XQo 1lAHpeIhVEBy9cCnZgEUWSs85DXD6N+jdG65ItHfCDm9tA4dnyD402lbj8bY4gZJPiRB 6id67cx6J4niOyXTrCHYk9uwDB3VRQvY6d+roSwCULw41pIZR88wP+Kn1n9ZdjzxmH6n +iEH1tGPGGtuMDBHz5OJAmcK2pJxFKmn3/++Vmq9bhPa7ycYJhEFtfch04MV0WpcMWNv Vip8UVmFFd/6IbVEBDKBK3071o+7nHnZ+ovwsA4k4AnPlcYRmOC4/amLxowc0+egpYpm UE+w== X-Gm-Message-State: AFeK/H0LtEb+dq4GkmGjBdkpdFvhfiDKuKOFAKZg7kfCAtknDFXuPfiXGUgHx7chUvHPVA== X-Received: by 10.36.137.4 with SMTP id s4mr3034959itd.63.1489851583984; Sat, 18 Mar 2017 08:39:43 -0700 (PDT) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id w133sm2604809itf.2.2017.03.18.08.39.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 18 Mar 2017 08:39:42 -0700 (PDT) From: npostavs@users.sourceforge.net References: <83lh0sx0yf.fsf@gnu.org> <83shv0v716.fsf@gnu.org> <83poq4v4jk.fsf@gnu.org> <83wpkbt92i.fsf@gnu.org> <83mvl5tzv7.fsf@gnu.org> <83invttyv7.fsf@gnu.org> <874lys64bm.fsf@users.sourceforge.net> <87var74h2j.fsf@users.sourceforge.net> Date: Sat, 18 Mar 2017 11:41:03 -0400 In-Reply-To: (Kaushal Modi's message of "Sat, 18 Mar 2017 01:28:46 +0000") Message-ID: <87r31u4mpc.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) 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.0 (/) tags 24057 patch quit Kaushal Modi writes: > Btw if you don't mind explaining: > - How did you detect that minor missing space? Do you have a minor mode? Or > do you have a check function? I enable ocd-mode in my brain while reading patches ;) > - Being used to using single spaces at end of sentences, I always forget > adding double spaces. More seriously, I've gotten used to using double spaces and so single spaced sentences stand out to me more now. > Is there a robust way to ensure that sentences always > end in double spaces in commit messages and in the docstrings? The trouble is that sometimes a period followed by a space doesn't end a sentence, e.g., in "Mr. Foo". Actually, this ambiguity is what convinced me to switch over to double spacing. Such cases might be rare enough in commit messages and docstrings that we could get away with some automatic warning on all matches for "\\sw[.] \\<" though. > > The attached patch has the double space fixed in the commit message. Thanks, I will push to master in a couple of days. From unknown Sat Aug 16 18:47:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#24057: 25.1.50; ffap interprets comments beginning with "//" as file path Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 23 Mar 2017 13:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24057 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Kaushal Modi Cc: Eli Zaretskii , 24057@debbugs.gnu.org Received: via spool by 24057-submit@debbugs.gnu.org id=B24057.149027398812891 (code B ref 24057); Thu, 23 Mar 2017 13:00:02 +0000 Received: (at 24057) by debbugs.gnu.org; 23 Mar 2017 12:59:48 +0000 Received: from localhost ([127.0.0.1]:40247 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cr2LD-0003Lq-Q7 for submit@debbugs.gnu.org; Thu, 23 Mar 2017 08:59:47 -0400 Received: from mail-io0-f169.google.com ([209.85.223.169]:35012) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cr2LC-0003LU-5A; Thu, 23 Mar 2017 08:59:46 -0400 Received: by mail-io0-f169.google.com with SMTP id z13so82058855iof.2; Thu, 23 Mar 2017 05:59:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=Ic4qfKslgxQ5oKyUfqIerF5cJwi1+OkOWmhKU2uUc6c=; b=RwRvtmiU3bNHEYpImPI6hp+kvmpOASCT/pAzxrGLe0GuKpYfHTI+qg1omwjCRwyDW0 lyUzDkYsiE456pnRy6hQzNgkYnPd5e0txj6HhfLdRtmZ87spN2EtN7EkNg0oyy7JpBKN uzlVHVHxmnqQMaQSe0hF8d0rZmUmPWhJIyoVBS2vYzAnZjHGUUzTnXnWM6FMwfc0yW/n BAIbG+BD9uxBqjC9GNusZ3u1e5B34rTrB2qrzSPjUsHcpjWeqrtyOlzq72Y7YtdmFbQr RbMlh+duIHYa9MuabuU/MfzleUCzvGY0i48nVziL3O0nOYTXmpkC/tq9oG/1FrXYTyNe qlAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=Ic4qfKslgxQ5oKyUfqIerF5cJwi1+OkOWmhKU2uUc6c=; b=WGC5GkAExo8iVBIYCYmiWxuLNl5fcO7COn1A2XLJRnUpO5BEFKR/hy6t+PpQhw0LUI FTpryRsj32KfU/z9eLwo0K14DZJdjCUMe0iJ6obZWKvEPteDkmEPtTUF0Oajl3hTH2L+ Ms4+s5idp2G436sEnX/8M7PnmcWbMKR6KOb/LoKQWO2TGAPQQaYNwYu6vQ0bR2BA0qWy eS05/+OeK+Qzhecgq60mXDbvDxFPlgo6oFBmc/NzUdIVRoLztHDTRlU/wSxGDwCpCZoB FSp5oExy1S/VZ/SgBoRU/8WZfs768tB/269IWo9EtzIx3NsyhK70kYYxkSOrdZxV/Gum 0A9A== X-Gm-Message-State: AFeK/H117kotUKKKYXKzGeMR47PYnGESVa53niLzNpHYHKC0ZFi9HIrrgGAddfiid93W6Q== X-Received: by 10.107.175.152 with SMTP id p24mr2672128ioo.80.1490273980593; Thu, 23 Mar 2017 05:59:40 -0700 (PDT) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id p70sm355503itg.0.2017.03.23.05.59.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Mar 2017 05:59:39 -0700 (PDT) From: npostavs@users.sourceforge.net References: <83lh0sx0yf.fsf@gnu.org> <83shv0v716.fsf@gnu.org> <83poq4v4jk.fsf@gnu.org> <83wpkbt92i.fsf@gnu.org> <83mvl5tzv7.fsf@gnu.org> <83invttyv7.fsf@gnu.org> <874lys64bm.fsf@users.sourceforge.net> <87var74h2j.fsf@users.sourceforge.net> <87r31u4mpc.fsf@users.sourceforge.net> Date: Thu, 23 Mar 2017 09:01:02 -0400 In-Reply-To: <87r31u4mpc.fsf@users.sourceforge.net> (npostavs@users.sourceforge.net's message of "Sat, 18 Mar 2017 11:41:03 -0400") Message-ID: <877f3g406p.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.6 (--) 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 (--) tags 24057 fixed close 24057 26.1 quit npostavs@users.sourceforge.net writes: > > Thanks, I will push to master in a couple of days. Done [1: e472cfe8f3] 1: 2017-03-23 08:57:13 -0400 e472cfe8f3b01f29a49614f6207e4128e8b36b8c Do not include comment start chars in ffap string From unknown Sat Aug 16 18:47:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#24057: 25.1.50; ffap interprets comments beginning with "//" as file path Resent-From: Kaushal Modi Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 23 Mar 2017 13:31:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24057 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch fixed To: Noam Postavsky Cc: Eli Zaretskii , 24057@debbugs.gnu.org Received: via spool by 24057-submit@debbugs.gnu.org id=B24057.149027581922457 (code B ref 24057); Thu, 23 Mar 2017 13:31:03 +0000 Received: (at 24057) by debbugs.gnu.org; 23 Mar 2017 13:30:19 +0000 Received: from localhost ([127.0.0.1]:40261 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cr2ol-0005q9-6n for submit@debbugs.gnu.org; Thu, 23 Mar 2017 09:30:19 -0400 Received: from mail-pf0-f177.google.com ([209.85.192.177]:36580) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cr2ok-0005px-CW for 24057@debbugs.gnu.org; Thu, 23 Mar 2017 09:30:18 -0400 Received: by mail-pf0-f177.google.com with SMTP id o126so105844114pfb.3 for <24057@debbugs.gnu.org>; Thu, 23 Mar 2017 06:30:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Kj3f62bwaPAcuWoQ6iumxcXjNu6kPEhdt2LaXvuo50Y=; b=CnT2yBARJcf/khNpkjFErg2DGxedn2S0fvH8DzFLwx4jWVDz5WwKQC0yjChNY8U4BS nzZZdwkQYGLuDGhIXL7yrqseaxPOM/TWcP0t4AImxvVXZXeT1R4WTepryNloGxkIkQEM 9bEbyTZ6ZwYE5eHDEUm/fAe9I1736JvEBSmcFOGsUvXPE1ajd+RXhI3yAADEWGeOZCtO SMloPuKmvYW1w0u0Xfcpq0O8Ln7iEv2e4y1etg+bMNfmDAbZbj2SPX1+gcHdZKgnwlwi djzIkPLAuAeE7S2DzyFZ33gt8zjZtHZ4aMkrUEEWJ2OQB2/7WtSvgoQy77FB3f0APEc3 gjLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Kj3f62bwaPAcuWoQ6iumxcXjNu6kPEhdt2LaXvuo50Y=; b=k37Z01c5US3AsocnJLcxg+cF9HJnW4VwD+01ZtAZW2N7udLd1mhF/elZptkcG1qBM9 g2joxJsX3FK9x3xJwvQObVdNKriirak+VVrb5A/oif+B3pa25yhePudtQiUuvAbo9FYU sc5fGNNOsZQ8Zjbejq6LMVvxXuYlQFltblQJpnHy04juAOH8k9TJog9C9ckobA6lknW8 ax0Vj5W0oLLjr/13yWxMpx2UWzxdMiXEOFCPh2bHqO1KJyL+F6UpVAEjtJhMCrxZI1nK /cOj29PxSnlZEc+xPazRmqHW86qNiFXtiPylmHc19ZfoDbyJMkxtmmkgPLAHcUHcXjcN 1enQ== X-Gm-Message-State: AFeK/H3UvNzB6tvv5Hc0gCtrLwlcHBMi2XFK0ZYeKucjKzhdvJOHMrjPEH3v/aPcDKqYXUek3BO3vj05oTsQ2g== X-Received: by 10.99.161.17 with SMTP id b17mr2942743pgf.72.1490275812404; Thu, 23 Mar 2017 06:30:12 -0700 (PDT) MIME-Version: 1.0 References: <83lh0sx0yf.fsf@gnu.org> <83shv0v716.fsf@gnu.org> <83poq4v4jk.fsf@gnu.org> <83wpkbt92i.fsf@gnu.org> <83mvl5tzv7.fsf@gnu.org> <83invttyv7.fsf@gnu.org> <874lys64bm.fsf@users.sourceforge.net> <87var74h2j.fsf@users.sourceforge.net> <87r31u4mpc.fsf@users.sourceforge.net> <877f3g406p.fsf@users.sourceforge.net> In-Reply-To: <877f3g406p.fsf@users.sourceforge.net> From: Kaushal Modi Date: Thu, 23 Mar 2017 13:30:00 +0000 Message-ID: Content-Type: multipart/alternative; boundary=94eb2c1be9306a7600054b65e01b X-Spam-Score: -2.8 (--) 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.8 (--) --94eb2c1be9306a7600054b65e01b Content-Type: text/plain; charset=UTF-8 Thank you! On Thu, Mar 23, 2017, 8:59 AM wrote: > > Done [1: e472cfe8f3] > > 1: 2017-03-23 08:57:13 -0400 e472cfe8f3b01f29a49614f6207e4128e8b36b8c > Do not include comment start chars in ffap string > -- Kaushal Modi --94eb2c1be9306a7600054b65e01b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Thank you!

On Thu, Mar 23, 2017= , 8:59 AM <npostavs@u= sers.sourceforge.net> wrote:

Done [1: e472cfe8f3]

1: 2017-03-23 08:57:13 -0400 e472cfe8f3b01f29a49614f6207e4128e8b36b8c
=C2=A0 Do not include comment start chars in ffap string
--

Kaushal Modi

--94eb2c1be9306a7600054b65e01b--