diff options
| author | Stephen Leake | 2019-09-18 17:43:28 -0700 |
|---|---|---|
| committer | Stephen Leake | 2019-09-18 17:43:28 -0700 |
| commit | 34f1035e878a06ad181ff7fc533cd1fa0a565847 (patch) | |
| tree | 7708b0e62b09571ba5b2c625d810cd932c380508 /lisp | |
| parent | b478444099655f36f7b243e21e8f98051299ca8f (diff) | |
| parent | 107ce3050fc37b9a13d8304ae1bb73fac9de5f61 (diff) | |
| download | emacs-34f1035e878a06ad181ff7fc533cd1fa0a565847.tar.gz emacs-34f1035e878a06ad181ff7fc533cd1fa0a565847.zip | |
Merge commit '107ce3050fc37b9a13d8304ae1bb73fac9de5f61'
Diffstat (limited to 'lisp')
52 files changed, 619 insertions, 313 deletions
diff --git a/lisp/calc/calc-prog.el b/lisp/calc/calc-prog.el index ba8efd43b8e..37e10e8dfac 100644 --- a/lisp/calc/calc-prog.el +++ b/lisp/calc/calc-prog.el | |||
| @@ -1097,7 +1097,7 @@ Redefine the corresponding command." | |||
| 1097 | (or func (setq func (and cmd (symbolp cmd) (fboundp cmd) cmd))) | 1097 | (or func (setq func (and cmd (symbolp cmd) (fboundp cmd) cmd))) |
| 1098 | (if (get func 'math-compose-forms) | 1098 | (if (get func 'math-compose-forms) |
| 1099 | (let ((pt (point))) | 1099 | (let ((pt (point))) |
| 1100 | (insert "(put '" (symbol-name cmd) | 1100 | (insert "(put '" (symbol-name func) |
| 1101 | " 'math-compose-forms '" | 1101 | " 'math-compose-forms '" |
| 1102 | (prin1-to-string (get func 'math-compose-forms)) | 1102 | (prin1-to-string (get func 'math-compose-forms)) |
| 1103 | ")\n") | 1103 | ")\n") |
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 8a8bad91137..24969633373 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el | |||
| @@ -2212,7 +2212,12 @@ and `face'." | |||
| 2212 | (unless (eq state 'modified) | 2212 | (unless (eq state 'modified) |
| 2213 | (unless (memq state '(nil unknown hidden)) | 2213 | (unless (memq state '(nil unknown hidden)) |
| 2214 | (widget-put widget :custom-state 'modified)) | 2214 | (widget-put widget :custom-state 'modified)) |
| 2215 | (custom-magic-reset widget) | 2215 | ;; Update the status text (usually from "STANDARD" to "EDITED |
| 2216 | ;; bla bla" in the buffer after the command has run. Otherwise | ||
| 2217 | ;; commands like `M-u' (that work on a region in the buffer) | ||
| 2218 | ;; will upcase the wrong part of the buffer, since more text has | ||
| 2219 | ;; been inserted before point. | ||
| 2220 | (run-with-idle-timer 0.0 nil #'custom-magic-reset widget) | ||
| 2216 | (apply 'widget-default-notify widget args)))) | 2221 | (apply 'widget-default-notify widget args)))) |
| 2217 | 2222 | ||
| 2218 | (defun custom-redraw (widget) | 2223 | (defun custom-redraw (widget) |
diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el index a2dbd402c52..ce2827162b9 100644 --- a/lisp/emacs-lisp/autoload.el +++ b/lisp/emacs-lisp/autoload.el | |||
| @@ -398,9 +398,8 @@ FILE's name." | |||
| 398 | ;; Probably pointless, but replaces the old AUTOGEN_VCS in lisp/Makefile, | 398 | ;; Probably pointless, but replaces the old AUTOGEN_VCS in lisp/Makefile, |
| 399 | ;; which was designed to handle CVSREAD=1 and equivalent. | 399 | ;; which was designed to handle CVSREAD=1 and equivalent. |
| 400 | (and autoload-ensure-writable | 400 | (and autoload-ensure-writable |
| 401 | (file-exists-p file) | ||
| 402 | (let ((modes (file-modes file))) | 401 | (let ((modes (file-modes file))) |
| 403 | (if (zerop (logand modes #o0200)) | 402 | (if (and modes (zerop (logand modes #o0200))) |
| 404 | ;; Ignore any errors here, and let subsequent attempts | 403 | ;; Ignore any errors here, and let subsequent attempts |
| 405 | ;; to write the file raise any real error. | 404 | ;; to write the file raise any real error. |
| 406 | (ignore-errors (set-file-modes file (logior modes #o0200)))))) | 405 | (ignore-errors (set-file-modes file (logior modes #o0200)))))) |
diff --git a/lisp/emacs-lisp/backtrace.el b/lisp/emacs-lisp/backtrace.el index 60d146e24a8..0c4c7987c3c 100644 --- a/lisp/emacs-lisp/backtrace.el +++ b/lisp/emacs-lisp/backtrace.el | |||
| @@ -175,7 +175,8 @@ This should be a list of `backtrace-frame' objects.") | |||
| 175 | 175 | ||
| 176 | (defvar-local backtrace-view nil | 176 | (defvar-local backtrace-view nil |
| 177 | "A plist describing how to render backtrace frames. | 177 | "A plist describing how to render backtrace frames. |
| 178 | Possible entries are :show-flags, :show-locals and :print-circle.") | 178 | Possible entries are :show-flags, :show-locals, :print-circle |
| 179 | and :print-gensym.") | ||
| 179 | 180 | ||
| 180 | (defvar-local backtrace-insert-header-function nil | 181 | (defvar-local backtrace-insert-header-function nil |
| 181 | "Function for inserting a header for the current Backtrace buffer. | 182 | "Function for inserting a header for the current Backtrace buffer. |
| @@ -205,6 +206,7 @@ frames where the source code location is known.") | |||
| 205 | (define-key map "p" 'backtrace-backward-frame) | 206 | (define-key map "p" 'backtrace-backward-frame) |
| 206 | (define-key map "v" 'backtrace-toggle-locals) | 207 | (define-key map "v" 'backtrace-toggle-locals) |
| 207 | (define-key map "#" 'backtrace-toggle-print-circle) | 208 | (define-key map "#" 'backtrace-toggle-print-circle) |
| 209 | (define-key map ":" 'backtrace-toggle-print-gensym) | ||
| 208 | (define-key map "s" 'backtrace-goto-source) | 210 | (define-key map "s" 'backtrace-goto-source) |
| 209 | (define-key map "\C-m" 'backtrace-help-follow-symbol) | 211 | (define-key map "\C-m" 'backtrace-help-follow-symbol) |
| 210 | (define-key map "+" 'backtrace-multi-line) | 212 | (define-key map "+" 'backtrace-multi-line) |
| @@ -224,6 +226,18 @@ frames where the source code location is known.") | |||
| 224 | :active (backtrace-get-index) | 226 | :active (backtrace-get-index) |
| 225 | :selected (plist-get (backtrace-get-view) :show-locals) | 227 | :selected (plist-get (backtrace-get-view) :show-locals) |
| 226 | :help "Show or hide the local variables for the frame at point"] | 228 | :help "Show or hide the local variables for the frame at point"] |
| 229 | ["Show Circular Structures" backtrace-toggle-print-circle | ||
| 230 | :style toggle | ||
| 231 | :active (backtrace-get-index) | ||
| 232 | :selected (plist-get (backtrace-get-view) :print-circle) | ||
| 233 | :help | ||
| 234 | "Condense or expand shared or circular structures in the frame at point"] | ||
| 235 | ["Show Uninterned Symbols" backtrace-toggle-print-gensym | ||
| 236 | :style toggle | ||
| 237 | :active (backtrace-get-index) | ||
| 238 | :selected (plist-get (backtrace-get-view) :print-gensym) | ||
| 239 | :help | ||
| 240 | "Toggle unique printing of uninterned symbols in the frame at point"] | ||
| 227 | ["Expand \"...\"s" backtrace-expand-ellipses | 241 | ["Expand \"...\"s" backtrace-expand-ellipses |
| 228 | :help "Expand all the abbreviated forms in the current frame"] | 242 | :help "Expand all the abbreviated forms in the current frame"] |
| 229 | ["Show on Multiple Lines" backtrace-multi-line | 243 | ["Show on Multiple Lines" backtrace-multi-line |
| @@ -339,6 +353,7 @@ It runs `backtrace-revert-hook', then calls `backtrace-print'." | |||
| 339 | `(let ((print-escape-control-characters t) | 353 | `(let ((print-escape-control-characters t) |
| 340 | (print-escape-newlines t) | 354 | (print-escape-newlines t) |
| 341 | (print-circle (plist-get ,view :print-circle)) | 355 | (print-circle (plist-get ,view :print-circle)) |
| 356 | (print-gensym (plist-get ,view :print-gensym)) | ||
| 342 | (standard-output (current-buffer))) | 357 | (standard-output (current-buffer))) |
| 343 | ,@body)) | 358 | ,@body)) |
| 344 | 359 | ||
| @@ -420,12 +435,18 @@ Set it to VALUE unless the button is a `backtrace-ellipsis' button." | |||
| 420 | 435 | ||
| 421 | (defun backtrace-toggle-print-circle (&optional all) | 436 | (defun backtrace-toggle-print-circle (&optional all) |
| 422 | "Toggle `print-circle' for the backtrace frame at point. | 437 | "Toggle `print-circle' for the backtrace frame at point. |
| 423 | With prefix argument ALL, toggle the value of :print-circle in | 438 | With prefix argument ALL, toggle the default value bound to |
| 424 | `backtrace-view', which affects all of the backtrace frames in | 439 | `print-circle' for all the frames in the buffer." |
| 425 | the buffer." | ||
| 426 | (interactive "P") | 440 | (interactive "P") |
| 427 | (backtrace--toggle-feature :print-circle all)) | 441 | (backtrace--toggle-feature :print-circle all)) |
| 428 | 442 | ||
| 443 | (defun backtrace-toggle-print-gensym (&optional all) | ||
| 444 | "Toggle `print-gensym' for the backtrace frame at point. | ||
| 445 | With prefix argument ALL, toggle the default value bound to | ||
| 446 | `print-gensym' for all the frames in the buffer." | ||
| 447 | (interactive "P") | ||
| 448 | (backtrace--toggle-feature :print-gensym all)) | ||
| 449 | |||
| 429 | (defun backtrace--toggle-feature (feature all) | 450 | (defun backtrace--toggle-feature (feature all) |
| 430 | "Toggle FEATURE for the current backtrace frame or for the buffer. | 451 | "Toggle FEATURE for the current backtrace frame or for the buffer. |
| 431 | FEATURE should be one of the options in `backtrace-view'. If ALL | 452 | FEATURE should be one of the options in `backtrace-view'. If ALL |
| @@ -450,12 +471,15 @@ position point at the start of the frame it was in before." | |||
| 450 | (goto-char (point-min)) | 471 | (goto-char (point-min)) |
| 451 | (while (and (not (eql index (backtrace-get-index))) | 472 | (while (and (not (eql index (backtrace-get-index))) |
| 452 | (< (point) (point-max))) | 473 | (< (point) (point-max))) |
| 453 | (goto-char (backtrace-get-frame-end))))) | 474 | (goto-char (backtrace-get-frame-end)))) |
| 454 | (let ((index (backtrace-get-index))) | 475 | (message "%s is now %s for all frames" |
| 455 | (unless index | 476 | (substring (symbol-name feature) 1) value)) |
| 456 | (user-error "Not in a stack frame")) | 477 | (unless (backtrace-get-index) |
| 457 | (backtrace--set-feature feature | 478 | (user-error "Not in a stack frame")) |
| 458 | (not (plist-get (backtrace-get-view) feature)))))) | 479 | (let ((value (not (plist-get (backtrace-get-view) feature)))) |
| 480 | (backtrace--set-feature feature value) | ||
| 481 | (message "%s is now %s for this frame" | ||
| 482 | (substring (symbol-name feature) 1) value)))) | ||
| 459 | 483 | ||
| 460 | (defun backtrace--set-feature (feature value) | 484 | (defun backtrace--set-feature (feature value) |
| 461 | "Set FEATURE in the view plist of the frame at point to VALUE. | 485 | "Set FEATURE in the view plist of the frame at point to VALUE. |
diff --git a/lisp/emacs-lisp/cl-print.el b/lisp/emacs-lisp/cl-print.el index 5fe3dd1b912..530770128e6 100644 --- a/lisp/emacs-lisp/cl-print.el +++ b/lisp/emacs-lisp/cl-print.el | |||
| @@ -548,21 +548,22 @@ limit." | |||
| 548 | ;; call_debugger (bug#31919). | 548 | ;; call_debugger (bug#31919). |
| 549 | (let* ((print-length (when limit (min limit 50))) | 549 | (let* ((print-length (when limit (min limit 50))) |
| 550 | (print-level (when limit (min 8 (truncate (log limit))))) | 550 | (print-level (when limit (min 8 (truncate (log limit))))) |
| 551 | (delta (when limit | 551 | (delta-length (when limit |
| 552 | (max 1 (truncate (/ print-length print-level)))))) | 552 | (max 1 (truncate (/ print-length print-level)))))) |
| 553 | (with-temp-buffer | 553 | (with-temp-buffer |
| 554 | (catch 'done | 554 | (catch 'done |
| 555 | (while t | 555 | (while t |
| 556 | (erase-buffer) | 556 | (erase-buffer) |
| 557 | (funcall print-function value (current-buffer)) | 557 | (funcall print-function value (current-buffer)) |
| 558 | ;; Stop when either print-level is too low or the value is | 558 | (let ((result (- (point-max) (point-min)))) |
| 559 | ;; successfully printed in the space allowed. | 559 | ;; Stop when either print-level is too low or the value is |
| 560 | (when (or (not limit) | 560 | ;; successfully printed in the space allowed. |
| 561 | (< (- (point-max) (point-min)) limit) | 561 | (when (or (not limit) (< result limit) (<= print-level 2)) |
| 562 | (= print-level 2)) | 562 | (throw 'done (buffer-string))) |
| 563 | (throw 'done (buffer-string))) | 563 | (let* ((ratio (/ result limit)) |
| 564 | (cl-decf print-level) | 564 | (delta-level (max 1 (min (- print-level 2) ratio)))) |
| 565 | (cl-decf print-length delta)))))) | 565 | (cl-decf print-level delta-level) |
| 566 | (cl-decf print-length (* delta-length delta-level))))))))) | ||
| 566 | 567 | ||
| 567 | (provide 'cl-print) | 568 | (provide 'cl-print) |
| 568 | ;;; cl-print.el ends here | 569 | ;;; cl-print.el ends here |
diff --git a/lisp/emacs-lisp/elint.el b/lisp/emacs-lisp/elint.el index b7ef6eeb2ae..187d619f1bc 100644 --- a/lisp/emacs-lisp/elint.el +++ b/lisp/emacs-lisp/elint.el | |||
| @@ -106,7 +106,7 @@ are as follows, and suppress messages about the indicated features: | |||
| 106 | :group 'elint) | 106 | :group 'elint) |
| 107 | 107 | ||
| 108 | (defcustom elint-directory-skip-re "\\(ldefs-boot\\|loaddefs\\)\\.el\\'" | 108 | (defcustom elint-directory-skip-re "\\(ldefs-boot\\|loaddefs\\)\\.el\\'" |
| 109 | "If nil, a regexp matching files to skip when linting a directory." | 109 | "If non-nil, a regexp matching files to skip when linting a directory." |
| 110 | :type '(choice (const :tag "Lint all files" nil) | 110 | :type '(choice (const :tag "Lint all files" nil) |
| 111 | (regexp :tag "Regexp to skip")) | 111 | (regexp :tag "Regexp to skip")) |
| 112 | :safe 'string-or-null-p | 112 | :safe 'string-or-null-p |
diff --git a/lisp/emulation/viper.el b/lisp/emulation/viper.el index 521edbe6048..0f5c92c2c9e 100644 --- a/lisp/emulation/viper.el +++ b/lisp/emulation/viper.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; viper.el --- A full-featured Vi emulator for Emacs and XEmacs, -*-lexical-binding:t -*- | 1 | ;;; viper.el --- A full-featured Vi emulator for Emacs -*- lexical-binding:t -*- |
| 2 | ;; a VI Plan for Emacs Rescue, | 2 | ;; a VI Plan for Emacs Rescue, |
| 3 | ;; and a venomous VI PERil. | 3 | ;; and a venomous VI PERil. |
| 4 | ;; Viper Is also a Package for Emacs Rebels. | 4 | ;; Viper Is also a Package for Emacs Rebels. |
| @@ -34,7 +34,7 @@ | |||
| 34 | 34 | ||
| 35 | ;;; Commentary: | 35 | ;;; Commentary: |
| 36 | 36 | ||
| 37 | ;; Viper is a full-featured Vi emulator for Emacs and XEmacs. It emulates and | 37 | ;; Viper is a full-featured Vi emulator for Emacs. It emulates and |
| 38 | ;; improves upon the standard features of Vi and, at the same time, allows | 38 | ;; improves upon the standard features of Vi and, at the same time, allows |
| 39 | ;; full access to all Emacs facilities. Viper supports multiple undo, | 39 | ;; full access to all Emacs facilities. Viper supports multiple undo, |
| 40 | ;; file name completion, command, file, and search history and it extends | 40 | ;; file name completion, command, file, and search history and it extends |
| @@ -541,7 +541,7 @@ If Viper is enabled, turn it off. Otherwise, turn it on." | |||
| 541 | "Viper Is a Package for Emacs Rebels, | 541 | "Viper Is a Package for Emacs Rebels, |
| 542 | a VI Plan for Emacs Rescue, and a venomous VI PERil. | 542 | a VI Plan for Emacs Rescue, and a venomous VI PERil. |
| 543 | 543 | ||
| 544 | Incidentally, Viper emulates Vi under Emacs/XEmacs 20. | 544 | Incidentally, Viper emulates Vi under Emacs. |
| 545 | It supports all of what is good in Vi and Ex, while extending | 545 | It supports all of what is good in Vi and Ex, while extending |
| 546 | and improving upon much of it. | 546 | and improving upon much of it. |
| 547 | 547 | ||
diff --git a/lisp/files.el b/lisp/files.el index ce4dd99bd53..5ceaacd744e 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -2554,13 +2554,13 @@ unless NOMODES is non-nil." | |||
| 2554 | (auto-save-mode 1))) | 2554 | (auto-save-mode 1))) |
| 2555 | ;; Make people do a little extra work (C-x C-q) | 2555 | ;; Make people do a little extra work (C-x C-q) |
| 2556 | ;; before altering a backup file. | 2556 | ;; before altering a backup file. |
| 2557 | (when (backup-file-name-p buffer-file-name) | ||
| 2558 | (setq buffer-read-only t)) | ||
| 2559 | ;; When a file is marked read-only, | 2557 | ;; When a file is marked read-only, |
| 2560 | ;; make the buffer read-only even if root is looking at it. | 2558 | ;; make the buffer read-only even if root is looking at it. |
| 2561 | (when (and (file-modes (buffer-file-name)) | 2559 | (unless buffer-read-only |
| 2562 | (zerop (logand (file-modes (buffer-file-name)) #o222))) | 2560 | (when (or (backup-file-name-p buffer-file-name) |
| 2563 | (setq buffer-read-only t)) | 2561 | (let ((modes (file-modes (buffer-file-name)))) |
| 2562 | (and modes (zerop (logand modes #o222))))) | ||
| 2563 | (setq buffer-read-only t))) | ||
| 2564 | (unless nomodes | 2564 | (unless nomodes |
| 2565 | (when (and view-read-only view-mode) | 2565 | (when (and view-read-only view-mode) |
| 2566 | (view-mode -1)) | 2566 | (view-mode -1)) |
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index 04cb087737f..eba66c1c3aa 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el | |||
| @@ -5378,9 +5378,9 @@ Compressed files like .gz and .bz2 are decompressed." | |||
| 5378 | 'gnus-undeletable t)))) | 5378 | 'gnus-undeletable t)))) |
| 5379 | ;; We're in the article header. | 5379 | ;; We're in the article header. |
| 5380 | (delete-char -1) | 5380 | (delete-char -1) |
| 5381 | (dolist (ovl (overlays-in btn (point))) | 5381 | (let ((ovl (make-overlay btn (point)))) |
| 5382 | (overlay-put ovl 'gnus-button-attachment-extra t) | 5382 | (overlay-put ovl 'gnus-button-attachment-extra t) |
| 5383 | (overlay-put ovl 'face nil)) | 5383 | (overlay-put ovl 'evaporate t)) |
| 5384 | (save-restriction | 5384 | (save-restriction |
| 5385 | (message-narrow-to-field) | 5385 | (message-narrow-to-field) |
| 5386 | (let ((gnus-treatment-function-alist | 5386 | (let ((gnus-treatment-function-alist |
| @@ -5763,9 +5763,9 @@ all parts." | |||
| 5763 | 'gnus-undeletable t)))) | 5763 | 'gnus-undeletable t)))) |
| 5764 | ;; We're in the article header. | 5764 | ;; We're in the article header. |
| 5765 | (delete-char -1) | 5765 | (delete-char -1) |
| 5766 | (dolist (ovl (overlays-in point (point))) | 5766 | (let ((ovl (make-overlay point (point)))) |
| 5767 | (overlay-put ovl 'gnus-button-attachment-extra t) | 5767 | (overlay-put ovl 'gnus-button-attachment-extra t) |
| 5768 | (overlay-put ovl 'face nil)) | 5768 | (overlay-put ovl 'evaporate t)) |
| 5769 | (save-restriction | 5769 | (save-restriction |
| 5770 | (message-narrow-to-field) | 5770 | (message-narrow-to-field) |
| 5771 | (let ((gnus-treatment-function-alist | 5771 | (let ((gnus-treatment-function-alist |
| @@ -6379,9 +6379,9 @@ in the body. Use `gnus-header-face-alist' to highlight buttons." | |||
| 6379 | (insert "\n") | 6379 | (insert "\n") |
| 6380 | (end-of-line))) | 6380 | (end-of-line))) |
| 6381 | (insert "\n") | 6381 | (insert "\n") |
| 6382 | (dolist (ovl (overlays-in (point-min) (point))) | 6382 | (let ((ovl (make-overlay (point-min) (point)))) |
| 6383 | (overlay-put ovl 'gnus-button-attachment-extra t) | 6383 | (overlay-put ovl 'gnus-button-attachment-extra t) |
| 6384 | (overlay-put ovl 'face nil)) | 6384 | (overlay-put ovl 'evaporate t)) |
| 6385 | (let ((gnus-treatment-function-alist | 6385 | (let ((gnus-treatment-function-alist |
| 6386 | '((gnus-treat-highlight-headers | 6386 | '((gnus-treat-highlight-headers |
| 6387 | gnus-article-highlight-headers)))) | 6387 | gnus-article-highlight-headers)))) |
diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el index e8775c66673..cb369f07b92 100644 --- a/lisp/gnus/gnus-start.el +++ b/lisp/gnus/gnus-start.el | |||
| @@ -897,9 +897,8 @@ If REGEXP is given, lines that match it will be deleted." | |||
| 897 | (set-buffer-modified-p t)) | 897 | (set-buffer-modified-p t)) |
| 898 | ;; Set the file modes to reflect the .newsrc file modes. | 898 | ;; Set the file modes to reflect the .newsrc file modes. |
| 899 | (save-buffer) | 899 | (save-buffer) |
| 900 | (when (and (file-exists-p gnus-current-startup-file) | 900 | (when (and (setq modes (file-modes gnus-current-startup-file)) |
| 901 | (file-exists-p dribble-file) | 901 | (file-exists-p dribble-file)) |
| 902 | (setq modes (file-modes gnus-current-startup-file))) | ||
| 903 | (gnus-set-file-modes dribble-file modes)) | 902 | (gnus-set-file-modes dribble-file modes)) |
| 904 | (goto-char (point-min)) | 903 | (goto-char (point-min)) |
| 905 | (when (search-forward "Gnus was exited on purpose" nil t) | 904 | (when (search-forward "Gnus was exited on purpose" nil t) |
diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el index cba9633b539..5636b8eca47 100644 --- a/lisp/gnus/mm-decode.el +++ b/lisp/gnus/mm-decode.el | |||
| @@ -381,9 +381,11 @@ enables you to choose manually one of two types those mails include." | |||
| 381 | :type 'directory | 381 | :type 'directory |
| 382 | :group 'mime-display) | 382 | :group 'mime-display) |
| 383 | 383 | ||
| 384 | (defcustom mm-inline-large-images nil | 384 | (defcustom mm-inline-large-images 'resize |
| 385 | "If t, then all images fit in the buffer. | 385 | "If nil, images larger than the window aren't displayed in the buffer. |
| 386 | If `resize', try to resize the images so they fit." | 386 | If `resize', try to resize the images so they fit in the buffer. |
| 387 | If t, show the images as they are without resizing." | ||
| 388 | :version "27.1" | ||
| 387 | :type '(radio | 389 | :type '(radio |
| 388 | (const :tag "Inline large images as they are." t) | 390 | (const :tag "Inline large images as they are." t) |
| 389 | (const :tag "Resize large images." resize) | 391 | (const :tag "Resize large images." resize) |
diff --git a/lisp/gnus/mm-view.el b/lisp/gnus/mm-view.el index 6ffa1fc168d..02d99200a35 100644 --- a/lisp/gnus/mm-view.el +++ b/lisp/gnus/mm-view.el | |||
| @@ -65,8 +65,9 @@ | |||
| 65 | :group 'mime-display) | 65 | :group 'mime-display) |
| 66 | 66 | ||
| 67 | (defcustom mm-inline-large-images-proportion 0.9 | 67 | (defcustom mm-inline-large-images-proportion 0.9 |
| 68 | "Maximum proportion of large image resized when | 68 | "Maximum proportion large images can occupy in the buffer. |
| 69 | `mm-inline-large-images' is set to resize." | 69 | This is only used if `mm-inline-large-images' is set to |
| 70 | `resize'." | ||
| 70 | :type 'float | 71 | :type 'float |
| 71 | :version "24.1" | 72 | :version "24.1" |
| 72 | :group 'mime-display) | 73 | :group 'mime-display) |
diff --git a/lisp/help-mode.el b/lisp/help-mode.el index fb29bd2be4f..efc0b8ffa9e 100644 --- a/lisp/help-mode.el +++ b/lisp/help-mode.el | |||
| @@ -59,7 +59,7 @@ | |||
| 59 | ["Next Topic" help-go-forward | 59 | ["Next Topic" help-go-forward |
| 60 | :help "Go back to next topic in this help buffer"] | 60 | :help "Go back to next topic in this help buffer"] |
| 61 | ["Move to Previous Button" backward-button | 61 | ["Move to Previous Button" backward-button |
| 62 | :help "Move to the Next Button in the help buffer"] | 62 | :help "Move to the Previous Button in the help buffer"] |
| 63 | ["Move to Next Button" forward-button | 63 | ["Move to Next Button" forward-button |
| 64 | :help "Move to the Next Button in the help buffer"])) | 64 | :help "Move to the Next Button in the help buffer"])) |
| 65 | 65 | ||
diff --git a/lisp/htmlfontify.el b/lisp/htmlfontify.el index b8442be1e89..c1aaab5e211 100644 --- a/lisp/htmlfontify.el +++ b/lisp/htmlfontify.el | |||
| @@ -1938,9 +1938,9 @@ adding an extension of `hfy-extn'. Fontification is actually done by | |||
| 1938 | (set-buffer html) | 1938 | (set-buffer html) |
| 1939 | (write-file (concat target hfy-extn)) | 1939 | (write-file (concat target hfy-extn)) |
| 1940 | (kill-buffer html)) | 1940 | (kill-buffer html)) |
| 1941 | ;; #o0200 == 128, but emacs20 doesn't know that | 1941 | (let ((modes (file-modes target))) |
| 1942 | (if (and (file-exists-p target) (not (file-writable-p target))) | 1942 | (if (and modes (not (file-writable-p target))) |
| 1943 | (set-file-modes target (logior (file-modes target) 128))) | 1943 | (set-file-modes target (logior modes #o0200)))) |
| 1944 | (copy-file (buffer-file-name source) target 'overwrite)) | 1944 | (copy-file (buffer-file-name source) target 'overwrite)) |
| 1945 | (kill-buffer source)) )) | 1945 | (kill-buffer source)) )) |
| 1946 | 1946 | ||
diff --git a/lisp/imenu.el b/lisp/imenu.el index 5084fe61eff..9df597b4d63 100644 --- a/lisp/imenu.el +++ b/lisp/imenu.el | |||
| @@ -510,8 +510,9 @@ See `imenu--index-alist' for the format of the index alist." | |||
| 510 | "No items suitable for an index found in this buffer")) | 510 | "No items suitable for an index found in this buffer")) |
| 511 | (or imenu--index-alist | 511 | (or imenu--index-alist |
| 512 | (setq imenu--index-alist (list nil))) | 512 | (setq imenu--index-alist (list nil))) |
| 513 | ;; Add a rescan option to the index. | 513 | (unless imenu-auto-rescan |
| 514 | (cons imenu--rescan-item imenu--index-alist)) | 514 | ;; Add a rescan option to the index. |
| 515 | (cons imenu--rescan-item imenu--index-alist))) | ||
| 515 | 516 | ||
| 516 | (defvar imenu--cleanup-seen nil) | 517 | (defvar imenu--cleanup-seen nil) |
| 517 | 518 | ||
diff --git a/lisp/international/fontset.el b/lisp/international/fontset.el index f3ab81633dc..1debec7f469 100644 --- a/lisp/international/fontset.el +++ b/lisp/international/fontset.el | |||
| @@ -719,6 +719,7 @@ | |||
| 719 | symbol | 719 | symbol |
| 720 | braille | 720 | braille |
| 721 | yi | 721 | yi |
| 722 | tai-viet | ||
| 722 | aegean-number | 723 | aegean-number |
| 723 | ancient-greek-number | 724 | ancient-greek-number |
| 724 | ancient-symbol | 725 | ancient-symbol |
| @@ -731,18 +732,26 @@ | |||
| 731 | deseret | 732 | deseret |
| 732 | shavian | 733 | shavian |
| 733 | osmanya | 734 | osmanya |
| 735 | osage | ||
| 734 | cypriot-syllabary | 736 | cypriot-syllabary |
| 735 | phoenician | 737 | phoenician |
| 736 | lydian | 738 | lydian |
| 737 | kharoshthi | 739 | kharoshthi |
| 740 | manichaean | ||
| 741 | elymaic | ||
| 742 | makasar | ||
| 738 | cuneiform-numbers-and-punctuation | 743 | cuneiform-numbers-and-punctuation |
| 739 | cuneiform | 744 | cuneiform |
| 740 | egyptian | 745 | egyptian |
| 746 | bassa-vah | ||
| 747 | pahawh-hmong | ||
| 748 | medefaidrin | ||
| 741 | byzantine-musical-symbol | 749 | byzantine-musical-symbol |
| 742 | musical-symbol | 750 | musical-symbol |
| 743 | ancient-greek-musical-notation | 751 | ancient-greek-musical-notation |
| 744 | tai-xuan-jing-symbol | 752 | tai-xuan-jing-symbol |
| 745 | counting-rod-numeral | 753 | counting-rod-numeral |
| 754 | adlam | ||
| 746 | mahjong-tile | 755 | mahjong-tile |
| 747 | domino-tile)) | 756 | domino-tile)) |
| 748 | (set-fontset-font "fontset-default" | 757 | (set-fontset-font "fontset-default" |
diff --git a/lisp/international/iso-transl.el b/lisp/international/iso-transl.el index b573e1e47c5..3530e6f2538 100644 --- a/lisp/international/iso-transl.el +++ b/lisp/international/iso-transl.el | |||
| @@ -177,6 +177,8 @@ | |||
| 177 | ("c" . [?¢]) | 177 | ("c" . [?¢]) |
| 178 | ("*o" . [?°]) | 178 | ("*o" . [?°]) |
| 179 | ("o" . [?°]) | 179 | ("o" . [?°]) |
| 180 | ("Oe" . [?œ]) | ||
| 181 | ("OE" . [?Œ]) | ||
| 180 | ("*u" . [?µ]) | 182 | ("*u" . [?µ]) |
| 181 | ("u" . [?µ]) | 183 | ("u" . [?µ]) |
| 182 | ("*m" . [?µ]) | 184 | ("*m" . [?µ]) |
diff --git a/lisp/isearch.el b/lisp/isearch.el index 30f7fc7254c..ec51c2cf4cc 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el | |||
| @@ -514,6 +514,9 @@ This is like `describe-bindings', but displays only Isearch keys." | |||
| 514 | (define-key map [isearch-yank-kill] | 514 | (define-key map [isearch-yank-kill] |
| 515 | '(menu-item "Current kill" isearch-yank-kill | 515 | '(menu-item "Current kill" isearch-yank-kill |
| 516 | :help "Append current kill to search string")) | 516 | :help "Append current kill to search string")) |
| 517 | (define-key map [isearch-yank-until-char] | ||
| 518 | '(menu-item "Until char..." isearch-yank-until-char | ||
| 519 | :help "Yank from point to specified character into search string")) | ||
| 517 | (define-key map [isearch-yank-line] | 520 | (define-key map [isearch-yank-line] |
| 518 | '(menu-item "Rest of line" isearch-yank-line | 521 | '(menu-item "Rest of line" isearch-yank-line |
| 519 | :help "Yank the rest of the current line on search string")) | 522 | :help "Yank the rest of the current line on search string")) |
| @@ -705,6 +708,7 @@ This is like `describe-bindings', but displays only Isearch keys." | |||
| 705 | (define-key map "\M-\C-d" 'isearch-del-char) | 708 | (define-key map "\M-\C-d" 'isearch-del-char) |
| 706 | (define-key map "\M-\C-y" 'isearch-yank-char) | 709 | (define-key map "\M-\C-y" 'isearch-yank-char) |
| 707 | (define-key map "\C-y" 'isearch-yank-kill) | 710 | (define-key map "\C-y" 'isearch-yank-kill) |
| 711 | (define-key map "\M-\C-z" 'isearch-yank-until-char) | ||
| 708 | (define-key map "\M-s\C-e" 'isearch-yank-line) | 712 | (define-key map "\M-s\C-e" 'isearch-yank-line) |
| 709 | 713 | ||
| 710 | (define-key map "\M-s\M-<" 'isearch-beginning-of-buffer) | 714 | (define-key map "\M-s\M-<" 'isearch-beginning-of-buffer) |
| @@ -998,6 +1002,8 @@ Type \\[isearch-yank-word-or-char] to yank next word or character in buffer | |||
| 998 | Type \\[isearch-del-char] to delete character from end of search string. | 1002 | Type \\[isearch-del-char] to delete character from end of search string. |
| 999 | Type \\[isearch-yank-char] to yank char from buffer onto end of search\ | 1003 | Type \\[isearch-yank-char] to yank char from buffer onto end of search\ |
| 1000 | string and search for it. | 1004 | string and search for it. |
| 1005 | Type \\[isearch-yank-until-char] to yank from point until the next instance of a | ||
| 1006 | specified character onto end of search string and search for it. | ||
| 1001 | Type \\[isearch-yank-line] to yank rest of line onto end of search string\ | 1007 | Type \\[isearch-yank-line] to yank rest of line onto end of search string\ |
| 1002 | and search for it. | 1008 | and search for it. |
| 1003 | Type \\[isearch-yank-kill] to yank the last string of killed text. | 1009 | Type \\[isearch-yank-kill] to yank the last string of killed text. |
| @@ -1364,7 +1370,6 @@ NOPUSH is t and EDIT is t." | |||
| 1364 | (remove-hook 'post-command-hook 'isearch-post-command-hook) | 1370 | (remove-hook 'post-command-hook 'isearch-post-command-hook) |
| 1365 | (remove-hook 'mouse-leave-buffer-hook 'isearch-mouse-leave-buffer) | 1371 | (remove-hook 'mouse-leave-buffer-hook 'isearch-mouse-leave-buffer) |
| 1366 | (remove-hook 'kbd-macro-termination-hook 'isearch-done) | 1372 | (remove-hook 'kbd-macro-termination-hook 'isearch-done) |
| 1367 | (setq isearch-lazy-highlight-start nil) | ||
| 1368 | (when (buffer-live-p isearch--current-buffer) | 1373 | (when (buffer-live-p isearch--current-buffer) |
| 1369 | (with-current-buffer isearch--current-buffer | 1374 | (with-current-buffer isearch--current-buffer |
| 1370 | (setq isearch--current-buffer nil) | 1375 | (setq isearch--current-buffer nil) |
| @@ -2562,6 +2567,23 @@ If optional ARG is non-nil, pull in the next ARG words." | |||
| 2562 | (interactive "p") | 2567 | (interactive "p") |
| 2563 | (isearch-yank-internal (lambda () (forward-word arg) (point)))) | 2568 | (isearch-yank-internal (lambda () (forward-word arg) (point)))) |
| 2564 | 2569 | ||
| 2570 | (defun isearch-yank-until-char (char) | ||
| 2571 | "Pull everything until next instance of CHAR from buffer into search string. | ||
| 2572 | Interactively, prompt for CHAR. | ||
| 2573 | This is often useful for keyboard macros, for example in programming | ||
| 2574 | languages or markup languages in which CHAR marks a token boundary." | ||
| 2575 | (interactive "cYank until character: ") | ||
| 2576 | (isearch-yank-internal | ||
| 2577 | (lambda () (let ((inhibit-field-text-motion t)) | ||
| 2578 | (condition-case nil | ||
| 2579 | (progn | ||
| 2580 | (search-forward (char-to-string char)) | ||
| 2581 | (forward-char -1)) | ||
| 2582 | (search-failed | ||
| 2583 | (message "`%c' not found" char) | ||
| 2584 | (sit-for 2))) | ||
| 2585 | (point))))) | ||
| 2586 | |||
| 2565 | (defun isearch-yank-line (&optional arg) | 2587 | (defun isearch-yank-line (&optional arg) |
| 2566 | "Pull rest of line from buffer into search string. | 2588 | "Pull rest of line from buffer into search string. |
| 2567 | If optional ARG is non-nil, yank the next ARG lines." | 2589 | If optional ARG is non-nil, yank the next ARG lines." |
| @@ -3947,8 +3969,9 @@ Attempt to do the search exactly the way the pending Isearch would." | |||
| 3947 | (if isearch-lazy-highlight-forward | 3969 | (if isearch-lazy-highlight-forward |
| 3948 | (setq isearch-lazy-highlight-end (point-min)) | 3970 | (setq isearch-lazy-highlight-end (point-min)) |
| 3949 | (setq isearch-lazy-highlight-start (point-max))) | 3971 | (setq isearch-lazy-highlight-start (point-max))) |
| 3950 | (run-at-time lazy-highlight-interval nil | 3972 | (setq isearch-lazy-highlight-timer |
| 3951 | 'isearch-lazy-highlight-buffer-update)) | 3973 | (run-at-time lazy-highlight-interval nil |
| 3974 | 'isearch-lazy-highlight-buffer-update))) | ||
| 3952 | (setq isearch-lazy-highlight-timer | 3975 | (setq isearch-lazy-highlight-timer |
| 3953 | (run-at-time lazy-highlight-interval nil | 3976 | (run-at-time lazy-highlight-interval nil |
| 3954 | 'isearch-lazy-highlight-update))))))))) | 3977 | 'isearch-lazy-highlight-update))))))))) |
diff --git a/lisp/language/tai-viet.el b/lisp/language/tai-viet.el index b202abf029c..086483da813 100644 --- a/lisp/language/tai-viet.el +++ b/lisp/language/tai-viet.el | |||
| @@ -39,21 +39,20 @@ | |||
| 39 | (input-method . "tai-sonla") | 39 | (input-method . "tai-sonla") |
| 40 | (sample-text . "TaiViet (ꪁꪫꪱꪣ ꪼꪕ)\t\tꪅꪰꪙꫂ ꪨꪮꫂ ꪁꪫꪱ / ꪅꪽ ꪨꪷ ꪁꪫꪱ") | 40 | (sample-text . "TaiViet (ꪁꪫꪱꪣ ꪼꪕ)\t\tꪅꪰꪙꫂ ꪨꪮꫂ ꪁꪫꪱ / ꪅꪽ ꪨꪷ ꪁꪫꪱ") |
| 41 | (documentation . "\ | 41 | (documentation . "\ |
| 42 | TaiViet refers to the Tai language used by Tai people in | 42 | TaiViet refers to the Tai script, which is used to write several |
| 43 | Vietnam, and also refers to the script used for this language. | 43 | Tai languages of northwestern Vietnam and surrounding areas. These |
| 44 | Both the script and language have the same origin as that of Thai | 44 | languages are Tai Dam (also known as Black Tai or Tai Noir), |
| 45 | Tai Dón (also known as White Tai or Tai Blanc), Tày Tac, | ||
| 46 | Tai Daeng (also known as Red Tai or Tai Rouge), | ||
| 47 | and Thai Song (also known as Lao Song). However, some people | ||
| 48 | consider Tai Dam, Tai Dón and Tai Daeng to be dialects of the | ||
| 49 | same language, and call them collectively \"Tai Viet\". | ||
| 50 | |||
| 51 | Both the script and languages have the same origin as that of Thai | ||
| 45 | language/script used in Thailand, but now they differ from each | 52 | language/script used in Thailand, but now they differ from each |
| 46 | other in a significant way (especially the scripts are). | 53 | other in a significant way (especially the scripts are). |
| 47 | 54 | ||
| 48 | The language name is spelled as \"ꪁꪫꪱꪣ ꪼꪕ\", and the script name is | 55 | The language name is spelled as \"ꪁꪫꪱꪣ ꪼꪕ\", and the script name is |
| 49 | spelled as \"ꪎ ꪼꪕ\" in the modern form, \"ꪎꪳ ꪼꪕ\" in the traditional | 56 | spelled as \"ꪎꪳ ꪼꪕ\"."))) |
| 50 | form. | ||
| 51 | |||
| 52 | As the proposal for TaiViet script to the Unicode is still on | ||
| 53 | the progress, we use the Private Use Area for TaiViet | ||
| 54 | characters (U+F000..U+F07E). A TaiViet font encoded accordingly | ||
| 55 | is available at this web page: | ||
| 56 | http://www.m17n.org/viettai/ | ||
| 57 | "))) | ||
| 58 | 57 | ||
| 59 | (provide 'tai-viet) | 58 | (provide 'tai-viet) |
diff --git a/lisp/leim/quail/ipa-praat.el b/lisp/leim/quail/ipa-praat.el index 74a2dccc060..169dbcf0e22 100644 --- a/lisp/leim/quail/ipa-praat.el +++ b/lisp/leim/quail/ipa-praat.el | |||
| @@ -148,7 +148,14 @@ input | example | description | |||
| 148 | \\'1 | ˈ | primary stress | 148 | \\'1 | ˈ | primary stress |
| 149 | \\'2 | ˌ | secondary stress | 149 | \\'2 | ˌ | secondary stress |
| 150 | \\cn | t̚ | unreleased plosive | 150 | \\cn | t̚ | unreleased plosive |
| 151 | \\rh | ɜ˞ | rhotacized vowel | 151 | \\hr | ɜ˞ | rhotacized vowel |
| 152 | \\^h | ʰ | aspiration | ||
| 153 | \\^H | ʱ | voiced aspiration | ||
| 154 | \\^w | ʷ | labialized, rounded | ||
| 155 | \\^j | ʲ | palatalized | ||
| 156 | \\^g | ˠ | velarized | ||
| 157 | \\^9 | ˤ | pharyngealized | ||
| 158 | |||
| 152 | 159 | ||
| 153 | - Understrikes | 160 | - Understrikes |
| 154 | 161 | ||
| @@ -168,7 +175,7 @@ input | example | description | |||
| 168 | \\Uv | d̺ | apical | 175 | \\Uv | d̺ | apical |
| 169 | \\Dv | d̻ | laminal | 176 | \\Dv | d̻ | laminal |
| 170 | \\nv | u̯ | nonsyllabic | 177 | \\nv | u̯ | nonsyllabic |
| 171 | \\e3v | e̹ | slightly rounded | 178 | \\3v | e̹ | slightly rounded |
| 172 | \\cv | u̜ | slightly unrounded | 179 | \\cv | u̜ | slightly unrounded |
| 173 | 180 | ||
| 174 | - Overstrikes | 181 | - Overstrikes |
| @@ -176,14 +183,14 @@ input | example | description | |||
| 176 | input | example | description | 183 | input | example | description |
| 177 | ------+---------+-------------------------------------------- | 184 | ------+---------+-------------------------------------------- |
| 178 | \\0^ | ɣ̊ | voiceless | 185 | \\0^ | ɣ̊ | voiceless |
| 179 | \\'^ | | high tone | 186 | \\'^ | é | high tone |
| 180 | \\`^ | | low tone | 187 | \\`^ | è | low tone |
| 181 | \\-^ | | mid tone | 188 | \\-^ | ē | mid tone |
| 182 | \\~^ | | nasalized | 189 | \\~^ | ẽ | nasalized |
| 183 | \\v^ | | rising tone | 190 | \\v^ | ě | rising tone |
| 184 | \\^^ | | falling tone | 191 | \\^^ | ê | falling tone |
| 185 | \\:^ | | centralized | 192 | \\:^ | ë | centralized |
| 186 | \\N^ | | short | 193 | \\N^ | ĕ | short |
| 187 | \\li | k͡p | simultaneous articulation or single segment | 194 | \\li | k͡p | simultaneous articulation or single segment |
| 188 | " | 195 | " |
| 189 | nil t nil nil nil nil nil nil nil nil t) | 196 | nil t nil nil nil nil nil nil nil nil t) |
| @@ -308,7 +315,13 @@ input | example | description | |||
| 308 | ("\\'1" ?ˈ) ; primary stress | 315 | ("\\'1" ?ˈ) ; primary stress |
| 309 | ("\\'2" ?ˌ) ; secondary stress | 316 | ("\\'2" ?ˌ) ; secondary stress |
| 310 | ("\\cn" #x031A) ; t̚ unreleased plosive | 317 | ("\\cn" #x031A) ; t̚ unreleased plosive |
| 311 | ("\\rh" #x02DE) ; ɜ˞ rhotacized vowel | 318 | ("\\hr" #x02DE) ; ɜ˞ rhotacized vowel |
| 319 | ("\\^h" ?ʰ) ; ʰ aspiration (usually following a plosive) | ||
| 320 | ("\\^H" ?ʱ) ; ʱ voiced aspiration (usually following a plosive) | ||
| 321 | ("\\^w" ?ʷ) ; labialized | ||
| 322 | ("\\^j" ?ʲ) ; palatalized | ||
| 323 | ("\\^g" ?ˠ) ; velarized | ||
| 324 | ("\\^9" ?ˤ) ; pharyngealized | ||
| 312 | 325 | ||
| 313 | ("\\|v" #x0329) ; n̩ syllabic consonant | 326 | ("\\|v" #x0329) ; n̩ syllabic consonant |
| 314 | ("\\0v" #x0325) ; b̥ voiceless | 327 | ("\\0v" #x0325) ; b̥ voiceless |
| @@ -324,7 +337,7 @@ input | example | description | |||
| 324 | ("\\Uv" #x033A) ; d̺ apical | 337 | ("\\Uv" #x033A) ; d̺ apical |
| 325 | ("\\Dv" #x033B) ; d̻ laminal | 338 | ("\\Dv" #x033B) ; d̻ laminal |
| 326 | ("\\nv" #x032F) ; u̯ nonsyllabic | 339 | ("\\nv" #x032F) ; u̯ nonsyllabic |
| 327 | ("\\e3v" #x0339) ; e̹ slightly rounded | 340 | ("\\3v" #x0339) ; e̹ slightly rounded |
| 328 | ("\\cv" #x031C) ; u̜ slightly unrounded | 341 | ("\\cv" #x031C) ; u̜ slightly unrounded |
| 329 | 342 | ||
| 330 | ("\\0^" #x030A) ; ɣ̊ voiceless | 343 | ("\\0^" #x030A) ; ɣ̊ voiceless |
diff --git a/lisp/mail/feedmail.el b/lisp/mail/feedmail.el index babc3fc212a..b362614d3a0 100644 --- a/lisp/mail/feedmail.el +++ b/lisp/mail/feedmail.el | |||
| @@ -17,15 +17,6 @@ | |||
| 17 | ;; ability to queue messages for later sending. This replaces | 17 | ;; ability to queue messages for later sending. This replaces |
| 18 | ;; the standalone fakemail program that used to be distributed with Emacs. | 18 | ;; the standalone fakemail program that used to be distributed with Emacs. |
| 19 | 19 | ||
| 20 | ;; feedmail works with recent versions of Emacs (20.x series) and | ||
| 21 | ;; XEmacs (tested with 20.4 and later betas). It probably no longer | ||
| 22 | ;; works with Emacs v18, though I haven't tried that in a long | ||
| 23 | ;; time. Makoto.Nakagawa@jp.compaq.com reports: "I have a report | ||
| 24 | ;; that with a help of APEL library, feedmail works fine under emacs | ||
| 25 | ;; 19.28. You can get APEL from ftp://ftp.m17n.org/pub/mule/apel/. | ||
| 26 | ;; you need apel-10.2 or later to make feedmail work under emacs | ||
| 27 | ;; 19.28." | ||
| 28 | |||
| 29 | ;; Sorry, no manual yet in this release. Look for one with the next | 20 | ;; Sorry, no manual yet in this release. Look for one with the next |
| 30 | ;; release. Or the one after that. Or maybe later. | 21 | ;; release. Or the one after that. Or maybe later. |
| 31 | 22 | ||
| @@ -437,9 +428,7 @@ shuttled robotically onward." | |||
| 437 | (defcustom feedmail-confirm-outgoing-timeout nil | 428 | (defcustom feedmail-confirm-outgoing-timeout nil |
| 438 | "If non-nil, a timeout in seconds at the send confirmation prompt. | 429 | "If non-nil, a timeout in seconds at the send confirmation prompt. |
| 439 | If a positive number, it's a timeout before sending. If a negative | 430 | If a positive number, it's a timeout before sending. If a negative |
| 440 | number, it's a timeout before not sending. This will not work if your | 431 | number, it's a timeout before not sending." |
| 441 | version of Emacs doesn't include the function `y-or-n-p-with-timeout' | ||
| 442 | \(e.g., some versions of XEmacs)." | ||
| 443 | :version "24.1" | 432 | :version "24.1" |
| 444 | :group 'feedmail-misc | 433 | :group 'feedmail-misc |
| 445 | :type '(choice (const nil) integer) | 434 | :type '(choice (const nil) integer) |
| @@ -2004,9 +1993,7 @@ backup file names and the like)." | |||
| 2004 | ((feedmail-fqm-p blobby) | 1993 | ((feedmail-fqm-p blobby) |
| 2005 | (setq blobby-buffer (generate-new-buffer (concat "FQM " blobby))) | 1994 | (setq blobby-buffer (generate-new-buffer (concat "FQM " blobby))) |
| 2006 | (setq already-buffer | 1995 | (setq already-buffer |
| 2007 | (if (fboundp 'find-buffer-visiting) ; missing from XEmacs | 1996 | (find-buffer-visiting maybe-file)) |
| 2008 | (find-buffer-visiting maybe-file) | ||
| 2009 | (get-file-buffer maybe-file))) | ||
| 2010 | (if (and already-buffer (buffer-modified-p already-buffer)) | 1997 | (if (and already-buffer (buffer-modified-p already-buffer)) |
| 2011 | (save-window-excursion | 1998 | (save-window-excursion |
| 2012 | (display-buffer (set-buffer already-buffer)) | 1999 | (display-buffer (set-buffer already-buffer)) |
diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el index f6fd1cd65eb..802c9ba788d 100644 --- a/lisp/mail/smtpmail.el +++ b/lisp/mail/smtpmail.el | |||
| @@ -165,6 +165,13 @@ attempt." | |||
| 165 | :type '(choice regexp (const :tag "None" nil)) | 165 | :type '(choice regexp (const :tag "None" nil)) |
| 166 | :version "27.1") | 166 | :version "27.1") |
| 167 | 167 | ||
| 168 | (defcustom smtpmail-retries 10 | ||
| 169 | "The number of times smtpmail will retry sending when getting transient errors. | ||
| 170 | These are errors with a code of 4xx from the SMTP server, which | ||
| 171 | mean \"try again\"." | ||
| 172 | :type 'integer | ||
| 173 | :version "27.1") | ||
| 174 | |||
| 168 | ;; End of customizable variables. | 175 | ;; End of customizable variables. |
| 169 | 176 | ||
| 170 | 177 | ||
| @@ -654,10 +661,12 @@ Returns an error if the server cannot be contacted." | |||
| 654 | user-mail-address)))) | 661 | user-mail-address)))) |
| 655 | 662 | ||
| 656 | (defun smtpmail-via-smtp (recipient smtpmail-text-buffer | 663 | (defun smtpmail-via-smtp (recipient smtpmail-text-buffer |
| 657 | &optional ask-for-password) | 664 | &optional ask-for-password |
| 665 | send-attempts) | ||
| 658 | (unless smtpmail-smtp-server | 666 | (unless smtpmail-smtp-server |
| 659 | (smtpmail-query-smtp-server)) | 667 | (smtpmail-query-smtp-server)) |
| 660 | (let ((process nil) | 668 | (let ((process nil) |
| 669 | (send-attempts (or send-attempts 1)) | ||
| 661 | (host (or smtpmail-smtp-server | 670 | (host (or smtpmail-smtp-server |
| 662 | (error "`smtpmail-smtp-server' not defined"))) | 671 | (error "`smtpmail-smtp-server' not defined"))) |
| 663 | (port smtpmail-smtp-service) | 672 | (port smtpmail-smtp-service) |
| @@ -819,6 +828,23 @@ Returns an error if the server cannot be contacted." | |||
| 819 | ((smtpmail-ok-p (setq result (smtpmail-read-response process))) | 828 | ((smtpmail-ok-p (setq result (smtpmail-read-response process))) |
| 820 | ;; Success. | 829 | ;; Success. |
| 821 | ) | 830 | ) |
| 831 | ((and (numberp (car result)) | ||
| 832 | (<= 400 (car result) 499) | ||
| 833 | (< send-attempts smtpmail-retries)) | ||
| 834 | (message "Got transient error code %s when sending; retrying attempt %d..." | ||
| 835 | (car result) send-attempts) | ||
| 836 | ;; Retry on getting a transient 4xx code; see | ||
| 837 | ;; https://tools.ietf.org/html/rfc5321#section-4.2.1 | ||
| 838 | (ignore-errors | ||
| 839 | (smtpmail-send-command process "QUIT") | ||
| 840 | (smtpmail-read-response process)) | ||
| 841 | (delete-process process) | ||
| 842 | (sleep-for 1) | ||
| 843 | (setq process nil) | ||
| 844 | (throw 'done | ||
| 845 | (smtpmail-via-smtp recipient smtpmail-text-buffer | ||
| 846 | ask-for-password | ||
| 847 | (1+ send-attempts)))) | ||
| 822 | ((and auth-mechanisms | 848 | ((and auth-mechanisms |
| 823 | (not ask-for-password) | 849 | (not ask-for-password) |
| 824 | (eq (car result) 530)) | 850 | (eq (car result) 530)) |
diff --git a/lisp/mh-e/mh-acros.el b/lisp/mh-e/mh-acros.el index c017419df2e..0f15d3eb71b 100644 --- a/lisp/mh-e/mh-acros.el +++ b/lisp/mh-e/mh-acros.el | |||
| @@ -270,10 +270,16 @@ MH-E functions." | |||
| 270 | (declare (debug let) (indent 1)) | 270 | (declare (debug let) (indent 1)) |
| 271 | ;; Works in both lexical and non-lexical mode. | 271 | ;; Works in both lexical and non-lexical mode. |
| 272 | `(progn | 272 | `(progn |
| 273 | ,@(mapcar (lambda (binder) | 273 | (with-suppressed-warnings ((lexical |
| 274 | `(defvar ,(if (consp binder) (car binder) binder))) | 274 | ,@(mapcar (lambda (binder) |
| 275 | binders) | 275 | (if (consp binder) |
| 276 | (let* ,binders ,@body))) | 276 | (car binder) |
| 277 | binder)) | ||
| 278 | binders))) | ||
| 279 | ,@(mapcar (lambda (binder) | ||
| 280 | `(defvar ,(if (consp binder) (car binder) binder))) | ||
| 281 | binders) | ||
| 282 | (let* ,binders ,@body)))) | ||
| 277 | 283 | ||
| 278 | (provide 'mh-acros) | 284 | (provide 'mh-acros) |
| 279 | 285 | ||
diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 77e6cec9b04..fb495a98582 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el | |||
| @@ -326,6 +326,18 @@ the default EWW buffer." | |||
| 326 | #'url-hexify-string (split-string url) "+")))))) | 326 | #'url-hexify-string (split-string url) "+")))))) |
| 327 | url) | 327 | url) |
| 328 | 328 | ||
| 329 | (defun eww--preprocess-html (start end) | ||
| 330 | "Translate all < characters that do not look like start of tags into <." | ||
| 331 | (save-excursion | ||
| 332 | (save-restriction | ||
| 333 | (narrow-to-region start end) | ||
| 334 | (goto-char start) | ||
| 335 | (let ((case-fold-search t)) | ||
| 336 | (while (re-search-forward "<[^0-9a-z!/]" nil t) | ||
| 337 | (goto-char (match-beginning 0)) | ||
| 338 | (delete-region (point) (1+ (point))) | ||
| 339 | (insert "<")))))) | ||
| 340 | |||
| 329 | ;;;###autoload (defalias 'browse-web 'eww) | 341 | ;;;###autoload (defalias 'browse-web 'eww) |
| 330 | 342 | ||
| 331 | ;;;###autoload | 343 | ;;;###autoload |
| @@ -479,6 +491,7 @@ Currently this means either text/html or application/xhtml+xml." | |||
| 479 | ;; Remove CRLF and replace NUL with � before parsing. | 491 | ;; Remove CRLF and replace NUL with � before parsing. |
| 480 | (while (re-search-forward "\\(\r$\\)\\|\0" nil t) | 492 | (while (re-search-forward "\\(\r$\\)\\|\0" nil t) |
| 481 | (replace-match (if (match-beginning 1) "" "�") t t))) | 493 | (replace-match (if (match-beginning 1) "" "�") t t))) |
| 494 | (eww--preprocess-html (point) (point-max)) | ||
| 482 | (libxml-parse-html-region (point) (point-max)))))) | 495 | (libxml-parse-html-region (point) (point-max)))))) |
| 483 | (source (and (null document) | 496 | (source (and (null document) |
| 484 | (buffer-substring (point) (point-max))))) | 497 | (buffer-substring (point) (point-max))))) |
| @@ -716,6 +729,7 @@ the like." | |||
| 716 | (condition-case nil | 729 | (condition-case nil |
| 717 | (decode-coding-region (point-min) (point-max) 'utf-8) | 730 | (decode-coding-region (point-min) (point-max) 'utf-8) |
| 718 | (coding-system-error nil)) | 731 | (coding-system-error nil)) |
| 732 | (eww--preprocess-html (point-min) (point-max)) | ||
| 719 | (libxml-parse-html-region (point-min) (point-max)))) | 733 | (libxml-parse-html-region (point-min) (point-max)))) |
| 720 | (base (plist-get eww-data :url))) | 734 | (base (plist-get eww-data :url))) |
| 721 | (eww-score-readability dom) | 735 | (eww-score-readability dom) |
| @@ -1433,15 +1447,15 @@ See URL `https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input'.") | |||
| 1433 | (push (cons name (plist-get input :value)) | 1447 | (push (cons name (plist-get input :value)) |
| 1434 | values))) | 1448 | values))) |
| 1435 | ((equal (plist-get input :type) "file") | 1449 | ((equal (plist-get input :type) "file") |
| 1436 | (push (cons "file" | 1450 | (when-let ((file (plist-get input :filename))) |
| 1437 | (list (cons "filedata" | 1451 | (push (list "file" |
| 1438 | (with-temp-buffer | 1452 | (cons "filedata" |
| 1439 | (insert-file-contents | 1453 | (with-temp-buffer |
| 1440 | (plist-get input :filename)) | 1454 | (insert-file-contents file) |
| 1441 | (buffer-string))) | 1455 | (buffer-string))) |
| 1442 | (cons "name" (plist-get input :name)) | 1456 | (cons "name" name) |
| 1443 | (cons "filename" (plist-get input :filename)))) | 1457 | (cons "filename" file)) |
| 1444 | values)) | 1458 | values))) |
| 1445 | ((equal (plist-get input :type) "submit") | 1459 | ((equal (plist-get input :type) "submit") |
| 1446 | ;; We want the values from buttons if we hit a button if | 1460 | ;; We want the values from buttons if we hit a button if |
| 1447 | ;; we hit enter on it, or if it's the first button after | 1461 | ;; we hit enter on it, or if it's the first button after |
diff --git a/lisp/net/net-utils.el b/lisp/net/net-utils.el index 4f68e5db61d..03ed4a59575 100644 --- a/lisp/net/net-utils.el +++ b/lisp/net/net-utils.el | |||
| @@ -563,7 +563,7 @@ This command uses `nslookup-program' to look up DNS records." | |||
| 563 | (apply #'vector (mapcar #'string-to-number (split-string ip "\\.")))) | 563 | (apply #'vector (mapcar #'string-to-number (split-string ip "\\.")))) |
| 564 | (t (error "Invalid format: %s" format))))) | 564 | (t (error "Invalid format: %s" format))))) |
| 565 | 565 | ||
| 566 | (defun ipv6-expand (ipv6-vector) | 566 | (defun nslookup--ipv6-expand (ipv6-vector) |
| 567 | (let ((len (length ipv6-vector))) | 567 | (let ((len (length ipv6-vector))) |
| 568 | (if (< len 8) | 568 | (if (< len 8) |
| 569 | (let* ((pivot (cl-position 0 ipv6-vector)) | 569 | (let* ((pivot (cl-position 0 ipv6-vector)) |
| @@ -598,9 +598,10 @@ This command uses `nslookup-program' to look up DNS records." | |||
| 598 | (cond ((memq format '(string nil)) | 598 | (cond ((memq format '(string nil)) |
| 599 | ip) | 599 | ip) |
| 600 | ((eq format 'vector) | 600 | ((eq format 'vector) |
| 601 | (ipv6-expand (apply #'vector | 601 | (nslookup--ipv6-expand |
| 602 | (cl-loop for hextet in (split-string ip "[:]") | 602 | (apply #'vector |
| 603 | collect (string-to-number hextet 16))))) | 603 | (cl-loop for hextet in (split-string ip "[:]") |
| 604 | collect (string-to-number hextet 16))))) | ||
| 604 | (t (error "Invalid format: %s" format))))) | 605 | (t (error "Invalid format: %s" format))))) |
| 605 | 606 | ||
| 606 | ;;;###autoload | 607 | ;;;###autoload |
diff --git a/lisp/net/rfc2104.el b/lisp/net/rfc2104.el index 5de8401d5b6..fadc979bc15 100644 --- a/lisp/net/rfc2104.el +++ b/lisp/net/rfc2104.el | |||
| @@ -37,8 +37,6 @@ | |||
| 37 | ;; 64 is block length of hash function (64 for MD5 and SHA), 16 is | 37 | ;; 64 is block length of hash function (64 for MD5 and SHA), 16 is |
| 38 | ;; resulting hash length (16 for MD5, 20 for SHA). | 38 | ;; resulting hash length (16 for MD5, 20 for SHA). |
| 39 | ;; | 39 | ;; |
| 40 | ;; Tested with Emacs 20.2 and XEmacs 20.3. | ||
| 41 | ;; | ||
| 42 | ;; Test case reference: RFC 2202. | 40 | ;; Test case reference: RFC 2202. |
| 43 | 41 | ||
| 44 | ;;; History: | 42 | ;;; History: |
diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 81c3fb4aa52..1dff129b9dc 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el | |||
| @@ -1180,8 +1180,24 @@ Return a string with image data." | |||
| 1180 | ;; so glitches may occur during this transformation. | 1180 | ;; so glitches may occur during this transformation. |
| 1181 | (shr-dom-to-xml | 1181 | (shr-dom-to-xml |
| 1182 | (libxml-parse-xml-region (point) (point-max))))) | 1182 | (libxml-parse-xml-region (point) (point-max))))) |
| 1183 | ;; SVG images often do not have a specified foreground/background | ||
| 1184 | ;; color, so wrap them in styles. | ||
| 1185 | (when (eq content-type 'image/svg+xml) | ||
| 1186 | (setq data (svg--wrap-svg data))) | ||
| 1183 | (list data content-type))) | 1187 | (list data content-type))) |
| 1184 | 1188 | ||
| 1189 | (defun svg--wrap-svg (data) | ||
| 1190 | "Add a default foreground colour to SVG images." | ||
| 1191 | (with-temp-buffer | ||
| 1192 | (insert "<svg xmlns:xlink=\"http://www.w3.org/1999/xlink\" " | ||
| 1193 | "xmlns:xi=\"http://www.w3.org/2001/XInclude\" " | ||
| 1194 | "style=\"color: " | ||
| 1195 | (face-foreground 'default) ";\">" | ||
| 1196 | "<xi:include href=\"data:image/svg+xml;base64," | ||
| 1197 | (base64-encode-string data t) | ||
| 1198 | "\"></xi:include></svg>") | ||
| 1199 | (buffer-string))) | ||
| 1200 | |||
| 1185 | (defun shr-image-displayer (content-function) | 1201 | (defun shr-image-displayer (content-function) |
| 1186 | "Return a function to display an image. | 1202 | "Return a function to display an image. |
| 1187 | CONTENT-FUNCTION is a function to retrieve an image for a cid url that | 1203 | CONTENT-FUNCTION is a function to retrieve an image for a cid url that |
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index df4778c9c96..982522bdaf4 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el | |||
| @@ -1191,6 +1191,10 @@ FMT and ARGS are passed to `error'." | |||
| 1191 | "Maybe open a connection VEC. | 1191 | "Maybe open a connection VEC. |
| 1192 | Does not do anything if a connection is already open, but re-opens the | 1192 | Does not do anything if a connection is already open, but re-opens the |
| 1193 | connection if a previous connection has died for some reason." | 1193 | connection if a previous connection has died for some reason." |
| 1194 | ;; During completion, don't reopen a new connection. | ||
| 1195 | (unless (tramp-connectable-p vec) | ||
| 1196 | (throw 'non-essential 'non-essential)) | ||
| 1197 | |||
| 1194 | (let* ((buf (tramp-get-connection-buffer vec)) | 1198 | (let* ((buf (tramp-get-connection-buffer vec)) |
| 1195 | (p (get-buffer-process buf)) | 1199 | (p (get-buffer-process buf)) |
| 1196 | (host (tramp-file-name-host vec)) | 1200 | (host (tramp-file-name-host vec)) |
| @@ -1204,14 +1208,6 @@ connection if a previous connection has died for some reason." | |||
| 1204 | (tramp-error vec 'file-error "Cannot switch to user `%s'" user)) | 1208 | (tramp-error vec 'file-error "Cannot switch to user `%s'" user)) |
| 1205 | 1209 | ||
| 1206 | (unless (process-live-p p) | 1210 | (unless (process-live-p p) |
| 1207 | ;; During completion, don't reopen a new connection. We check | ||
| 1208 | ;; this for the process related to `tramp-buffer-name'; | ||
| 1209 | ;; otherwise `start-file-process' wouldn't run ever when | ||
| 1210 | ;; `non-essential' is non-nil. | ||
| 1211 | (when (and (tramp-completion-mode-p) | ||
| 1212 | (null (get-process (tramp-buffer-name vec)))) | ||
| 1213 | (throw 'non-essential 'non-essential)) | ||
| 1214 | |||
| 1215 | (save-match-data | 1211 | (save-match-data |
| 1216 | (when (and p (processp p)) (delete-process p)) | 1212 | (when (and p (processp p)) (delete-process p)) |
| 1217 | (if (zerop (length device)) | 1213 | (if (zerop (length device)) |
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index b9b6b4b6d18..1036865e4ec 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el | |||
| @@ -1787,6 +1787,10 @@ This is relevant for GNOME Online Accounts." | |||
| 1787 | "Maybe open a connection VEC. | 1787 | "Maybe open a connection VEC. |
| 1788 | Does not do anything if a connection is already open, but re-opens the | 1788 | Does not do anything if a connection is already open, but re-opens the |
| 1789 | connection if a previous connection has died for some reason." | 1789 | connection if a previous connection has died for some reason." |
| 1790 | ;; During completion, don't reopen a new connection. | ||
| 1791 | (unless (tramp-connectable-p vec) | ||
| 1792 | (throw 'non-essential 'non-essential)) | ||
| 1793 | |||
| 1790 | ;; We set the file name, in case there are incoming D-Bus signals or | 1794 | ;; We set the file name, in case there are incoming D-Bus signals or |
| 1791 | ;; D-Bus errors. | 1795 | ;; D-Bus errors. |
| 1792 | (setq tramp-gvfs-dbus-event-vector vec) | 1796 | (setq tramp-gvfs-dbus-event-vector vec) |
diff --git a/lisp/net/tramp-rclone.el b/lisp/net/tramp-rclone.el index 866e7791bf8..1f0c7eadbc5 100644 --- a/lisp/net/tramp-rclone.el +++ b/lisp/net/tramp-rclone.el | |||
| @@ -520,19 +520,14 @@ file names." | |||
| 520 | "Maybe open a connection VEC. | 520 | "Maybe open a connection VEC. |
| 521 | Does not do anything if a connection is already open, but re-opens the | 521 | Does not do anything if a connection is already open, but re-opens the |
| 522 | connection if a previous connection has died for some reason." | 522 | connection if a previous connection has died for some reason." |
| 523 | ;; During completion, don't reopen a new connection. | ||
| 524 | (unless (tramp-connectable-p vec) | ||
| 525 | (throw 'non-essential 'non-essential)) | ||
| 526 | |||
| 523 | (let ((host (tramp-file-name-host vec))) | 527 | (let ((host (tramp-file-name-host vec))) |
| 524 | (when (rassoc `(,host) (tramp-rclone-parse-device-names nil)) | 528 | (when (rassoc `(,host) (tramp-rclone-parse-device-names nil)) |
| 525 | (if (zerop (length host)) | 529 | (if (zerop (length host)) |
| 526 | (tramp-error vec 'file-error "Storage %s not connected" host)) | 530 | (tramp-error vec 'file-error "Storage %s not connected" host)) |
| 527 | |||
| 528 | ;; During completion, don't reopen a new connection. We check | ||
| 529 | ;; this for the process related to `tramp-buffer-name'; | ||
| 530 | ;; otherwise `start-file-process' wouldn't run ever when | ||
| 531 | ;; `non-essential' is non-nil. | ||
| 532 | (when (and (tramp-completion-mode-p) | ||
| 533 | (null (get-process (tramp-buffer-name vec)))) | ||
| 534 | (throw 'non-essential 'non-essential)) | ||
| 535 | |||
| 536 | ;; We need a process bound to the connection buffer. Therefore, | 531 | ;; We need a process bound to the connection buffer. Therefore, |
| 537 | ;; we create a dummy process. Maybe there is a better solution? | 532 | ;; we create a dummy process. Maybe there is a better solution? |
| 538 | (unless (get-buffer-process (tramp-get-connection-buffer vec)) | 533 | (unless (get-buffer-process (tramp-get-connection-buffer vec)) |
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index bcfac78ee65..8092f6a5cf1 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el | |||
| @@ -525,7 +525,9 @@ based on the Tramp and Emacs versions, and should not be set here." | |||
| 525 | :type '(repeat string)) | 525 | :type '(repeat string)) |
| 526 | 526 | ||
| 527 | ;;;###tramp-autoload | 527 | ;;;###tramp-autoload |
| 528 | (defcustom tramp-sh-extra-args '(("/bash\\'" . "-norc -noprofile")) | 528 | (defcustom tramp-sh-extra-args |
| 529 | '(("/bash\\'" . "-norc -noprofile") | ||
| 530 | ("/zsh\\'" . "-f +Z")) | ||
| 529 | "Alist specifying extra arguments to pass to the remote shell. | 531 | "Alist specifying extra arguments to pass to the remote shell. |
| 530 | Entries are (REGEXP . ARGS) where REGEXP is a regular expression | 532 | Entries are (REGEXP . ARGS) where REGEXP is a regular expression |
| 531 | matching the shell file name and ARGS is a string specifying the | 533 | matching the shell file name and ARGS is a string specifying the |
| @@ -1198,18 +1200,22 @@ component is used as the target of the symlink." | |||
| 1198 | 1200 | ||
| 1199 | (defun tramp-sh-handle-file-exists-p (filename) | 1201 | (defun tramp-sh-handle-file-exists-p (filename) |
| 1200 | "Like `file-exists-p' for Tramp files." | 1202 | "Like `file-exists-p' for Tramp files." |
| 1201 | (with-parsed-tramp-file-name filename nil | 1203 | ;; `file-exists-p' is used as predicate in file name completion. |
| 1202 | (with-tramp-file-property v localname "file-exists-p" | 1204 | ;; We don't want to run it when `non-essential' is t, or there is |
| 1203 | (or (not (null (tramp-get-file-property | 1205 | ;; no connection process yet. |
| 1204 | v localname "file-attributes-integer" nil))) | 1206 | (when (tramp-connectable-p filename) |
| 1205 | (not (null (tramp-get-file-property | 1207 | (with-parsed-tramp-file-name filename nil |
| 1206 | v localname "file-attributes-string" nil))) | 1208 | (with-tramp-file-property v localname "file-exists-p" |
| 1207 | (tramp-send-command-and-check | 1209 | (or (not (null (tramp-get-file-property |
| 1208 | v | 1210 | v localname "file-attributes-integer" nil))) |
| 1209 | (format | 1211 | (not (null (tramp-get-file-property |
| 1210 | "%s %s" | 1212 | v localname "file-attributes-string" nil))) |
| 1211 | (tramp-get-file-exists-command v) | 1213 | (tramp-send-command-and-check |
| 1212 | (tramp-shell-quote-argument localname))))))) | 1214 | v |
| 1215 | (format | ||
| 1216 | "%s %s" | ||
| 1217 | (tramp-get-file-exists-command v) | ||
| 1218 | (tramp-shell-quote-argument localname)))))))) | ||
| 1213 | 1219 | ||
| 1214 | (defun tramp-sh-handle-file-attributes (filename &optional id-format) | 1220 | (defun tramp-sh-handle-file-attributes (filename &optional id-format) |
| 1215 | "Like `file-attributes' for Tramp files." | 1221 | "Like `file-attributes' for Tramp files." |
| @@ -4762,6 +4768,10 @@ If there is just some editing, retry it after 5 seconds." | |||
| 4762 | "Maybe open a connection VEC. | 4768 | "Maybe open a connection VEC. |
| 4763 | Does not do anything if a connection is already open, but re-opens the | 4769 | Does not do anything if a connection is already open, but re-opens the |
| 4764 | connection if a previous connection has died for some reason." | 4770 | connection if a previous connection has died for some reason." |
| 4771 | ;; During completion, don't reopen a new connection. | ||
| 4772 | (unless (tramp-connectable-p vec) | ||
| 4773 | (throw 'non-essential 'non-essential)) | ||
| 4774 | |||
| 4765 | (let ((p (tramp-get-connection-process vec)) | 4775 | (let ((p (tramp-get-connection-process vec)) |
| 4766 | (process-name (tramp-get-connection-property vec "process-name" nil)) | 4776 | (process-name (tramp-get-connection-property vec "process-name" nil)) |
| 4767 | (process-environment (copy-sequence process-environment)) | 4777 | (process-environment (copy-sequence process-environment)) |
| @@ -4806,15 +4816,6 @@ connection if a previous connection has died for some reason." | |||
| 4806 | ;; New connection must be opened. | 4816 | ;; New connection must be opened. |
| 4807 | (condition-case err | 4817 | (condition-case err |
| 4808 | (unless (process-live-p p) | 4818 | (unless (process-live-p p) |
| 4809 | |||
| 4810 | ;; During completion, don't reopen a new connection. We | ||
| 4811 | ;; check this for the process related to | ||
| 4812 | ;; `tramp-buffer-name'; otherwise `start-file-process' | ||
| 4813 | ;; wouldn't run ever when `non-essential' is non-nil. | ||
| 4814 | (when (and (tramp-completion-mode-p) | ||
| 4815 | (null (get-process (tramp-buffer-name vec)))) | ||
| 4816 | (throw 'non-essential 'non-essential)) | ||
| 4817 | |||
| 4818 | (with-tramp-progress-reporter | 4819 | (with-tramp-progress-reporter |
| 4819 | vec 3 | 4820 | vec 3 |
| 4820 | (if (zerop (length (tramp-file-name-user vec))) | 4821 | (if (zerop (length (tramp-file-name-user vec))) |
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index 5df26a1e33e..b008e6b25eb 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el | |||
| @@ -832,12 +832,12 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." | |||
| 832 | "Implement `file-attributes' for Tramp files using stat command." | 832 | "Implement `file-attributes' for Tramp files using stat command." |
| 833 | (tramp-message | 833 | (tramp-message |
| 834 | vec 5 "file attributes with stat: %s" (tramp-file-name-localname vec)) | 834 | vec 5 "file attributes with stat: %s" (tramp-file-name-localname vec)) |
| 835 | (with-current-buffer (tramp-get-connection-buffer vec) | 835 | (let* (size id link uid gid atime mtime ctime mode inode) |
| 836 | (let* (size id link uid gid atime mtime ctime mode inode) | 836 | (when (tramp-smb-send-command |
| 837 | (when (tramp-smb-send-command | 837 | vec (format "stat \"%s\"" (tramp-smb-get-localname vec))) |
| 838 | vec (format "stat \"%s\"" (tramp-smb-get-localname vec))) | ||
| 839 | 838 | ||
| 840 | ;; Loop the listing. | 839 | ;; Loop the listing. |
| 840 | (with-current-buffer (tramp-get-connection-buffer vec) | ||
| 841 | (goto-char (point-min)) | 841 | (goto-char (point-min)) |
| 842 | (unless (re-search-forward tramp-smb-errors nil t) | 842 | (unless (re-search-forward tramp-smb-errors nil t) |
| 843 | (while (not (eobp)) | 843 | (while (not (eobp)) |
| @@ -1628,40 +1628,40 @@ Result is a list of (LOCALNAME MODE SIZE MONTH DAY TIME YEAR)." | |||
| 1628 | (with-parsed-tramp-file-name (file-name-as-directory directory) nil | 1628 | (with-parsed-tramp-file-name (file-name-as-directory directory) nil |
| 1629 | (setq localname (or localname "/")) | 1629 | (setq localname (or localname "/")) |
| 1630 | (with-tramp-file-property v localname "file-entries" | 1630 | (with-tramp-file-property v localname "file-entries" |
| 1631 | (with-current-buffer (tramp-get-connection-buffer v) | 1631 | (let* ((share (tramp-smb-get-share v)) |
| 1632 | (let* ((share (tramp-smb-get-share v)) | 1632 | (cache (tramp-get-connection-property v "share-cache" nil)) |
| 1633 | (cache (tramp-get-connection-property v "share-cache" nil)) | 1633 | res entry) |
| 1634 | res entry) | 1634 | |
| 1635 | 1635 | (if (and (not share) cache) | |
| 1636 | (if (and (not share) cache) | 1636 | ;; Return cached shares. |
| 1637 | ;; Return cached shares. | 1637 | (setq res cache) |
| 1638 | (setq res cache) | 1638 | |
| 1639 | 1639 | ;; Read entries. | |
| 1640 | ;; Read entries. | 1640 | (if share |
| 1641 | (if share | 1641 | (tramp-smb-send-command |
| 1642 | (tramp-smb-send-command | 1642 | v (format "dir \"%s*\"" (tramp-smb-get-localname v))) |
| 1643 | v (format "dir \"%s*\"" (tramp-smb-get-localname v))) | 1643 | ;; `tramp-smb-maybe-open-connection' lists also the share names. |
| 1644 | ;; `tramp-smb-maybe-open-connection' lists also the share names. | 1644 | (tramp-smb-maybe-open-connection v)) |
| 1645 | (tramp-smb-maybe-open-connection v)) | 1645 | |
| 1646 | 1646 | ;; Loop the listing. | |
| 1647 | ;; Loop the listing. | 1647 | (with-current-buffer (tramp-get-connection-buffer v) |
| 1648 | (goto-char (point-min)) | 1648 | (goto-char (point-min)) |
| 1649 | (if (re-search-forward tramp-smb-errors nil t) | 1649 | (if (re-search-forward tramp-smb-errors nil t) |
| 1650 | (tramp-error v 'file-error "%s `%s'" (match-string 0) directory) | 1650 | (tramp-error v 'file-error "%s `%s'" (match-string 0) directory) |
| 1651 | (while (not (eobp)) | 1651 | (while (not (eobp)) |
| 1652 | (setq entry (tramp-smb-read-file-entry share)) | 1652 | (setq entry (tramp-smb-read-file-entry share)) |
| 1653 | (forward-line) | 1653 | (forward-line) |
| 1654 | (when entry (push entry res)))) | 1654 | (when entry (push entry res))))) |
| 1655 | 1655 | ||
| 1656 | ;; Cache share entries. | 1656 | ;; Cache share entries. |
| 1657 | (unless share | 1657 | (unless share |
| 1658 | (tramp-set-connection-property v "share-cache" res))) | 1658 | (tramp-set-connection-property v "share-cache" res))) |
| 1659 | 1659 | ||
| 1660 | ;; Add directory itself. | 1660 | ;; Add directory itself. |
| 1661 | (push '("" "drwxrwxrwx" 0 (0 0)) res) | 1661 | (push '("" "drwxrwxrwx" 0 (0 0)) res) |
| 1662 | 1662 | ||
| 1663 | ;; Return entries. | 1663 | ;; Return entries. |
| 1664 | (delq nil res)))))) | 1664 | (delq nil res))))) |
| 1665 | 1665 | ||
| 1666 | ;; Return either a share name (if SHARE is nil), or a file name. | 1666 | ;; Return either a share name (if SHARE is nil), or a file name. |
| 1667 | ;; | 1667 | ;; |
| @@ -1855,6 +1855,10 @@ Does not do anything if a connection is already open, but re-opens the | |||
| 1855 | connection if a previous connection has died for some reason. | 1855 | connection if a previous connection has died for some reason. |
| 1856 | If ARGUMENT is non-nil, use it as argument for | 1856 | If ARGUMENT is non-nil, use it as argument for |
| 1857 | `tramp-smb-winexe-program', and suppress any checks." | 1857 | `tramp-smb-winexe-program', and suppress any checks." |
| 1858 | ;; During completion, don't reopen a new connection. | ||
| 1859 | (unless (tramp-connectable-p vec) | ||
| 1860 | (throw 'non-essential 'non-essential)) | ||
| 1861 | |||
| 1858 | (let* ((share (tramp-smb-get-share vec)) | 1862 | (let* ((share (tramp-smb-get-share vec)) |
| 1859 | (buf (tramp-get-connection-buffer vec)) | 1863 | (buf (tramp-get-connection-buffer vec)) |
| 1860 | (p (get-buffer-process buf))) | 1864 | (p (get-buffer-process buf))) |
| @@ -1909,15 +1913,6 @@ If ARGUMENT is non-nil, use it as argument for | |||
| 1909 | (string-equal | 1913 | (string-equal |
| 1910 | share | 1914 | share |
| 1911 | (tramp-get-connection-property p "smb-share" "")))) | 1915 | (tramp-get-connection-property p "smb-share" "")))) |
| 1912 | |||
| 1913 | ;; During completion, don't reopen a new connection. We | ||
| 1914 | ;; check this for the process related to | ||
| 1915 | ;; `tramp-buffer-name'; otherwise `start-file-process' | ||
| 1916 | ;; wouldn't run ever when `non-essential' is non-nil. | ||
| 1917 | (when (and (tramp-completion-mode-p) | ||
| 1918 | (null (get-process (tramp-buffer-name vec)))) | ||
| 1919 | (throw 'non-essential 'non-essential)) | ||
| 1920 | |||
| 1921 | (save-match-data | 1916 | (save-match-data |
| 1922 | ;; There might be unread output from checking for share names. | 1917 | ;; There might be unread output from checking for share names. |
| 1923 | (when buf (with-current-buffer buf (erase-buffer))) | 1918 | (when buf (with-current-buffer buf (erase-buffer))) |
diff --git a/lisp/net/tramp-sudoedit.el b/lisp/net/tramp-sudoedit.el index 80ce8f78747..bfc9b3bdc3a 100644 --- a/lisp/net/tramp-sudoedit.el +++ b/lisp/net/tramp-sudoedit.el | |||
| @@ -424,10 +424,14 @@ the result will be a local, non-Tramp, file name." | |||
| 424 | 424 | ||
| 425 | (defun tramp-sudoedit-handle-file-exists-p (filename) | 425 | (defun tramp-sudoedit-handle-file-exists-p (filename) |
| 426 | "Like `file-exists-p' for Tramp files." | 426 | "Like `file-exists-p' for Tramp files." |
| 427 | (with-parsed-tramp-file-name filename nil | 427 | ;; `file-exists-p' is used as predicate in file name completion. |
| 428 | (with-tramp-file-property v localname "file-exists-p" | 428 | ;; We don't want to run it when `non-essential' is t, or there is |
| 429 | (tramp-sudoedit-send-command | 429 | ;; no connection process yet. |
| 430 | v "test" "-e" (tramp-compat-file-name-unquote localname))))) | 430 | (when (tramp-connectable-p filename) |
| 431 | (with-parsed-tramp-file-name filename nil | ||
| 432 | (with-tramp-file-property v localname "file-exists-p" | ||
| 433 | (tramp-sudoedit-send-command | ||
| 434 | v "test" "-e" (tramp-compat-file-name-unquote localname)))))) | ||
| 431 | 435 | ||
| 432 | (defun tramp-sudoedit-handle-file-name-all-completions (filename directory) | 436 | (defun tramp-sudoedit-handle-file-name-all-completions (filename directory) |
| 433 | "Like `file-name-all-completions' for Tramp files." | 437 | "Like `file-name-all-completions' for Tramp files." |
| @@ -760,18 +764,13 @@ Remove unneeded output." | |||
| 760 | "Maybe open a connection VEC. | 764 | "Maybe open a connection VEC. |
| 761 | Does not do anything if a connection is already open, but re-opens the | 765 | Does not do anything if a connection is already open, but re-opens the |
| 762 | connection if a previous connection has died for some reason." | 766 | connection if a previous connection has died for some reason." |
| 767 | ;; During completion, don't reopen a new connection. | ||
| 768 | (unless (tramp-connectable-p vec) | ||
| 769 | (throw 'non-essential 'non-essential)) | ||
| 770 | |||
| 763 | ;; We need a process bound to the connection buffer. Therefore, we | 771 | ;; We need a process bound to the connection buffer. Therefore, we |
| 764 | ;; create a dummy process. Maybe there is a better solution? | 772 | ;; create a dummy process. Maybe there is a better solution? |
| 765 | (unless (tramp-get-connection-process vec) | 773 | (unless (tramp-get-connection-process vec) |
| 766 | |||
| 767 | ;; During completion, don't reopen a new connection. We check | ||
| 768 | ;; this for the process related to `tramp-buffer-name'; otherwise | ||
| 769 | ;; `start-file-process' wouldn't run ever when `non-essential' is | ||
| 770 | ;; non-nil. | ||
| 771 | (when (and (tramp-completion-mode-p) | ||
| 772 | (null (get-process (tramp-buffer-name vec)))) | ||
| 773 | (throw 'non-essential 'non-essential)) | ||
| 774 | |||
| 775 | (let ((p (make-network-process | 774 | (let ((p (make-network-process |
| 776 | :name (tramp-get-connection-name vec) | 775 | :name (tramp-get-connection-name vec) |
| 777 | :buffer (tramp-get-connection-buffer vec) | 776 | :buffer (tramp-get-connection-buffer vec) |
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index ed0f1def181..aefb84bb4e4 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -1566,25 +1566,27 @@ necessary only. This function will be used in file name completion." | |||
| 1566 | tramp-postfix-host-format)) | 1566 | tramp-postfix-host-format)) |
| 1567 | (when localname localname))) | 1567 | (when localname localname))) |
| 1568 | 1568 | ||
| 1569 | (defun tramp-get-buffer (vec) | 1569 | (defun tramp-get-buffer (vec &optional dont-create) |
| 1570 | "Get the connection buffer to be used for VEC." | 1570 | "Get the connection buffer to be used for VEC." |
| 1571 | (or (get-buffer (tramp-buffer-name vec)) | 1571 | (or (get-buffer (tramp-buffer-name vec)) |
| 1572 | (with-current-buffer (get-buffer-create (tramp-buffer-name vec)) | 1572 | (unless dont-create |
| 1573 | ;; We use the existence of connection property "process-buffer" | 1573 | (with-current-buffer (get-buffer-create (tramp-buffer-name vec)) |
| 1574 | ;; as indication, whether a connection is active. | 1574 | ;; We use the existence of connection property "process-buffer" |
| 1575 | (tramp-set-connection-property | 1575 | ;; as indication, whether a connection is active. |
| 1576 | vec "process-buffer" | 1576 | (tramp-set-connection-property |
| 1577 | (tramp-get-connection-property vec "process-buffer" nil)) | 1577 | vec "process-buffer" |
| 1578 | (setq buffer-undo-list t | 1578 | (tramp-get-connection-property vec "process-buffer" nil)) |
| 1579 | default-directory (tramp-make-tramp-file-name vec 'noloc 'nohop)) | 1579 | (setq buffer-undo-list t |
| 1580 | (current-buffer)))) | 1580 | default-directory |
| 1581 | 1581 | (tramp-make-tramp-file-name vec 'noloc 'nohop)) | |
| 1582 | (defun tramp-get-connection-buffer (vec) | 1582 | (current-buffer))))) |
| 1583 | |||
| 1584 | (defun tramp-get-connection-buffer (vec &optional dont-create) | ||
| 1583 | "Get the connection buffer to be used for VEC. | 1585 | "Get the connection buffer to be used for VEC. |
| 1584 | In case a second asynchronous communication has been started, it is different | 1586 | In case a second asynchronous communication has been started, it is different |
| 1585 | from `tramp-get-buffer'." | 1587 | from `tramp-get-buffer'." |
| 1586 | (or (tramp-get-connection-property vec "process-buffer" nil) | 1588 | (or (tramp-get-connection-property vec "process-buffer" nil) |
| 1587 | (tramp-get-buffer vec))) | 1589 | (tramp-get-buffer vec dont-create))) |
| 1588 | 1590 | ||
| 1589 | (defun tramp-get-connection-name (vec) | 1591 | (defun tramp-get-connection-name (vec) |
| 1590 | "Get the connection name to be used for VEC. | 1592 | "Get the connection name to be used for VEC. |
| @@ -1770,14 +1772,15 @@ applicable)." | |||
| 1770 | ;; Log only when there is a minimum level. | 1772 | ;; Log only when there is a minimum level. |
| 1771 | (when (>= tramp-verbose 4) | 1773 | (when (>= tramp-verbose 4) |
| 1772 | (let ((tramp-verbose 0)) | 1774 | (let ((tramp-verbose 0)) |
| 1773 | ;; Append connection buffer for error messages. | 1775 | ;; Append connection buffer for error messages, if exists. |
| 1774 | (when (= level 1) | 1776 | (when (= level 1) |
| 1775 | (with-current-buffer | 1777 | (ignore-errors |
| 1776 | (if (processp vec-or-proc) | 1778 | (with-current-buffer |
| 1777 | (process-buffer vec-or-proc) | 1779 | (if (processp vec-or-proc) |
| 1778 | (tramp-get-connection-buffer vec-or-proc)) | 1780 | (process-buffer vec-or-proc) |
| 1779 | (setq fmt-string (concat fmt-string "\n%s") | 1781 | (tramp-get-connection-buffer vec-or-proc 'dont-create)) |
| 1780 | arguments (append arguments (list (buffer-string)))))) | 1782 | (setq fmt-string (concat fmt-string "\n%s") |
| 1783 | arguments (append arguments (list (buffer-string))))))) | ||
| 1781 | ;; Translate proc to vec. | 1784 | ;; Translate proc to vec. |
| 1782 | (when (processp vec-or-proc) | 1785 | (when (processp vec-or-proc) |
| 1783 | (setq vec-or-proc (process-get vec-or-proc 'vector)))) | 1786 | (setq vec-or-proc (process-get vec-or-proc 'vector)))) |
| @@ -2517,16 +2520,21 @@ Add operations defined in `HANDLER-alist' to `tramp-file-name-handler'." | |||
| 2517 | ;; This variable has been obsoleted in Emacs 26. | 2520 | ;; This variable has been obsoleted in Emacs 26. |
| 2518 | tramp-completion-mode)) | 2521 | tramp-completion-mode)) |
| 2519 | 2522 | ||
| 2520 | (defun tramp-connectable-p (filename) | 2523 | (defun tramp-connectable-p (vec-or-filename) |
| 2521 | "Check, whether it is possible to connect the remote host w/o side-effects. | 2524 | "Check, whether it is possible to connect the remote host w/o side-effects. |
| 2522 | This is true, if either the remote host is already connected, or if we are | 2525 | This is true, if either the remote host is already connected, or if we are |
| 2523 | not in completion mode." | 2526 | not in completion mode." |
| 2524 | (let (tramp-verbose) | 2527 | (let (tramp-verbose |
| 2525 | (and (tramp-tramp-file-p filename) | 2528 | (vec |
| 2526 | (or (not (tramp-completion-mode-p)) | 2529 | (cond |
| 2527 | (process-live-p | 2530 | ((tramp-file-name-p vec-or-filename) vec-or-filename) |
| 2528 | (tramp-get-connection-process | 2531 | ((tramp-tramp-file-p vec-or-filename) |
| 2529 | (tramp-dissect-file-name filename))))))) | 2532 | (tramp-dissect-file-name vec-or-filename))))) |
| 2533 | (or ;; We check this for the process related to | ||
| 2534 | ;; `tramp-buffer-name'; otherwise `start-file-process' | ||
| 2535 | ;; wouldn't run ever when `non-essential' is non-nil. | ||
| 2536 | (and vec (process-live-p (get-process (tramp-buffer-name vec)))) | ||
| 2537 | (not (tramp-completion-mode-p))))) | ||
| 2530 | 2538 | ||
| 2531 | ;; Method, host name and user name completion. | 2539 | ;; Method, host name and user name completion. |
| 2532 | ;; `tramp-completion-dissect-file-name' returns a list of | 2540 | ;; `tramp-completion-dissect-file-name' returns a list of |
| @@ -2606,8 +2614,7 @@ not in completion mode." | |||
| 2606 | (try-completion | 2614 | (try-completion |
| 2607 | filename | 2615 | filename |
| 2608 | (mapcar #'list (file-name-all-completions filename directory)) | 2616 | (mapcar #'list (file-name-all-completions filename directory)) |
| 2609 | (when (and predicate | 2617 | (when (and predicate (tramp-connectable-p directory)) |
| 2610 | (tramp-connectable-p (expand-file-name filename directory))) | ||
| 2611 | (lambda (x) (funcall predicate (expand-file-name (car x) directory)))))) | 2618 | (lambda (x) (funcall predicate (expand-file-name (car x) directory)))))) |
| 2612 | 2619 | ||
| 2613 | ;; I misuse a little bit the `tramp-file-name' structure in order to | 2620 | ;; I misuse a little bit the `tramp-file-name' structure in order to |
| @@ -3096,7 +3103,11 @@ User is always nil." | |||
| 3096 | 3103 | ||
| 3097 | (defun tramp-handle-file-exists-p (filename) | 3104 | (defun tramp-handle-file-exists-p (filename) |
| 3098 | "Like `file-exists-p' for Tramp files." | 3105 | "Like `file-exists-p' for Tramp files." |
| 3099 | (not (null (file-attributes filename)))) | 3106 | ;; `file-exists-p' is used as predicate in file name completion. |
| 3107 | ;; We don't want to run it when `non-essential' is t, or there is | ||
| 3108 | ;; no connection process yet. | ||
| 3109 | (when (tramp-connectable-p filename) | ||
| 3110 | (not (null (file-attributes filename))))) | ||
| 3100 | 3111 | ||
| 3101 | (defun tramp-handle-file-in-directory-p (filename directory) | 3112 | (defun tramp-handle-file-in-directory-p (filename directory) |
| 3102 | "Like `file-in-directory-p' for Tramp files." | 3113 | "Like `file-in-directory-p' for Tramp files." |
diff --git a/lisp/play/gamegrid.el b/lisp/play/gamegrid.el index be09a73a1f1..df9b1352480 100644 --- a/lisp/play/gamegrid.el +++ b/lisp/play/gamegrid.el | |||
| @@ -505,9 +505,12 @@ format." | |||
| 505 | 505 | ||
| 506 | ;; ;;;;;;;;;;;;;;; high score functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 506 | ;; ;;;;;;;;;;;;;;; high score functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 507 | 507 | ||
| 508 | (defun gamegrid-add-score (file score) | 508 | (defun gamegrid-add-score (file score &optional reverse) |
| 509 | "Add the current score to the high score file. | 509 | "Add the current score to the high score file. |
| 510 | 510 | ||
| 511 | If REVERSE is non-nil, treat lower scores as better than higher | ||
| 512 | scores. This is useful for games where lower scores are better. | ||
| 513 | |||
| 511 | On POSIX systems there may be a shared game directory for all users in | 514 | On POSIX systems there may be a shared game directory for all users in |
| 512 | which the scorefiles are kept. On such systems Emacs doesn't create | 515 | which the scorefiles are kept. On such systems Emacs doesn't create |
| 513 | the score file FILE in this directory, if it doesn't already exist. | 516 | the score file FILE in this directory, if it doesn't already exist. |
| @@ -525,9 +528,9 @@ specified by the variable `temporary-file-directory'. If necessary, | |||
| 525 | FILE is created there." | 528 | FILE is created there." |
| 526 | (pcase system-type | 529 | (pcase system-type |
| 527 | ((or 'ms-dos 'windows-nt) | 530 | ((or 'ms-dos 'windows-nt) |
| 528 | (gamegrid-add-score-insecure file score)) | 531 | (gamegrid-add-score-insecure file score reverse)) |
| 529 | (_ | 532 | (_ |
| 530 | (gamegrid-add-score-with-update-game-score file score)))) | 533 | (gamegrid-add-score-with-update-game-score file score reverse)))) |
| 531 | 534 | ||
| 532 | 535 | ||
| 533 | ;; On POSIX systems there are four cases to distinguish: | 536 | ;; On POSIX systems there are four cases to distinguish: |
| @@ -556,20 +559,21 @@ FILE is created there." | |||
| 556 | 559 | ||
| 557 | (defvar gamegrid-shared-game-dir) | 560 | (defvar gamegrid-shared-game-dir) |
| 558 | 561 | ||
| 559 | (defun gamegrid-add-score-with-update-game-score (file score) | 562 | (defun gamegrid-add-score-with-update-game-score (file score &optional reverse) |
| 560 | (let* ((update-game-score-modes | 563 | (let* ((update-game-score-modes |
| 561 | (file-modes (expand-file-name "update-game-score" exec-directory))) | 564 | (file-modes (expand-file-name "update-game-score" exec-directory))) |
| 562 | (gamegrid-shared-game-dir | 565 | (gamegrid-shared-game-dir |
| 563 | (not (zerop (logand #o6000 (or update-game-score-modes 0)))))) | 566 | (not (zerop (logand #o6000 (or update-game-score-modes 0)))))) |
| 564 | (cond ((or (not update-game-score-modes) (file-name-absolute-p file)) | 567 | (cond ((or (not update-game-score-modes) (file-name-absolute-p file)) |
| 565 | (gamegrid-add-score-insecure file score | 568 | (gamegrid-add-score-insecure file score |
| 566 | gamegrid-user-score-file-directory)) | 569 | gamegrid-user-score-file-directory |
| 570 | reverse)) | ||
| 567 | ((and gamegrid-shared-game-dir | 571 | ((and gamegrid-shared-game-dir |
| 568 | (file-exists-p (expand-file-name file shared-game-score-directory))) | 572 | (file-exists-p (expand-file-name file shared-game-score-directory))) |
| 569 | ;; Use the setgid (or setuid) "update-game-score" program | 573 | ;; Use the setgid (or setuid) "update-game-score" program |
| 570 | ;; to update a system-wide score file. | 574 | ;; to update a system-wide score file. |
| 571 | (gamegrid-add-score-with-update-game-score-1 file | 575 | (gamegrid-add-score-with-update-game-score-1 file |
| 572 | (expand-file-name file shared-game-score-directory) score)) | 576 | (expand-file-name file shared-game-score-directory) score reverse)) |
| 573 | ;; Else: Add the score to a score file in the user's home | 577 | ;; Else: Add the score to a score file in the user's home |
| 574 | ;; directory. | 578 | ;; directory. |
| 575 | (gamegrid-shared-game-dir | 579 | (gamegrid-shared-game-dir |
| @@ -579,7 +583,8 @@ FILE is created there." | |||
| 579 | (directory-file-name gamegrid-user-score-file-directory)) | 583 | (directory-file-name gamegrid-user-score-file-directory)) |
| 580 | (make-directory gamegrid-user-score-file-directory t)) | 584 | (make-directory gamegrid-user-score-file-directory t)) |
| 581 | (gamegrid-add-score-insecure file score | 585 | (gamegrid-add-score-insecure file score |
| 582 | gamegrid-user-score-file-directory)) | 586 | gamegrid-user-score-file-directory |
| 587 | reverse)) | ||
| 583 | (t | 588 | (t |
| 584 | (unless (file-exists-p | 589 | (unless (file-exists-p |
| 585 | (directory-file-name gamegrid-user-score-file-directory)) | 590 | (directory-file-name gamegrid-user-score-file-directory)) |
| @@ -588,9 +593,9 @@ FILE is created there." | |||
| 588 | gamegrid-user-score-file-directory))) | 593 | gamegrid-user-score-file-directory))) |
| 589 | (unless (file-exists-p f) | 594 | (unless (file-exists-p f) |
| 590 | (write-region "" nil f nil 'silent nil 'excl)) | 595 | (write-region "" nil f nil 'silent nil 'excl)) |
| 591 | (gamegrid-add-score-with-update-game-score-1 file f score)))))) | 596 | (gamegrid-add-score-with-update-game-score-1 file f score reverse)))))) |
| 592 | 597 | ||
| 593 | (defun gamegrid-add-score-with-update-game-score-1 (file target score) | 598 | (defun gamegrid-add-score-with-update-game-score-1 (file target score &optional reverse) |
| 594 | (let ((default-directory "/") | 599 | (let ((default-directory "/") |
| 595 | (errbuf (generate-new-buffer " *update-game-score loss*")) | 600 | (errbuf (generate-new-buffer " *update-game-score loss*")) |
| 596 | (marker-string (concat | 601 | (marker-string (concat |
| @@ -601,17 +606,16 @@ FILE is created there." | |||
| 601 | (with-local-quit | 606 | (with-local-quit |
| 602 | (apply | 607 | (apply |
| 603 | 'call-process | 608 | 'call-process |
| 604 | (append | 609 | `(,(expand-file-name "update-game-score" exec-directory) |
| 605 | (list | 610 | nil ,errbuf nil |
| 606 | (expand-file-name "update-game-score" exec-directory) | 611 | "-m" ,(int-to-string gamegrid-score-file-length) |
| 607 | nil errbuf nil | 612 | "-d" ,(if gamegrid-shared-game-dir |
| 608 | "-m" (int-to-string gamegrid-score-file-length) | 613 | (expand-file-name shared-game-score-directory) |
| 609 | "-d" (if gamegrid-shared-game-dir | 614 | (file-name-directory target)) |
| 610 | (expand-file-name shared-game-score-directory) | 615 | ,@(if reverse '("-r")) |
| 611 | (file-name-directory target)) | 616 | ,file |
| 612 | file | 617 | ,(int-to-string score) |
| 613 | (int-to-string score) | 618 | ,marker-string))) |
| 614 | marker-string)))) | ||
| 615 | (if (buffer-modified-p errbuf) | 619 | (if (buffer-modified-p errbuf) |
| 616 | (progn | 620 | (progn |
| 617 | (display-buffer errbuf) | 621 | (display-buffer errbuf) |
| @@ -632,7 +636,7 @@ FILE is created there." | |||
| 632 | marker-string) nil t) | 636 | marker-string) nil t) |
| 633 | (beginning-of-line))))) | 637 | (beginning-of-line))))) |
| 634 | 638 | ||
| 635 | (defun gamegrid-add-score-insecure (file score &optional directory) | 639 | (defun gamegrid-add-score-insecure (file score &optional directory reverse) |
| 636 | (save-excursion | 640 | (save-excursion |
| 637 | (setq file (expand-file-name file (or directory | 641 | (setq file (expand-file-name file (or directory |
| 638 | temporary-file-directory))) | 642 | temporary-file-directory))) |
| @@ -645,7 +649,8 @@ FILE is created there." | |||
| 645 | (user-full-name) | 649 | (user-full-name) |
| 646 | user-mail-address)) | 650 | user-mail-address)) |
| 647 | (sort-fields 1 (point-min) (point-max)) | 651 | (sort-fields 1 (point-min) (point-max)) |
| 648 | (reverse-region (point-min) (point-max)) | 652 | (unless reverse |
| 653 | (reverse-region (point-min) (point-max))) | ||
| 649 | (goto-char (point-min)) | 654 | (goto-char (point-min)) |
| 650 | (forward-line gamegrid-score-file-length) | 655 | (forward-line gamegrid-score-file-length) |
| 651 | (delete-region (point) (point-max)) | 656 | (delete-region (point) (point-max)) |
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 14b65669c4b..ec5d8c55512 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -4084,6 +4084,12 @@ JUSTIFY should be used (if applicable) as in `fill-paragraph'." | |||
| 4084 | (goto-char (line-end-position)))) | 4084 | (goto-char (line-end-position)))) |
| 4085 | t) | 4085 | t) |
| 4086 | 4086 | ||
| 4087 | (defun python-do-auto-fill () | ||
| 4088 | "Like `do-auto-fill', but bind `fill-indent-according-to-mode'." | ||
| 4089 | ;; See Bug#36056. | ||
| 4090 | (let ((fill-indent-according-to-mode t)) | ||
| 4091 | (do-auto-fill))) | ||
| 4092 | |||
| 4087 | 4093 | ||
| 4088 | ;;; Skeletons | 4094 | ;;; Skeletons |
| 4089 | 4095 | ||
| @@ -5379,7 +5385,7 @@ REPORT-FN is Flymake's callback function." | |||
| 5379 | (set (make-local-variable 'paragraph-start) "\\s-*$") | 5385 | (set (make-local-variable 'paragraph-start) "\\s-*$") |
| 5380 | (set (make-local-variable 'fill-paragraph-function) | 5386 | (set (make-local-variable 'fill-paragraph-function) |
| 5381 | #'python-fill-paragraph) | 5387 | #'python-fill-paragraph) |
| 5382 | (set (make-local-variable 'fill-indent-according-to-mode) t) ; Bug#36056. | 5388 | (set (make-local-variable 'normal-auto-fill-function) #'python-do-auto-fill) |
| 5383 | 5389 | ||
| 5384 | (set (make-local-variable 'beginning-of-defun-function) | 5390 | (set (make-local-variable 'beginning-of-defun-function) |
| 5385 | #'python-nav-beginning-of-defun) | 5391 | #'python-nav-beginning-of-defun) |
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index aad38b94d76..cbc0ac74f09 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el | |||
| @@ -112,7 +112,7 @@ | |||
| 112 | ;; would make this unnecessary; simply learn the values when you visit | 112 | ;; would make this unnecessary; simply learn the values when you visit |
| 113 | ;; the buffer. | 113 | ;; the buffer. |
| 114 | ;; You can do this automatically like this: | 114 | ;; You can do this automatically like this: |
| 115 | ;; (add-hook 'sh-set-shell-hook 'sh-learn-buffer-indent) | 115 | ;; (add-hook 'sh-set-shell-hook #'sh-learn-buffer-indent) |
| 116 | ;; | 116 | ;; |
| 117 | ;; However... `sh-learn-buffer-indent' is extremely slow, | 117 | ;; However... `sh-learn-buffer-indent' is extremely slow, |
| 118 | ;; especially on large-ish buffer. Also, if there are conflicts the | 118 | ;; especially on large-ish buffer. Also, if there are conflicts the |
| @@ -480,7 +480,6 @@ This is buffer-local in every such buffer.") | |||
| 480 | (define-key map "\C-c>" 'sh-learn-buffer-indent) | 480 | (define-key map "\C-c>" 'sh-learn-buffer-indent) |
| 481 | (define-key map "\C-c\C-\\" 'sh-backslash-region) | 481 | (define-key map "\C-c\C-\\" 'sh-backslash-region) |
| 482 | 482 | ||
| 483 | (define-key map "=" 'sh-assignment) | ||
| 484 | (define-key map "\C-c+" 'sh-add) | 483 | (define-key map "\C-c+" 'sh-add) |
| 485 | (define-key map "\C-\M-x" 'sh-execute-region) | 484 | (define-key map "\C-\M-x" 'sh-execute-region) |
| 486 | (define-key map "\C-c\C-x" 'executable-interpret) | 485 | (define-key map "\C-c\C-x" 'executable-interpret) |
| @@ -1059,7 +1058,7 @@ subshells can nest." | |||
| 1059 | (when (< startpos (line-beginning-position)) | 1058 | (when (< startpos (line-beginning-position)) |
| 1060 | (put-text-property startpos (point) 'syntax-multiline t) | 1059 | (put-text-property startpos (point) 'syntax-multiline t) |
| 1061 | (add-hook 'syntax-propertize-extend-region-functions | 1060 | (add-hook 'syntax-propertize-extend-region-functions |
| 1062 | 'syntax-propertize-multiline nil t)) | 1061 | #'syntax-propertize-multiline nil t)) |
| 1063 | ))) | 1062 | ))) |
| 1064 | 1063 | ||
| 1065 | 1064 | ||
| @@ -1603,25 +1602,25 @@ with your script for an edit-interpret-debug cycle." | |||
| 1603 | (setq-local local-abbrev-table sh-mode-abbrev-table) | 1602 | (setq-local local-abbrev-table sh-mode-abbrev-table) |
| 1604 | (setq-local comint-dynamic-complete-functions | 1603 | (setq-local comint-dynamic-complete-functions |
| 1605 | sh-dynamic-complete-functions) | 1604 | sh-dynamic-complete-functions) |
| 1606 | (add-hook 'completion-at-point-functions 'comint-completion-at-point nil t) | 1605 | (add-hook 'completion-at-point-functions #'comint-completion-at-point nil t) |
| 1607 | ;; we can't look if previous line ended with `\' | 1606 | ;; we can't look if previous line ended with `\' |
| 1608 | (setq-local comint-prompt-regexp "^[ \t]*") | 1607 | (setq-local comint-prompt-regexp "^[ \t]*") |
| 1609 | (setq-local imenu-case-fold-search nil) | 1608 | (setq-local imenu-case-fold-search nil) |
| 1610 | (setq font-lock-defaults | 1609 | (setq font-lock-defaults |
| 1611 | '((sh-font-lock-keywords | 1610 | `((sh-font-lock-keywords |
| 1612 | sh-font-lock-keywords-1 sh-font-lock-keywords-2) | 1611 | sh-font-lock-keywords-1 sh-font-lock-keywords-2) |
| 1613 | nil nil | 1612 | nil nil |
| 1614 | ((?/ . "w") (?~ . "w") (?. . "w") (?- . "w") (?_ . "w")) nil | 1613 | ((?/ . "w") (?~ . "w") (?. . "w") (?- . "w") (?_ . "w")) nil |
| 1615 | (font-lock-syntactic-face-function | 1614 | (font-lock-syntactic-face-function |
| 1616 | . sh-font-lock-syntactic-face-function))) | 1615 | . ,#'sh-font-lock-syntactic-face-function))) |
| 1617 | (setq-local syntax-propertize-function #'sh-syntax-propertize-function) | 1616 | (setq-local syntax-propertize-function #'sh-syntax-propertize-function) |
| 1618 | (add-hook 'syntax-propertize-extend-region-functions | 1617 | (add-hook 'syntax-propertize-extend-region-functions |
| 1619 | #'syntax-propertize-multiline 'append 'local) | 1618 | #'syntax-propertize-multiline 'append 'local) |
| 1620 | (setq-local skeleton-pair-alist '((?` _ ?`))) | 1619 | (setq-local skeleton-pair-alist '((?` _ ?`))) |
| 1621 | (setq-local skeleton-pair-filter-function 'sh-quoted-p) | 1620 | (setq-local skeleton-pair-filter-function #'sh-quoted-p) |
| 1622 | (setq-local skeleton-further-elements | 1621 | (setq-local skeleton-further-elements |
| 1623 | '((< '(- (min sh-basic-offset (current-column)))))) | 1622 | '((< '(- (min sh-basic-offset (current-column)))))) |
| 1624 | (setq-local skeleton-filter-function 'sh-feature) | 1623 | (setq-local skeleton-filter-function #'sh-feature) |
| 1625 | (setq-local skeleton-newline-indent-rigidly t) | 1624 | (setq-local skeleton-newline-indent-rigidly t) |
| 1626 | (setq-local defun-prompt-regexp | 1625 | (setq-local defun-prompt-regexp |
| 1627 | (concat | 1626 | (concat |
| @@ -2408,12 +2407,12 @@ whose value is the shell name (don't quote it)." | |||
| 2408 | (message "setting up indent stuff") | 2407 | (message "setting up indent stuff") |
| 2409 | ;; sh-mode has already made indent-line-function local | 2408 | ;; sh-mode has already made indent-line-function local |
| 2410 | ;; but do it in case this is called before that. | 2409 | ;; but do it in case this is called before that. |
| 2411 | (setq-local indent-line-function 'sh-indent-line)) | 2410 | (setq-local indent-line-function #'sh-indent-line)) |
| 2412 | (if sh-make-vars-local | 2411 | (if sh-make-vars-local |
| 2413 | (sh-make-vars-local)) | 2412 | (sh-make-vars-local)) |
| 2414 | (message "Indentation setup for shell type %s" sh-shell)) | 2413 | (message "Indentation setup for shell type %s" sh-shell)) |
| 2415 | (message "No indentation for this shell type.") | 2414 | (message "No indentation for this shell type.") |
| 2416 | (setq-local indent-line-function 'sh-basic-indent-line)) | 2415 | (setq-local indent-line-function #'sh-basic-indent-line)) |
| 2417 | (when font-lock-mode | 2416 | (when font-lock-mode |
| 2418 | (setq font-lock-set-defaults nil) | 2417 | (setq font-lock-set-defaults nil) |
| 2419 | (font-lock-set-defaults) | 2418 | (font-lock-set-defaults) |
| @@ -3586,7 +3585,7 @@ so that `occur-next' and `occur-prev' will work." | |||
| 3586 | ;; (insert ")\n") | 3585 | ;; (insert ")\n") |
| 3587 | ;; ))) | 3586 | ;; ))) |
| 3588 | ;; | 3587 | ;; |
| 3589 | ;; (add-hook 'sh-learned-buffer-hook 'what-i-learned) | 3588 | ;; (add-hook 'sh-learned-buffer-hook #'what-i-learned) |
| 3590 | 3589 | ||
| 3591 | 3590 | ||
| 3592 | ;; Originally this was sh-learn-region-indent (beg end) | 3591 | ;; Originally this was sh-learn-region-indent (beg end) |
| @@ -4055,7 +4054,8 @@ Add these variables to `sh-shell-variables'." | |||
| 4055 | (goto-char (point-min)) | 4054 | (goto-char (point-min)) |
| 4056 | (setq sh-shell-variables-initialized t) | 4055 | (setq sh-shell-variables-initialized t) |
| 4057 | (while (search-forward "=" nil t) | 4056 | (while (search-forward "=" nil t) |
| 4058 | (sh-assignment 0))) | 4057 | (sh--assignment-collect))) |
| 4058 | (add-hook 'post-self-insert-hook #'sh--assignment-collect nil t) | ||
| 4059 | (message "Scanning buffer `%s' for variable assignments...done" | 4059 | (message "Scanning buffer `%s' for variable assignments...done" |
| 4060 | (buffer-name))) | 4060 | (buffer-name))) |
| 4061 | 4061 | ||
| @@ -4328,20 +4328,24 @@ option followed by a colon `:' if the option accepts an argument." | |||
| 4328 | 4328 | ||
| 4329 | 4329 | ||
| 4330 | 4330 | ||
| 4331 | (put 'sh-assignment 'delete-selection t) | ||
| 4331 | (defun sh-assignment (arg) | 4332 | (defun sh-assignment (arg) |
| 4332 | "Remember preceding identifier for future completion and do self-insert." | 4333 | "Remember preceding identifier for future completion and do self-insert." |
| 4333 | (interactive "p") | 4334 | (interactive "p") |
| 4335 | (declare (obsolete nil "27.1")) | ||
| 4334 | (self-insert-command arg) | 4336 | (self-insert-command arg) |
| 4335 | (if (<= arg 1) | 4337 | (sh--assignment-collect)) |
| 4336 | (sh-remember-variable | 4338 | |
| 4337 | (save-excursion | 4339 | (defun sh--assignment-collect () |
| 4338 | (if (re-search-forward (sh-feature sh-assignment-regexp) | 4340 | (sh-remember-variable |
| 4339 | (prog1 (point) | 4341 | (when (eq ?= (char-before)) |
| 4340 | (beginning-of-line 1)) | 4342 | (save-excursion |
| 4341 | t) | 4343 | (if (re-search-forward (sh-feature sh-assignment-regexp) |
| 4342 | (match-string 1)))))) | 4344 | (prog1 (point) |
| 4345 | (beginning-of-line 1)) | ||
| 4346 | t) | ||
| 4347 | (match-string 1)))))) | ||
| 4343 | 4348 | ||
| 4344 | (put 'sh-assignment 'delete-selection t) | ||
| 4345 | 4349 | ||
| 4346 | (defun sh-maybe-here-document (arg) | 4350 | (defun sh-maybe-here-document (arg) |
| 4347 | "Insert self. Without prefix, following unquoted `<' inserts here document. | 4351 | "Insert self. Without prefix, following unquoted `<' inserts here document. |
diff --git a/lisp/replace.el b/lisp/replace.el index ad9be77a79b..5c0616e25f0 100644 --- a/lisp/replace.el +++ b/lisp/replace.el | |||
| @@ -2698,7 +2698,7 @@ characters." | |||
| 2698 | (num-replacements 0) | 2698 | (num-replacements 0) |
| 2699 | (nocasify t) ; Undo must preserve case (Bug#31073). | 2699 | (nocasify t) ; Undo must preserve case (Bug#31073). |
| 2700 | search-string | 2700 | search-string |
| 2701 | next-replacement) | 2701 | last-replacement) |
| 2702 | (while (and (< stack-idx stack-len) | 2702 | (while (and (< stack-idx stack-len) |
| 2703 | stack | 2703 | stack |
| 2704 | (or (null replaced) last-was-act-and-show)) | 2704 | (or (null replaced) last-was-act-and-show)) |
| @@ -2709,9 +2709,9 @@ characters." | |||
| 2709 | ;; Bind swapped values | 2709 | ;; Bind swapped values |
| 2710 | ;; (search-string <--> replacement) | 2710 | ;; (search-string <--> replacement) |
| 2711 | search-string (nth (if replaced 4 3) elt) | 2711 | search-string (nth (if replaced 4 3) elt) |
| 2712 | next-replacement (nth (if replaced 3 4) elt) | 2712 | last-replacement (nth (if replaced 3 4) elt) |
| 2713 | search-string-replaced search-string | 2713 | search-string-replaced search-string |
| 2714 | next-replacement-replaced next-replacement | 2714 | next-replacement-replaced last-replacement |
| 2715 | last-was-act-and-show nil) | 2715 | last-was-act-and-show nil) |
| 2716 | 2716 | ||
| 2717 | (when (and (= stack-idx stack-len) | 2717 | (when (and (= stack-idx stack-len) |
| @@ -2733,16 +2733,18 @@ characters." | |||
| 2733 | (match-data t (nth 2 elt))) | 2733 | (match-data t (nth 2 elt))) |
| 2734 | noedit | 2734 | noedit |
| 2735 | (replace-match-maybe-edit | 2735 | (replace-match-maybe-edit |
| 2736 | next-replacement nocasify literal | 2736 | last-replacement nocasify literal |
| 2737 | noedit real-match-data backward) | 2737 | noedit real-match-data backward) |
| 2738 | replace-count (1- replace-count) | 2738 | replace-count (1- replace-count) |
| 2739 | real-match-data | 2739 | real-match-data |
| 2740 | (save-excursion | 2740 | (save-excursion |
| 2741 | (goto-char (match-beginning 0)) | 2741 | (goto-char (match-beginning 0)) |
| 2742 | (if regexp-flag | 2742 | (if regexp-flag |
| 2743 | (looking-at next-replacement) | 2743 | (looking-at last-replacement) |
| 2744 | (looking-at (regexp-quote next-replacement))) | 2744 | (looking-at (regexp-quote last-replacement))) |
| 2745 | (match-data t (nth 2 elt)))) | 2745 | (match-data t (nth 2 elt)))) |
| 2746 | (when regexp-flag | ||
| 2747 | (setq next-replacement (nth 4 elt))) | ||
| 2746 | ;; Set replaced nil to keep in loop | 2748 | ;; Set replaced nil to keep in loop |
| 2747 | (when (eq def 'undo-all) | 2749 | (when (eq def 'undo-all) |
| 2748 | (setq replaced nil | 2750 | (setq replaced nil |
diff --git a/lisp/select.el b/lisp/select.el index 59bcf7da664..334e10f41ba 100644 --- a/lisp/select.el +++ b/lisp/select.el | |||
| @@ -160,12 +160,11 @@ The value nil is the same as the list (UTF8_STRING COMPOUND_TEXT STRING)." | |||
| 160 | (const TEXT))) | 160 | (const TEXT))) |
| 161 | :group 'killing) | 161 | :group 'killing) |
| 162 | 162 | ||
| 163 | ;; Get a selection value of type TYPE by calling gui-get-selection with | ||
| 164 | ;; an appropriate DATA-TYPE argument decided by `x-select-request-type'. | ||
| 165 | ;; The return value is already decoded. If gui-get-selection causes an | ||
| 166 | ;; error, this function return nil. | ||
| 167 | |||
| 168 | (defun gui--selection-value-internal (type) | 163 | (defun gui--selection-value-internal (type) |
| 164 | "Get a selection value of type TYPE. | ||
| 165 | Call `gui-get-selection' with an appropriate DATA-TYPE argument | ||
| 166 | decided by `x-select-request-type'. The return value is already | ||
| 167 | decoded. If `gui-get-selection' signals an error, return nil." | ||
| 169 | (let ((request-type (if (eq window-system 'x) | 168 | (let ((request-type (if (eq window-system 'x) |
| 170 | (or x-select-request-type | 169 | (or x-select-request-type |
| 171 | '(UTF8_STRING COMPOUND_TEXT STRING)) | 170 | '(UTF8_STRING COMPOUND_TEXT STRING)) |
diff --git a/lisp/server.el b/lisp/server.el index ac81cdbd483..45fa55ad6b0 100644 --- a/lisp/server.el +++ b/lisp/server.el | |||
| @@ -563,9 +563,9 @@ See variable `server-auth-dir' for details." | |||
| 563 | (format "it is not owned by you (owner = %s (%d))" | 563 | (format "it is not owned by you (owner = %s (%d))" |
| 564 | (user-full-name uid) uid)) | 564 | (user-full-name uid) uid)) |
| 565 | (w32 nil) ; on NTFS? | 565 | (w32 nil) ; on NTFS? |
| 566 | ((/= 0 (logand ?\077 (file-modes dir))) | 566 | ((let ((modes (file-modes dir))) |
| 567 | (format "it is accessible by others (%03o)" | 567 | (unless (zerop (logand (or modes 0) #o077)) |
| 568 | (file-modes dir))) | 568 | (format "it is accessible by others (%03o)" modes)))) |
| 569 | (t nil)))) | 569 | (t nil)))) |
| 570 | (when unsafe | 570 | (when unsafe |
| 571 | (error "`%s' is not a safe directory because %s" | 571 | (error "`%s' is not a safe directory because %s" |
diff --git a/lisp/shadowfile.el b/lisp/shadowfile.el index 2778e583674..72491b99807 100644 --- a/lisp/shadowfile.el +++ b/lisp/shadowfile.el | |||
| @@ -207,7 +207,7 @@ PREFIX." | |||
| 207 | 207 | ||
| 208 | ;;; I use the term `site' to refer to a string which may be the | 208 | ;;; I use the term `site' to refer to a string which may be the |
| 209 | ;;; cluster identification "/name:", a remote identification | 209 | ;;; cluster identification "/name:", a remote identification |
| 210 | ;;; "/method:user@host:", or "/system-name:' (the value of | 210 | ;;; "/method:user@host:", or "/system-name:" (the value of |
| 211 | ;;; `shadow-system-name') for the location of local files. All | 211 | ;;; `shadow-system-name') for the location of local files. All |
| 212 | ;;; user-level commands should accept either. | 212 | ;;; user-level commands should accept either. |
| 213 | 213 | ||
| @@ -607,6 +607,11 @@ and to are absolute file names." | |||
| 607 | canonical-file shadow-literal-groups nil) | 607 | canonical-file shadow-literal-groups nil) |
| 608 | (shadow-shadows-of-1 | 608 | (shadow-shadows-of-1 |
| 609 | canonical-file shadow-regexp-groups t))))) | 609 | canonical-file shadow-regexp-groups t))))) |
| 610 | (when shadow-debug | ||
| 611 | (message | ||
| 612 | "shadow-shadows-of: %s %s %s %s %s" | ||
| 613 | file (shadow-local-file file) shadow-homedir | ||
| 614 | absolute-file canonical-file)) | ||
| 610 | (set (intern file shadow-hashtable) shadows)))) | 615 | (set (intern file shadow-hashtable) shadows)))) |
| 611 | 616 | ||
| 612 | (defun shadow-shadows-of-1 (file groups regexp) | 617 | (defun shadow-shadows-of-1 (file groups regexp) |
| @@ -621,6 +626,10 @@ Consider them as regular expressions if third arg REGEXP is true." | |||
| 621 | (let ((realname | 626 | (let ((realname |
| 622 | (tramp-file-name-localname | 627 | (tramp-file-name-localname |
| 623 | (shadow-parse-name file)))) | 628 | (shadow-parse-name file)))) |
| 629 | (when shadow-debug | ||
| 630 | (message | ||
| 631 | "shadow-shadows-of-1: %s %s %s" | ||
| 632 | file (shadow-parse-name file) realname)) | ||
| 624 | (mapcar | 633 | (mapcar |
| 625 | (function | 634 | (function |
| 626 | (lambda (x) | 635 | (lambda (x) |
| @@ -631,6 +640,11 @@ Consider them as regular expressions if third arg REGEXP is true." | |||
| 631 | 640 | ||
| 632 | (defun shadow-add-to-todo () | 641 | (defun shadow-add-to-todo () |
| 633 | "If current buffer has shadows, add them to the list needing to be copied." | 642 | "If current buffer has shadows, add them to the list needing to be copied." |
| 643 | (when shadow-debug | ||
| 644 | (message | ||
| 645 | "shadow-add-to-todo: %s %s" | ||
| 646 | (buffer-file-name (current-buffer)) | ||
| 647 | (shadow-expand-file-name (buffer-file-name (current-buffer))))) | ||
| 634 | (let ((shadows (shadow-shadows-of | 648 | (let ((shadows (shadow-shadows-of |
| 635 | (shadow-expand-file-name | 649 | (shadow-expand-file-name |
| 636 | (buffer-file-name (current-buffer)))))) | 650 | (buffer-file-name (current-buffer)))))) |
diff --git a/lisp/startup.el b/lisp/startup.el index a16db242da0..ef6234128aa 100644 --- a/lisp/startup.el +++ b/lisp/startup.el | |||
| @@ -406,6 +406,7 @@ if you have not already set `auto-save-list-file-name' yourself. | |||
| 406 | Directories in the prefix will be created if necessary. | 406 | Directories in the prefix will be created if necessary. |
| 407 | Set this to nil if you want to prevent `auto-save-list-file-name' | 407 | Set this to nil if you want to prevent `auto-save-list-file-name' |
| 408 | from being initialized." | 408 | from being initialized." |
| 409 | :initialize #'custom-initialize-delay | ||
| 409 | :type '(choice (const :tag "Don't record a session's auto save list" nil) | 410 | :type '(choice (const :tag "Don't record a session's auto save list" nil) |
| 410 | string) | 411 | string) |
| 411 | :group 'auto-save) | 412 | :group 'auto-save) |
diff --git a/lisp/subr.el b/lisp/subr.el index 0d7bffb35f3..0b47da884b7 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -2045,7 +2045,7 @@ Uses the `derived-mode-parent' property of the symbol to trace backwards." | |||
| 2045 | (put 'major-mode--suspended 'permanent-local t) | 2045 | (put 'major-mode--suspended 'permanent-local t) |
| 2046 | 2046 | ||
| 2047 | (defun major-mode-suspend () | 2047 | (defun major-mode-suspend () |
| 2048 | "Exit current major, remembering it." | 2048 | "Exit current major mode, remembering it." |
| 2049 | (let* ((prev-major-mode (or major-mode--suspended | 2049 | (let* ((prev-major-mode (or major-mode--suspended |
| 2050 | (unless (eq major-mode 'fundamental-mode) | 2050 | (unless (eq major-mode 'fundamental-mode) |
| 2051 | major-mode)))) | 2051 | major-mode)))) |
diff --git a/lisp/term/w32-win.el b/lisp/term/w32-win.el index 198182fca72..e2c019fc548 100644 --- a/lisp/term/w32-win.el +++ b/lisp/term/w32-win.el | |||
| @@ -485,6 +485,136 @@ numbers, and the build number." | |||
| 485 | That includes all Windows systems except for 9X/Me." | 485 | That includes all Windows systems except for 9X/Me." |
| 486 | (getenv "SystemRoot")) | 486 | (getenv "SystemRoot")) |
| 487 | 487 | ||
| 488 | ;; The value of the following variable was calculated using the table in | ||
| 489 | ;; https://docs.microsoft.com/windows/desktop/Intl/unicode-subset-bitfields, | ||
| 490 | ;; by looking for Unicode subranges for which no USB bits are defined. | ||
| 491 | (defconst w32-no-usb-subranges | ||
| 492 | '((#x000800 . #x0008ff) | ||
| 493 | (#x0018b0 . #x0018ff) | ||
| 494 | (#x001a20 . #x001aff) | ||
| 495 | (#x001bc0 . #x001bff) | ||
| 496 | (#x001c80 . #x001cff) | ||
| 497 | (#x002fe0 . #x002fef) | ||
| 498 | (#x00a4d0 . #x00a4ff) | ||
| 499 | (#x00a6a0 . #x00a6ff) | ||
| 500 | (#x00a830 . #x00a83f) | ||
| 501 | (#x00a8e0 . #x00a8ff) | ||
| 502 | (#x00a960 . #x00a9ff) | ||
| 503 | (#x00aa60 . #x00abff) | ||
| 504 | (#x00d7b0 . #x00d7ff) | ||
| 505 | (#x010200 . #x01027f) | ||
| 506 | (#x0102e0 . #x0102ff) | ||
| 507 | (#x010350 . #x01037f) | ||
| 508 | (#x0103e0 . #x0103ff) | ||
| 509 | (#x0104b0 . #x0107ff) | ||
| 510 | (#x010840 . #x0108ff) | ||
| 511 | (#x010940 . #x0109ff) | ||
| 512 | (#x010a60 . #x011fff) | ||
| 513 | (#x012480 . #x01cfff) | ||
| 514 | (#x01d250 . #x01d2ff) | ||
| 515 | (#x01d380 . #x01d3ff) | ||
| 516 | (#x01d800 . #x01efff) | ||
| 517 | (#x01f0a0 . #x01ffff) | ||
| 518 | (#x02a6e0 . #x02f7ff) | ||
| 519 | (#x02fa20 . #x0dffff) | ||
| 520 | (#x0e0080 . #x0e00ff) | ||
| 521 | (#x0e01f0 . #x0fefff)) | ||
| 522 | "List of Unicode subranges whose support cannot be announced by a font. | ||
| 523 | The FONTSIGNATURE structure reported by MS-Windows for a font | ||
| 524 | includes 123 Unicode Subset bits (USBs) to identify subranges of | ||
| 525 | the Unicode codepoint space supported by the font. Since the | ||
| 526 | number of bits is fixed, not every Unicode block can have a | ||
| 527 | corresponding USB bit; fonts that support characters from blocks | ||
| 528 | that have no USBs cannot communicate their support to Emacs, | ||
| 529 | unless the font is opened and physically tested for glyphs for | ||
| 530 | characters from these blocks.") | ||
| 531 | |||
| 532 | (defun w32--filter-USB-scripts () | ||
| 533 | "Filter USB scripts out of `script-representative-chars'." | ||
| 534 | (let (val) | ||
| 535 | (dolist (elt script-representative-chars) | ||
| 536 | (let ((subranges w32-no-usb-subranges) | ||
| 537 | (chars (cdr elt)) | ||
| 538 | ch found subrange) | ||
| 539 | (while (and (consp chars) (not found)) | ||
| 540 | (setq ch (car chars) | ||
| 541 | chars (cdr chars)) | ||
| 542 | (while (and (consp subranges) (not found)) | ||
| 543 | (setq subrange (car subranges) | ||
| 544 | subranges (cdr subranges)) | ||
| 545 | (when (and (>= ch (car subrange)) (<= ch (cdr subrange))) | ||
| 546 | (setq found t) | ||
| 547 | (push elt val)))))) | ||
| 548 | (nreverse val))) | ||
| 549 | |||
| 550 | (defvar w32-non-USB-fonts nil | ||
| 551 | "Alist of script symbols and corresponding fonts. | ||
| 552 | Each element of the alist has the form (SCRIPT FONTS...), where | ||
| 553 | SCRIPT is a symbol of a script and FONTS are one or more fonts installed | ||
| 554 | on the system that can display SCRIPT's characters. FONTS are | ||
| 555 | specified as symbols. | ||
| 556 | Only scripts that have no corresponding Unicode Subset Bits (USBs) can | ||
| 557 | be found in this alist. | ||
| 558 | This alist is used by w32font.c when it looks for fonts that can display | ||
| 559 | characters from scripts for which no USBs are defined.") | ||
| 560 | |||
| 561 | (defun w32-find-non-USB-fonts (&optional frame size) | ||
| 562 | "Compute the value of `w32-non-USB-fonts' for specified SIZE and FRAME. | ||
| 563 | FRAME defaults to the selected frame. | ||
| 564 | SIZE is the required font size and defaults to the nominal size of the | ||
| 565 | default font on FRAME, or its best approximation." | ||
| 566 | (let* ((inhibit-compacting-font-caches t) | ||
| 567 | (all-fonts | ||
| 568 | (delete-dups | ||
| 569 | (x-list-fonts "-*-*-medium-r-normal-*-*-*-*-*-*-iso10646-1" | ||
| 570 | 'default frame))) | ||
| 571 | val) | ||
| 572 | (mapc (function | ||
| 573 | (lambda (script-desc) | ||
| 574 | (let* ((script (car script-desc)) | ||
| 575 | (script-chars (vconcat (cdr script-desc))) | ||
| 576 | (nchars (length script-chars)) | ||
| 577 | (fntlist all-fonts) | ||
| 578 | (entry (list script)) | ||
| 579 | fspec ffont font-obj glyphs idx) | ||
| 580 | ;; For each font in FNTLIST, determine whether it | ||
| 581 | ;; supports the representative character(s) of any | ||
| 582 | ;; scripts that have no USBs defined for it. | ||
| 583 | (dolist (fnt fntlist) | ||
| 584 | (setq fspec (ignore-errors (font-spec :name fnt))) | ||
| 585 | (if fspec | ||
| 586 | (setq ffont (find-font fspec frame))) | ||
| 587 | (when ffont | ||
| 588 | (setq font-obj | ||
| 589 | (open-font ffont size frame)) | ||
| 590 | ;; Ignore fonts for which open-font returns nil: | ||
| 591 | ;; they are buggy fonts that we cannot use anyway. | ||
| 592 | (setq glyphs | ||
| 593 | (if font-obj | ||
| 594 | (font-get-glyphs font-obj | ||
| 595 | 0 nchars script-chars) | ||
| 596 | '[nil])) | ||
| 597 | ;; Does this font support ALL of the script's | ||
| 598 | ;; representative characters? | ||
| 599 | (setq idx 0) | ||
| 600 | (while (and (< idx nchars) (not (null (aref glyphs idx)))) | ||
| 601 | (setq idx (1+ idx))) | ||
| 602 | (if (= idx nchars) | ||
| 603 | ;; It does; add this font to the script's entry in alist. | ||
| 604 | (let ((font-family (font-get font-obj :family))) | ||
| 605 | ;; Unifont is an ugly font, and it is already | ||
| 606 | ;; present in the default fontset. | ||
| 607 | (unless (string= (downcase (symbol-name font-family)) | ||
| 608 | "unifont") | ||
| 609 | (push font-family entry)))))) | ||
| 610 | (if (> (length entry) 1) | ||
| 611 | (push (nreverse entry) val))))) | ||
| 612 | (w32--filter-USB-scripts)) | ||
| 613 | ;; We've opened a lot of fonts, so clear the font caches to free | ||
| 614 | ;; some memory. | ||
| 615 | (clear-font-cache) | ||
| 616 | (and val (setq w32-non-USB-fonts val)))) | ||
| 617 | |||
| 488 | (provide 'w32-win) | 618 | (provide 'w32-win) |
| 489 | (provide 'term/w32-win) | 619 | (provide 'term/w32-win) |
| 490 | 620 | ||
diff --git a/lisp/textmodes/table.el b/lisp/textmodes/table.el index 1f185e0f216..f684f4e4ca9 100644 --- a/lisp/textmodes/table.el +++ b/lisp/textmodes/table.el | |||
| @@ -567,10 +567,6 @@ | |||
| 567 | ;; Consider the use of `:box' face attribute under Emacs 21 | 567 | ;; Consider the use of `:box' face attribute under Emacs 21 |
| 568 | ;; Consider the use of `modification-hooks' text property instead of | 568 | ;; Consider the use of `modification-hooks' text property instead of |
| 569 | ;; rebinding the keymap | 569 | ;; rebinding the keymap |
| 570 | ;; Maybe provide complete XEmacs support in the future however the | ||
| 571 | ;; "extent" is the single largest obstacle lying ahead, read the | ||
| 572 | ;; document in Emacs info. | ||
| 573 | ;; (progn (require 'info) (Info-find-node "elisp" "Not Intervals")) | ||
| 574 | ;; | 570 | ;; |
| 575 | ;; | 571 | ;; |
| 576 | ;; --------------- | 572 | ;; --------------- |
diff --git a/lisp/tooltip.el b/lisp/tooltip.el index b1c69ae7368..eac510ba7ba 100644 --- a/lisp/tooltip.el +++ b/lisp/tooltip.el | |||
| @@ -365,7 +365,10 @@ It is also called if Tooltip mode is on, for text-only displays." | |||
| 365 | (let ((message-log-max nil)) | 365 | (let ((message-log-max nil)) |
| 366 | (message "%s" tooltip-previous-message) | 366 | (message "%s" tooltip-previous-message) |
| 367 | (setq tooltip-previous-message nil))) | 367 | (setq tooltip-previous-message nil))) |
| 368 | (t | 368 | ;; Only stop displaying the message when the current message is our own. |
| 369 | ;; This has the advantage of not clearing the echo area when | ||
| 370 | ;; running after an error message was displayed (Bug#3192). | ||
| 371 | ((equal-including-properties tooltip-help-message (current-message)) | ||
| 369 | (message nil))))) | 372 | (message nil))))) |
| 370 | 373 | ||
| 371 | (defun tooltip-show-help (msg) | 374 | (defun tooltip-show-help (msg) |
diff --git a/lisp/vc/vc-cvs.el b/lisp/vc/vc-cvs.el index d84700fc176..a9e79d7956c 100644 --- a/lisp/vc/vc-cvs.el +++ b/lisp/vc/vc-cvs.el | |||
| @@ -440,7 +440,7 @@ REV is the revision to check out." | |||
| 440 | (if vc-cvs-use-edit | 440 | (if vc-cvs-use-edit |
| 441 | (vc-cvs-command nil 0 file "unedit") | 441 | (vc-cvs-command nil 0 file "unedit") |
| 442 | ;; Make the file read-only by switching off all w-bits | 442 | ;; Make the file read-only by switching off all w-bits |
| 443 | (set-file-modes file (logand (file-modes file) 3950))))) | 443 | (set-file-modes file (logand (file-modes file) #o7555))))) |
| 444 | 444 | ||
| 445 | (defun vc-cvs-merge-file (file) | 445 | (defun vc-cvs-merge-file (file) |
| 446 | "Accept a file merge request, prompting for revisions." | 446 | "Accept a file merge request, prompting for revisions." |
diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el index 9a6f6bb6874..e2259785923 100644 --- a/lisp/vc/vc-dir.el +++ b/lisp/vc/vc-dir.el | |||
| @@ -864,10 +864,18 @@ with the command \\[tags-loop-continue]." | |||
| 864 | delimited) | 864 | delimited) |
| 865 | (fileloop-continue)) | 865 | (fileloop-continue)) |
| 866 | 866 | ||
| 867 | (defun vc-dir-ignore () | 867 | (defun vc-dir-ignore (&optional arg) |
| 868 | "Ignore the current file." | 868 | "Ignore the current file. |
| 869 | (interactive) | 869 | If a prefix argument is given, ignore all marked files." |
| 870 | (vc-ignore (vc-dir-current-file))) | 870 | (interactive "P") |
| 871 | (if arg | ||
| 872 | (ewoc-map | ||
| 873 | (lambda (filearg) | ||
| 874 | (when (vc-dir-fileinfo->marked filearg) | ||
| 875 | (vc-ignore (vc-dir-fileinfo->name filearg)) | ||
| 876 | t)) | ||
| 877 | vc-ewoc) | ||
| 878 | (vc-ignore (vc-dir-current-file)))) | ||
| 871 | 879 | ||
| 872 | (defun vc-dir-current-file () | 880 | (defun vc-dir-current-file () |
| 873 | (let ((node (ewoc-locate vc-ewoc))) | 881 | (let ((node (ewoc-locate vc-ewoc))) |
diff --git a/lisp/vc/vc-svn.el b/lisp/vc/vc-svn.el index 3c50c8fff64..88a280d10f3 100644 --- a/lisp/vc/vc-svn.el +++ b/lisp/vc/vc-svn.el | |||
| @@ -366,8 +366,9 @@ FILE is a file wildcard, relative to the root directory of DIRECTORY." | |||
| 366 | (defun vc-svn-ignore-completion-table (directory) | 366 | (defun vc-svn-ignore-completion-table (directory) |
| 367 | "Return the list of ignored files in DIRECTORY." | 367 | "Return the list of ignored files in DIRECTORY." |
| 368 | (with-temp-buffer | 368 | (with-temp-buffer |
| 369 | (vc-svn-command t t nil "propget" "svn:ignore" (expand-file-name directory)) | 369 | (when (zerop (vc-svn-command |
| 370 | (split-string (buffer-string)))) | 370 | t t nil "propget" "svn:ignore" (expand-file-name directory))) |
| 371 | (split-string (buffer-string) "\n")))) | ||
| 371 | 372 | ||
| 372 | (defun vc-svn-find-admin-dir (file) | 373 | (defun vc-svn-find-admin-dir (file) |
| 373 | "Return the administrative directory of FILE." | 374 | "Return the administrative directory of FILE." |
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 4cac1539289..c982b0220e3 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el | |||
| @@ -1417,17 +1417,22 @@ remove from the list of ignored files." | |||
| 1417 | 1417 | ||
| 1418 | (defun vc-default-ignore (backend file &optional directory remove) | 1418 | (defun vc-default-ignore (backend file &optional directory remove) |
| 1419 | "Ignore FILE under the VCS of DIRECTORY (default is `default-directory'). | 1419 | "Ignore FILE under the VCS of DIRECTORY (default is `default-directory'). |
| 1420 | FILE is a file wildcard, relative to the root directory of DIRECTORY. | 1420 | FILE is a wildcard specification, either relative to |
| 1421 | DIRECTORY or absolute. | ||
| 1421 | When called from Lisp code, if DIRECTORY is non-nil, the | 1422 | When called from Lisp code, if DIRECTORY is non-nil, the |
| 1422 | repository to use will be deduced by DIRECTORY; if REMOVE is | 1423 | repository to use will be deduced by DIRECTORY; if REMOVE is |
| 1423 | non-nil, remove FILE from ignored files. | 1424 | non-nil, remove FILE from ignored files. |
| 1424 | Argument BACKEND is the backend you are using." | 1425 | Argument BACKEND is the backend you are using." |
| 1425 | (let ((ignore | 1426 | (let ((ignore |
| 1426 | (vc-call-backend backend 'find-ignore-file (or directory default-directory))) | 1427 | (vc-call-backend backend 'find-ignore-file (or directory default-directory))) |
| 1427 | (pattern (file-relative-name | 1428 | file-path root-dir pattern) |
| 1428 | (expand-file-name file) (file-name-directory file)))) | 1429 | (setq file-path (expand-file-name file directory)) |
| 1430 | (setq root-dir (file-name-directory ignore)) | ||
| 1431 | (when (not (string= (substring file-path 0 (length root-dir)) root-dir)) | ||
| 1432 | (error "Ignore spec %s is not below project root %s" file-path root-dir)) | ||
| 1433 | (setq pattern (substring file-path (length root-dir))) | ||
| 1429 | (if remove | 1434 | (if remove |
| 1430 | (vc--remove-regexp pattern ignore) | 1435 | (vc--remove-regexp (concat "^" (regexp-quote pattern ) "\\(\n\\|$\\)") ignore) |
| 1431 | (vc--add-line pattern ignore)))) | 1436 | (vc--add-line pattern ignore)))) |
| 1432 | 1437 | ||
| 1433 | (defun vc-default-ignore-completion-table (backend file) | 1438 | (defun vc-default-ignore-completion-table (backend file) |
diff --git a/lisp/wid-browse.el b/lisp/wid-browse.el index dbc41009c77..3124a9c01e5 100644 --- a/lisp/wid-browse.el +++ b/lisp/wid-browse.el | |||
| @@ -89,7 +89,11 @@ if that value is non-nil." | |||
| 89 | (defun widget-browse-at (pos) | 89 | (defun widget-browse-at (pos) |
| 90 | "Browse the widget under point." | 90 | "Browse the widget under point." |
| 91 | (interactive "d") | 91 | (interactive "d") |
| 92 | (let* ((field (get-char-property pos 'field)) | 92 | (let* ((field (or |
| 93 | ;; See comments in `widget-specify-field' to know why we | ||
| 94 | ;; need this. | ||
| 95 | (get-char-property pos 'real-field) | ||
| 96 | (get-char-property pos 'field))) | ||
| 93 | (button (get-char-property pos 'button)) | 97 | (button (get-char-property pos 'button)) |
| 94 | (doc (get-char-property pos 'widget-doc)) | 98 | (doc (get-char-property pos 'widget-doc)) |
| 95 | (text (cond (field "This is an editable text area.") | 99 | (text (cond (field "This is an editable text area.") |
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index 9bc7a076eec..7ed7b81280b 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el | |||
| @@ -414,6 +414,7 @@ the :notify function can't know the new value.") | |||
| 414 | 414 | ||
| 415 | (defmacro widget-specify-insert (&rest form) | 415 | (defmacro widget-specify-insert (&rest form) |
| 416 | "Execute FORM without inheriting any text properties." | 416 | "Execute FORM without inheriting any text properties." |
| 417 | (declare (debug body)) | ||
| 417 | `(save-restriction | 418 | `(save-restriction |
| 418 | (let ((inhibit-read-only t) | 419 | (let ((inhibit-read-only t) |
| 419 | (inhibit-modification-hooks t)) | 420 | (inhibit-modification-hooks t)) |