unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#28503: 25.3; buffer-file-name returns nil in eww-pdfs
@ 2017-09-18 19:21 Alex Branham
  2017-09-19  0:40 ` Glenn Morris
  2018-04-12 23:17 ` Lars Ingebrigtsen
  0 siblings, 2 replies; 4+ messages in thread
From: Alex Branham @ 2017-09-18 19:21 UTC (permalink / raw)
  To: 28503

From emacs -Q:

M-x eww
(navigate to a pdf, I found this by searching "pdf test page"): http://www.orimi.com/pdf-test.pdf

then eval (buffer-file-name)

For me, it returns nil even though the pdf is a file on my computer (somewhere in /tmp for me).

It would be nice if this returned the actual path; I am trying to write a different function that will copy the pdf file elsewhere on my computer.

Thanks!


In GNU Emacs 25.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.22.19)
 of 2017-09-16 built on juergen
Windowing system distributor 'The X.Org Foundation', version 11.0.11903000
Configured using:
 'configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib
 --localstatedir=/var --with-x-toolkit=gtk3 --with-xft --with-modules
 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong
 -fno-plt' CPPFLAGS=-D_FORTIFY_SOURCE=2
 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS
NOTIFY ACL GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 MODULES

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: eww






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

* bug#28503: 25.3; buffer-file-name returns nil in eww-pdfs
  2017-09-18 19:21 bug#28503: 25.3; buffer-file-name returns nil in eww-pdfs Alex Branham
@ 2017-09-19  0:40 ` Glenn Morris
  2017-09-19  1:33   ` Alex Branham
  2018-04-12 23:17 ` Lars Ingebrigtsen
  1 sibling, 1 reply; 4+ messages in thread
From: Glenn Morris @ 2017-09-19  0:40 UTC (permalink / raw)
  To: Alex Branham; +Cc: 28503

Alex Branham wrote:

> M-x eww
> (navigate to a pdf, I found this by searching "pdf test page"): http://www.orimi.com/pdf-test.pdf
>
> then eval (buffer-file-name)
>
> For me, it returns nil even though the pdf is a file on my computer (somewhere in /tmp for me).

For me, the pdf is displayed using Emacs's Doc View mode.
This converts the pdf to a png and displays the png.
So you aren't viewing the actual pdf file, you can't edit it, etc.
So I don't think it would make sense to set buffer-file-name as if you were.
(There is doc-view--buffer-file-name, an internal variable.)





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

* bug#28503: 25.3; buffer-file-name returns nil in eww-pdfs
  2017-09-19  0:40 ` Glenn Morris
@ 2017-09-19  1:33   ` Alex Branham
  0 siblings, 0 replies; 4+ messages in thread
From: Alex Branham @ 2017-09-19  1:33 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 28503

But in a "normal" doc-view (ie one that's just visiting a file in your home dir), doc-view--buffer-file-name will return the file name even though the buffer is displaying the png, right? From the docstring:

The file name used for conversion.  Normally it’s the same as
‘buffer-file-name’...


On Tue 19 Sep 2017 at 00:40, Glenn Morris <rgm@gnu.org> wrote:

> Alex Branham wrote:
>
>> M-x eww
>> (navigate to a pdf, I found this by searching "pdf test page"): http://www.orimi.com/pdf-test.pdf
>>
>> then eval (buffer-file-name)
>>
>> For me, it returns nil even though the pdf is a file on my computer (somewhere in /tmp for me).
>
> For me, the pdf is displayed using Emacs's Doc View mode.
> This converts the pdf to a png and displays the png.
> So you aren't viewing the actual pdf file, you can't edit it, etc.
> So I don't think it would make sense to set buffer-file-name as if you were.
> (There is doc-view--buffer-file-name, an internal variable.)






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

* bug#28503: 25.3; buffer-file-name returns nil in eww-pdfs
  2017-09-18 19:21 bug#28503: 25.3; buffer-file-name returns nil in eww-pdfs Alex Branham
  2017-09-19  0:40 ` Glenn Morris
@ 2018-04-12 23:17 ` Lars Ingebrigtsen
  1 sibling, 0 replies; 4+ messages in thread
From: Lars Ingebrigtsen @ 2018-04-12 23:17 UTC (permalink / raw)
  To: Alex Branham; +Cc: 28503

Alex Branham <alex.branham@gmail.com> writes:

> M-x eww
> (navigate to a pdf, I found this by searching "pdf test page"): http://www.orimi.com/pdf-test.pdf
>
> then eval (buffer-file-name)
>
> For me, it returns nil even though the pdf is a file on my computer (somewhere in /tmp for me).

I don't think that's the right thing to do.  It's an eww buffer, not a
buffer tied to the file in question (even if it's showing a rendering of
the file).

So I'm closing this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

end of thread, other threads:[~2018-04-12 23:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-18 19:21 bug#28503: 25.3; buffer-file-name returns nil in eww-pdfs Alex Branham
2017-09-19  0:40 ` Glenn Morris
2017-09-19  1:33   ` Alex Branham
2018-04-12 23:17 ` Lars Ingebrigtsen

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