1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 18:40:39 -08:00

Merge from origin/emacs-26

12c77f6 (origin/emacs-26) Add ido-fallback special variable (Bug#31707)
826e8d1 Merge branch 'emacs-26' of git.sv.gnu.org:/srv/git/emacs into...
c784876 Tighten a cross-reference in documentation
517dc0b Fix last change in tramp-sh.el
f43186f Revert previous patch; comment was OK after all.
4c3306e Fix lead comment for count_trailing_zero_bits
b419f27 ; * doc/emacs/files.texi (Interlocking): Fix a non-portable @...
7488de4 * lisp/emacs-lisp/regexp-opt.el (regexp-opt): Fix docstring q...
0b69807 Make a minor update to the CSS mode docstring
9a53b6d Say how to override a primitive interactive spec
1d77078 Fix Bug#31941
This commit is contained in:
Glenn Morris 2018-06-26 07:51:01 -07:00
commit 513b97c0e9
6 changed files with 27 additions and 12 deletions

View file

@ -779,7 +779,7 @@ visiting a file, Emacs records that the file is @dfn{locked} by you.
(It does this by creating a specially-named symbolic link@footnote{If (It does this by creating a specially-named symbolic link@footnote{If
your file system does not support symbolic links, a regular file is your file system does not support symbolic links, a regular file is
used.} with special contents in the same directory. @xref{File used.} with special contents in the same directory. @xref{File
Locks,,, elisp} for more details.) Emacs removes the lock when you Locks,,, elisp}, for more details.) Emacs removes the lock when you
save the changes. The idea is that the file is locked whenever an save the changes. The idea is that the file is locked whenever an
Emacs buffer visiting it has unsaved changes. Emacs buffer visiting it has unsaved changes.

View file

@ -724,7 +724,8 @@ less than 8.
@cindex interactive specification in primitives @cindex interactive specification in primitives
@item interactive @item interactive
This is an interactive specification, a string such as might be used This is an interactive specification, a string such as might be used
as the argument of @code{interactive} in a Lisp function. In the case as the argument of @code{interactive} in a Lisp function
(@pxref{Using Interactive}). In the case
of @code{or}, it is 0 (a null pointer), indicating that @code{or} of @code{or}, it is 0 (a null pointer), indicating that @code{or}
cannot be called interactively. A value of @code{""} indicates a cannot be called interactively. A value of @code{""} indicates a
function that should receive no arguments when called interactively. function that should receive no arguments when called interactively.

View file

@ -117,12 +117,12 @@ than that of a simplified version:
(defun simplified-regexp-opt (strings &optional paren) (defun simplified-regexp-opt (strings &optional paren)
(let ((parens (let ((parens
(cond ((stringp paren) (cons paren \"\\\\)\")) (cond ((stringp paren) (cons paren \"\\\\)\"))
((eq paren 'words) '(\"\\\\\\=<\\\\(\" . \"\\\\)\\\\>\")) ((eq paren \\='words) \\='(\"\\\\\\=<\\\\(\" . \"\\\\)\\\\>\"))
((eq paren 'symbols) '(\"\\\\_<\\\\(\" . \"\\\\)\\\\_>\")) ((eq paren \\='symbols) \\='(\"\\\\_<\\\\(\" . \"\\\\)\\\\_>\"))
((null paren) '(\"\\\\(?:\" . \"\\\\)\")) ((null paren) \\='(\"\\\\(?:\" . \"\\\\)\"))
(t '(\"\\\\(\" . \"\\\\)\"))))) (t \\='(\"\\\\(\" . \"\\\\)\")))))
(concat (car paren) (concat (car paren)
(mapconcat 'regexp-quote strings \"\\\\|\") (mapconcat \\='regexp-quote strings \"\\\\|\")
(cdr paren))))" (cdr paren))))"
(save-match-data (save-match-data
;; Recurse on the sorted list. ;; Recurse on the sorted list.

View file

@ -1242,6 +1242,9 @@ Only used if `ido-use-virtual-buffers' is non-nil.")
;; Dynamically bound in ido-read-internal. ;; Dynamically bound in ido-read-internal.
(defvar ido-completing-read) (defvar ido-completing-read)
;; If dynamically set when ido-exit is 'fallback, overrides fallback command.
(defvar ido-fallback nil)
;;; FUNCTIONS ;;; FUNCTIONS
(defun ido-active (&optional merge) (defun ido-active (&optional merge)
@ -2220,6 +2223,7 @@ If cursor is not at the end of the user input, move to end of input."
(run-hook-with-args 'ido-before-fallback-functions (run-hook-with-args 'ido-before-fallback-functions
(or fallback 'switch-to-buffer)) (or fallback 'switch-to-buffer))
(call-interactively (or fallback 'switch-to-buffer))) (call-interactively (or fallback 'switch-to-buffer)))
(setq ido-fallback nil)
(let* ((ido-context-switch-command switch-cmd) (let* ((ido-context-switch-command switch-cmd)
(ido-current-directory nil) (ido-current-directory nil)
(ido-directory-nonreadable nil) (ido-directory-nonreadable nil)
@ -2245,7 +2249,7 @@ If cursor is not at the end of the user input, move to end of input."
((eq ido-exit 'fallback) ((eq ido-exit 'fallback)
(let ((read-buffer-function nil)) (let ((read-buffer-function nil))
(setq this-command (or fallback 'switch-to-buffer)) (setq this-command (or ido-fallback fallback 'switch-to-buffer))
(run-hook-with-args 'ido-before-fallback-functions this-command) (run-hook-with-args 'ido-before-fallback-functions this-command)
(call-interactively this-command))) (call-interactively this-command)))
@ -2341,6 +2345,7 @@ If cursor is not at the end of the user input, move to end of input."
;; Internal function for ido-find-file and friends ;; Internal function for ido-find-file and friends
(unless item (unless item
(setq item 'file)) (setq item 'file))
(setq ido-fallback nil)
(let ((ido-current-directory (ido-expand-directory default)) (let ((ido-current-directory (ido-expand-directory default))
(ido-context-switch-command switch-cmd) (ido-context-switch-command switch-cmd)
ido-directory-nonreadable ido-directory-too-big ido-directory-nonreadable ido-directory-too-big
@ -2412,7 +2417,7 @@ If cursor is not at the end of the user input, move to end of input."
;; we don't want to change directory of current buffer. ;; we don't want to change directory of current buffer.
(let ((default-directory ido-current-directory) (let ((default-directory ido-current-directory)
(read-file-name-function nil)) (read-file-name-function nil))
(setq this-command (or fallback 'find-file)) (setq this-command (or ido-fallback fallback 'find-file))
(run-hook-with-args 'ido-before-fallback-functions this-command) (run-hook-with-args 'ido-before-fallback-functions this-command)
(call-interactively this-command))) (call-interactively this-command)))
@ -2821,13 +2826,15 @@ If no buffer or file exactly matching the prompt exists, maybe create a new one.
(setq ido-exit 'takeprompt) (setq ido-exit 'takeprompt)
(exit-minibuffer)) (exit-minibuffer))
(defun ido-fallback-command () (defun ido-fallback-command (&optional fallback-command)
"Fallback to non-Ido version of current command." "Fallback to non-Ido version of current command.
The optional FALLBACK-COMMAND argument indicates which command to run."
(interactive) (interactive)
(let ((i (length ido-text))) (let ((i (length ido-text)))
(while (> i 0) (while (> i 0)
(push (aref ido-text (setq i (1- i))) unread-command-events))) (push (aref ido-text (setq i (1- i))) unread-command-events)))
(setq ido-exit 'fallback) (setq ido-exit 'fallback)
(setq ido-fallback fallback-command)
(exit-minibuffer)) (exit-minibuffer))
(defun ido-enter-find-file () (defun ido-enter-find-file ()

View file

@ -2037,7 +2037,9 @@ file names."
(unless (memq op '(copy rename)) (unless (memq op '(copy rename))
(error "Unknown operation `%s', must be `copy' or `rename'" op)) (error "Unknown operation `%s', must be `copy' or `rename'" op))
(if (file-directory-p filename) (if (and
(file-directory-p filename)
(not (tramp-equal-remote filename newname)))
(progn (progn
(copy-directory filename newname keep-date t) (copy-directory filename newname keep-date t)
(when (eq op 'rename) (delete-directory filename 'recursive))) (when (eq op 'rename) (delete-directory filename 'recursive)))
@ -2200,6 +2202,8 @@ the uid and gid from FILENAME."
(localname2 (if t2 (file-remote-p newname 'localname) newname)) (localname2 (if t2 (file-remote-p newname 'localname) newname))
(prefix (file-remote-p (if t1 filename newname))) (prefix (file-remote-p (if t1 filename newname)))
cmd-result) cmd-result)
(when (and (eq op 'copy) (file-directory-p filename))
(setq cmd (concat cmd " -R")))
(cond (cond
;; Both files are on a remote host, with same user. ;; Both files are on a remote host, with same user.

View file

@ -1583,6 +1583,9 @@ Use `\\[info-lookup-symbol]' to look up documentation of CSS properties, at-rule
pseudo-classes, and pseudo-elements on the Mozilla Developer pseudo-classes, and pseudo-elements on the Mozilla Developer
Network (MDN). Network (MDN).
Use `\\[fill-paragraph]' to reformat CSS declaration blocks. It can also
be used to fill comments.
\\{css-mode-map}" \\{css-mode-map}"
(setq-local font-lock-defaults css-font-lock-defaults) (setq-local font-lock-defaults css-font-lock-defaults)
(setq-local comment-start "/*") (setq-local comment-start "/*")