* bug#28113: 25.2; `ignore-errors' around `require'
@ 2017-08-16 20:11 Drew Adams
2017-08-16 21:59 ` Noam Postavsky
0 siblings, 1 reply; 3+ messages in thread
From: Drew Adams @ 2017-08-16 20:11 UTC (permalink / raw)
To: 28113
I'm guessing that there is not a bug here, as this seems to happen for
all Emacs versions I have. But it seems like it should be a bug. I
would like to understand it, in any case.
In crosshairs.el I require vline.el and hl-line+.el:
(require 'vline)
(require 'hl-line+)
In start.el I wrap requiring crosshairs.el with `ignore-errors'
(`condition-case', for compatibility with older releases):
(condition-case nil
(require 'crosshairs nil t)
(error nil))
If I remove vline.el from my load-path and then try to load
crosshairs.el then I get this error:
Debugger entered--Lisp error: (file-error "Cannot open load file" "No such file or directory" "vline")
require(vline)
byte-code("..." [require vline custom-declare-group column-highlight nil "..."] 20)
require(col-highlight)
byte-code("..." [require hl-line+ col-highlight custom-declare-group crosshairs nil "..." ...] 20)
require(crosshairs nil t)
Why is that? Shouldn't the `condition-case' cause the load error for
vline.el to be ignored, since it occurs as part of the loading of
crosshairs.el?
In GNU Emacs 25.2.1 (x86_64-w64-mingw32)
of 2017-04-24 built on LAPHROAIG
Windowing system distributor 'Microsoft Corp.', version 6.1.7601
Configured using:
'configure --without-dbus --without-compress-install 'CFLAGS=-O2
-static -g3''
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#28113: 25.2; `ignore-errors' around `require'
2017-08-16 20:11 bug#28113: 25.2; `ignore-errors' around `require' Drew Adams
@ 2017-08-16 21:59 ` Noam Postavsky
2017-08-16 22:39 ` Drew Adams
0 siblings, 1 reply; 3+ messages in thread
From: Noam Postavsky @ 2017-08-16 21:59 UTC (permalink / raw)
To: Drew Adams; +Cc: 28113
tags 28113 + unreproducible
quit
On Wed, Aug 16, 2017 at 4:11 PM, Drew Adams <drew.adams@oracle.com> wrote:
> I'm guessing that there is not a bug here, as this seems to happen for
> all Emacs versions I have.
Works for me. I tried
emacs -Q -f toggle-debug-on-error -l start.el
where start.el has
(condition-case err
(let ((load-path (cons default-directory load-path)))
(require 'load-some-nonexistent-files))
(error (message "caught error: %S" err)))
And load-some-nonexistent-files.el has
(require 'there-is-no-such-file)
(provide 'load-some-nonexistent-files)
I get
Debug on Error enabled globally
caught error: (file-error "Cannot open load file"
"no such file or directory"
"there-is-no-such-file")
in *Messages*.
Tested in 24.3 and 25.1.
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#28113: 25.2; `ignore-errors' around `require'
2017-08-16 21:59 ` Noam Postavsky
@ 2017-08-16 22:39 ` Drew Adams
0 siblings, 0 replies; 3+ messages in thread
From: Drew Adams @ 2017-08-16 22:39 UTC (permalink / raw)
To: Noam Postavsky; +Cc: 28113
> tags 28113 + unreproducible
> quit
>
> Works for me. I tried
> emacs -Q -f toggle-debug-on-error -l start.el
> where start.el has
> (condition-case err
> (let ((load-path (cons default-directory load-path)))
> (require 'load-some-nonexistent-files))
> (error (message "caught error: %S" err)))
> And load-some-nonexistent-files.el has
> (require 'there-is-no-such-file)
> (provide 'load-some-nonexistent-files)
>
> I get
> Debug on Error enabled globally
> caught error: (file-error "Cannot open load file"
> "no such file or directory"
> "there-is-no-such-file")
>
> in *Messages*.
> Tested in 24.3 and 25.1.
OK, I won't worry about it. It's actually more complicated, and I
don't have the time or worry to track it down more.
FYI - The files all exist and are in my load path, when I byte-compile
them. If I then start with emacs -Q and set the load-path so that it
can see all except vline.el (which is in a different dir) then the error
is raised.
I'm guessing that it is because of the files being compiled (no error
was raised when compiling because the load-path then was fuller, picking
up vline.el).
Also (perhaps relevant), the condition-case is itself not at top level
but is wrapped in a (when...) test for an emacs-major-version minimum.
Anyway, thanks for taking a look.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-08-16 22:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-16 20:11 bug#28113: 25.2; `ignore-errors' around `require' Drew Adams
2017-08-16 21:59 ` Noam Postavsky
2017-08-16 22:39 ` Drew Adams
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).