unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* CEDET non-regression bug fixes
@ 2012-11-13 20:52 David Engster
  2012-11-14  1:17 ` Stefan Monnier
  0 siblings, 1 reply; 6+ messages in thread
From: David Engster @ 2012-11-13 20:52 UTC (permalink / raw)
  To: emacs-devel

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

I'm asking for permission to apply the following CEDET non-regression
bug fixes to the emacs-24 branch. They fix some pretty annoying bugs but
are so small that I think they should be safe to commit.

- Patch1: Fixes a bug where C++ system headers like "vector"
  are not recognized as C++ and hence parsing fails. The bug was that
  `enable-local-variables' was erronously set to 'nil' when loading
  those files, but it should be ':safe', so that the magic comments are
  recognized.

- Patch2: Without this fix, the interactive function
  `semantic-symref-symbol' simply does not work at all, so it cannot
  possibly make anything worse.

- Patch3: Move to beginning of completions when pressing TAB at the end
  of the Completions buffer.

- Patch4: Fixes a very annoying, long-standing bug were active buffers
  were killed when using GNU global and file was loaded through a
  symlink.

-David


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch1.patch --]
[-- Type: text/x-patch, Size: 660 bytes --]

=== modified file 'lisp/cedet/semantic/fw.el'
--- lisp/cedet/semantic/fw.el	2012-10-07 12:07:12 +0000
+++ lisp/cedet/semantic/fw.el	2012-10-27 19:55:04 +0000
@@ -421,14 +421,7 @@
 	 ;; Don't prompt to insert a template if we visit an empty file
 	 (auto-insert nil)
 	 ;; We don't want emacs to query about unsafe local variables
-	 (enable-local-variables
-	  (if (featurep 'xemacs)
-	      ;; XEmacs only has nil as an option?
-	      nil
-	    ;; Emacs 23 has the spiffy :safe option, nil otherwise.
-	    (if (>= emacs-major-version 22)
-		nil
-	      :safe)))
+	 (enable-local-variables :safe)
 	 ;; ... or eval variables
 	 (enable-local-eval nil)
 	 )


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: patch2.patch --]
[-- Type: text/x-patch, Size: 575 bytes --]

=== modified file 'lisp/cedet/semantic/symref/list.el'
--- lisp/cedet/semantic/symref/list.el	2012-09-02 18:37:45 +0000
+++ lisp/cedet/semantic/symref/list.el	2012-11-04 21:03:27 +0000
@@ -69,7 +69,7 @@
 references are organized by file and the name of the function
 they are used in.
 Display the references in `semantic-symref-results-mode'."
