From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#19468: 25.0.50; UI inconveniences with M-. Date: Sat, 02 May 2015 14:16:22 +0300 Message-ID: <83oam3p6ux.fsf@gnu.org> References: <83zja6b3tc.fsf@gnu.org> <54A24079.4020902@yandex.ru> <54A2FF47.6010207@yandex.ru> <54A86135.7080004@yandex.ru> <54A90002.7080009@gmx.at> <54A9C3FB.7000602@yandex.ru> <54AA3881.3080304@gmx.at> <54ABBB47.7010603@yandex.ru> <837fszx7iy.fsf@gnu.org> <83pp6pwqnw.fsf@gnu.org> <553EB74A.4030208@yandex.ru> <83bni8wbin.fsf@gnu.org> <554009A5.5020001@yandex.ru> <83wq0vszof.fsf@gnu.org> <55411842.1020102@yandex.ru> <83a8xqu80z.fsf@gnu.org> <55441587.6050004@yandex.ru> <837fsrqwsh.fsf@gnu.org> <5544A2EE.1010507@yandex.ru> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1430565447 2430 80.91.229.3 (2 May 2015 11:17:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 2 May 2015 11:17:27 +0000 (UTC) Cc: 19468@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat May 02 13:17:14 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YoVPy-0001kR-WB for geb-bug-gnu-emacs@m.gmane.org; Sat, 02 May 2015 13:17:11 +0200 Original-Received: from localhost ([::1]:56631 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YoVPy-0006km-4i for geb-bug-gnu-emacs@m.gmane.org; Sat, 02 May 2015 07:17:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54949) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YoVPu-0006hU-4w for bug-gnu-emacs@gnu.org; Sat, 02 May 2015 07:17:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YoVPq-000804-SE for bug-gnu-emacs@gnu.org; Sat, 02 May 2015 07:17:06 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:49173) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YoVPq-000800-P1 for bug-gnu-emacs@gnu.org; Sat, 02 May 2015 07:17:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YoVPq-0008QB-AD for bug-gnu-emacs@gnu.org; Sat, 02 May 2015 07:17:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 02 May 2015 11:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19468 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 19468-submit@debbugs.gnu.org id=B19468.143056540832347 (code B ref 19468); Sat, 02 May 2015 11:17:02 +0000 Original-Received: (at 19468) by debbugs.gnu.org; 2 May 2015 11:16:48 +0000 Original-Received: from localhost ([127.0.0.1]:59148 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YoVPc-0008Pe-5S for submit@debbugs.gnu.org; Sat, 02 May 2015 07:16:48 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:43700) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YoVPZ-0008PN-Sg for 19468@debbugs.gnu.org; Sat, 02 May 2015 07:16:47 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0NNP00700Z4CN500@a-mtaout20.012.net.il> for 19468@debbugs.gnu.org; Sat, 02 May 2015 14:16:39 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NNP007KFZBQMR10@a-mtaout20.012.net.il>; Sat, 02 May 2015 14:16:39 +0300 (IDT) In-reply-to: <5544A2EE.1010507@yandex.ru> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:102367 Archived-At: > Cc: 19468@debbugs.gnu.org > From: Dmitry Gutov > Date: Sat, 2 May 2015 13:11:58 +0300 > > On 05/02/2015 10:10 AM, Eli Zaretskii wrote: > > > I get "Symbol's function definition is void: mapcan". > > Sorry, fixed now. Thanks. > > I then manually load cl, and re-invoke the command. The result now is > > "No known references for: set_cursor_from_row". > > It expected you to load the tags tables first It did, so that's not the problem. > Now it'll prompt for one otherwise. I don't understand this new prompt, it says: In directory: /patch/to/emacs/trunk/src/ What does it ask about? (I just pressed RET, since the directory sounds correct.) > > In case it matters, the ID file was produced manually with this > > command in the top-level Emacs directory: > > > > mkid -o ID . > > If you want to see it used, then like I said, it needs to be in the same > directory as TAGS (not one level above). I tried both, and got the same results. So this is not the reason; there's something else at work here. > But without it, we default to using Grep. So why didn't it do that? Why did I get "no known references"? [Time passes] Ah, I see the reason: Some code that uses ID Utils expects the file names in the ID database to be absolute. So if I create the ID database like this: mkid -o ID /path/to/emacs/src then the feature starts working. I think it should support relative names as well, by expanding them relative to the directory in which the ID database was found. And in any case, claiming it found no references instead of saying something about finding no files whose names were returned by ID Utils is a less than useful error message, IMO. Now to the Grep alternative: if I rename the ID database, I get an error message: Searching for program: No such file or directory, sh (This is on MS-Windows.) The patch for that is below. But that doesn't end the saga, because after fixing this, I get "No known references for: set_cursor_from_row" again, when there's no ID database. The reason is that the find/grep command uses the wrong quoting style; the patch below fixes that as well. And the saga is not yet over, but now I need help. The method semantic-symref-parse-tool-output-one-line returns nil, but I cannot seem to figure out why. The buffer which contains Grep hits look fine to me (except that it includes SGR escape sequences, due to "--color=always" switch to Grep -- why is that a good idea?), but where's the code of this method? I couldn't step into it with Edebug, for some reason. Help?.... Here's that patch I promised. I will push it if no one objects. diff --git a/lisp/cedet/semantic/symref/grep.el b/lisp/cedet/semantic/symref/grep.el index 981dab8..ecb3279 100644 --- a/lisp/cedet/semantic/symref/grep.el +++ b/lisp/cedet/semantic/symref/grep.el @@ -115,7 +115,7 @@ (defun semantic-symref-grep-use-template (rootdir filepattern grepflags greppatt ;;(message "New command: %s" cmd) cmd)) -(defcustom semantic-symref-grep-shell "sh" +(defcustom semantic-symref-grep-shell shell-file-name "The shell command to use for executing find/grep. This shell should support pipe redirect syntax." :group 'semantic @@ -140,7 +140,8 @@ (cl-defmethod semantic-symref-perform-search ((tool semantic-symref-tool-grep)) (greppat (cond ((eq (oref tool :searchtype) 'regexp) (oref tool searchfor)) (t - (concat "'\\<" (oref tool searchfor) "\\>'")))) + (shell-quote-argument + (concat "\\<" (oref tool searchfor) "\\>"))))) ;; Misc (b (get-buffer-create "*Semantic SymRef*")) (ans nil) @@ -158,10 +159,12 @@ (cl-defmethod semantic-symref-perform-search ((tool semantic-symref-tool-grep)) (let ((cmd (concat "find " default-directory " -type f " filepattern " -print0 " "| xargs -0 grep -H " grepflags "-e " greppat))) ;;(message "Old command: %s" cmd) - (call-process semantic-symref-grep-shell nil b nil "-c" cmd) + (call-process semantic-symref-grep-shell nil b nil + shell-command-switch cmd) ) (let ((cmd (semantic-symref-grep-use-template rootdir filepattern grepflags greppat))) - (call-process semantic-symref-grep-shell nil b nil "-c" cmd)) + (call-process semantic-symref-grep-shell nil b nil + shell-command-switch cmd)) )) (setq ans (semantic-symref-parse-tool-output tool b)) ;; Return the answer