commit 897998291fd09c3b9825a07045fa05f17bf83875 (HEAD, refs/remotes/origin/master)
Author: Paul Eggert <eggert@cs.ucla.edu>
Date:   Fri Oct 21 13:04:02 2016 -0700

    New error file-missing
    
    This fixes a recently-introduced bug in delete-directory,
    where the code assumes the C locale when determining
    whether a file-error corresponds to a missing file (Bug#24714).
    * doc/lispref/errors.texi (Standard Errors):
    * doc/lispref/files.texi (Changing Files):
    * etc/NEWS:
    Document this.
    * doc/lispref/loading.texi (How Programs Do Loading):
    Say "a file-error" rather than "the error file-error" since
    it might be a file-missing now.
    * lisp/emacs-lisp/bytecomp.el (byte-compile-file):
    * lisp/epa-file.el (epa-file--find-file-not-found-function):
    (epa-file-insert-file-contents, epa-file-write-region):
    * lisp/ffap.el (find-file-at-point, dired-at-point):
    * lisp/jka-compr.el (jka-compr-insert-file-contents)
    (jka-compr-insert-file-contents):
    * lisp/net/ange-ftp.el (ange-ftp-barf-if-not-directory)
    (ange-ftp-insert-file-contents, ange-ftp-copy-file-internal):
    * lisp/progmodes/etags.el (visit-tags-table):
    * lisp/url/url-handlers.el (url-copy-file):
    * src/fileio.c (report_file_errno):
    Signal file-missing if appropriate.
    * lisp/epa-file.el (epa-file-insert-file-contents):
    * lisp/jka-compr.el (jka-compr-insert-file-contents):
    Don't assume file-error is a leaf in the error hierarchy.
    * lisp/files.el (files--force):
    * lisp/gnus/nnmaildir.el (nnmaildir--enoent-p):
    * lisp/jka-compr.el (jka-compr-insert-file-contents):
    Use file-missing to detect whether the file is missing.
    * lisp/url/url-handlers.el (url-copy-file):
    Signal file-already-exists if appropriate.
    * src/fileio.c (syms_of_fileio): Define file-missing.
    
    2016-10-18  Paul Eggert  <eggert@cs.ucla.edu>

diff --git a/doc/lispref/errors.texi b/doc/lispref/errors.texi
index 03aea4e..4a0e38c 100644
--- a/doc/lispref/errors.texi
+++ b/doc/lispref/errors.texi
@@ -107,6 +107,11 @@ the error-strings are not very relevant.  However, these error symbols
 do have @code{error-message} properties, and if no data is provided,
 the @code{error-message} property @emph{is} used.  @xref{Files}.
 
+@item file-missing
+This is a subcategory of @code{file-error}.  It occurs when an
+operation attempts to act on a file that is missing.  @xref{Changing
+Files}.
+
 @c jka-compr.el
 @item compression-error
 This is a subcategory of @code{file-error}, which results from
diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi
index 62e0199..ecc3e03 100644
--- a/doc/lispref/files.texi
+++ b/doc/lispref/files.texi
@@ -1501,10 +1501,11 @@ in @code{exec-path}, and tries all the file-name extensions in
 @cindex setting modes of files
 
   The functions in this section rename, copy, delete, link, and set
-the modes (permissions) of files.  They all signal a @code{file-error}
-error if they fail to perform their function, reporting the
-system-dependent error message that describes the reason for the
-failure.
+the modes (permissions) of files.  Typically, they signal a
+@code{file-error} error if they fail to perform their function,
+reporting the system-dependent error message that describes the reason
+for the failure.  If they fail because a file is missing, they signal
+a @code{file-missing} error instead.
 
   For performance, the operating system may cache or alias changes
 made by these functions instead of writing them immediately to
diff --git a/doc/lispref/loading.texi b/doc/lispref/loading.texi
index 81a1922..a73ae59 100644
--- a/doc/lispref/loading.texi
+++ b/doc/lispref/loading.texi
@@ -161,8 +161,8 @@ load was done for the sake of @code{autoload}, any function definitions
 made during the loading are undone.
 
 @kindex file-error
-If @code{load} can't find the file to load, then normally it signals the
-error @code{file-error} (with @samp{Cannot open load file
+If @code{load} can't find the file to load, then normally it signals a
+@code{file-error} (with @samp{Cannot open load file
 @var{filename}}).  But if @var{missing-ok} is non-@code{nil}, then
 @code{load} just returns @code{nil}.
 
diff --git a/etc/NEWS b/etc/NEWS
index 4e41dbb..d9973c0 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -625,6 +625,11 @@ collection).
 can be used for creation of temporary files of remote or mounted directories.
 
 +++
+** The new error 'file-missing', a subcategory of 'file-error', is now
+signaled instead of 'file-error' if a file operation acts on a file
+that does not exist.
+
++++
 ** The function 'delete-directory' no longer signals an error when
 operating recursively and when some other process deletes the directory
 or its files before 'delete-directory' gets to them.
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index c34ec5c..428e21c 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -1892,12 +1892,13 @@ The value is non-nil if there were no errors, nil if errors."
 		(rename-file tempfile target-file t)
 		(or noninteractive (message "Wrote %s" target-file)))
 	    ;; This is just to give a better error message than write-region
-	    (signal 'file-error
-		    (list "Opening output file"
-			  (if (file-exists-p target-file)
-			      "Cannot overwrite file"
-			    "Directory not writable or nonexistent")
-			  target-file)))
+	    (let ((exists (file-exists-p target-file)))
+	      (signal (if exists 'file-error 'file-missing)
+		      (list "Opening output file"
+			    (if exists
+				"Cannot overwrite file"
+			      "Directory not writable or nonexistent")
+			    target-file))))
 	  (kill-buffer (current-buffer)))
 	(if (and byte-compile-generate-call-tree
 		 (or (eq t byte-compile-generate-call-tree)
diff --git a/lisp/epa-file.el b/lisp/epa-file.el
index ee502ef..2303a08 100644
--- a/lisp/epa-file.el
+++ b/lisp/epa-file.el
@@ -120,7 +120,7 @@ encryption is used."
   (let ((error epa-file-error))
     (save-window-excursion
       (kill-buffer))
-    (signal 'file-error
+    (signal (car error)
 	    (cons "Opening input file" (cdr error)))))
 
 (defvar last-coding-system-used)
@@ -161,7 +161,7 @@ encryption is used."
 	     ;; signal that as a non-file error
 	     ;; so that find-file-noselect-1 won't handle it.
 	     ;; Borrowed from jka-compr.el.
-	     (if (and (eq (car error) 'file-error)
+	     (if (and (memq 'file-error (get (car error) 'error-conditions))
 		      (equal (cadr error) "Searching for program"))
 		 (error "Decryption program `%s' not found"
 			(nth 3 error)))
@@ -175,7 +175,7 @@ encryption is used."
 			 'epa-file--find-file-not-found-function
 			 nil t)
 	       (epa-display-error context))
-	     (signal 'file-error
+	     (signal (car error)
 		     (cons "Opening input file" (cdr error)))))
           (set-buffer buf) ;In case timer/filter changed/killed it (bug#16029)!
 	  (setq-local epa-file-encrypt-to
@@ -272,7 +272,7 @@ If no one is selected, symmetric encryption will be performed.  "
        (epa-display-error context)
        (if (setq entry (assoc file epa-file-passphrase-alist))
 	   (setcdr entry nil))
-       (signal 'file-error (cons "Opening output file" (cdr error)))))
+       (signal (car error) (cons "Opening output file" (cdr error)))))
     (epa-file-run-real-handler
      #'write-region
      (list string nil file append visit lockname mustbenew))
diff --git a/lisp/ffap.el b/lisp/ffap.el
index 7013e6e..3d7ceba 100644
--- a/lisp/ffap.el
+++ b/lisp/ffap.el
@@ -1510,9 +1510,9 @@ and the functions `ffap-file-at-point' and `ffap-url-at-point'."
 		 ;; expand-file-name fixes "~/~/.emacs" bug sent by CHUCKR.
 		 (expand-file-name filename)))
        ;; User does not want to find a non-existent file:
-       ((signal 'file-error (list "Opening file buffer"
-				  "No such file or directory"
-				  filename)))))))
+       ((signal 'file-missing (list "Opening file buffer"
+				    "No such file or directory"
+				    filename)))))))
 
 ;; Shortcut: allow {M-x ffap} rather than {M-x find-file-at-point}.
 ;;;###autoload
