From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan Schmitt Subject: Re: navi-search-and-switch fails Date: Mon, 01 Sep 2014 18:50:02 +0200 Message-ID: References: <87ha0svf2o.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47511) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOUoK-0003sQ-Ep for emacs-orgmode@gnu.org; Mon, 01 Sep 2014 12:50:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XOUoE-0000Ry-AT for emacs-orgmode@gnu.org; Mon, 01 Sep 2014 12:50:32 -0400 Received: from mx1.polytechnique.org ([129.104.30.34]:55303) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOUoD-0000Ro-Sc for emacs-orgmode@gnu.org; Mon, 01 Sep 2014 12:50:26 -0400 In-Reply-To: <87ha0svf2o.fsf@gmail.com> (Thorsten Jolitz's message of "Sun, 31 Aug 2014 17:44:47 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Thorsten Jolitz Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On 2014-08-31 17:44, Thorsten Jolitz writes: > Alan Schmitt writes: > >> (Thorsten asked me to repost this from github.) >> >> When calling navi-search-and-switch interactively, I get the following >> backtrace: > > But when 'navi-search-and-switch' would have a bug, one could not use > navi-mode at all ... and I use it all the time. Yes, I imagine the problem comes from an interaction with something else, but the code below does not seem to deal with the case where there is no occur buffer. >> Debugger entered--Lisp error: (wrong-type-argument stringp nil) >> navi-rename-buffer() >> navi-search-and-switch() >> call-interactively(navi-search-and-switch record nil) >> command-execute(navi-search-and-switch record) >> >> The problem seems to be with this code in navi-rename-buffer >> >> #+begin_src emacs-lisp >> (with-current-buffer >> (if (eq major-mode 'occur-mode) (current-buffer) (get-buffer "*Occur= *")) >> #+end_src >> >> >> As there is no "*Occur*" buffer, and the current buffer is in >> emacs-lisp-mode, =3D(if (eq major-mode 'occur-mode) (current-buffer) >> (get-buffer "*Occur*"))=3D returns nil and with-current-buffer fails. > 1. Can you try 'navi-search-and-switch' on an org-mode buffer, with -> > (eq major-mode 'org-mode), e.g. > > ,---- > | * ORG SCRATCH > | ** 2nd Level > | #+BEGIN_SRC emacs-lisp :cache no > | (+ 2 2) > | #+END_SRC > `---- > > *Navi* buffer should pop-up, typing 2 should show both headlines. Yes, it works with an org file. > 2. Is there anything special about the outshine file you used? It's an emacs-lisp file. > Is it structured with outshine headers? is it emacs-lisp-mode? > old-school or org-style headers? Here is a simple example that fails for me: ;; * ORG SCRATCH ;; ** 2nd Level (+ 2 2) Alan =2D-=20 OpenPGP Key ID : 040D0A3B4ED2E5C7 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iQEcBAEBCgAGBQJUBKPNAAoJEAQNCjtO0uXHWjsH+QEPTwT9TQK64SYvBp2Fqg1U wDHrbVVe7QIyLq91VhUW806bckgOHd7hEqQ/nv3rFyzxjd/Rm5NcIymj5jZNLPbg hO7vzIdWnhZZhCTziu/2Qt44u4Pa1v6Q+Lyn2d5zWAfhTwqt2R9VfFgp53UXXX+M VsiJnAhLdHu3Nwaj9s1wmObyTbzS9wcxzNclKSVhPeGhd7TXlgg2TgH5093bG1wJ LStNImuLuDPXd9lgaLES2FcUIIPB4JM9oKfCF/LrzvPHlP9jyOdDVdPc64YdQMVa h2wi8KTy2DgT7nN/4punTsA6QyaFDJuVvsgVfhMKfSyCTAjje4mfcLbdTvqzc7Y= =HAxu -----END PGP SIGNATURE----- --=-=-=--