-  (interactive (list (semantic-tag-name (semantic-complete-read-tag-buffer-deep
+  (interactive (list (semantic-tag-name (semantic-complete-read-tag-project
 					 "Symrefs for: "))))
   (semantic-fetch-tags)
   (let ((res nil)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: patch3.patch --]
[-- Type: text/x-patch, Size: 668 bytes --]

=== modified file 'lisp/cedet/semantic/complete.el'
--- lisp/cedet/semantic/complete.el	2012-10-12 19:56:34 +0000
+++ lisp/cedet/semantic/complete.el	2012-11-04 21:06:33 +0000
@@ -1340,7 +1343,10 @@
 
 (defmethod semantic-displayor-scroll-request ((obj semantic-displayor-abstract))
   "A request to for the displayor to scroll the completion list (if needed)."
-  (scroll-other-window))
+  (with-selected-window (get-buffer-window "*Completions*")
+    (if (posn-at-point (point-max))
+	(goto-char (point-min))
+      (scroll-up))))
 
 (defmethod semantic-displayor-focus-previous ((obj semantic-displayor-abstract))
   "Set the current focus to the previous item."


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #5: patch4.patch --]
[-- Type: text/x-patch, Size: 377 bytes --]

=== modified file 'lisp/cedet/semantic/symref.el'
--- lisp/cedet/semantic/symref.el	2012-09-02 16:59:23 +0000
+++ lisp/cedet/semantic/symref.el	2012-11-06 16:35:07 +0000
@@ -356,7 +356,7 @@
 	  (lambda (hit)
 	    (let* ((line (car hit))
 		   (file (cdr hit))
-		   (buff (get-file-buffer file))
+		   (buff (find-buffer-visiting file))
 		   (tag nil)
 		   )
 	      (cond


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: CEDET non-regression bug fixes
  2012-11-13 20:52 CEDET non-regression bug fixes David Engster
@ 2012-11-14  1:17 ` Stefan Monnier
  2012-11-14 18:56   ` David Engster
  0 siblings, 1 reply; 6+ messages in thread
From: Stefan Monnier @ 2012-11-14  1:17 UTC (permalink / raw)
  To: emacs-devel

> --- lisp/cedet/semantic/fw.el	2012-10-07 12:07:12 +0000
> +++ lisp/cedet/semantic/fw.el	2012-10-27 19:55:04 +0000
> @@ -421,14 +421,7 @@
>  	 ;; Don't prompt to insert a template if we visit an empty file
>  	 (auto-insert nil)
>  	 ;; We don't want emacs to query about unsafe local variables
> -	 (enable-local-variables
> -	  (if (featurep 'xemacs)
> -	      ;; XEmacs only has nil as an option?
> -	      nil
> -	    ;; Emacs 23 has the spiffy :safe option, nil otherwise.
> -	    (if (>= emacs-major-version 22)
> -		nil
> -	      :safe)))
> +	 (enable-local-variables :safe)
>  	 ;; ... or eval variables
>  	 (enable-local-eval nil)
>  	 )

Fine.

> === modified file 'lisp/cedet/semantic/symref/list.el'
> --- lisp/cedet/semantic/symref/list.el	2012-09-02 18:37:45 +0000
> +++ lisp/cedet/semantic/symref/list.el	2012-11-04 21:03:27 +0000
> @@ -69,7 +69,7 @@
>  references are organized by file and the name of the function
>  they are used in.
>  Display the references in `semantic-symref-results-mode'."
> -  (interactive (list (semantic-tag-name (semantic-complete-read-tag-buffer-deep
> +  (interactive (list (semantic-tag-name (semantic-complete-read-tag-project
>  					 "Symrefs for: "))))
>    (semantic-fetch-tags)
>    (let ((res nil)

From what you say, it's OK.

> === modified file 'lisp/cedet/semantic/complete.el'
> --- lisp/cedet/semantic/complete.el	2012-10-12 19:56:34 +0000
> +++ lisp/cedet/semantic/complete.el	2012-11-04 21:06:33 +0000
> @@ -1340,7 +1343,10 @@
 
>  (defmethod semantic-displayor-scroll-request ((obj semantic-displayor-abstract))
>    "A request to for the displayor to scroll the completion list (if needed)."
> -  (scroll-other-window))
> +  (with-selected-window (get-buffer-window "*Completions*")
> +    (if (posn-at-point (point-max))
> +	(goto-char (point-min))
> +      (scroll-up))))

This will signal an error when *Completions* is not displayed anywhere.

> -		   (buff (get-file-buffer file))
> +		   (buff (find-buffer-visiting file))

We need to do something to avoid those problems.  AFAIK there's no
reason to ever prefer get-file-buffer over find-buffer-visiting, so
maybe we should simply get rid of get-file-buffer and make it an alias
of find-buffer-visiting.


        Stefan



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: CEDET non-regression bug fixes
  2012-11-14  1:17 ` Stefan Monnier
@ 2012-11-14 18:56   ` David Engster
  2012-11-14 21:16     ` Stefan Monnier
  0 siblings, 1 reply; 6+ messages in thread
From: David Engster @ 2012-11-14 18:56 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

Stefan Monnier writes:
>> === modified file 'lisp/cedet/semantic/complete.el'
>> --- lisp/cedet/semantic/complete.el	2012-10-12 19:56:34 +0000
>> +++ lisp/cedet/semantic/complete.el	2012-11-04 21:06:33 +0000
>> @@ -1340,7 +1343,10 @@
>  
>>  (defmethod semantic-displayor-scroll-request ((obj semantic-displayor-abstract))
>>    "A request to for the displayor to scroll the completion list (if needed)."
>> -  (scroll-other-window))
>> +  (with-selected-window (get-buffer-window "*Completions*")
>> +    (if (posn-at-point (point-max))
>> +	(goto-char (point-min))
>> +      (scroll-up))))
>
> This will signal an error when *Completions* is not displayed anywhere.

At this stage, there must be a *Completions* buffer, otherwise it's an
error anyway. But regarding the freeze, I will wrap something around
that making sure it exists.

>> -		   (buff (get-file-buffer file))
>> +		   (buff (find-buffer-visiting file))
>
> We need to do something to avoid those problems.  AFAIK there's no
> reason to ever prefer get-file-buffer over find-buffer-visiting, so
> maybe we should simply get rid of get-file-buffer and make it an alias
> of find-buffer-visiting.

Oh, you have my vote for that. But I have a hunch you won't put this
change into the emacs-24 branch, so I read this comment as "Fine, please
commit". ;-)

-David



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: CEDET non-regression bug fixes
  2012-11-14 18:56   ` David Engster
@ 2012-11-14 21:16     ` Stefan Monnier
  2012-11-15 19:51       ` David Engster
  0 siblings, 1 reply; 6+ messages in thread
From: Stefan Monnier @ 2012-11-14 21:16 UTC (permalink / raw)
  To: emacs-devel

>>> +  (with-selected-window (get-buffer-window "*Completions*")
>>> +    (if (posn-at-point (point-max))
>>> +	(goto-char (point-min))
>>> +      (scroll-up))))
>> This will signal an error when *Completions* is not displayed anywhere.

Actually, it's worse: it will signal an error when *Completions* is not
displayed in the selected frame.  IOW in my config it will always signal
an error.

> At this stage, there must be a *Completions* buffer, otherwise it's an
> error anyway. But regarding the freeze, I will wrap something around
> that making sure it exists.

I'd rather keep this for trunk:
- it's not safe.
- It's not a regression.
- It's not even a bug fix: it improves behavior more than it fixes a bug.

>>> -		   (buff (get-file-buffer file))
>>> +		   (buff (find-buffer-visiting file))
>> We need to do something to avoid those problems.  AFAIK there's no
>> reason to ever prefer get-file-buffer over find-buffer-visiting, so
>> maybe we should simply get rid of get-file-buffer and make it an alias
>> of find-buffer-visiting.
> Oh, you have my vote for that.

Great!  How much (time and effort) are you willing to contribute to
my campaign?

> But I have a hunch you won't put this change into the emacs-24 branch,

Huh?  How did you guess?

> so I read this comment as "Fine, please commit". ;-)

Indeed,


        Stefan



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: CEDET non-regression bug fixes
  2012-11-14 21:16     ` Stefan Monnier
@ 2012-11-15 19:51       ` David Engster
  2012-11-16 13:57         ` Stefan Monnier
  0 siblings, 1 reply; 6+ messages in thread
From: David Engster @ 2012-11-15 19:51 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

Stefan Monnier writes:
>> At this stage, there must be a *Completions* buffer, otherwise it's an
>> error anyway. But regarding the freeze, I will wrap something around
>> that making sure it exists.
>
> I'd rather keep this for trunk:
> - it's not safe.
> - It's not a regression.
> - It's not even a bug fix: it improves behavior more than it fixes a bug.

OK.

>>> We need to do something to avoid those problems.  AFAIK there's no
>>> reason to ever prefer get-file-buffer over find-buffer-visiting, so
>>> maybe we should simply get rid of get-file-buffer and make it an alias
>>> of find-buffer-visiting.
>> Oh, you have my vote for that.
>
> Great!  How much (time and effort) are you willing to contribute to
> my campaign?

Can't I just give you money?

Anyway, do you plan on actually replacing all `get-file-buffer's? That
would have to wait for the release anyway, I guess.

-David



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: CEDET non-regression bug fixes
  2012-11-15 19:51       ` David Engster
@ 2012-11-16 13:57         ` Stefan Monnier
  0 siblings, 0 replies; 6+ messages in thread
From: Stefan Monnier @ 2012-11-16 13:57 UTC (permalink / raw)
  To: emacs-devel

>>>> We need to do something to avoid those problems.  AFAIK there's no
>>>> reason to ever prefer get-file-buffer over find-buffer-visiting, so
>>>> maybe we should simply get rid of get-file-buffer and make it an alias
>>>> of find-buffer-visiting.
>>> Oh, you have my vote for that.
>> Great!  How much (time and effort) are you willing to contribute to
>> my campaign?
> Can't I just give you money?

If you want to give me money additionally to time and effort, that's
fine, yes.

> Anyway, do you plan on actually replacing all `get-file-buffer's?

"Plan" is a big word here.  But if someone could take care of making
get-file-buffer an alias of find-buffer-visiting (and checking that it
doesn't introduce any obvious problem), that would be appreciated.


        Stefan



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-11-16 13:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-13 20:52 CEDET non-regression bug fixes David Engster
2012-11-14  1:17 ` Stefan Monnier
2012-11-14 18:56   ` David Engster
2012-11-14 21:16     ` Stefan Monnier
2012-11-15 19:51       ` David Engster
2012-11-16 13:57         ` Stefan Monnier

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).