From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/83926 Path: news.gmane.org!not-for-mail From: Alexander Baier Newsgroups: gmane.emacs.gnus.general Subject: nnir notmuch backend and the string-match function Date: Wed, 27 Nov 2013 21:26:27 +0100 Message-ID: <87fvqh4mmk.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1385584069 6375 80.91.229.3 (27 Nov 2013 20:27:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 27 Nov 2013 20:27:49 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M32181@lists.math.uh.edu Wed Nov 27 21:27:53 2013 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VlliC-0001YG-2Q for ding-account@gmane.org; Wed, 27 Nov 2013 21:27:52 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1VllhI-0006hj-2E; Wed, 27 Nov 2013 14:26:56 -0600 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1VllhG-0006hT-8U for ding@lists.math.uh.edu; Wed, 27 Nov 2013 14:26:54 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtps (TLSv1:AES128-SHA:128) (Exim 4.76) (envelope-from ) id 1VllhE-0001Ap-Uc for ding@lists.math.uh.edu; Wed, 27 Nov 2013 14:26:53 -0600 Original-Received: from mail-ea0-f174.google.com ([209.85.215.174]) by quimby.gnus.org with esmtp (Exim 4.80) (envelope-from ) id 1VllhD-00071t-5i for ding@gnus.org; Wed, 27 Nov 2013 21:26:51 +0100 Original-Received: by mail-ea0-f174.google.com with SMTP id b10so5051157eae.33 for ; Wed, 27 Nov 2013 12:26:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:mail-followup-to:date:message-id:user-agent :mime-version:content-type; bh=4CVRMx7I62qHIYg4poGRsUY5WMN6aIJ33Ii8YcfDq5I=; b=uVQH2EEr+Ctsp+irHZgLLrIMaCn1RK4Ldwnt9Jthju9BAu5suhsthv24zxqJa7RKHI W1O/VDSxlVvUqIKBB5uJkyS7yA9LyBz3a5rsf7EMsClFIhhF1+wo3iGNizPGlblQZ5y6 mGj2LKmRXOHvNsfEm/d4rLmiOU2SsAPxEJA8h8kjrQp+8P34sVPsfcR/cRsRTBWDcUNf ReM3cQunDQmIaRTHm2HH07K/exhBGbpTzVaXgV2+1LcJwwqHhBD2enwrFkY3uJy2kiw8 8VMUj4ZIj+fKRLjadbhkQvPUNCHBk4RwuijEwQuzza/5J3Yj2ZYQleLVL2rGXR5D+u3d i+oA== X-Received: by 10.15.75.68 with SMTP id k44mr3084431eey.57.1385584005747; Wed, 27 Nov 2013 12:26:45 -0800 (PST) Original-Received: from T420s (nat-wh-wh36.rz.uni-karlsruhe.de. [141.70.81.154]) by mx.google.com with ESMTPSA id 1sm22952815eeg.4.2013.11.27.12.26.44 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Nov 2013 12:26:45 -0800 (PST) Mail-Followup-To: ding@gnus.org User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3 (gnu/linux) X-Spam-Score: -3.0 (---) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:83926 Archived-At: Hello, I am currently trying to set up maildir search while using notmuch as a nnir backend. So far, however, this has not been very successful. Issuing a search using "G G" on a nnmaildir group presents me with the following error message: "Unknown header type nil while requesting articles of group nnmaildir+gmail:gmail.Inbox" So I started digging around in nnir.el and came across a very strange bug I can't explain. In the function `nnir-compose-result' there is the following expression: #+begin_src emacs-lisp (when (string-match (concat "^" prefix) dirnam) (setq dirnam (replace-match "" t t dirnam))) #+end_src I stepped through this code with edebug and was very confused: The value of dirnam is "/home/delexi/Mail/gmail/Inbox/cur/" and the value of prefix is "/home/delexi/Mail/". To my surprise `string-match' did not match anything! This of course leads to errors in the code following this snippet. I tried this snippet in my scratch buffer and everything worked fine (it matched the prefix correctly). How is this possible? Is there something about string-match I am missing? How is it possible, that this does not match anything? #+begin_src emacs-lisp (string-match "^/home/delexi/Mail/" "/home/delexi/Mail/gmail/Inbox/cur/") #+end_src Thanks in advance, -- Alexander Baier