diff options
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/cedet/pulse.el | 2 | ||||
-rw-r--r-- | lisp/emacs-lisp/rx.el | 4 | ||||
-rw-r--r-- | lisp/erc/erc.el | 2 | ||||
-rw-r--r-- | lisp/icomplete.el | 15 | ||||
-rw-r--r-- | lisp/minibuffer.el | 11 | ||||
-rw-r--r-- | lisp/textmodes/bibtex.el | 50 | ||||
-rw-r--r-- | lisp/textmodes/table.el | 21 | ||||
-rw-r--r-- | lisp/window.el | 4 |
8 files changed, 68 insertions, 41 deletions
diff --git a/lisp/cedet/pulse.el b/lisp/cedet/pulse.el index 5713a7b0d1f..16243e16b45 100644 --- a/lisp/cedet/pulse.el +++ b/lisp/cedet/pulse.el @@ -181,6 +181,7 @@ Optional argument FACE specifies the face to do the highlighting." (overlay-put o 'original-face (overlay-get o 'face)) ;; Make this overlay take priority over the `transient-mark-mode' ;; overlay. + (overlay-put o 'original-priority (overlay-get o 'priority)) (overlay-put o 'priority 1) (setq pulse-momentary-overlay o) (if (eq pulse-flag 'never) @@ -214,6 +215,7 @@ Optional argument FACE specifies the face to do the highlighting." (let ((ol pulse-momentary-overlay)) (overlay-put ol 'face (overlay-get ol 'original-face)) (overlay-put ol 'original-face nil) + (overlay-put ol 'priority (overlay-get ol 'original-priority)) ;; Clear the overlay if it needs deleting. (when (overlay-get ol 'pulse-delete) (delete-overlay ol))) diff --git a/lisp/emacs-lisp/rx.el b/lisp/emacs-lisp/rx.el index a0b2444346a..aa4b2addd47 100644 --- a/lisp/emacs-lisp/rx.el +++ b/lisp/emacs-lisp/rx.el @@ -134,7 +134,7 @@ Each entry is: (if (cdr def) (error "Not an `rx' symbol definition: %s" form) (car def))))) - ((consp form) + ((and (consp form) (symbolp (car form))) (let* ((op (car form)) (def (rx--lookup-def op))) (and def @@ -360,7 +360,7 @@ character X becomes (?X . ?X). Return the intervals in a list." (push (cons start end) intervals)) (t (error "Invalid rx `any' range: %s" - (substring str i 3)))) + (substring str i (+ i 3))))) (setq i (+ i 3)))) (t ;; Single character. diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index a46755153e3..81325df3f4f 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -75,7 +75,7 @@ (eval-when-compile (require 'subr-x)) (defvar erc-official-location - "https://www.emacswiki.org/emacs/ERC (mailing list: erc-discuss@gnu.org)" + "https://www.emacswiki.org/emacs/ERC (mailing list: emacs-erc@gnu.org)" "Location of the ERC client on the Internet.") (defgroup erc nil diff --git a/lisp/icomplete.el b/lisp/icomplete.el index a1a67e2330a..66bc731f67f 100644 --- a/lisp/icomplete.el +++ b/lisp/icomplete.el @@ -284,6 +284,17 @@ require user confirmation." (t (icomplete-force-complete-and-exit))))) +(defun icomplete-fido-exit (force) + "Attempt to exit minibuffer immediately with current input. +Unless FORCE is non-nil (interactively with a prefix argument), +honour a non-nil REQUIRE-MATCH argument to `completing-read' by +trying to complete as much as possible and disallowing the exit +if that doesn't produce a completion match." + (interactive "P") + (if (and (not force) minibuffer--require-match) + (minibuffer-complete-and-exit) + (exit-minibuffer))) + (defun icomplete-fido-backward-updir () "Delete char before or go up directory, like `ido-mode'." (interactive) @@ -299,7 +310,7 @@ require user confirmation." (define-key map (kbd "RET") 'icomplete-fido-ret) (define-key map (kbd "C-m") 'icomplete-fido-ret) (define-key map (kbd "DEL") 'icomplete-fido-backward-updir) - (define-key map (kbd "M-j") 'exit-minibuffer) + (define-key map (kbd "M-j") 'icomplete-fido-exit) (define-key map (kbd "C-s") 'icomplete-forward-completions) (define-key map (kbd "C-r") 'icomplete-backward-completions) (define-key map (kbd "<right>") 'icomplete-forward-completions) @@ -541,7 +552,7 @@ See `icomplete-mode' and `minibuffer-setup-hook'." (icomplete--completion-table) (icomplete--completion-predicate) (if (window-minibuffer-p) - (not minibuffer-completion-confirm))))) + (eq minibuffer--require-match t))))) (buffer-undo-list t) deactivate-mark) ;; Do nothing if while-no-input was aborted. diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 49daabc44e3..7f5b597542a 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -1400,7 +1400,11 @@ scroll the window of possible completions." (minibuffer-prompt-end) (point-max) #'exit-minibuffer ;; If the previous completion completed to an element which fails ;; test-completion, then we shouldn't exit, but that should be rare. - (lambda () (minibuffer-message "Incomplete")))) + (lambda () + (if minibuffer--require-match + (minibuffer-message "Incomplete") + ;; If a match is not required, exit after all. + (exit-minibuffer))))) (defun minibuffer-force-complete (&optional start end dont-cycle) "Complete the minibuffer to an exact match. @@ -1464,6 +1468,9 @@ DONT-CYCLE tells the function not to setup cycling." "List of commands which cause an immediately following `minibuffer-complete-and-exit' to ask for extra confirmation.") +(defvar minibuffer--require-match nil + "Value of REQUIRE-MATCH passed to `completing-read'.") + (defun minibuffer-complete-and-exit () "Exit if the minibuffer contains a valid completion. Otherwise, try to complete the minibuffer contents. If @@ -3748,8 +3755,10 @@ See `completing-read' for the meaning of the arguments." (let* ((minibuffer-completion-table collection) (minibuffer-completion-predicate predicate) + ;; FIXME: Remove/rename this var, see the next one. (minibuffer-completion-confirm (unless (eq require-match t) require-match)) + (minibuffer--require-match require-match) (base-keymap (if require-match minibuffer-local-must-match-map minibuffer-local-completion-map)) diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el index a7be57e5a3f..670e763814c 100644 --- a/lisp/textmodes/bibtex.el +++ b/lisp/textmodes/bibtex.el @@ -1006,32 +1006,36 @@ See `bibtex-generate-autokey' for details." :type 'boolean) (defvar bibtex-autokey-transcriptions - '(;; language specific characters - ("\\\\aa" . "a") ; \aa -> a - ("\\\\AA" . "A") ; \AA -> A - ("\\\"a\\|\\\\\\\"a\\|\\\\ae" . "ae") ; "a,\"a,\ae -> ae - ("\\\"A\\|\\\\\\\"A\\|\\\\AE" . "Ae") ; "A,\"A,\AE -> Ae - ("\\\\i" . "i") ; \i -> i - ("\\\\j" . "j") ; \j -> j - ("\\\\l" . "l") ; \l -> l - ("\\\\L" . "L") ; \L -> L - ("\\\"o\\|\\\\\\\"o\\|\\\\o\\|\\\\oe" . "oe") ; "o,\"o,\o,\oe -> oe - ("\\\"O\\|\\\\\\\"O\\|\\\\O\\|\\\\OE" . "Oe") ; "O,\"O,\O,\OE -> Oe - ("\\\"s\\|\\\\\\\"s\\|\\\\3" . "ss") ; "s,\"s,\3 -> ss - ("\\\"u\\|\\\\\\\"u" . "ue") ; "u,\"u -> ue - ("\\\"U\\|\\\\\\\"U" . "Ue") ; "U,\"U -> Ue - ;; accents - ("\\\\`\\|\\\\'\\|\\\\\\^\\|\\\\~\\|\\\\=\\|\\\\\\.\\|\\\\u\\|\\\\v\\|\\\\H\\|\\\\t\\|\\\\c\\|\\\\d\\|\\\\b" . "") - ;; braces, quotes, concatenation. - ("[`'\"{}#]" . "") - ("\\\\-" . "") ; \- -> - ;; spaces - ("\\\\?[ \t\n]+\\|~" . " ")) + (nconc + (mapcar (lambda (a) (cons (regexp-opt (car a)) (cdr a))) + '(;; language specific characters + (("\\aa") . "a") ; \aa -> a + (("\\AA") . "A") ; \AA -> A + (("\"a" "\\\"a" "\\ae") . "ae") ; "a,\"a,\ae -> ae + (("\"A" "\\\"A" "\\AE") . "Ae") ; "A,\"A,\AE -> Ae + (("\\i") . "i") ; \i -> i + (("\\j") . "j") ; \j -> j + (("\\l") . "l") ; \l -> l + (("\\L") . "L") ; \L -> L + (("\"o" "\\\"o" "\\o" "\\oe") . "oe") ; "o,\"o,\o,\oe -> oe + (("\"O" "\\\"O" "\\O" "\\OE") . "Oe") ; "O,\"O,\O,\OE -> Oe + (("\"s" "\\\"s" "\\3") . "ss") ; "s,\"s,\3 -> ss + (("\"u" "\\\"u") . "ue") ; "u,\"u -> ue + (("\"U" "\\\"U") . "Ue") ; "U,\"U -> Ue + ;; hyphen, accents + (("\\-" "\\`" "\\'" "\\^" "\\~" "\\=" "\\." "\\u" "\\v" + "\\H" "\\t" "\\c" "\\d" "\\b") . "") + ;; space + (("~") . " "))) + ;; more spaces + '(("[\s\t\n]*\\(?:\\\\\\)?[\s\t\n]+" . " ") + ;; braces, quotes, concatenation. + ("[`'\"{}#]" . ""))) "Alist of (OLD-REGEXP . NEW-STRING) pairs. -Used by the default values of `bibtex-autokey-name-change-strings' and +Used as default values of `bibtex-autokey-name-change-strings' and `bibtex-autokey-titleword-change-strings'. Defaults to translating some language specific characters to their ASCII transcriptions, and -removing any character accents.") +removing any accent characters.") (defcustom bibtex-autokey-name-change-strings bibtex-autokey-transcriptions diff --git a/lisp/textmodes/table.el b/lisp/textmodes/table.el index 7f87ee3646d..33f181b80c3 100644 --- a/lisp/textmodes/table.el +++ b/lisp/textmodes/table.el @@ -2914,16 +2914,17 @@ WHERE is provided the cell and table at that location is reported." (defun table-generate-source (language &optional dest-buffer caption) "Generate source of the current table in the specified language. LANGUAGE is a symbol that specifies the language to describe the -structure of the table. It must be either `html', `latex' or `cals'. -The resulted source text is inserted into DEST-BUFFER and the buffer -object is returned. When DEST-BUFFER is omitted or nil the default -buffer specified in `table-dest-buffer-name' is used. In this case -the content of the default buffer is erased prior to the generation. -When DEST-BUFFER is non-nil it is expected to be either a destination -buffer or a name of the destination buffer. In this case the -generated result is inserted at the current point in the destination -buffer and the previously existing contents in the buffer are -untouched. +structure of the table. It must be either `html', `latex', `cals', +`wiki', or `mediawiki'. +The function inserts the resulting source text into DEST-BUFFER, and +returns the buffer object. When DEST-BUFFER is omitted or nil, the +function uses the default buffer specified in `table-dest-buffer-name'. +In this case, the function erases the default buffer prior to the +source generation. +When DEST-BUFFER is non-nil, it should be either a destination +buffer or a name of the destination buffer. In that case, the +function inserts the generated result at point in the destination +buffer, and leaves the previous contents of the buffer untouched. References used for this implementation: diff --git a/lisp/window.el b/lisp/window.el index bbd4e9b6dfc..5824b1cb845 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -9125,8 +9125,8 @@ accessible position." ;; wider than its frame's pixel width, its height ;; remains unaltered. (width (+ (car (window-text-pixel-size - window (window-start) (point-max) - (frame-pixel-width) + window (window-start window) nil + (frame-pixel-width (window-frame window)) ;; Add one line-height to assure that ;; we're on the safe side. This ;; overshoots when the first line below |