| Re: Problem with second-sel.el |
|
 |
|
 |
|
 |
|
 |
Group: gnu.emacs.help · Group Profile
Author: NordlöwNordlöw Date: Aug 20, 2008 03:27
On 19 Aug, 17:45, "Drew Adams" oracle.com> wrote:
>> I am trying to trace an annoying bug regarding secondary selection.
>> The problem occurs on a number of places in my settings if I have
>> second-sel.el in my load path otherwise it does not.
>
>> For example the following happens when nxhtml is loaded:
>
>> Debugger entered--Lisp error: (error "No `SECONDARY' selection")
>> Â x-get-selection-internal(SECONDARY STRING)
>> Â x-get-selection(SECONDARY)
>> Â (and (fboundp (quote x-get-selection)) (x-get-selection (quote
>> SECONDARY)) (not buffer-read-only))
>> Â message("Loading %%s (source)...done"
>> "/home/per/pnw/emacs/nxhtml/etc/
>> schema/schema-path-patch.el")
>> Â load-with-code-conversion("/home/per/pnw/emacs/nxhtml/etc/schema/
>> schema-path-patch.el" "/home/per/pnw/emacs/nxhtml/etc/schema/schema-
>> path-patch.el" nil nil)
>> Â load("/home/per/pnw/emacs/nxhtml/etc/schema/schema-path-patch.el"
>> nil nil t)
>> Â load-file("/home/per/pnw/emacs/nxhtml/etc/schema/schema-path-
>> patch.el")
>
>> Because of this I have deactivated second-sel.el for now; Am I missing
>> out on something, Drew Adams?
>
> Hi Per,
>
> We can take this off list to try to debug your problem.
>
> This code: (and (fboundp (quote x-get-selection)) (x-get-selection (quote> SECONDARY)) (not buffer-read-only)) is not from second-sel.el. It is no doubt
>
> from menu-bar+.el:
>
> (when (fboundp 'yank-secondary)
> Â (define-key-after menu-bar-edit-menu [yank-secondary] ; In `second-sel.el'
> Â Â '(menu-item "Paste Secondary" yank-secondary
> Â Â Â :help "Paste secondary selection."
> Â Â Â :enable
> Â Â Â (and (fboundp 'x-get-selection) (x-get-selection 'SECONDARY)
> Â Â Â Â Â Â (not buffer-read-only))
> Â Â Â :keys "\\[yank-secondary-or-swap-w-region]")
> Â Â 'paste))
>
> Library second-sel.el has similar, but not identical error message: "No
> secondary selection" (notice the lowercase and lack of quotes). This message
> appears when you try to use the secondary selection but there is none.
>
> My guess is this:
>
> 1. The :enable code is run when the menu-bar is created.
>
> 2. (fboundp 'x-get-selection) succeeds on your platform.
>
> 3. (x-get-selection on your platform raises an error if there is no secondary
> selection. It should not, I believe - it should return nil. On Windows, at
> least, it returns nil.
>
> 4. This occurs only when second-sel.el is loaded, because of the (fboundp
> 'yank-secondary) test at the beginning of the :enable sexp.
>
> Try just evaluating M-: (x-get-selection 'SECONDARY) in Emacs -Q (with no
> secondary). Does it raise an error or return nil? If the former, then I'd
> suggest that you file an Emacs bug.
>
> Experiment a bit more and contact me off list, and we'll see what we can do. If
> you just want a workaround for now, just remove the :enable sexp from
> menu-bar+.el.
You are right! Evaluating the expression
(x-get-selection 'SECONDARY)
does raise an error in emacs -Q on my Ubuntu Linux (using my daily
emacs CVS-build)! I agree that this is strange.
How do I file an emacs bug?
Thanks again Drew,
Nordlöw
|