customizing @code{Man-prefer-synchronous-calls} to a non-@code{nil}
value.
+@vindex Man-support-remote-systems
+ If the user option @code{Man-support-remote-systems} is
+non-@code{nil}, and @code{default-directory} indicates a remote system
+(@pxref{Remote Files}), the man page is taken from the remote system.
+Calling the @code{man} command with a prefix like @kbd{C-u M-x man}
+reverts the value of @code{Man-support-remote-systems} for that call.
+
@findex woman
@cindex manual pages, on MS-DOS/MS-Windows
An alternative way of reading manual pages is the @kbd{M-x woman}
** Emacs now supports Unicode Standard version 15.1.
+** Network Security Manager
+
+++
-** The Network Security Manager now warns about 3DES by default.
+*** The Network Security Manager now warns about 3DES by default.
This cypher is no longer recommended owing to a major vulnerability
disclosed in 2016, and its small 112 bit key size. Emacs now warns
about its use also when 'network-security-level' is set to 'medium'
(the default). See 'network-security-protocol-checks'.
---
-** The Network Security Manager now warns about <2048 bits in DH key exchange.
+*** The Network Security Manager now warns about <2048 bits in DH key exchange.
Emacs used to warn for Diffie-Hellman key exchanges with prime numbers
smaller than 1024 bits. Since more servers now support it, this
number has been bumped to 2048 bits.
are displayed along the tool bar.
+++
-** 'd' in the mode line now indicates that the window is dedicated.
+** "d" in the mode line now indicates that the window is dedicated.
Windows have always been able to be dedicated to a specific buffer;
see 'window-dedicated-p'. Now the mode line indicates the dedicated
-status of a window, with 'd' appearing in the mode line if a window is
-dedicated and 'D' if the window is strongly dedicated. This indicator
+status of a window, with "d" appearing in the mode line if a window is
+dedicated and "D" if the window is strongly dedicated. This indicator
appears before the buffer name, and after the buffer modification and
remote buffer indicators (usually "---" together).
useful for complicated window setups. It is bound to 'C-x w d'
globally.
-** cl-print
-*** You can expand the "..." truncation everywhere.
-The code that allowed "..." to be expanded in the *Backtrace* should
-now work anywhere the data is generated by `cl-print`.
-
---
** New user option 'uniquify-dirname-transform'.
This can be used to customize how buffer names are uniquified, by
*** Modes can control the expansion via 'cl-print-expand-ellipsis-function'.
+++
-*** There is a new setting 'raw' for 'cl-print-compiled' which causes
-byte-compiled functions to be printed in full by 'prin1'. A button on
-this output can be activated to disassemble the function.
+*** New setting 'raw' for 'cl-print-compiled'.
+This setting causes byte-compiled functions to be printed in full by
+'prin1'. A button on this output can be activated to disassemble the
+function.
+++
*** There is a new chapter in the CL manual documenting cl-print.el.
+See the Info node "(cl) Printing".
** Modeline elements can now be right-aligned.
Anything following the symbol 'mode-line-format-right-align' in
the appearance of every tab on the tab bar.
+++
-** New optional argument for modifying directory local variables
+** New optional argument for modifying directory-local variables.
The commands 'add-dir-local-variable', 'delete-dir-local-variable' and
'copy-file-locals-to-dir-locals' now take an optional prefix argument,
to enter the file you want to modify.
+
** Miscellaneous
---
+++
** New command 'lldb'.
Run the LLDB debugger, analogous to the 'gud-gdb' command. Note that
-you might want to add these settings to your .lldbinit file, to reduce
+you might want to add these settings to your ".lldbinit" file, to reduce
the output in the LLDB output when stepping through source files.
settings set stop-line-count-before 0
*** Obsolete command 'vc-switch-backend' re-added as 'vc-change-backend'.
The command was previously obsoleted and unbound in Emacs 28.
-** Diff Mode
+** Diff mode
+++
*** 'diff-ignore-whitespace-hunk' can now be applied to all hunks.
together with related commands used in the "*Macros and Targets*"
buffer. We recommend using an alternative like 'imenu' instead.
-** Prog Mode
+** Prog mode
+++
*** New command 'prog-fill-reindent-defun'.
point is not in a comment or a string. It is by default bound to
'M-q' in 'prog-mode' and all its descendants.
-** Which Function Mode
+** Which Function mode
+++
-*** Which Function Mode can now display function names on the header line.
+*** Which Function mode can now display function names on the header line.
The new user option 'which-func-display' allows choosing where the
function name is displayed. The default is 'mode' to display in the
mode line. 'header' will display in the header line;
comment already exists, point is only moved to the comment. It is
bound to 'C-c C-d' in 'go-ts-mode'.
-** Man-mode
+** Man mode
+++
*** New user option 'Man-prefer-synchronous-call'.
When this is non-nil, call the 'man' program synchronously rather than
asynchronously (which is the default behavior).
++++
+*** New user option 'Man-support-remote-systems'.
+If the user option 'Man-support-remote-systems' is non-nil, and
+'default-directory' indicates a remote system, the man page is taken
+from the remote system. Calling the 'man' command with a prefix like
+'C-u M-x man' reverts the value of 'Man-support-remote-systems' for
+that call.
+
** DocView
---
early aid that relieves you from moving the buffer or reaching for the
mouse to consult an error message.
-** Python Mode
+** Python mode
---
*** New user option 'python-indent-block-paren-deeper'.
*** The 'nnweb-type' option 'gmane' has been removed.
The gmane.org website is, sadly, down since a number of years with no
prospect of it coming back. Therefore, it is no longer valid to set
-the user option 'nnweb-type' to the 'gmane'.
+the user option 'nnweb-type' to 'gmane'.
** Rmail
object oriented syntax which were added in Perl 5.36 and 5.38.
*** New user option 'cperl-fontify-trailer'.
-This user option takes the values "perl-code" or "comment" and treats
+This user option takes the values 'perl-code' or 'comment' and treats
text after an "__END__" or "__DATA__" token accordingly. The default
-value of "perl-code" is useful for trailing POD and for AutoSplit
-modules, the value "comment" makes cperl-mode treat trailers as
-comment, like perl-mode does.
+value of 'perl-code' is useful for trailing POD and for AutoSplit
+modules, the value 'comment' makes CPerl mode treat trailers as
+comment, like Perl mode does.
*** Commands using the Perl info page are obsolete.
-
The Perl documentation in info format is no longer distributed with
Perl or on CPAN since more than 10 years. Perl documentation can be
read with 'cperl-perldoc' instead.
The user option 'url-gateway-nslookup-program' and the function
'url-gateway-nslookup-host' are consequently also obsolete.
-** socks
+** Socks
+++
-*** SOCKS supports version 4a.
-The 'socks-server' option accepts '4a' as a value for its version
+*** Socks supports version 4a.
+The 'socks-server' user option accepts '4a' as a value for its version
field.
** Edmacro
URIs are now prefixed with "https://" instead.
** Customize
+
+++
-*** New command customize-dirlocals
-This command pops up a buffer to edit the settings in .dir-locals.el
+*** New command 'customize-dirlocals'.
+This command pops up a buffer to edit the settings in ".dir-locals.el".
\f
* New Modes and Packages in Emacs 30.1
\f
* Incompatible Lisp Changes in Emacs 30.1
-** `buffer-match-p and `match-buffers` take `&rest args`
-They used to take a single `&optional arg` and were documented to use
+** 'buffer-match-p' and 'match-buffers' take '&rest args'.
+They used to take a single '&optional arg' and were documented to use
an unreliable hack to try and support condition predicates that
don't accept this optional arg.
The new semantics makes no such accommodation, but the code still
Use 'define-minor-mode' and 'define-globalized-minor-mode' instead.
** The obsolete calling convention of 'sit-for' has been removed.
-That convention was: (sit-for SECONDS MILLISEC &optional NODISP)
+That convention was: '(sit-for SECONDS MILLISEC &optional NODISP)'.
** The 'millisec' argument of 'sleep-for' has been declared obsolete.
Use a float value for the first argument instead.
It is now possible for drag-and-drop handler functions to respond to
drops incorporating more than one URL. Functions capable of this must
set their 'dnd-multiple-handler' symbol properties to a non-nil value.
-See the Info node "(elisp)Drag and Drop".
+See the Info node "(elisp) Drag and Drop".
Incident to this change, the function 'dnd-handle-one-url' has been
made obsolete, for it cannot take these new handlers into account.
produce and understand XLFDs larger than 255 characters.
** 'defadvice' is marked as obsolete.
-See the "(elisp) Porting Old Advice" node for help converting them
-to use 'advice-add' or 'define-advice' instead.
+See the "(elisp) Porting Old Advice" Info node for help converting
+them to use 'advice-add' or 'define-advice' instead.
** 'cl-old-struct-compat-mode' is marked as obsolete.
You may need to recompile our code if it was compiled with Emacs < 24.3.
default to use 'LANGUAGE'.
---
-** New optional argument to 'modify-dir-local-variable'
+** New optional argument to 'modify-dir-local-variable'.
A 5th argument, optional, has been added to
'modify-dir-local-variable'. It can be used to specify which
dir-locals file to modify.
+
\f
* Changes in Emacs 30.1 on Non-Free Operating Systems
;;; Miscellaneous commands
(declare-function Man-getpage-in-background "man" (topic))
+(defvar Man-support-remote-systems) ; from man.el
(defvar manual-program) ; from man.el
(defun dired-do-man ()
(interactive nil dired-mode)
(require 'man)
(let* ((file (dired-get-file-for-visit))
+ (Man-support-remote-systems (file-remote-p file))
(manual-program (string-replace "*" "%s"
(dired-guess-shell-command
"Man command: " (list file)))))
- (Man-getpage-in-background file)))
+ (Man-getpage-in-background (file-local-name file))))
(defun dired-do-info ()
"In Dired, run `info' on this file."
:group 'man
:version "30.1")
+(defcustom Man-support-remote-systems nil
+ "Whether to call the Un*x \"man\" program on remote systems.
+When this is non-nil, call the \"man\" program on the remote
+system determined by `default-directory'."
+ :type 'boolean
+ :version "30.1")
+
(defcustom Man-filter-list nil
"Manpage cleaning filter command phrases.
This variable contains a list of the following form:
(define-button-type 'Man-xref-normal-file
'action (lambda (button)
- (let ((f (substitute-in-file-name
- (button-get button 'Man-target-string))))
+ (let ((f (concat (file-remote-p default-directory)
+ (substitute-in-file-name
+ (button-get button 'Man-target-string)))))
(if (file-exists-p f)
(if (file-readable-p f)
(view-file f)
;; ======================================================================
;; utilities
+(defun Man-default-directory ()
+ "Return a default directory according to `Man-support-remote-systems'."
+ ;; Ensure that `default-directory' exists and is readable.
+ ;; We assume, that this function is always called inside the `man'
+ ;; command, so that we can check `current-prefix-arg' for reverting
+ ;; `Man-support-remote-systems'.
+ (let ((result default-directory)
+ (remote (if current-prefix-arg
+ (not Man-support-remote-systems)
+ Man-support-remote-systems)))
+
+ ;; Use a local directory if remote isn't possible.
+ (when (and (file-remote-p default-directory)
+ (not (and remote
+ ;; TODO:: Test that remote processes are supported.
+ )))
+ (setq result (expand-file-name "~/")))
+
+ ;; Check, whether the directory is accessible.
+ (if (file-accessible-directory-p result)
+ result
+ (expand-file-name (concat (file-remote-p result) "~/")))))
+
+(defun Man-shell-file-name ()
+ "Return a proper shell file name, respecting remote directories."
+ (or ; This works also in the local case.
+ (with-connection-local-variables shell-file-name)
+ "/bin/sh"))
+
+(defun Man-header-file-path ()
+ "C Header file search path used in Man.
+In the local case, it is the value of `Man-header-file-path'.
+Otherwise, it will be checked on the remote system."
+ (let ((remote-id (file-remote-p default-directory)))
+ (if (null remote-id)
+ ;; The local case.
+ Man-header-file-path
+ ;; The remote case. Use connection-local variables.
+ (mapcar
+ (lambda (elt) (concat remote-id elt))
+ (with-connection-local-variables
+ (or (and (local-variable-p 'Man-header-file-path (current-buffer))
+ Man-header-file-path)
+ (setq-connection-local
+ Man-header-file-path
+ (let ((arch (with-temp-buffer
+ (when (zerop (ignore-errors
+ (process-file "gcc" nil '(t nil) nil
+ "-print-multiarch")))
+ (goto-char (point-min))
+ (buffer-substring (point) (line-end-position)))))
+ (base '("/usr/include" "/usr/local/include")))
+ (if (zerop (length arch))
+ base
+ (append
+ base (list (expand-file-name arch "/usr/include"))))))))))))
+
(defun Man-init-defvars ()
"Used for initializing variables based on display's color support.
This is necessary if one wants to dump man.el with Emacs."
(if Man-sed-script
(concat "-e '" Man-sed-script "'")
"")
- "-e '/^[\001-\032][\001-\032]*$/d'"
+ ;; Use octal numbers. Otherwise, \032 (Ctrl-Z) would
+ ;; suspend remote connections.
+ "-e '/^[\\o001-\\o032][\\o001-\\o032]*$/d'"
"-e '/\e[789]/s///g'"
"-e '/Reformatting page. Wait/d'"
"-e '/Reformatting entry. Wait/d'"
a \"/\" as a local filename. The function returns either `man-db'
`man', or nil."
(if (eq Man-support-local-filenames 'auto-detect)
- (setq Man-support-local-filenames
- (with-temp-buffer
- (let ((default-directory
- ;; Ensure that `default-directory' exists and is readable.
- (if (file-accessible-directory-p default-directory)
- default-directory
- (expand-file-name "~/"))))
- (ignore-errors
- (call-process manual-program nil t nil "--help")))
- (cond ((search-backward "--local-file" nil 'move)
- 'man-db)
- ;; This feature seems to be present in at least ver 1.4f,
- ;; which is about 20 years old.
- ;; I don't know if this version has an official name?
- ((looking-at "^man, versione? [1-9]")
- 'man))))
+ (with-connection-local-variables
+ (or (and (local-variable-p 'Man-support-local-filenames (current-buffer))
+ Man-support-local-filenames)
+ (setq-connection-local
+ Man-support-local-filenames
+ (with-temp-buffer
+ (let ((default-directory (Man-default-directory)))
+ (ignore-errors
+ (process-file manual-program nil t nil "--help")))
+ (cond ((search-backward "--local-file" nil 'move)
+ 'man-db)
+ ;; This feature seems to be present in at least
+ ;; ver 1.4f, which is about 20 years old. I
+ ;; don't know if this version has an official
+ ;; name?
+ ((looking-at "^man, versione? [1-9]")
+ 'man))))))
Man-support-local-filenames))
\f
(unless (and Man-completion-cache
(string-prefix-p (car Man-completion-cache) prefix))
(with-temp-buffer
- (setq default-directory "/") ;; in case inherited doesn't exist
+ ;; In case inherited doesn't exist.
+ (setq default-directory (Man-default-directory))
;; Actually for my `man' the arg is a regexp.
;; POSIX says it must be ERE and "man-db" seems to agree,
;; whereas under macOS it seems to be BRE-style and doesn't
;; error later.
(when (eq 0
(ignore-errors
- (call-process
+ (process-file
manual-program nil '(t nil) nil
"-k" (concat (when (or Man-man-k-use-anchor
(string-equal prefix ""))
Note that in some cases you will need to use \\[quoted-insert] to quote the
SPC character in the above examples, because this command attempts
-to auto-complete your input based on the installed manual pages."
+to auto-complete your input based on the installed manual pages.
+
+If `default-directory' is remote, and `Man-support-remote-systems'
+is non-nil, the man page will be formatted on the corresponding
+remote system.
+
+If `man' is called interactively with a prefix argument, the
+value of `Man-support-remote-systems' is reverted."
(interactive
(list (let* ((default-entry (Man-default-man-entry))
Man-coding-system
locale-coding-system))
;; Avoid possible error by using a directory that always exists.
- (default-directory
- (if (and (file-directory-p default-directory)
- (not (find-file-name-handler default-directory
- 'file-directory-p)))
- default-directory
- "/")))
+ (default-directory (Man-default-directory)))
;; Prevent any attempt to use display terminal fanciness.
(setenv "TERM" "dumb")
;; In Debian Woody, at least, we get overlong lines under X
(defun Man-getpage-in-background (topic)
"Use TOPIC to build and fire off the manpage and cleaning command.
Return the buffer in which the manpage will appear."
- (let* ((man-args topic)
- (bufname (concat "*Man " man-args "*"))
- (buffer (get-buffer bufname)))
+ (let* ((default-directory (Man-default-directory))
+ (man-args topic)
+ (bufname
+ (if (file-remote-p default-directory)
+ (format "*Man %s %s *" (file-remote-p default-directory) man-args)
+ (format "*Man %s *" man-args)))
+ (buffer (get-buffer bufname)))
(if buffer
(Man-notify-when-ready buffer)
(message "Invoking %s %s in the background" manual-program man-args)
(Man-start-calling
(if (and (fboundp 'make-process)
(not Man-prefer-synchronous-call))
- (let ((proc (start-process
+ (let ((proc (start-file-process
manual-program buffer
- (if (memq system-type '(cygwin windows-nt))
- shell-file-name
- "sh")
+ (Man-shell-file-name)
shell-command-switch
(format (Man-build-man-command) man-args))))
(set-process-sentinel proc 'Man-bgproc-sentinel)
(set-process-filter proc 'Man-bgproc-filter))
(let* ((inhibit-read-only t)
(exit-status
- (call-process shell-file-name nil (list buffer nil) nil
- shell-command-switch
- (format (Man-build-man-command) man-args)))
+ (process-file
+ (Man-shell-file-name) nil (list buffer nil) nil
+ shell-command-switch
+ (format (Man-build-man-command) man-args)))
(msg ""))
(or (and (numberp exit-status)
(= exit-status 0))
(buffer-read-only nil))
(erase-buffer)
(Man-start-calling
- (call-process shell-file-name nil (list (current-buffer) nil) nil
- shell-command-switch
- (format (Man-build-man-command) Man-arguments)))
+ (process-file
+ (Man-shell-file-name) nil (list (current-buffer) nil) nil
+ shell-command-switch
+ (format (Man-build-man-command) Man-arguments)))
(if Man-fontify-manpage-flag
(Man-fontify-manpage)
(Man-cleanup-manpage))
;; Header file support
(defun Man-view-header-file (file)
"View a header file specified by FILE from `Man-header-file-path'."
- (let ((path Man-header-file-path)
+ (let ((path (Man-header-file-path))
complete-path)
(while path
(setq complete-path (expand-file-name file (car path))