From: Stefan Kangas Date: Sat, 2 Jul 2022 07:33:51 +0000 (+0200) Subject: Merge from origin/emacs-28 X-Git-Tag: emacs-29.0.90~1447^2~1283 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=52c91122eecb0f679de46d539fc85b8e28599fe1;p=emacs.git Merge from origin/emacs-28 1c3d107cb5 Fix "C-u C-x =" for SPC 7e33618bbc ; * src/fns.c (Frequire): Fix a typo in the doc string. (... 6908309827 Doc fixes: don't refer to some obsolete items dc3cb749f3 Remove obsolete cust-print from elisp index 9ffbbddf8e * admin/make-tarball.txt: Minor clarifications. f5421104e9 Fix external image conversion on MS-Windows 6f22631a63 * doc/emacs/buffers.texi (Indirect Buffers): Mention modif... # Conflicts: # doc/emacs/buffers.texi # lisp/emacs-lisp/nadvice.el # lisp/image/image-converter.el --- 52c91122eecb0f679de46d539fc85b8e28599fe1 diff --cc doc/emacs/buffers.texi index 94e9d2760ec,a1ad4926be7..120c957ff86 --- a/doc/emacs/buffers.texi +++ b/doc/emacs/buffers.texi @@@ -643,12 -646,14 +644,20 @@@ buffer in another window named @var{indirect-name} from a buffer @var{base-buffer}, prompting for both using the minibuffer. +@vindex clone-indirect-buffer-hook + The functions that create indirect buffers run the hook +@code{clone-indirect-buffer-hook} after creating the indirect buffer. +When this hook runs, the newly created indirect buffer is the current +buffer. + + Note: When a modification is made to the text of a buffer, the + modification hooks are run only in the base buffer, because most of + the functions on those hooks are not prepared to work correctly in + indirect buffers. So if you need a modification hook function in an + indirect buffer, you need to manually add that function to the hook + @emph{in the base buffer} and then make the function operate in the + desired indirect buffer. + @node Buffer Convenience @section Convenience Features and Customization of Buffer Handling diff --cc lisp/emacs-lisp/nadvice.el index 00c9e5438b8,eae4a0f0ec8..2d5a1b5e77b --- a/lisp/emacs-lisp/nadvice.el +++ b/lisp/emacs-lisp/nadvice.el @@@ -286,34 -273,11 +286,34 @@@ different, but `function-equal' will ho ((symbolp place) `(default-value ',place)) (t place)))) +(defun nadvice--make-docstring (sym) + (let* ((main (documentation (symbol-function sym) 'raw)) + (ud (help-split-fundoc main 'pcase)) + (doc (or (cdr ud) main)) + (col1width (apply #'max (mapcar (lambda (x) + (string-width (symbol-name (car x)))) + advice--how-alist))) + (table (mapconcat (lambda (x) + (format (format " %%-%ds %%s" col1width) + (car x) (nth 2 x))) + advice--how-alist "\n")) + (table (if global-prettify-symbols-mode + (replace-regexp-in-string "(lambda\\>" "(λ" table t t) + table)) + (combined-doc + (if (not (string-match "<<>>" doc)) + doc + (replace-match table t t doc)))) + (if ud (help-add-fundoc-usage combined-doc (car ud)) combined-doc))) + +(put 'add-function 'function-documentation + '(nadvice--make-docstring 'add-function)) + ;;;###autoload -(defmacro add-function (where place function &optional props) +(defmacro add-function (how place function &optional props) ;; TODO: - ;; - maybe let `where' specify some kind of predicate and use it + ;; - maybe let `how' specify some kind of predicate and use it - ;; to implement things like mode-local or eieio-defmethod. + ;; to implement things like mode-local or cl-defmethod. ;; Of course, that only makes sense if the predicates of all advices can ;; be combined and made more efficient. ;; :before is like a normal add-hook on a normal hook. @@@ -352,8 -325,8 +352,8 @@@ is also interactive. There are 3 cases (declare ;;(indent 2) (debug (form [&or symbolp ("local" form) ("var" sexp) gv-place] -- form &optional form))) - `(advice--add-function ,where (gv-ref ,(advice--normalize-place place)) ++ form &optional form))) + `(advice--add-function ,how (gv-ref ,(advice--normalize-place place)) ,function ,props)) (declare-function comp-subr-trampoline-install "comp") diff --cc lisp/image/image-converter.el index 9440c623f90,d3d560f0219..9ce46f01a33 --- a/lisp/image/image-converter.el +++ b/lisp/image/image-converter.el @@@ -249,15 -233,15 +250,16 @@@ Only suffixes that map to `image-mode' ;; We have the image data in SOURCE. (progn (insert source) - (apply #'call-process-region (point-min) (point-max) - (car command) t t nil - (append - (cdr command) - (list (format "%s:-" - (image-converter--mime-type - image-format)) + (let ((coding-system-for-write 'no-conversion)) + (apply #'call-process-region (point-min) (point-max) + (car command) t t nil + (append + (cdr command) + (list (format "%s:-" + (image-converter--mime-type + image-format)) - "png:-"))))) + (concat image-convert-to-format - ":-"))))) ++ ":-")))))) ;; SOURCE is a file name. (apply #'call-process (car command) nil t nil @@@ -276,14 -259,15 +279,15 @@@ (unless (zerop (if image-format (progn (insert source) - (apply #'call-process-region - (point-min) (point-max) (car command) - t '(t nil) nil - (append - (cdr command) - (list "-i" "-" - "-c:v" image-convert-to-format - "-f" "image2pipe" "-")))) + (let ((coding-system-for-write 'no-conversion)) + (apply #'call-process-region + (point-min) (point-max) (car command) + t '(t nil) nil + (append + (cdr command) + (list "-i" "-" - "-c:v" "png" ++ "-c:v" image-convert-to-format + "-f" "image2pipe" "-"))))) (apply #'call-process (car command) nil '(t nil) nil