unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: David Edmondson <dme@dme.org>
To: "Daniel Martín" <mardani29@yahoo.es>
Cc: emacs-devel@gnu.org
Subject: Re: [PATCH] nextstep: Emacs can be used to edit PDF files
Date: Tue, 23 Nov 2021 10:09:59 +0000	[thread overview]
Message-ID: <cunzgpvmbd4.fsf@dme.org> (raw)
In-Reply-To: <m1zgq1uhkg.fsf@yahoo.es> ("Daniel Martín"'s message of "Fri, 19 Nov 2021 01:15:11 +0100")

On Friday, 2021-11-19 at 01:15:11 +01, Daniel Martín wrote:

> David Edmondson <dme@dme.org> writes:
>
>> Add editor role for PDF files, allowing them to be opened in Emacs via
>> the Finder.
>> ---
>>  nextstep/templates/Info.plist.in | 12 ++++++++++++
>>  1 file changed, 12 insertions(+)
>>
>> diff --git a/nextstep/templates/Info.plist.in b/nextstep/templates/Info.plist.in
>> index f9f0ec0857..bd86a75e79 100644
>> --- a/nextstep/templates/Info.plist.in
>> +++ b/nextstep/templates/Info.plist.in
>> @@ -488,6 +488,18 @@ along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.
>>  			<key>CFBundleTypeRole</key>
>>  			<string>Editor</string>
>>  		</dict>
>> +		<dict>
>> +			<key>CFBundleTypeExtensions</key>
>> +			<array>
>> +				<string>pdf</string>
>> +			</array>
>> +			<key>CFBundleTypeIconFile</key>
>> +			<string>document.icns</string>
>> +			<key>CFBundleTypeName</key>
>> +			<string>PDF document</string>
>> +			<key>CFBundleTypeRole</key>
>> +			<string>Editor</string>
>> +		</dict>
>>  		<dict>
>>  			<key>CFBundleTypeExtensions</key>
>>  			<array>
>
> Thanks for the patch, but by default Emacs opens PDF files in
> fundamental-mode, which IMO is not very convenient for reading PDFs.

I don't see this as a reason not to include the patch. Users are not
forced to use Emacs to open PDFs, so this is only something that will
happen with explicit configuration or selection in any case.

I would also argue that fundamental mode is not a terrible place to edit
PDF documents. It's not a very good viewer, but then...

> It's true that there's also doc-view-mode, but that requires some extra
> configuration.

...doc-view-mode is a *terrible* PDF viewer for larger (1000+ page)
documents, and it is the default if ghostscript is found.

> If someone has configured Emacs to be a good PDF viewer, they can always
> force the Open With dialog to open PDFs with Emacs.

If one wishes to open all PDF documents with Emacs then this is a good
solution. If, as in my case, someone wishes to open some PDF documents
using Emacs, the existing "Open with..." is very cumbersome to use, as
it requires navigating the filesystem to find the Emacs application
every time.

The current Info.plist.in includes a clause that attempts to make Emacs
available as an editor for *all* file types on macOS, but Apple appear
to have discontinued support for this, which is unfortunate.

dme.
-- 
There's someone in my head but it's not me.



  parent reply	other threads:[~2021-11-23 10:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-10  8:38 [PATCH] nextstep: Emacs can be used to edit PDF files David Edmondson
2021-11-19  0:15 ` Daniel Martín
2021-11-19  3:22   ` Stefan Monnier
2021-11-19  3:42     ` Stefan Kangas
2021-11-19 18:03       ` Stefan Monnier
2021-11-20  3:55         ` Stefan Kangas
2021-11-20 13:06           ` Stefan Monnier
2021-11-20 19:51             ` Alan Third
2021-11-23 10:09   ` David Edmondson [this message]
2021-11-23 17:35     ` Tomas Hlavaty
2021-11-24 21:10       ` James Cloos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cunzgpvmbd4.fsf@dme.org \
    --to=dme@dme.org \
    --cc=emacs-devel@gnu.org \
    --cc=mardani29@yahoo.es \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).