unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: "Lennart Borgman (gmail)" <lennart.borgman@gmail.com>
Cc: emacs-pretest-bug@gnu.org
Subject: Re: 23.0.50; find-library scan-error "Unbalanced parenthesis"
Date: Thu, 24 Jan 2008 08:59:42 +0100	[thread overview]
Message-ID: <4798456E.9080607@gmx.at> (raw)
In-Reply-To: <4797D6C5.70807@gmail.com>

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

 > Here is a simple bug - I believe. I get the error
 >
 >   error: (scan-error "Unbalanced parentheses" 344 1)
 >
 > from find-libary
 >
 > To reproduce do
 >
 >   emacs -Q
 >
 > Paste these lines in the scratch buffer
 >
 > ;;(add-to-list 'load-path "c:/DL/emacs/org-5.13h/org-5.13h/")
 > ;;(require 'org-install)
 >
 > Place cursor at beginning of second line and do
 >
 >   M-x find-library RET

The bug occurs (also) because `function-called-at-point' is a misnomer.
`find-tag-default' is allowed to return a symbol somewhere on the
current line.  `find-library' assumes that the "require" is right there
at point and tries to get out of a non-existent list.

You can reproduce a similar bug by putting point on the "require" in the
top-level string below when invoking `find-library':

"require 'org-install"

Hence there is a bug with `find-library' itself.  Let's wrap this in a
simple `condition-case'.

[-- Attachment #2: find-func.patch --]
[-- Type: text/plain, Size: 1013 bytes --]

*** find-func.el.~1.83.~	Wed Oct 31 13:39:44 2007
--- find-func.el	Thu Jan 24 08:51:58 2008
***************
*** 195,205 ****
     (let* ((path (cons (or find-function-source-path load-path)
  		      (find-library-suffixes)))
  	  (def (if (eq (function-called-at-point) 'require)
! 		   (save-excursion
! 		     (backward-up-list)
! 		     (forward-char)
! 		     (backward-sexp -2)
! 		     (thing-at-point 'symbol))
  		 (thing-at-point 'symbol))))
       (when def
         (setq def (and (locate-file-completion def path 'test) def)))
--- 195,207 ----
     (let* ((path (cons (or find-function-source-path load-path)
  		      (find-library-suffixes)))
  	  (def (if (eq (function-called-at-point) 'require)
! 		   (condition-case nil
! 		       (save-excursion
! 			 (backward-up-list)
! 			 (forward-char)
! 			 (backward-sexp -2)
! 			 (thing-at-point 'symbol))
! 		     (error nil))
  		 (thing-at-point 'symbol))))
       (when def
         (setq def (and (locate-file-completion def path 'test) def)))

[-- Attachment #3: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

      reply	other threads:[~2008-01-24  7:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-24  0:07 23.0.50; find-library scan-error "Unbalanced parenthesis" Lennart Borgman (gmail)
2008-01-24  7:59 ` martin rudalics [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4798456E.9080607@gmx.at \
    --to=rudalics@gmx.at \
    --cc=emacs-pretest-bug@gnu.org \
    --cc=lennart.borgman@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).