unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#43775: 28.0.50; Feature request: to include EPUB reading into doc-view
@ 2020-10-03  9:03 Jean Louis
       [not found] ` <VI1PR06MB4526E1B8D23CC152E879499C960E0@VI1PR06MB4526.eurprd06.prod.outlook.com>
                   ` (2 more replies)
  0 siblings, 3 replies; 23+ messages in thread
From: Jean Louis @ 2020-10-03  9:03 UTC (permalink / raw)
  To: 43775


Situation is that doc-view can read PDF files, and Libreoffice or Open
Document files, and others, but EPUB files are not included. Many
digital books are made in EPUB format.

Vasilij Schneidermann <mail 📧 vasilij.de> have written the nov-mode
which when aded to auto-mode-list, opens EPUB files

(add-to-list 'auto-mode-alist '("\\.epub\\'" . nov-mode))

I have asked him, he would be somehow willing to cooperate if this is
also confirmed by more users, there are few problems with it, as it
depends on dash.el and other packages.

Maybe doc-view could be expanded with similar feature such as nov-mode
so that it can read EPUB files natively.

I am myself working on project to help local libraries and school
install and use offline Wikipedia, Gutenberg books and similar, there
will be course about Emacs and introduction to computing, EPUB files
are handy. I am each time getting surprised that I cannot read EPUB
files with native Emacs.





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

* bug#43775: Sv: bug#43775: 28.0.50; Feature request: to include EPUB reading into doc-view
       [not found] ` <VI1PR06MB4526E1B8D23CC152E879499C960E0@VI1PR06MB4526.eurprd06.prod.outlook.com>
@ 2020-10-03 10:26   ` Jean Louis
  0 siblings, 0 replies; 23+ messages in thread
From: Jean Louis @ 2020-10-03 10:26 UTC (permalink / raw)
  To: arthur miller; +Cc: 43775, Vasilij Schneidermann

Thank you for support Arthur, me too, I read EPUBs inside of Emacs.

* arthur miller <arthur.miller@live.com> [2020-10-03 12:35]:
> I use nov mode to read epubs. I think it works well for the most;
> but some epubs are not rendered correctly. I don't know what
> it depends on. It would be needed to find out which epubs can not
> render correctly and offer some message to user to maybe
> open the file in some other viewer or at least to inform that there
> will be errors in viewing.
> 
> Otherwise it would be nice to see it included in Emacs; if you can sort,
> out the legalities.






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

* bug#43775: 28.0.50; Feature request: to include EPUB reading into doc-view
  2020-10-03  9:03 bug#43775: 28.0.50; Feature request: to include EPUB reading into doc-view Jean Louis
       [not found] ` <VI1PR06MB4526E1B8D23CC152E879499C960E0@VI1PR06MB4526.eurprd06.prod.outlook.com>
@ 2020-10-03 11:30 ` Philip K.
  2020-10-04  3:44   ` Richard Stallman
  2022-04-23 14:50 ` Lars Ingebrigtsen
  2 siblings, 1 reply; 23+ messages in thread
From: Philip K. @ 2020-10-03 11:30 UTC (permalink / raw)
  To: Jean Louis; +Cc: 43775

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

Jean Louis <bugs@gnu.support> writes:

> Situation is that doc-view can read PDF files, and Libreoffice or Open
> Document files, and others, but EPUB files are not included. Many
> digital books are made in EPUB format.
>
> Vasilij Schneidermann <mail 📧 vasilij.de> have written the nov-mode
> which when aded to auto-mode-list, opens EPUB files
>
> (add-to-list 'auto-mode-alist '("\\.epub\\'" . nov-mode))
>
> I have asked him, he would be somehow willing to cooperate if this is
> also confirmed by more users, there are few problems with it, as it
> depends on dash.el and other packages.

I sent him a patch a few weeks ago to remove dash (attached below), so
that shouldn't be an issue if he's interested. It's not a radical
change, but at the time he wasn't interested.

The second dependency, esxml is practically part of nov-mode, and
wouldn't make sense to factor it out.

-- 
	Philip K.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Drop-dash-dependency.patch --]
[-- Type: text/x-patch, Size: 9401 bytes --]

From a50b42281c8dfa4bb727f43f006cbaefa0d88640 Mon Sep 17 00:00:00 2001
From: Philip K <philipk@posteo.net>
Date: Fri, 28 Aug 2020 23:34:05 +0200
Subject: [PATCH] Drop dash dependency

---
 nov.el | 96 +++++++++++++++++++++++++++++++---------------------------
 1 file changed, 51 insertions(+), 45 deletions(-)

diff --git a/nov.el b/nov.el
index 0072ea1..43749de 100644
--- a/nov.el
+++ b/nov.el
@@ -5,7 +5,7 @@
 ;; Author: Vasilij Schneidermann <mail@vasilij.de>
 ;; URL: https://depp.brause.cc/nov.el
 ;; Version: 0.3.0
