unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Sven Joachim <svenjoac@gmx.de>
To: emacs-devel@gnu.org
Cc: 469486-forwarded@bugs.debian.org,
	Goedson Teixeira Paixao <goedson@debian.org>
Subject: Re: Bug#469486: emacs22-common: partial-complete adds ".h" to filename without trying the plain input first
Date: Wed, 05 Mar 2008 18:10:40 +0100	[thread overview]
Message-ID: <87ejap9jvz.fsf@gmx.de> (raw)
In-Reply-To: <1204726142.22737.10.camel@framps> (Goedson Teixeira Paixao's message of "Wed, 05 Mar 2008 11:09:02 -0300")

I received the following report via the Debian bug tracking system.
The patch needs to be reindented, but seems to be correct, AFAICS.


On 2008-03-05 15:09 +0100, Goedson Teixeira Paixao wrote:

> Package: emacs22-common
> Version: 22.1+1-2.3
> Severity: normal
>
>
> When using partial-complete-mode, trying to find a file, and providing
> "<list>" as the filename should make emacs look for files named "list"
> in the directories listed in PC-include-file-path but, instead of doing
> that, emacs will look for files named "list.h". This happens because the
> function PC-look-for-include-file will add an extra ".h" without even
> trying to find the file first.
>
> Steps to reproduce the bug:
>
> 1 - enable partial-complete-mode
> 2 - Add a directory containing a file without an extension in its name
> to the list PC-include-file-path. (add-to-list 'PC-include-file-path
> "/usr/include/c++/4.2") is enough if you have libstdc++6-4.2-dev
> installed.
> 3 - Invoke find-file (C-x C-f) and type "<list>" as the name of file
> to find.
> 4 - emacs will complain there is no header named "list.h" when it
> should have loaded "/usr/include/c++/4.2/list"
>
> Attached is a patch that will make it try to find the plain filename
> or filename+".h" in each directory listed in PC-include-file-path and
> load the first file found.
>
>
> -- System Information:
> Debian Release: lenny/sid
>   APT prefers unstable
>   APT policy: (500, 'unstable'), (1, 'experimental')
> Architecture: i386 (i686)
>
> Kernel: Linux 2.6.24-1-686 (SMP w/1 CPU core)
> Locale: LANG=pt_BR.UTF-8, LC_CTYPE=pt_BR.UTF-8 (charmap=UTF-8) (ignored:
> LC_ALL set to pt_BR.UTF-8)
> Shell: /bin/sh linked to /bin/bash
>
> Versions of packages emacs22-common depends on:
> ii  dpkg                          1.14.16.6  package maintenance system
> for Deb
> ii  emacsen-common                1.4.17     Common facilities for all
> emacsen
>
> emacs22-common recommends no packages.
>
> -- no debconf information
>
> -- 
> Goedson Teixeira Paixao          http://mundolivre.wordpress.com/
> Debian Project                   http://www.debian.org/
> Jabber ID: goedson@jabber.org    http://www.jabber.org/
>
>
> diff -ur emacs22-22.1+1/lisp/complete.el emacs22-22.1+1.new/lisp/complete.el
> --- emacs22-22.1+1/lisp/complete.el	2007-04-15 11:51:28.000000000 -0300
> +++ emacs22-22.1+1.new/lisp/complete.el	2008-03-04 12:50:49.000000000 -0300
> @@ -1020,23 +1020,27 @@
>  			  (or (string-match "\\.el$" name)
>  			      (setq name (concat name ".el")))))
>  		    (error "Not on an #include line"))))))
> -	(or (string-match "\\.[[:alnum:]]+$" name)
> -	    (setq name (concat name ".h")))
>  	(if (eq punc ?\<)
>  	    (let ((path (or path (PC-include-file-path))))
>  	      (while (and path
> -			  (not (file-exists-p
> -				(concat (file-name-as-directory (car path))
> -					name))))
> -		(setq path (cdr path)))
> +					  (not (or (file-exists-p
> +								(concat (file-name-as-directory (car path))
> +										name))
> +							   (file-exists-p
> +								(concat (file-name-as-directory (car path))
> +										name ".h")))))
> +			(setq path (cdr path)))
>  	      (if path
> -		  (setq name (concat (file-name-as-directory (car path)) name))
> -		(error "No such include file: <%s>" name)))
> +			  (if (file-exists-p
> +				   (concat (file-name-as-directory (car path)) name))
> +				  (setq name (concat (file-name-as-directory (car path)) name))
> +				  (setq name (concat (file-name-as-directory (car path)) name ".h")))
> +		  (error "No such include file: <%s>" name)))
>  	  (let ((dir (with-current-buffer (car (buffer-list))
>  		       default-directory)))
> -	    (if (file-exists-p (concat dir name))
> -		(setq name (concat dir name))
> -	      (error "No such include file: `%s'" name))))
> +		(if (file-exists-p (concat dir name))
> +			(setq name (concat dir name))
> +		  (error "No such include file: `%s'" name))))
>  	(setq new-buf (get-file-buffer name))
>  	(if new-buf
>  	    ;; no need to verify last-modified time for this!




       reply	other threads:[~2008-03-05 17:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1204726142.22737.10.camel@framps>
2008-03-05 17:10 ` Sven Joachim [this message]
2008-03-05 17:35   ` Bug#469486: emacs22-common: partial-complete adds ".h" to filename without trying the plain input first Chong Yidong
2008-03-05 18:36     ` Goedson Teixeira Paixao

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=87ejap9jvz.fsf@gmx.de \
    --to=svenjoac@gmx.de \
    --cc=469486-forwarded@bugs.debian.org \
    --cc=emacs-devel@gnu.org \
    --cc=goedson@debian.org \
    /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).