aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorGlenn Morris2020-04-25 07:50:21 -0700
committerGlenn Morris2020-04-25 07:50:21 -0700
commit519567878fa32715aa377d1fa23240f09ce291f6 (patch)
tree6024af0ac41fca6aa73cebd84352860a864dae7e /lisp
parentf7748ad682abca5968ce24ed488ba56d2e48ef8a (diff)
parent45a64c97c74c34d3d2e912a670b30aa10dbf439c (diff)
downloademacs-519567878fa32715aa377d1fa23240f09ce291f6.tar.gz
emacs-519567878fa32715aa377d1fa23240f09ce291f6.zip
Merge from origin/emacs-27
45a64c97c7 (origin/emacs-27) Clarify semantics of trace-function CONT... 821760fdc4 Don't let a code literal get modified in mml parsing (Bug#... 74a92be16d * lisp/simple.el (kill-ring-save): Doc fix. (Bug#40797) 3d0e859692 Minor doc clarification regarding fringe bitmaps 4d86c7f822 Fix documentation of fringe bitmaps a76af88dd8 Tweak mutability doc a bit more f7e488d206 Calc: fix autoload errors (bug#40800) 369761b36d ; * src/xdisp.c: Improve the introductory commentary. a92ca1f177 Improve indexing of ELisp manual 5a25d17760 * lisp/image-mode.el (image-transform-resize): Remove FIXM... 37ebec3a95 Improve the default value of 'doc-view-ghostscript-program'. ba6104d1e8 Change doc-view-mode-map prefix key 's' to 'c'. 400ff5cd19 Improve wording about constants d2836fe71b Improve the default value of 'doc-view-ghostscript-program'. fc55f65305 Minor improvements in documentation of the last change a64da75961 Add image-auto-resize defcustoms to image-mode.el 692ad40539 Improve the documentation of tab-bar and tab-line # Conflicts: # etc/NEWS
Diffstat (limited to 'lisp')
-rw-r--r--lisp/calc/calc-ext.el9
-rw-r--r--lisp/calc/calc-prog.el5
-rw-r--r--lisp/doc-view.el32
-rw-r--r--lisp/emacs-lisp/trace.el4
-rw-r--r--lisp/gnus/mml.el2
-rw-r--r--lisp/image-mode.el55
-rw-r--r--lisp/simple.el2
7 files changed, 78 insertions, 31 deletions
diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el
index bc70ec283fa..5c11554d5d7 100644
--- a/lisp/calc/calc-ext.el
+++ b/lisp/calc/calc-ext.el
@@ -674,7 +674,6 @@
674 (define-key calc-mode-map "Z/" 'calc-kbd-break) 674 (define-key calc-mode-map "Z/" 'calc-kbd-break)
675 (define-key calc-mode-map "Z`" 'calc-kbd-push) 675 (define-key calc-mode-map "Z`" 'calc-kbd-push)
676 (define-key calc-mode-map "Z'" 'calc-kbd-pop) 676 (define-key calc-mode-map "Z'" 'calc-kbd-pop)
677 (define-key calc-mode-map "Z=" 'calc-kbd-report)
678 (define-key calc-mode-map "Z#" 'calc-kbd-query) 677 (define-key calc-mode-map "Z#" 'calc-kbd-query)
679 678
680 (calc-init-prefixes) 679 (calc-init-prefixes)
@@ -845,8 +844,8 @@ math-bernoulli-number math-gammap1-raw)
845 ("calc-incom" calc-digit-dots) 844 ("calc-incom" calc-digit-dots)
846 845
847 ("calc-keypd" calc-do-keypad 846 ("calc-keypd" calc-do-keypad
848calc-keypad-x-left-click calc-keypad-x-middle-click 847calc-keypad-left-click calc-keypad-middle-click
849calc-keypad-x-right-click) 848calc-keypad-right-click)
850 849
851 ("calc-lang" calc-set-language 850 ("calc-lang" calc-set-language
852math-read-big-balance math-read-big-rec) 851math-read-big-balance math-read-big-rec)
@@ -1003,7 +1002,7 @@ calc-find-root calc-poly-interp)
1003calc-floor calc-idiv calc-increment calc-mant-part calc-max calc-min 1002calc-floor calc-idiv calc-increment calc-mant-part calc-max calc-min
1004calc-round calc-scale-float calc-sign calc-trunc calc-xpon-part) 1003calc-round calc-scale-float calc-sign calc-trunc calc-xpon-part)
1005 1004
1006 ("calc-bin" calc-and calc-binary-radix calc-clip calc-twos-complement-mode 1005 ("calc-bin" calc-and calc-binary-radix calc-clip
1007calc-decimal-radix calc-diff calc-hex-radix calc-leading-zeros 1006calc-decimal-radix calc-diff calc-hex-radix calc-leading-zeros
1008calc-lshift-arith calc-lshift-binary calc-not calc-octal-radix calc-or calc-radix 1007calc-lshift-arith calc-lshift-binary calc-not calc-octal-radix calc-or calc-radix
1009calc-rotate-binary calc-rshift-arith calc-rshift-binary calc-word-size 1008calc-rotate-binary calc-rshift-arith calc-rshift-binary calc-word-size
@@ -1116,7 +1115,7 @@ calc-equal-to calc-get-user-defn calc-greater-equal calc-greater-than
1116calc-in-set calc-kbd-break calc-kbd-else calc-kbd-else-if 1115calc-in-set calc-kbd-break calc-kbd-else calc-kbd-else-if
1117calc-kbd-end-for calc-kbd-end-if calc-kbd-end-loop calc-kbd-end-repeat 1116calc-kbd-end-for calc-kbd-end-if calc-kbd-end-loop calc-kbd-end-repeat
1118calc-kbd-for calc-kbd-if calc-kbd-loop calc-kbd-pop calc-kbd-push 1117calc-kbd-for calc-kbd-if calc-kbd-loop calc-kbd-pop calc-kbd-push
1119calc-kbd-query calc-kbd-repeat calc-kbd-report calc-less-equal 1118calc-kbd-query calc-kbd-repeat calc-less-equal
1120calc-less-than calc-logical-and calc-logical-if calc-logical-not 1119calc-less-than calc-logical-and calc-logical-if calc-logical-not
1121calc-logical-or calc-not-equal-to calc-pass-errors calc-remove-equal 1120calc-logical-or calc-not-equal-to calc-pass-errors calc-remove-equal
1122calc-timing calc-user-define calc-user-define-composition 1121calc-timing calc-user-define calc-user-define-composition
diff --git a/lisp/calc/calc-prog.el b/lisp/calc/calc-prog.el
index e88aa92364c..6db5de4c96c 100644
--- a/lisp/calc/calc-prog.el
+++ b/lisp/calc/calc-prog.el
@@ -1452,11 +1452,6 @@ Redefine the corresponding command."
1452 (error "%s" "Unbalanced Z' in keyboard macro"))) 1452 (error "%s" "Unbalanced Z' in keyboard macro")))
1453 1453
1454 1454
1455;; (defun calc-kbd-report (msg)
1456;; (interactive "sMessage: ")
1457;; (calc-wrapper
1458;; (math-working msg (calc-top-n 1))))
1459
1460(defun calc-kbd-query () 1455(defun calc-kbd-query ()
1461 (interactive) 1456 (interactive)
1462 (let ((defining-kbd-macro nil) 1457 (let ((defining-kbd-macro nil)
diff --git a/lisp/doc-view.el b/lisp/doc-view.el
index 8b3d5527f08..3cac2629a9c 100644
--- a/lisp/doc-view.el
+++ b/lisp/doc-view.el
@@ -59,16 +59,16 @@
59;; will be remembered and applied to all pages of the current 59;; will be remembered and applied to all pages of the current
60;; document. This enables you to cut away the margins of a document 60;; document. This enables you to cut away the margins of a document
61;; to save some space. To select a slice you can use 61;; to save some space. To select a slice you can use
62;; `doc-view-set-slice' (bound to `s s') which will query you for the 62;; `doc-view-set-slice' (bound to `c s') which will query you for the
63;; coordinates of the slice's top-left corner and its width and 63;; coordinates of the slice's top-left corner and its width and
64;; height. A much more convenient way to do the same is offered by 64;; height. A much more convenient way to do the same is offered by
65;; the command `doc-view-set-slice-using-mouse' (bound to `s m'). 65;; the command `doc-view-set-slice-using-mouse' (bound to `c m').
66;; After invocation you only have to press mouse-1 at the top-left 66;; After invocation you only have to press mouse-1 at the top-left
67;; corner and drag it to the bottom-right corner of the desired slice. 67;; corner and drag it to the bottom-right corner of the desired slice.
68;; Even more accurate and convenient is to use 68;; Even more accurate and convenient is to use
69;; `doc-view-set-slice-from-bounding-box' (bound to `s b') which uses 69;; `doc-view-set-slice-from-bounding-box' (bound to `c b') which uses
70;; the BoundingBox information of the current page to set an optimal 70;; the BoundingBox information of the current page to set an optimal
71;; slice. To reset the slice use `doc-view-reset-slice' (bound to `s 71;; slice. To reset the slice use `doc-view-reset-slice' (bound to `c
72;; r'). 72;; r').
73;; 73;;
74;; You can also search within the document. The command `doc-view-search' 74;; You can also search within the document. The command `doc-view-search'
@@ -155,9 +155,19 @@
155(defcustom doc-view-ghostscript-program 155(defcustom doc-view-ghostscript-program
156 (cond 156 (cond
157 ((memq system-type '(windows-nt ms-dos)) 157 ((memq system-type '(windows-nt ms-dos))
158 "gswin32c") 158 (cond
159 (t 159 ;; Windows Ghostscript
160 "gs")) 160 ((executable-find "gswin64c") "gswin64c")
161 ((executable-find "gswin32c") "gswin32c")
162 ;; The GS wrapper coming with TeX Live
163 ((executable-find "rungs") "rungs")
164 ;; The MikTeX builtin GS Check if mgs is functional for external
165 ;; non-MikTeX apps. Was available under:
166 ;; http://blog.miktex.org/post/2005/04/07/Starting-mgsexe-at-the-DOS-Prompt.aspx
167 ((and (executable-find "mgs")
168 (= 0 (shell-command "mgs -q -dNODISPLAY -c quit")))
169 "mgs")))
170 (t "gs"))
161 "Program to convert PS and PDF files to PNG." 171 "Program to convert PS and PDF files to PNG."
162 :type 'file 172 :type 'file
163 :version "27.1") 173 :version "27.1")
@@ -421,10 +431,10 @@ Typically \"page-%s.png\".")
421 ;; Killing the buffer (and the process) 431 ;; Killing the buffer (and the process)
422 (define-key map (kbd "K") 'doc-view-kill-proc) 432 (define-key map (kbd "K") 'doc-view-kill-proc)
423 ;; Slicing the image 433 ;; Slicing the image
424 (define-key map (kbd "s s") 'doc-view-set-slice) 434 (define-key map (kbd "c s") 'doc-view-set-slice)
425 (define-key map (kbd "s m") 'doc-view-set-slice-using-mouse) 435 (define-key map (kbd "c m") 'doc-view-set-slice-using-mouse)
426 (define-key map (kbd "s b") 'doc-view-set-slice-from-bounding-box) 436 (define-key map (kbd "c b") 'doc-view-set-slice-from-bounding-box)
427 (define-key map (kbd "s r") 'doc-view-reset-slice) 437 (define-key map (kbd "c r") 'doc-view-reset-slice)
428 ;; Searching 438 ;; Searching
429 (define-key map (kbd "C-s") 'doc-view-search) 439 (define-key map (kbd "C-s") 'doc-view-search)
430 (define-key map (kbd "<find>") 'doc-view-search) 440 (define-key map (kbd "<find>") 'doc-view-search)
diff --git a/lisp/emacs-lisp/trace.el b/lisp/emacs-lisp/trace.el
index 5c35036a50d..4ebb7ff711d 100644
--- a/lisp/emacs-lisp/trace.el
+++ b/lisp/emacs-lisp/trace.el
@@ -292,7 +292,9 @@ If `current-prefix-arg' is non-nil, also read a buffer and a \"context\"
292(defun trace-function-foreground (function &optional buffer context) 292(defun trace-function-foreground (function &optional buffer context)
293 "Trace calls to function FUNCTION. 293 "Trace calls to function FUNCTION.
294With a prefix argument, also prompt for the trace buffer (default 294With a prefix argument, also prompt for the trace buffer (default
295`trace-buffer'), and a Lisp expression CONTEXT. 295`trace-buffer'), and a Lisp expression CONTEXT. When called from
296Lisp, CONTEXT should be a function of no arguments which returns
297a value to insert into BUFFER during the trace.
296 298
297Tracing a function causes every call to that function to insert 299Tracing a function causes every call to that function to insert
298into BUFFER Lisp-style trace messages that display the function's 300into BUFFER Lisp-style trace messages that display the function's
diff --git a/lisp/gnus/mml.el b/lisp/gnus/mml.el
index 2006837d6a7..21491499eb8 100644
--- a/lisp/gnus/mml.el
+++ b/lisp/gnus/mml.el
@@ -281,7 +281,7 @@ part. This is for the internal use, you should never modify the value.")
281 (setq tag (mml-read-tag) 281 (setq tag (mml-read-tag)
282 no-markup-p nil 282 no-markup-p nil
283 warn nil) 283 warn nil)
284 (setq tag (list 'part '(type . "text/plain")) 284 (setq tag (list 'part (cons 'type "text/plain"))
285 no-markup-p t 285 no-markup-p t
286 warn t)) 286 warn t))
287 (setq raw (cdr (assq 'raw tag)) 287 (setq raw (cdr (assq 'raw tag))
diff --git a/lisp/image-mode.el b/lisp/image-mode.el
index fbce1193cd0..3ee185a0dc5 100644
--- a/lisp/image-mode.el
+++ b/lisp/image-mode.el
@@ -53,11 +53,37 @@ See `image-mode-winprops'.")
53 "Special hook run when image data is requested in a new window. 53 "Special hook run when image data is requested in a new window.
54It is called with one argument, the initial WINPROPS.") 54It is called with one argument, the initial WINPROPS.")
55 55
56;; FIXME this doesn't seem mature yet. Document in manual when it is. 56(defcustom image-auto-resize t
57 "Non-nil to resize the image upon first display.
58Its value should be one of the following:
59 - nil, meaning no resizing.
60 - t, meaning to fit the image to the window height and width.
61 - `fit-height', meaning to fit the image to the window height.
62 - `fit-width', meaning to fit the image to the window width.
63 - A number, which is a scale factor (the default size is 1)."
64 :type '(choice (const :tag "No resizing" nil)
65 (other :tag "Fit height and width" t)
66 (const :tag "Fit height" fit-height)
67 (const :tag "Fit width" fit-width)
68 (number :tag "Scale factor" 1))
69 :version "27.1"
70 :group 'image)
71
72(defcustom image-auto-resize-on-window-resize 1
73 "Non-nil to resize the image whenever the window's dimensions change.
74This will always keep the image fit to the window.
75When non-nil, the value should be a number of seconds to wait before
76resizing according to the value specified in `image-auto-resize'."
77 :type '(choice (const :tag "No auto-resize on window size change" nil)
78 (integer :tag "Wait for number of seconds before resize" 1))
79 :version "27.1"
80 :group 'image)
81
57(defvar-local image-transform-resize nil 82(defvar-local image-transform-resize nil
58 "The image resize operation. 83 "The image resize operation.
59Its value should be one of the following: 84Its value should be one of the following:
60 - nil, meaning no resizing. 85 - nil, meaning no resizing.
86 - t, meaning to fit the image to the window height and width.
61 - `fit-height', meaning to fit the image to the window height. 87 - `fit-height', meaning to fit the image to the window height.
62 - `fit-width', meaning to fit the image to the window width. 88 - `fit-width', meaning to fit the image to the window width.
63 - A number, which is a scale factor (the default size is 1).") 89 - A number, which is a scale factor (the default size is 1).")
@@ -427,9 +453,10 @@ call."
427 (define-key map "sf" 'image-mode-fit-frame) 453 (define-key map "sf" 'image-mode-fit-frame)
428 (define-key map "sh" 'image-transform-fit-to-height) 454 (define-key map "sh" 'image-transform-fit-to-height)
429 (define-key map "sw" 'image-transform-fit-to-width) 455 (define-key map "sw" 'image-transform-fit-to-width)
456 (define-key map "sb" 'image-transform-fit-both)
457 (define-key map "ss" 'image-transform-set-scale)
430 (define-key map "sr" 'image-transform-set-rotation) 458 (define-key map "sr" 'image-transform-set-rotation)
431 (define-key map "s0" 'image-transform-reset) 459 (define-key map "s0" 'image-transform-reset)
432 (define-key map "ss" 'image-transform-set-scale)
433 460
434 ;; Multi-frame keys 461 ;; Multi-frame keys
435 (define-key map (kbd "RET") 'image-toggle-animation) 462 (define-key map (kbd "RET") 'image-toggle-animation)
@@ -482,6 +509,10 @@ call."
482 :help "Resize image to match the window height"] 509 :help "Resize image to match the window height"]
483 ["Fit to Window Width" image-transform-fit-to-width 510 ["Fit to Window Width" image-transform-fit-to-width
484 :help "Resize image to match the window width"] 511 :help "Resize image to match the window width"]
512 ["Fit to Window Height and Width" image-transform-fit-both
513 :help "Resize image to match the window height and width"]
514 ["Set Scale..." image-transform-set-scale
515 :help "Resize image by specified scale factor"]
485 ["Rotate Image..." image-transform-set-rotation 516 ["Rotate Image..." image-transform-set-rotation
486 :help "Rotate the image"] 517 :help "Rotate the image"]
487 ["Reset Transformations" image-transform-reset 518 ["Reset Transformations" image-transform-reset
@@ -569,6 +600,7 @@ Key bindings:
569 600
570 (major-mode-suspend) 601 (major-mode-suspend)
571 (setq major-mode 'image-mode) 602 (setq major-mode 'image-mode)
603 (setq image-transform-resize image-auto-resize)
572 604
573 (if (not (image-get-display-property)) 605 (if (not (image-get-display-property))
574 (progn 606 (progn
@@ -611,7 +643,8 @@ Key bindings:
611 643
612 (add-hook 'change-major-mode-hook #'image-toggle-display-text nil t) 644 (add-hook 'change-major-mode-hook #'image-toggle-display-text nil t)
613 (add-hook 'after-revert-hook #'image-after-revert-hook nil t) 645 (add-hook 'after-revert-hook #'image-after-revert-hook nil t)
614 (add-hook 'window-state-change-functions #'image--window-state-change nil t) 646 (when image-auto-resize-on-window-resize
647 (add-hook 'window-state-change-functions #'image--window-state-change nil t))
615 648
616 (run-mode-hooks 'image-mode-hook) 649 (run-mode-hooks 'image-mode-hook)
617 (let ((image (image-get-display-property)) 650 (let ((image (image-get-display-property))
@@ -768,7 +801,7 @@ was inserted."
768 filename)) 801 filename))
769 ;; If we have a `fit-width' or a `fit-height', don't limit 802 ;; If we have a `fit-width' or a `fit-height', don't limit
770 ;; the size of the image to the window size. 803 ;; the size of the image to the window size.
771 (edges (and (null image-transform-resize) 804 (edges (and (eq image-transform-resize t)
772 (window-inside-pixel-edges (get-buffer-window)))) 805 (window-inside-pixel-edges (get-buffer-window))))
773 (type (if (image--imagemagick-wanted-p filename) 806 (type (if (image--imagemagick-wanted-p filename)
774 'imagemagick 807 'imagemagick
@@ -878,7 +911,9 @@ Otherwise, display the image by calling `image-mode'."
878 ;; image resizing happens later during redisplay. So if those 911 ;; image resizing happens later during redisplay. So if those
879 ;; consecutive calls happen without any redisplay between them, 912 ;; consecutive calls happen without any redisplay between them,
880 ;; the costly operation of image resizing should happen only once. 913 ;; the costly operation of image resizing should happen only once.
881 (run-with-idle-timer 1 nil #'image-fit-to-window window)) 914 (when (numberp image-auto-resize-on-window-resize)
915 (run-with-idle-timer image-auto-resize-on-window-resize nil
916 #'image-fit-to-window window)))
882 917
883(defun image-fit-to-window (window) 918(defun image-fit-to-window (window)
884 "Adjust size of image to display it exactly in WINDOW boundaries." 919 "Adjust size of image to display it exactly in WINDOW boundaries."
@@ -1282,7 +1317,7 @@ These properties are determined by the Image mode variables
1282`image-transform-resize' and `image-transform-rotation'. The 1317`image-transform-resize' and `image-transform-rotation'. The
1283return value is suitable for appending to an image spec." 1318return value is suitable for appending to an image spec."
1284 (setq image-transform-scale 1.0) 1319 (setq image-transform-scale 1.0)
1285 (when (or image-transform-resize 1320 (when (or (not (memq image-transform-resize '(nil t)))
1286 (/= image-transform-rotation 0.0)) 1321 (/= image-transform-rotation 0.0))
1287 ;; Note: `image-size' looks up and thus caches the untransformed 1322 ;; Note: `image-size' looks up and thus caches the untransformed
1288 ;; image. There's no easy way to prevent that. 1323 ;; image. There's no easy way to prevent that.
@@ -1328,6 +1363,12 @@ return value is suitable for appending to an image spec."
1328 (setq image-transform-resize 'fit-width) 1363 (setq image-transform-resize 'fit-width)
1329 (image-toggle-display-image)) 1364 (image-toggle-display-image))
1330 1365
1366(defun image-transform-fit-both ()
1367 "Fit the current image both to the height and width of the current window."
1368 (interactive)
1369 (setq image-transform-resize t)
1370 (image-toggle-display-image))
1371
1331(defun image-transform-set-rotation (rotation) 1372(defun image-transform-set-rotation (rotation)
1332 "Prompt for an angle ROTATION, and rotate the image by that amount. 1373 "Prompt for an angle ROTATION, and rotate the image by that amount.
1333ROTATION should be in degrees." 1374ROTATION should be in degrees."
@@ -1338,7 +1379,7 @@ ROTATION should be in degrees."
1338(defun image-transform-reset () 1379(defun image-transform-reset ()
1339 "Display the current image with the default size and rotation." 1380 "Display the current image with the default size and rotation."
1340 (interactive) 1381 (interactive)
1341 (setq image-transform-resize nil 1382 (setq image-transform-resize image-auto-resize
1342 image-transform-rotation 0.0 1383 image-transform-rotation 0.0
1343 image-transform-scale 1) 1384 image-transform-scale 1)
1344 (image-toggle-display-image)) 1385 (image-toggle-display-image))
diff --git a/lisp/simple.el b/lisp/simple.el
index 8bc84a9dfa0..b5ba05426f5 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -4846,7 +4846,7 @@ In Transient Mark mode, deactivate the mark.
4846If `interprogram-cut-function' is non-nil, also save the text for a window 4846If `interprogram-cut-function' is non-nil, also save the text for a window
4847system cut and paste. 4847system cut and paste.
4848 4848
4849If you want to append the killed line to the last killed text, 4849If you want to append the killed region to the last killed text,
4850use \\[append-next-kill] before \\[kill-ring-save]. 4850use \\[append-next-kill] before \\[kill-ring-save].
4851 4851
4852The copied text is filtered by `filter-buffer-substring' before it is 4852The copied text is filtered by `filter-buffer-substring' before it is