emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug#469486: emacs22-common: partial-complete adds ".h" to filename w


From: Sven Joachim
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
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1.91 (gnu/linux)

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: address@hidden    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 via email to

[Prev in Thread] Current Thread [Next in Thread]