unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* gpr-query vs Mac OS 10.11.6
@ 2016-09-04 11:39 Simon Wright
  0 siblings, 0 replies; 3+ messages in thread
From: Simon Wright @ 2016-09-04 11:39 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 419 bytes --]

(I'm not sure it's really the macOS update - but that's the only change I can think of)

Using gpr_query as the query backend, C-c C-d started failing.

I think the reason is that the reported case of file names has changed, so that the file being looked for doesn't match the file found.

This patch solves it for me -- I haven't checked it in because two of the tests have failed, more investigation needed.


[-- Attachment #2: gpr-query.el.diff --]
[-- Type: application/octet-stream, Size: 2383 bytes --]

#
# old_revision [d2c4f08999fae44acb5b01847d1080e727957d8e]
#
# patch "gpr-query.el"
#  from [518d5f71e3e5b48d57494f99c95b950e40018acd]
#    to [f4e0a6ec5c6bbb160f9ef8e106e677cf7907f08b]
#
============================================================
--- gpr-query.el	518d5f71e3e5b48d57494f99c95b950e40018acd
+++ gpr-query.el	f4e0a6ec5c6bbb160f9ef8e106e677cf7907f08b
@@ -445,10 +445,7 @@ Enable mode if ARG is positive."
     (setq identifier (substring identifier 1 (1- (length identifier))))
     )
 
-  (when (eq system-type 'windows-nt)
-    ;; Since Windows file system is case insensitive, GNAT and Emacs
-    ;; can disagree on the case, so convert all to lowercase.
-    (setq file (downcase file)))
+  (setq file (gpr-query--normalize-filename file))
 
   (let ((cmd (format "refs %s:%s:%d:%d" identifier (file-name-nondirectory file) line col))
 	(decl-loc nil)
@@ -495,12 +492,7 @@ Enable mode if ARG is positive."
 		 (dist       (gpr-query-dist found-line line found-col col))
 		 )
 
-	    (when (eq system-type 'windows-nt)
-	      ;; 'expand-file-name' converts Windows directory
-	      ;; separators to normal Emacs.  Since Windows file
-	      ;; system is case insensitive, GNAT and Emacs can
-	      ;; disagree on the case, so convert all to lowercase.
-	      (setq found-file (downcase (expand-file-name found-file))))
+            (setq found-file (gpr-query--normalize-filename found-file))
 
 	    (when (string-equal found-type "declaration")
 	      (setq decl-loc (list found-file found-line (1- found-col))))
@@ -593,6 +585,20 @@ Enable mode if ARG is positive."
       (message "parsing result ... done")
       result)))
 
+(defun gpr-query--normalize-filename (file)
+  "Takes account of filesystem differences."
+  (when (eq system-type 'windows-nt)
+    ;; 'expand-file-name' converts Windows directory
+    ;; separators to normal Emacs.  Since Windows file
+    ;; system is case insensitive, GNAT and Emacs can
+    ;; disagree on the case, so convert all to lowercase.
+    (setq file (downcase (expand-file-name file))))
+  (when (eq system-type 'darwin)
+    ;; case-insensitive case-preserving; so just downcase
+    (setq file (downcase file)))
+  file
+  )
+
 (defun ada-gpr-query-select-prj ()
   (setq ada-file-name-from-ada-name 'ada-gnat-file-name-from-ada-name)
   (setq ada-ada-name-from-file-name 'ada-gnat-ada-name-from-file-name)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* gpr-query vs Mac OS 10.11.6
@ 2016-09-04 14:47 Simon Wright
  2016-09-04 15:42 ` Simon Wright
  0 siblings, 1 reply; 3+ messages in thread
From: Simon Wright @ 2016-09-04 14:47 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 419 bytes --]

(I'm not sure it's really the macOS update - but that's the only change I can think of)

Using gpr_query as the query backend, C-c C-d started failing.

I think the reason is that the reported case of file names has changed, so that the file being looked for doesn't match the file found.

This patch solves it for me -- I haven't checked it in because two of the tests have failed, more investigation needed.


[-- Attachment #2: gpr-query.el.diff --]
[-- Type: application/octet-stream, Size: 2383 bytes --]

#
# old_revision [d2c4f08999fae44acb5b01847d1080e727957d8e]
#
# patch "gpr-query.el"
#  from [518d5f71e3e5b48d57494f99c95b950e40018acd]
#    to [f4e0a6ec5c6bbb160f9ef8e106e677cf7907f08b]
#
============================================================
--- gpr-query.el	518d5f71e3e5b48d57494f99c95b950e40018acd
+++ gpr-query.el	f4e0a6ec5c6bbb160f9ef8e106e677cf7907f08b
@@ -445,10 +445,7 @@ Enable mode if ARG is positive."
     (setq identifier (substring identifier 1 (1- (length identifier))))
     )
 
-  (when (eq system-type 'windows-nt)
-    ;; Since Windows file system is case insensitive, GNAT and Emacs
-    ;; can disagree on the case, so convert all to lowercase.
-    (setq file (downcase file)))
+  (setq file (gpr-query--normalize-filename file))
 
   (let ((cmd (format "refs %s:%s:%d:%d" identifier (file-name-nondirectory file) line col))
 	(decl-loc nil)
@@ -495,12 +492,7 @@ Enable mode if ARG is positive."
 		 (dist       (gpr-query-dist found-line line found-col col))
 		 )
 
-	    (when (eq system-type 'windows-nt)
-	      ;; 'expand-file-name' converts Windows directory
-	      ;; separators to normal Emacs.  Since Windows file
-	      ;; system is case insensitive, GNAT and Emacs can
-	      ;; disagree on the case, so convert all to lowercase.
-	      (setq found-file (downcase (expand-file-name found-file))))
+            (setq found-file (gpr-query--normalize-filename found-file))
 
 	    (when (string-equal found-type "declaration")
 	      (setq decl-loc (list found-file found-line (1- found-col))))
@@ -593,6 +585,20 @@ Enable mode if ARG is positive."
       (message "parsing result ... done")
       result)))
 
+(defun gpr-query--normalize-filename (file)
+  "Takes account of filesystem differences."
+  (when (eq system-type 'windows-nt)
+    ;; 'expand-file-name' converts Windows directory
+    ;; separators to normal Emacs.  Since Windows file
+    ;; system is case insensitive, GNAT and Emacs can
+    ;; disagree on the case, so convert all to lowercase.
+    (setq file (downcase (expand-file-name file))))
+  (when (eq system-type 'darwin)
+    ;; case-insensitive case-preserving; so just downcase
+    (setq file (downcase file)))
+  file
+  )
+
 (defun ada-gpr-query-select-prj ()
   (setq ada-file-name-from-ada-name 'ada-gnat-file-name-from-ada-name)
   (setq ada-ada-name-from-file-name 'ada-gnat-ada-name-from-file-name)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: gpr-query vs Mac OS 10.11.6
  2016-09-04 14:47 Simon Wright
@ 2016-09-04 15:42 ` Simon Wright
  0 siblings, 0 replies; 3+ messages in thread
From: Simon Wright @ 2016-09-04 15:42 UTC (permalink / raw)
  To: emacs-devel

On 4 Sep 2016, at 15:47, Simon Wright <simon.j.wright@mac.com> wrote:

something intended for <ada-mode-users@nongnu.org> - sorry for the noise



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-09-04 15:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-04 11:39 gpr-query vs Mac OS 10.11.6 Simon Wright
  -- strict thread matches above, loose matches on Subject: below --
2016-09-04 14:47 Simon Wright
2016-09-04 15:42 ` Simon Wright

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).