-;; Package-Requires: ((dash "2.12.0") (esxml "0.3.3") (emacs "24.4"))
+;; Package-Requires: ((esxml "0.3.3") (emacs "24.4"))
 ;; Keywords: hypermedia, multimedia, epub
 
 ;; This file is NOT part of GNU Emacs.
@@ -44,7 +44,7 @@
 ;;; Code:
 
 (require 'cl-lib)
-(require 'dash)
+(require 'pcase)
 (require 'esxml-query)
 (require 'shr)
 (require 'url-parse)
@@ -148,8 +148,9 @@ Each element of the stack is a list (NODEINDEX BUFFERPOS).")
 
 (defun nov-directory-files (directory)
   "Returns a list of files in DIRECTORY except for . and .."
-  (--remove (string-match-p "/\\.\\(?:\\.\\)?\\'" it)
-            (directory-files directory t)))
+  (cl-loop for file in (directory-files directory t)
+	   unless (string-match-p "/\\.\\(?:\\.\\)?\\'" file)
+	   collect file))
 
 (defun nov-contains-nested-directory-p (directory)
   "Non-nil if DIRECTORY contains exactly one directory."
@@ -167,9 +168,9 @@ Each element of the stack is a list (NODEINDEX BUFFERPOS).")
   (delete-directory child))
 
 (defun nov--fix-permissions (file-or-directory mode)
-  (->> (file-modes file-or-directory)
-       (file-modes-symbolic-to-number mode)
-       (set-file-modes file-or-directory)))
+  (let* ((modes (file-modes file-or-directory))
+	 (symbolic (file-modes-symbolic-to-number mode modes)))
+    (set-file-modes file-or-directory symbolic)))
 
 (defun nov-fix-permissions (directory)
   "Iterate recursively through DIRECTORY to fix its files."
@@ -306,7 +307,9 @@ Required keys are 'identifier and everything in
   "Extract an alist of manifest files for CONTENT in DIRECTORY.
 Each alist item consists of the identifier and full path."
   (mapcar (lambda (node)
-            (-let [(&alist 'id id 'href href) (esxml-node-attributes node)]
+            (let* ((attr (esxml-node-attributes node))
+		   (id (cdr (assq 'id attr)))
+		   (href (cdr (assq 'href attr))))
               (cons (intern id)
                     (nov-make-path directory (nov-urldecode href)))))
           (esxml-query-all "package>manifest>item" content)))
@@ -336,7 +339,7 @@ Each alist item consists of the identifier and full path."
     (let ((toc-file (assq nov-toc-id manifest)))
       (when (not toc-file)
         (error "EPUB 3 <nav> file not found"))
-      (setq files (--remove (eq (car it) nov-toc-id) files))
+      (setq files (cl-remove nov-toc-id files :key #'car))
       (cons toc-file files))))
 
 (defun nov-content-files (directory content)
@@ -351,8 +354,9 @@ Each alist item consists of the identifier and full path."
 
 (defun nov--walk-ncx-node (node)
   (let ((tag (esxml-node-tag node))
-        (children (--filter (eq (esxml-node-tag it) 'navPoint)
-                            (esxml-node-children node))))
+        (children (cl-loop for node in (esxml-node-children node)
+			   when (eq (esxml-node-tag node) 'navPoint)
+			   collect node)))
     (cond
      ((eq tag 'navMap)
       (insert "<ol>\n")
@@ -449,17 +453,18 @@ This function honors `shr-max-image-proportion' if possible."
                 'imagemagick)))
     (if (not (display-graphic-p))
         (insert alt)
-      (-let* (((x1 y1 x2 y2) (window-inside-pixel-edges
-                              (get-buffer-window (current-buffer))))
-              (image
-               ;; `create-image' errors out for unsupported image types
-               (ignore-errors
-                 (create-image path type nil
-                               :ascent 100
-                               :max-width (truncate (* shr-max-image-proportion
-                                                       (- x2 x1)))
-                               :max-height (truncate (* shr-max-image-proportion
-                                                        (- y2 y1)))))))
+      (pcase-let* ((`(,x1 ,y1 ,x2 ,y2)
+		    (window-inside-pixel-edges
+		     (get-buffer-window (current-buffer))))
+		   (image
+		    ;; `create-image' errors out for unsupported image types
+		    (ignore-errors
+                      (create-image path type nil
+				    :ascent 100
+				    :max-width (truncate (* shr-max-image-proportion
+							    (- x2 x1)))
+				    :max-height (truncate (* shr-max-image-proportion
+                                                             (- y2 y1)))))))
         (if image
             (insert-image image)
           (insert alt))))))
@@ -524,13 +529,14 @@ If the document path refers to an image (as determined by
 `image-type-file-name-regexps'), an image is inserted, otherwise
 the HTML is rendered with `nov-render-html-function'."
   (interactive)
-  (-let* (((id . path) (aref nov-documents nov-documents-index))
-          ;; HACK: this should be looked up in the manifest
-          (imagep (--find (string-match-p (car it) path)
-                          image-type-file-name-regexps))
-          ;; NOTE: allows resolving image references correctly
-          (default-directory (file-name-directory path))
-          (buffer-read-only nil))
+  (pcase-let* ((`(,id . ,path) (aref nov-documents nov-documents-index))
+               ;; HACK: this should be looked up in the manifest
+               (imagep (cl-find path image-type-file-name-regexps
+				:test (lambda (a b) (string-match-p b a))
+				:key #'car))
+               ;; NOTE: allows resolving image references correctly
+               (default-directory (file-name-directory path))
+               (buffer-read-only nil))
     (erase-buffer)
 
     (cond
@@ -602,7 +608,7 @@ the HTML is rendered with `nov-render-html-function'."
         (erase-buffer)
         (insert (format "EPUB Version: %s\n" version))
         (dolist (item metadata)
-          (-let [(key . value) item]
+          (pcase-let ((`(,key . ,value) item))
             (insert (format "%s: " (capitalize (symbol-name key))))
             (if value
                 (if (eq key 'description)
@@ -721,10 +727,10 @@ Saving is only done if `nov-save-place-file' is set."
   (interactive)
   (or nov-history
       (user-error "This is the first document you looked at"))
-  (-let ((history-forward
-          (cons (list nov-documents-index (point))
-                nov-history-forward))
-         ((index opoint) (car nov-history)))
+  (pcase-let ((history-forward
+               (cons (list nov-documents-index (point))
+                     nov-history-forward))
+              (`(,index ,opoint) (car nov-history)))
     (setq nov-history (cdr nov-history))
     (nov-goto-document index)
     (setq nov-history (cdr nov-history))
@@ -737,8 +743,8 @@ Saving is only done if `nov-save-place-file' is set."
   (interactive)
   (or nov-history-forward
       (user-error "This is the last document you looked at"))
-  (-let ((history-forward (cdr nov-history-forward))
-         ((index opoint) (car nov-history-forward)))
+  (pcase-let ((history-forward (cdr nov-history-forward))
+              (`(,index ,opoint) (car nov-history-forward)))
     (nov-goto-document index)
     (setq nov-history-forward history-forward)
     (goto-char opoint)
@@ -764,15 +770,15 @@ Saving is only done if `nov-save-place-file' is set."
     (nov-clean-up)
     (error "Invalid EPUB file"))
   (let* ((content (nov-slurp (nov-container-filename nov-temp-dir) t))
-         (content-file (->> (nov-container-content-filename content)
-                            (nov-make-path nov-temp-dir)))
+         (content-file (nov-make-path
+			nov-temp-dir
+			(nov-container-content-filename content)))
          (work-dir (file-name-directory content-file))
          (content (nov-slurp content-file t)))
     (setq nov-content-file content-file)
     (setq nov-epub-version (nov-content-version content))
     (setq nov-metadata (nov-content-metadata content))
-    (setq nov-documents (->> (nov-content-files work-dir content)
-                             (apply 'vector)))
+    (setq nov-documents (apply 'vector (nov-content-files work-dir content)))
     (setq nov-documents-index 0))
   (setq buffer-undo-list t)
   (setq nov-file-name (buffer-file-name))
@@ -880,11 +886,11 @@ See also `nov-bookmark-make-record'."
                 (libxml-parse-html-region (point-min) (point-max)))))
     (mapcar
      (lambda (node)
-       (-let* ((href (esxml-node-attribute 'href node))
-               (label (mapconcat 'string-trim-whitespace
-                                 (esxml-find-descendants #'stringp node) " "))
-               ((filename target) (nov-url-filename-and-target href)))
-         (list label filename 'nov-imenu-goto-function target)))
+       (pcase-let* ((href (esxml-node-attribute 'href node))
+		    (label (mapconcat 'string-trim-whitespace
+                                      (esxml-find-descendants #'stringp node) " "))
+		    (`(,filename ,target) (nov-url-filename-and-target href)))
+	 (list label filename 'nov-imenu-goto-function target)))
      (esxml-query-all "a" toc))))
 
 (defun nov-imenu-setup ()
-- 
2.26.2


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

* bug#43775: 28.0.50; Feature request: to include EPUB reading into doc-view
  2020-10-03 11:30 ` Philip K.
@ 2020-10-04  3:44   ` Richard Stallman
  2020-10-04  4:40     ` bug#43775: 28.0.50; Feature request: to include EPUB reading into main Emacs Jean Louis
  2020-10-04  7:22     ` bug#43775: 28.0.50; Feature request: to include EPUB reading into doc-view Eli Zaretskii
  0 siblings, 2 replies; 23+ messages in thread
From: Richard Stallman @ 2020-10-04  3:44 UTC (permalink / raw)
  To: Philip K.; +Cc: 43775, bugs

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

It looks like nov-mode is not included in Emacs.  At least, grep-find
did not find it.  Is it part of ELPA?

Doc-view cannot refer to it if not is not in Emacs.

Why is it called 'nov-mode'?


-- 
Dr Richard Stallman
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)







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

* bug#43775: 28.0.50; Feature request: to include EPUB reading into main Emacs
  2020-10-04  3:44   ` Richard Stallman
@ 2020-10-04  4:40     ` Jean Louis
  2020-10-04  5:48       ` Vasilij Schneidermann
  2020-10-04  7:22     ` bug#43775: 28.0.50; Feature request: to include EPUB reading into doc-view Eli Zaretskii
  1 sibling, 1 reply; 23+ messages in thread
From: Jean Louis @ 2020-10-04  4:40 UTC (permalink / raw)
  To: Richard Stallman; +Cc: 43775, Philip K., Vasilij Schneidermann

* Richard Stallman <rms@gnu.org> [2020-10-04 06:44]:
> [[[ To any NSA and FBI agents reading my email: please consider    ]]]
> [[[ whether defending the US Constitution against all enemies,     ]]]
> [[[ foreign or domestic, requires you to follow Snowden's example. ]]]
> 
> It looks like nov-mode is not included in Emacs.  At least, grep-find
> did not find it.  Is it part of ELPA?

Name of package is "nov", and is included in ELPA.

I proposed for doc-view to be standard, but Author Vasilij
Schneidermann <mail@vasilij.de> said that is not related to doc-view,
as EPUB files are like packaged HTML files. Author is willing to
contribute, and is Emacs contributor, so I understood.

Many digital books are in EPUB format. I got every time surprised to
find that Emacs could not read EPUB, but could read PDF and other
documents.

> Why is it called 'nov-mode'?

Maybe Vasilij can answer.







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

* bug#43775: 28.0.50; Feature request: to include EPUB reading into main Emacs
  2020-10-04  4:40     ` bug#43775: 28.0.50; Feature request: to include EPUB reading into main Emacs Jean Louis
@ 2020-10-04  5:48       ` Vasilij Schneidermann
  2020-10-05  3:15         ` Richard Stallman
  2020-10-05  7:53         ` Lars Ingebrigtsen
  0 siblings, 2 replies; 23+ messages in thread
From: Vasilij Schneidermann @ 2020-10-04  5:48 UTC (permalink / raw)
  To: Jean Louis; +Cc: 43775, Philip K., Richard Stallman

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

> > It looks like nov-mode is not included in Emacs.  At least, grep-find
> > did not find it.  Is it part of ELPA?

FWIW, I think that it would make more sense to contribute the package to
GNU ELPA first:

- Greater flexibility of update cycle
- Still reasonably easy to install
- There's a significant dependency on esxml-query.el for XML/HTML
  traversal which I don't expect to get included into Emacs any
  time soon.

> > Why is it called 'nov-mode'?

Actually, I called it nov.el because it's for reading novels.  The
package prefix however is nov-, so the package name was turned into nov
when I submitted the package to MELPA.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* bug#43775: 28.0.50; Feature request: to include EPUB reading into doc-view
  2020-10-04  3:44   ` Richard Stallman
  2020-10-04  4:40     ` bug#43775: 28.0.50; Feature request: to include EPUB reading into main Emacs Jean Louis
@ 2020-10-04  7:22     ` Eli Zaretskii
  1 sibling, 0 replies; 23+ messages in thread
From: Eli Zaretskii @ 2020-10-04  7:22 UTC (permalink / raw)
  To: rms, Vasilij Schneidermann; +Cc: 43775, philipk, bugs

> From: Richard Stallman <rms@gnu.org>
> Date: Sat, 03 Oct 2020 23:44:15 -0400
> Cc: 43775@debbugs.gnu.org, bugs@gnu.support
> 
> It looks like nov-mode is not included in Emacs.  At least, grep-find
> did not find it.  Is it part of ELPA?

No, it has its own site, AFAIU:

  https://depp.brause.cc/nov.el/

It is also on MELPA, AFAICT.

> Why is it called 'nov-mode'?

I don't know, perhaps because it allows to read novels?  Vasilij?





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

* bug#43775: 28.0.50; Feature request: to include EPUB reading into main Emacs
  2020-10-04  5:48       ` Vasilij Schneidermann
@ 2020-10-05  3:15         ` Richard Stallman
  2020-10-05  4:12           ` Jean Louis
  2020-10-05  4:22           ` Vasilij Schneidermann
  2020-10-05  7:53         ` Lars Ingebrigtsen
  1 sibling, 2 replies; 23+ messages in thread
From: Richard Stallman @ 2020-10-05  3:15 UTC (permalink / raw)
  To: Vasilij Schneidermann; +Cc: 43775, philipk, bugs

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > FWIW, I think that it would make more sense to contribute the package to
  > GNU ELPA first:

The other Emacs maintainers will be glad to work with you on that.
Thank you for contributing.

  > Actually, I called it nov.el because it's for reading novels.

We've been having a discussion about how to make Emacs easier to
learn.  I think one important way is to cease giving packages cryptic
names, and start giving each mode or package a name whose meaning will
be clear to everyone who sees it.

The name "Nov mode" is not clear -- witness the fact that it wasn't
obvious to me what it meant.  One needs to be told its meaning.

What would you think of "E-Reader mode"?  "E-Book View mode"?
(I am making a surmise here about what it does -- please forgive
me if I'm mistaken.)

-- 
Dr Richard Stallman
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)







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

* bug#43775: 28.0.50; Feature request: to include EPUB reading into main Emacs
  2020-10-05  3:15         ` Richard Stallman
@ 2020-10-05  4:12           ` Jean Louis
  2020-10-05  4:22           ` Vasilij Schneidermann
  1 sibling, 0 replies; 23+ messages in thread
From: Jean Louis @ 2020-10-05  4:12 UTC (permalink / raw)
  To: Richard Stallman; +Cc: 43775, philipk, Vasilij Schneidermann

* Richard Stallman <rms@gnu.org> [2020-10-05 06:15]:
> [[[ To any NSA and FBI agents reading my email: please consider    ]]]
> [[[ whether defending the US Constitution against all enemies,     ]]]
> [[[ foreign or domestic, requires you to follow Snowden's example. ]]]
> 
>   > FWIW, I think that it would make more sense to contribute the package to
>   > GNU ELPA first:
> 
> The other Emacs maintainers will be glad to work with you on that.
> Thank you for contributing.
> 
>   > Actually, I called it nov.el because it's for reading novels.
> 
> We've been having a discussion about how to make Emacs easier to
> learn.  I think one important way is to cease giving packages cryptic
> names, and start giving each mode or package a name whose meaning will
> be clear to everyone who sees it.
> 
> The name "Nov mode" is not clear -- witness the fact that it wasn't
> obvious to me what it meant.  One needs to be told its meaning.
> 
> What would you think of "E-Reader mode"?  "E-Book View mode"?
> (I am making a surmise here about what it does -- please forgive
> me if I'm mistaken.)

Just make it epub-mode






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

* bug#43775: 28.0.50; Feature request: to include EPUB reading into main Emacs
  2020-10-05  3:15         ` Richard Stallman
  2020-10-05  4:12           ` Jean Louis
@ 2020-10-05  4:22           ` Vasilij Schneidermann
  2020-10-05  5:17             ` Jean Louis
                               ` (2 more replies)
  1 sibling, 3 replies; 23+ messages in thread
From: Vasilij Schneidermann @ 2020-10-05  4:22 UTC (permalink / raw)
  To: Richard Stallman; +Cc: 43775, philipk, bugs

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

> We've been having a discussion about how to make Emacs easier to
> learn.  I think one important way is to cease giving packages cryptic
> names, and start giving each mode or package a name whose meaning will
> be clear to everyone who sees it.

That's a laudable goal, but it's hard to fulfill given the crutch of
identifier prefixing Emacs Lisp is stuck with.  The choice of a unique,
yet short prefix is more important as chances are that someone else beat
you to the punch and picked the obvious ones first.  In my case,
epub-mode.el (no adherence to prefixing) and ereader.el (ereader-
prefix) were already taken.

> What would you think of "E-Reader mode"?  "E-Book View mode"?
> (I am making a surmise here about what it does -- please forgive
> me if I'm mistaken.)

These are display names, they don't tell me how they'd map to the file
name or package prefix.  With "E-Reader mode" there would be high
confusion potential with ereader.el and maybe even namespace collisions
as it defines ereader-mode and other identifiers of that kind.  "E-Book
View mode" might work (ebook-view-mode?), but is overall too long to
comfortably work with.  How much I wish that Emacs Lisp were more like
other Lisp dialects and offered you to write code without having to
spell out package prefixes for every single identifier you write...

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* bug#43775: 28.0.50; Feature request: to include EPUB reading into main Emacs
  2020-10-05  4:22           ` Vasilij Schneidermann
@ 2020-10-05  5:17             ` Jean Louis
  2020-10-06  2:30             ` Richard Stallman
       [not found]             ` <E1kPco3-000841-JM@fencepost.gnu.org>
  2 siblings, 0 replies; 23+ messages in thread
From: Jean Louis @ 2020-10-05  5:17 UTC (permalink / raw)
  To: Vasilij Schneidermann; +Cc: 43775, philipk, Richard Stallman, bugs

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

* Vasilij Schneidermann <mail@vasilij.de> [2020-10-05 07:23]:
> > We've been having a discussion about how to make Emacs easier to
> > learn.  I think one important way is to cease giving packages cryptic
> > names, and start giving each mode or package a name whose meaning will
> > be clear to everyone who sees it.
> 
> That's a laudable goal, but it's hard to fulfill given the crutch of
> identifier prefixing Emacs Lisp is stuck with.  The choice of a unique,
> yet short prefix is more important as chances are that someone else beat
> you to the punch and picked the obvious ones first.  In my case,
> epub-mode.el (no adherence to prefixing) and ereader.el (ereader-
> prefix) were already taken.

epub-reader-mode


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* bug#43775: 28.0.50; Feature request: to include EPUB reading into main Emacs
  2020-10-04  5:48       ` Vasilij Schneidermann
  2020-10-05  3:15         ` Richard Stallman
@ 2020-10-05  7:53         ` Lars Ingebrigtsen
  2020-10-05  8:52           ` Arthur Miller
  2020-10-05 11:32           ` Vasilij Schneidermann
  1 sibling, 2 replies; 23+ messages in thread
From: Lars Ingebrigtsen @ 2020-10-05  7:53 UTC (permalink / raw)
  To: Vasilij Schneidermann; +Cc: 43775, Philip K., Richard Stallman, Jean Louis

Vasilij Schneidermann <mail@vasilij.de> writes:

> - Greater flexibility of update cycle
> - Still reasonably easy to install
> - There's a significant dependency on esxml-query.el for XML/HTML
>   traversal which I don't expect to get included into Emacs any
>   time soon.

Is there any reason why?  esxml-query looks really cool.

>> > Why is it called 'nov-mode'?
>
> Actually, I called it nov.el because it's for reading novels.  The
> package prefix however is nov-, so the package name was turned into nov
> when I submitted the package to MELPA.

nov sounds like a good name to me.

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





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

* bug#43775: 28.0.50; Feature request: to include EPUB reading into main Emacs
  2020-10-05  7:53         ` Lars Ingebrigtsen
@ 2020-10-05  8:52           ` Arthur Miller
  2020-10-05 11:36             ` Vasilij Schneidermann
  2020-10-05 11:32           ` Vasilij Schneidermann
  1 sibling, 1 reply; 23+ messages in thread
From: Arthur Miller @ 2020-10-05  8:52 UTC (permalink / raw)
  To: Lars Ingebrigtsen
  Cc: 43775, Philip K., Richard Stallman, Jean Louis,
	Vasilij Schneidermann

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Vasilij Schneidermann <mail@vasilij.de> writes:
>
>> - Greater flexibility of update cycle
>> - Still reasonably easy to install
>> - There's a significant dependency on esxml-query.el for XML/HTML
>>   traversal which I don't expect to get included into Emacs any
>>   time soon.
>
> Is there any reason why?  esxml-query looks really cool.
>
>>> > Why is it called 'nov-mode'?
>>
>> Actually, I called it nov.el because it's for reading novels.  The
>> package prefix however is nov-, so the package name was turned into nov
>> when I submitted the package to MELPA.
>
> nov sounds like a good name to me.

Is there already epub.el and epub-mode? If epub.el could be merged with
doc-view, then maybe doc-view-epub mode; if it needs separate name?





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

* bug#43775: 28.0.50; Feature request: to include EPUB reading into main Emacs
  2020-10-05  7:53         ` Lars Ingebrigtsen
  2020-10-05  8:52           ` Arthur Miller
@ 2020-10-05 11:32           ` Vasilij Schneidermann
  2020-10-06  1:31             ` Lars Ingebrigtsen
  1 sibling, 1 reply; 23+ messages in thread
From: Vasilij Schneidermann @ 2020-10-05 11:32 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 43775, Philip K., Richard Stallman, Jean Louis



>Is there any reason why?  esxml-query looks really cool.

It could be added as it's independent from esxml.el, I am the only contributor and it doesn't depend on anything from the rest of the esxml package. I expect some adjustments though before it can be included, both with regards to style (commit messages don't adhere to GNU standards) and architecture (most of the code is for parsing CSS selectors, it might make more sense to have a s-expression syntax instead and integrate it into xml.el).





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

* bug#43775: 28.0.50; Feature request: to include EPUB reading into main Emacs
  2020-10-05  8:52           ` Arthur Miller
@ 2020-10-05 11:36             ` Vasilij Schneidermann
  0 siblings, 0 replies; 23+ messages in thread
From: Vasilij Schneidermann @ 2020-10-05 11:36 UTC (permalink / raw)
  To: Arthur Miller, Lars Ingebrigtsen
  Cc: 43775, Philip K., Richard Stallman, Jean Louis



>Is there already epub.el and epub-mode? If epub.el could be merged with
>doc-view, then maybe doc-view-epub mode; if it needs separate name?

That wouldn't make much sense: doc-view operates on images of pages and offers navigation in terms of that, whereas this mode operates in terms of subdocuments that are rendered as htmlized text using shr.el.





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

* bug#43775: 28.0.50; Feature request: to include EPUB reading into main Emacs
  2020-10-05 11:32           ` Vasilij Schneidermann
@ 2020-10-06  1:31             ` Lars Ingebrigtsen
  2020-10-07 17:50               ` Vasilij Schneidermann
  0 siblings, 1 reply; 23+ messages in thread
From: Lars Ingebrigtsen @ 2020-10-06  1:31 UTC (permalink / raw)
  To: Vasilij Schneidermann; +Cc: 43775, Philip K., Richard Stallman, Jean Louis

Vasilij Schneidermann <mail@vasilij.de> writes:

>>Is there any reason why?  esxml-query looks really cool.
>
> It could be added as it's independent from esxml.el, I am the only
> contributor and it doesn't depend on anything from the rest of the
> esxml package. I expect some adjustments though before it can be
> included, both with regards to style (commit messages don't adhere to
> GNU standards) and architecture (most of the code is for parsing CSS
> selectors, it might make more sense to have a s-expression syntax
> instead and integrate it into xml.el).

Or integrate it with dom.el, which covers much the same area, but with a
different approach.  The query selectors in esxml-query would complement
those functions nicely, I think. 

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





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

* bug#43775: 28.0.50; Feature request: to include EPUB reading into main Emacs
  2020-10-05  4:22           ` Vasilij Schneidermann
  2020-10-05  5:17             ` Jean Louis
@ 2020-10-06  2:30             ` Richard Stallman
       [not found]             ` <E1kPco3-000841-JM@fencepost.gnu.org>
  2 siblings, 0 replies; 23+ messages in thread
From: Richard Stallman @ 2020-10-06  2:30 UTC (permalink / raw)
  To: Vasilij Schneidermann; +Cc: 43775, philipk, bugs

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > These are display names, they don't tell me how they'd map to the file
  > name or package prefix.

THe intention is to use them as the name of the mode and the command
to select it.  For instance, the command could be M-x ebook-view-mode.
That is where we need names that are clear to the user.

The file name does not have to be the same as that.
We don't need file names to be obvious to the user.

  >   How much I wish that Emacs Lisp were more like
  > other Lisp dialects and offered you to write code without having to
  > spell out package prefixes for every single identifier you write...

I understand the issue, but since the file prefix can be different
from (and shorter than) the name of the mode, it isn't as bad as it
seems.

Meanwhile, Joao is working on a symbol renaming feature which might
make things more convenient.

-- 
Dr Richard Stallman
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)







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

* bug#43775: 28.0.50; Feature request: to include EPUB reading into main Emacs
       [not found]             ` <E1kPco3-000841-JM@fencepost.gnu.org>
@ 2020-10-07 17:47               ` Vasilij Schneidermann
  0 siblings, 0 replies; 23+ messages in thread
From: Vasilij Schneidermann @ 2020-10-07 17:47 UTC (permalink / raw)
  To: Richard Stallman

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

> In what sense are those names taken?
> Are packages with those names included in Emacs, or in GNU ELPA?
> 
> If it simply means that people published files with those names, that
> doesn't mean the names are off limits for anyone else.  We can install
> a file in Emacs core or in GNU ELPA with either of those names.

Neither are in Emacs or GNU ELPA because the effort to do that is
prohibitively high for the majority of the Emacs community.  Sure, one
can ignore their existence, but that will make things confusing as one
needs to clarify whether they mean the package in Emacs/GNU ELPA or the
community one that preceded them.  Names are important after all and so
are communities.

> By the way, I know that your package can be used to read some ebooks,
> but that is all I know.  Could you please tell me just a little more?
> For instance, which formats does it aspire to handle?  Which formats
> does it handle now?

It handles standards-complying EPUB2 and EPUB3 ebooks.  I've considered
extending it to handle the FB2 format, but that would pretty much
require a full rewrite.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* bug#43775: 28.0.50; Feature request: to include EPUB reading into main Emacs
  2020-10-06  1:31             ` Lars Ingebrigtsen
@ 2020-10-07 17:50               ` Vasilij Schneidermann
  2020-10-09  4:16                 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 23+ messages in thread
From: Vasilij Schneidermann @ 2020-10-07 17:50 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 43775, Philip K., Richard Stallman, Jean Louis

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

> Or integrate it with dom.el, which covers much the same area, but with a
> different approach.  The query selectors in esxml-query would complement
> those functions nicely, I think. 

That's an interesting proposal as esxml-query.el contains ad-hoc
functions to retrieve tag attributes/children which have been covered by
dom.el already.  How about changing the file name from esxml-query.el to
dom-query.el and the package prefix from esxml- to dom-, would that work
for you?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* bug#43775: 28.0.50; Feature request: to include EPUB reading into main Emacs
  2020-10-07 17:50               ` Vasilij Schneidermann
@ 2020-10-09  4:16                 ` Lars Ingebrigtsen
  2020-10-12  6:36                   ` Vasilij Schneidermann
  0 siblings, 1 reply; 23+ messages in thread
From: Lars Ingebrigtsen @ 2020-10-09  4:16 UTC (permalink / raw)
  To: Vasilij Schneidermann; +Cc: 43775, Philip K., Richard Stallman, Jean Louis

Vasilij Schneidermann <mail@vasilij.de> writes:

> That's an interesting proposal as esxml-query.el contains ad-hoc
> functions to retrieve tag attributes/children which have been covered by
> dom.el already.  How about changing the file name from esxml-query.el to
> dom-query.el and the package prefix from esxml- to dom-, would that work
> for you?

Yes, sounds like a good idea.

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





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

* bug#43775: 28.0.50; Feature request: to include EPUB reading into main Emacs
  2020-10-09  4:16                 ` Lars Ingebrigtsen
@ 2020-10-12  6:36                   ` Vasilij Schneidermann
  2020-10-12 14:55                     ` Eli Zaretskii
  0 siblings, 1 reply; 23+ messages in thread
From: Vasilij Schneidermann @ 2020-10-12  6:36 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 43775, Philip K., Richard Stallman, Jean Louis

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

> Yes, sounds like a good idea.

Great, now how do I get there?  Presumably I'll need write access and
someone to guide me into the exact Git workflow used there?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* bug#43775: 28.0.50; Feature request: to include EPUB reading into main Emacs
  2020-10-12  6:36                   ` Vasilij Schneidermann
@ 2020-10-12 14:55                     ` Eli Zaretskii
  0 siblings, 0 replies; 23+ messages in thread
From: Eli Zaretskii @ 2020-10-12 14:55 UTC (permalink / raw)
  To: Vasilij Schneidermann; +Cc: 43775, larsi, philipk, bugs, rms

> Date: Mon, 12 Oct 2020 08:36:36 +0200
> From: Vasilij Schneidermann <mail@vasilij.de>
> Cc: 43775@debbugs.gnu.org, "Philip K." <philipk@posteo.net>,
>  Richard Stallman <rms@gnu.org>, Jean Louis <bugs@gnu.support>
> 
> > Yes, sounds like a good idea.
> 
> Great, now how do I get there?  Presumably I'll need write access and
> someone to guide me into the exact Git workflow used there?

To get write access, create a user on Savannah, and then request to
make that use a member of the Emacs project.  I will then approve you,
and that will give you write access to the Git repository.

For the Git worklfow, I'm not sure what you mean.  You are going to
add code to an existing file, right?  If so, just post the patches for
review, and when all the comments are addressed, push the changeset to
the master branch.

Some details are in CONTRIBUTE and in admin/notes/git-workflow, but
I'm not sure you need that.  In general, new features are always
pushed to the master branch, and bugfixes either to the release branch
or the master branch; the release branch is then merged periodically
onto master.  If you are not sure about something, just ask.

TIA





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

* bug#43775: 28.0.50; Feature request: to include EPUB reading into doc-view
  2020-10-03  9:03 bug#43775: 28.0.50; Feature request: to include EPUB reading into doc-view Jean Louis
       [not found] ` <VI1PR06MB4526E1B8D23CC152E879499C960E0@VI1PR06MB4526.eurprd06.prod.outlook.com>
  2020-10-03 11:30 ` Philip K.
@ 2022-04-23 14:50 ` Lars Ingebrigtsen
  2 siblings, 0 replies; 23+ messages in thread
From: Lars Ingebrigtsen @ 2022-04-23 14:50 UTC (permalink / raw)
  To: Jean Louis; +Cc: 43775

Jean Louis <bugs@gnu.support> writes:

> Situation is that doc-view can read PDF files, and Libreoffice or Open
> Document files, and others, but EPUB files are not included. Many
> digital books are made in EPUB format.

This was added to Emacs 29 in:

commit d633db5189f335873a03544f9f41dcaf77c8e31d
Author:     Daniel Nicolai <dalanicolai@gmail.com>
AuthorDate: Thu Jan 27 17:03:38 2022 +0100


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





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

end of thread, other threads:[~2022-04-23 14:50 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-03  9:03 bug#43775: 28.0.50; Feature request: to include EPUB reading into doc-view Jean Louis
     [not found] ` <VI1PR06MB4526E1B8D23CC152E879499C960E0@VI1PR06MB4526.eurprd06.prod.outlook.com>
2020-10-03 10:26   ` bug#43775: Sv: " Jean Louis
2020-10-03 11:30 ` Philip K.
2020-10-04  3:44   ` Richard Stallman
2020-10-04  4:40     ` bug#43775: 28.0.50; Feature request: to include EPUB reading into main Emacs Jean Louis
2020-10-04  5:48       ` Vasilij Schneidermann
2020-10-05  3:15         ` Richard Stallman
2020-10-05  4:12           ` Jean Louis
2020-10-05  4:22           ` Vasilij Schneidermann
2020-10-05  5:17             ` Jean Louis
2020-10-06  2:30             ` Richard Stallman
     [not found]             ` <E1kPco3-000841-JM@fencepost.gnu.org>
2020-10-07 17:47               ` Vasilij Schneidermann
2020-10-05  7:53         ` Lars Ingebrigtsen
2020-10-05  8:52           ` Arthur Miller
2020-10-05 11:36             ` Vasilij Schneidermann
2020-10-05 11:32           ` Vasilij Schneidermann
2020-10-06  1:31             ` Lars Ingebrigtsen
2020-10-07 17:50               ` Vasilij Schneidermann
2020-10-09  4:16                 ` Lars Ingebrigtsen
2020-10-12  6:36                   ` Vasilij Schneidermann
2020-10-12 14:55                     ` Eli Zaretskii
2020-10-04  7:22     ` bug#43775: 28.0.50; Feature request: to include EPUB reading into doc-view Eli Zaretskii
2022-04-23 14:50 ` 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).