@@ -1888,7 +1888,10 @@ If `dired-at-point-require-prefix' is set, the prefix meaning is reversed."
 	     (y-or-n-p "Directory does not exist, create it? "))
 	(make-directory filename)
 	(funcall ffap-directory-finder filename))
-       ((error "No such file or directory `%s'" filename))))))
+       (t
+	(signal 'file-missing (list "Opening directory"
+				    "No such file or directory"
+				    filename)))))))
 
 (defun dired-at-point-prompter (&optional guess)
   ;; Does guess and prompt step for find-file-at-point.
diff --git a/lisp/files.el b/lisp/files.el
index 12c6c14..8277877 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -5342,9 +5342,7 @@ This acts like (apply FN ARGS) except it returns NO-SUCH if it is
 non-nil and if FN fails due to a missing file or directory."
   (condition-case err
       (apply fn args)
-    (file-error
-     (or (pcase err (`(,_ ,_ "No such file or directory" . ,_) no-such))
-	 (signal (car err) (cdr err))))))
+    (file-missing (or no-such (signal (car err) (cdr err))))))
 
 (defun delete-directory (directory &optional recursive trash)
   "Delete the directory named DIRECTORY.  Does not follow symlinks.
diff --git a/lisp/gnus/nnmaildir.el b/lisp/gnus/nnmaildir.el
index 21c8375..03cb445 100644
--- a/lisp/gnus/nnmaildir.el
+++ b/lisp/gnus/nnmaildir.el
@@ -371,8 +371,7 @@ This variable is set by `nnmaildir-request-article'.")
        (string= (downcase (caddr err)) "too many links")))
 
 (defun nnmaildir--enoent-p (err)
-  (and (eq (car err) 'file-error)
-       (string= (downcase (caddr err)) "no such file or directory")))
+  (eq (car err) 'file-missing))
 
 (defun nnmaildir--eexist-p (err)
   (eq (car err) 'file-already-exists))
diff --git a/lisp/jka-compr.el b/lisp/jka-compr.el
index a555674..d8137b1 100644
--- a/lisp/jka-compr.el
+++ b/lisp/jka-compr.el
@@ -444,17 +444,18 @@ There should be no more than seven characters after the final `/'."
                  ;; If the file we wanted to uncompress does not exist,
                  ;; handle that according to VISIT as `insert-file-contents'
                  ;; would, maybe signaling the same error it normally would.
-                 (if (and (eq (car error-code) 'file-error)
+                 (if (and (eq (car error-code) 'file-missing)
                           (eq (nth 3 error-code) local-file))
                      (if visit
                          (setq notfound error-code)
-                       (signal 'file-error
+                       (signal 'file-missing
                                (cons "Opening input file"
                                      (nthcdr 2 error-code))))
                    ;; If the uncompression program can't be found,
                    ;; signal that as a non-file error
                    ;; so that find-file-noselect-1 won't handle it.
-                   (if (and (eq (car error-code) 'file-error)
+                   (if (and (memq 'file-error (get (car error-code)
+                                                   'error-conditions))
                             (equal (cadr error-code) "Searching for program"))
                        (error "Uncompression program `%s' not found"
                               (nth 3 error-code)))
@@ -487,7 +488,7 @@ There should be no more than seven characters after the final `/'."
         (and
          visit
          notfound
-         (signal 'file-error
+         (signal 'file-missing
                  (cons "Opening input file" (nth 2 notfound))))
 
         ;; This is done in insert-file-contents after we return.
diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el
index d5c03e3..9ff9997 100644
--- a/lisp/net/ange-ftp.el
+++ b/lisp/net/ange-ftp.el
@@ -1533,12 +1533,11 @@ then kill the related FTP process."
 
 (defun ange-ftp-barf-if-not-directory (directory)
   (or (file-directory-p directory)
-      (signal 'file-error
-	      (list "Opening directory"
-		    (if (file-exists-p directory)
-			"Not a directory"
-		      "No such file or directory")
-		    directory))))
+      (let ((exists (file-exists-p directory)))
+	(signal (if exists 'file-error 'file-missing)
+		(list "Opening directory"
+		      (if exists "Not a directory" "No such file or directory")
+		      directory)))))
 
 ;;;; ------------------------------------------------------------
 ;;;; FTP process filter support.
@@ -3352,9 +3351,10 @@ system TYPE.")
 		      (setq buffer-file-name filename)))
 		(setq last-coding-system-used coding-system-used)
 		(list filename size))
-	    (signal 'file-error
+	    (signal 'file-missing
 		    (list
 		     "Opening input file"
+		     "No such file or directory"
 		     filename))))
       (ange-ftp-real-insert-file-contents filename visit beg end replace))))
 
@@ -3663,7 +3663,7 @@ so return the size on the remote host exactly. See RFC 3659."
 	newname (expand-file-name newname))
 
   (or (file-exists-p filename)
-      (signal 'file-error
+      (signal 'file-missing
 	      (list "Copy file" "No such file or directory" filename)))
 
   ;; canonicalize newname if a directory.
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el
index d37ab8a..7d4521c 100644
--- a/lisp/progmodes/etags.el
+++ b/lisp/progmodes/etags.el
@@ -307,9 +307,9 @@ file the tag was in."
   (let ((tags-file-name file))
     (save-excursion
       (or (visit-tags-table-buffer file)
-	  (signal 'file-error (list "Visiting tags table"
-				    "No such file or directory"
-				    file)))
+	  (signal 'file-missing (list "Visiting tags table"
+				      "No such file or directory"
+				      file)))
       ;; Set FILE to the expanded name.
       (setq file tags-file-name)))
   (if local
diff --git a/lisp/url/url-handlers.el b/lisp/url/url-handlers.el
index d3be880..0fada8d 100644
--- a/lisp/url/url-handlers.el
+++ b/lisp/url/url-handlers.el
@@ -262,11 +262,12 @@ Fifth arg PRESERVE-UID-GID is ignored.
 A prefix arg makes KEEP-TIME non-nil."
   (if (and (file-exists-p newname)
 	   (not ok-if-already-exists))
-      (error "Opening output file: File already exists, %s" newname))
+      (signal 'file-already-exists (list "File exists" newname)))
   (let ((buffer (url-retrieve-synchronously url))
 	(handle nil))
     (if (not buffer)
-	(error "Opening input file: No such file or directory, %s" url))
+        (signal 'file-missing (list "Opening URL" "No such file or directory"
+                                    url)))
     (with-current-buffer buffer
       (setq handle (mm-dissect-buffer t)))
     (let ((mm-attachment-file-modes (default-file-modes)))
diff --git a/src/fileio.c b/src/fileio.c
index 6026d8e..ea6e4ae 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -203,7 +203,8 @@ report_file_errno (char const *string, Lisp_Object name, int errorno)
   if (errorno == EEXIST)
     xsignal (Qfile_already_exists, errdata);
   else
-    xsignal (Qfile_error, Fcons (build_string (string), errdata));
+    xsignal (errorno == ENOENT ? Qfile_missing : Qfile_error,
+	     Fcons (build_string (string), errdata));
 }
 
 /* Signal a file-access failure that set errno.  STRING describes the
@@ -5874,6 +5875,7 @@ syms_of_fileio (void)
   DEFSYM (Qfile_error, "file-error");
   DEFSYM (Qfile_already_exists, "file-already-exists");
   DEFSYM (Qfile_date_error, "file-date-error");
+  DEFSYM (Qfile_missing, "file-missing");
   DEFSYM (Qfile_notify_error, "file-notify-error");
   DEFSYM (Qexcl, "excl");
 
@@ -5926,6 +5928,11 @@ behaves as if file names were encoded in `utf-8'.  */);
   Fput (Qfile_date_error, Qerror_message,
 	build_pure_c_string ("Cannot set file date"));
 
+  Fput (Qfile_missing, Qerror_conditions,
+	Fpurecopy (list3 (Qfile_missing, Qfile_error, Qerror)));
+  Fput (Qfile_missing, Qerror_message,
+	build_pure_c_string ("File is missing"));
+
   Fput (Qfile_notify_error, Qerror_conditions,
 	Fpurecopy (list3 (Qfile_notify_error, Qfile_error, Qerror)));
   Fput (Qfile_notify_error, Qerror_message,

commit 76b08a35bb6b3b32e5e5fda53e374769ceae6ed8
Author: Mark Oteiza <mvoteiza@udel.edu>
Date:   Fri Oct 21 11:23:39 2016 -0400

    Teach browse-url to open man page urls
    
    * lisp/net/browse-url.el (browse-url-man-function): New custom option.
    (browse-url): Add a condition to catch links matching "^man:".
    (browse-url-man): New function.

diff --git a/etc/NEWS b/etc/NEWS
index 3b3164c..4e41dbb 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -275,6 +275,10 @@ whose content matches a regexp; bound to '% g'.
 'ibuffer-never-search-content-mode' used by
 'ibuffer-mark-by-content-regexp'.
 
+** Browse-URL
+
+*** Support for opening links to man pages in Man or WoMan mode.
+
 ** Compilation mode
 
 ---
diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el
index c0b3591..1bb4831 100644
--- a/lisp/net/browse-url.el
+++ b/lisp/net/browse-url.el
@@ -184,6 +184,15 @@ be used instead."
   :version "24.1"
   :group 'browse-url)
 
+(defcustom browse-url-man-function 'browse-url-man
+  "Function to display man: links."
+  :type '(radio
+          (function-item :tag "Emacs Man" :value browse-url-man)
+          (const :tag "None" nil)
+          (function :tag "Other function"))
+  :version "26.1"
+  :group 'browse-url)
+
 (defcustom browse-url-netscape-program "netscape"
   ;; Info about netscape-remote from Karl Berry.
   "The name by which to invoke Netscape.
@@ -801,6 +810,8 @@ as ARGS."
   (let ((process-environment (copy-sequence process-environment))
 	(function (or (and (string-match "\\`mailto:" url)
 			   browse-url-mailto-function)
+                      (and (string-match "\\`man:" url)
+                           browse-url-man-function)
 		      browse-url-browser-function))
 	;; Ensure that `default-directory' exists and is readable (b#6077).
 	(default-directory (or (unhandled-file-name-directory default-directory)
@@ -1588,6 +1599,19 @@ used instead of `browse-url-new-window-flag'."
 		     (unless (bolp)
 		       (insert "\n"))))))))
 
+;; --- man ---
+
+(defvar manual-program)
+
+(defun browse-url-man (url &optional _new-window)
+  "Open a man page."
+  (interactive (browse-url-interactive-arg "Man page URL: "))
+  (require 'man)
+  (setq url (replace-regexp-in-string "\\`man:" "" url))
+  (cond
+   ((executable-find manual-program) (man url))
+    (t (woman (replace-regexp-in-string "([[:alnum:]]+)" "" url)))))
+
 ;; --- Random browser ---
 
 ;;;###autoload

commit 0929e061fb544c0f4c10ff0412a41cf7e8148270
Author: Eli Zaretskii <eliz@gnu.org>
Date:   Fri Oct 21 12:59:58 2016 +0300

    Improve fontification of footnote references in Info buffers
    
    * lisp/info.el (Info-fontify-node): Don't fontify random numbers
    in parentheses as if they were footnote references.  See
    https://lists.gnu.org/archive/html/bug-texinfo/2016-10/msg00007.html
    for the details.

diff --git a/lisp/info.el b/lisp/info.el
index bb259bd..6b8b369 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -5001,17 +5001,29 @@ first line or header line, and for breadcrumb links.")
       ;; Fontify footnotes
       (goto-char (point-min))
       (when (and not-fontified-p (re-search-forward "^[ \t]*-+ Footnotes -+$" nil t))
-        (let ((limit (point)))
+        (let ((limit (point))
+              (fncount 0))
+          ;; How many footnotes do we have in this node?
+          (while (re-search-forward "^ [ \t]*([0-9]+) " nil t)
+            (setq fncount (1+ fncount)))
           (goto-char (point-min))
-          (while (re-search-forward "\\(([0-9]+)\\)" nil t)
-            (add-text-properties (match-beginning 0) (match-end 0)
-                                 `(font-lock-face info-xref
-                                   link t
-                                   mouse-face highlight
-                                   help-echo
-                                   ,(if (< (point) limit)
-                                        "mouse-2: go to footnote definition"
-                                      "mouse-2: go to footnote reference"))))))
+          (while (re-search-forward "\\((\\([0-9]+\\))\\)" nil t)
+            (let ((footnote-num (string-to-number (match-string 2))))
+              ;; Don't fontify parenthesized numbers that cannot
+              ;; possibly be one of this node's footnotes.  This still
+              ;; doesn't catch unrelated numbers that happen to be
+              ;; small enough, but in that case they should use
+              ;; "@footnotestyle separate" in the Texinfo sources.
+              (when (and (> footnote-num 0)
+                         (<= footnote-num fncount))
+                (add-text-properties (match-beginning 0) (match-end 0)
+                                     `(font-lock-face info-xref
+                                       link t
+                                       mouse-face highlight
+                                       help-echo
+                                       ,(if (< (point) limit)
+                                          "mouse-2: go to footnote definition"
+                                         "mouse-2: go to footnote reference"))))))))
 
       ;; Hide empty lines at the end of the node.
       (goto-char (point-max))
