diff options
| author | Karoly Lorentey | 2004-05-22 22:52:43 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2004-05-22 22:52:43 +0000 |
| commit | 04a0dc45e1e3833a3a97e45f2b20197c8bec744a (patch) | |
| tree | af6a98682fc8bd24be22340137e489a0796c9eed /lisp/simple.el | |
| parent | f3c9434fad0ae6dfcadf44292df1472a402b5738 (diff) | |
| parent | 47ff5b284043393f79f231f0c6bd005a542721cb (diff) | |
| download | emacs-04a0dc45e1e3833a3a97e45f2b20197c8bec744a.tar.gz emacs-04a0dc45e1e3833a3a97e45f2b20197c8bec744a.zip | |
Merged in changes from CVS trunk.
Patches applied:
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-325
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-326
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-327
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-328
Update from CVS: src/.gdbinit (xsymbol): Fix last change.
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-329
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-166
Diffstat (limited to 'lisp/simple.el')
| -rw-r--r-- | lisp/simple.el | 72 |
1 files changed, 34 insertions, 38 deletions
diff --git a/lisp/simple.el b/lisp/simple.el index 95e3ab0580d..fc8553cb133 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -3396,15 +3396,14 @@ Setting this variable automatically makes it local to the current buffer.") | |||
| 3396 | ;; (Actually some major modes use a different auto-fill function, | 3396 | ;; (Actually some major modes use a different auto-fill function, |
| 3397 | ;; but this one is the default one.) | 3397 | ;; but this one is the default one.) |
| 3398 | (defun do-auto-fill () | 3398 | (defun do-auto-fill () |
| 3399 | (let (fc justify bol give-up | 3399 | (let (fc justify give-up |
| 3400 | (fill-prefix fill-prefix)) | 3400 | (fill-prefix fill-prefix)) |
| 3401 | (if (or (not (setq justify (current-justification))) | 3401 | (if (or (not (setq justify (current-justification))) |
| 3402 | (null (setq fc (current-fill-column))) | 3402 | (null (setq fc (current-fill-column))) |
| 3403 | (and (eq justify 'left) | 3403 | (and (eq justify 'left) |
| 3404 | (<= (current-column) fc)) | 3404 | (<= (current-column) fc)) |
| 3405 | (save-excursion (beginning-of-line) | 3405 | (and auto-fill-inhibit-regexp |
| 3406 | (setq bol (point)) | 3406 | (save-excursion (beginning-of-line) |
| 3407 | (and auto-fill-inhibit-regexp | ||
| 3408 | (looking-at auto-fill-inhibit-regexp)))) | 3407 | (looking-at auto-fill-inhibit-regexp)))) |
| 3409 | nil ;; Auto-filling not required | 3408 | nil ;; Auto-filling not required |
| 3410 | (if (memq justify '(full center right)) | 3409 | (if (memq justify '(full center right)) |
| @@ -3427,16 +3426,15 @@ Setting this variable automatically makes it local to the current buffer.") | |||
| 3427 | ;; Determine where to split the line. | 3426 | ;; Determine where to split the line. |
| 3428 | (let* (after-prefix | 3427 | (let* (after-prefix |
| 3429 | (fill-point | 3428 | (fill-point |
| 3430 | (let ((opoint (point))) | 3429 | (save-excursion |
| 3431 | (save-excursion | 3430 | (beginning-of-line) |
| 3432 | (beginning-of-line) | 3431 | (setq after-prefix (point)) |
| 3433 | (setq after-prefix (point)) | 3432 | (and fill-prefix |
| 3434 | (and fill-prefix | 3433 | (looking-at (regexp-quote fill-prefix)) |
| 3435 | (looking-at (regexp-quote fill-prefix)) | 3434 | (setq after-prefix (match-end 0))) |
| 3436 | (setq after-prefix (match-end 0))) | 3435 | (move-to-column (1+ fc)) |
| 3437 | (move-to-column (1+ fc)) | 3436 | (fill-move-to-break-point after-prefix) |
| 3438 | (fill-move-to-break-point after-prefix) | 3437 | (point)))) |
| 3439 | (point))))) | ||
| 3440 | 3438 | ||
| 3441 | ;; See whether the place we found is any good. | 3439 | ;; See whether the place we found is any good. |
| 3442 | (if (save-excursion | 3440 | (if (save-excursion |
| @@ -4269,16 +4267,15 @@ of the differing parts is, by contrast, slightly highlighted." | |||
| 4269 | :group 'completion) | 4267 | :group 'completion) |
| 4270 | 4268 | ||
| 4271 | (defun completion-setup-function () | 4269 | (defun completion-setup-function () |
| 4272 | (save-excursion | 4270 | (let ((mainbuf (current-buffer)) |
| 4273 | (let ((mainbuf (current-buffer)) | 4271 | (mbuf-contents (minibuffer-contents))) |
| 4274 | (mbuf-contents (minibuffer-contents))) | 4272 | ;; When reading a file name in the minibuffer, |
| 4275 | ;; When reading a file name in the minibuffer, | 4273 | ;; set default-directory in the minibuffer |
| 4276 | ;; set default-directory in the minibuffer | 4274 | ;; so it will get copied into the completion list buffer. |
| 4277 | ;; so it will get copied into the completion list buffer. | 4275 | (if minibuffer-completing-file-name |
| 4278 | (if minibuffer-completing-file-name | 4276 | (with-current-buffer mainbuf |
| 4279 | (with-current-buffer mainbuf | 4277 | (setq default-directory (file-name-directory mbuf-contents)))) |
| 4280 | (setq default-directory (file-name-directory mbuf-contents)))) | 4278 | (with-current-buffer standard-output |
| 4281 | (set-buffer standard-output) | ||
| 4282 | (completion-list-mode) | 4279 | (completion-list-mode) |
| 4283 | (make-local-variable 'completion-reference-buffer) | 4280 | (make-local-variable 'completion-reference-buffer) |
| 4284 | (setq completion-reference-buffer mainbuf) | 4281 | (setq completion-reference-buffer mainbuf) |
| @@ -4287,24 +4284,23 @@ of the differing parts is, by contrast, slightly highlighted." | |||
| 4287 | ;; use the number of chars before the start of the | 4284 | ;; use the number of chars before the start of the |
| 4288 | ;; last file name component. | 4285 | ;; last file name component. |
| 4289 | (setq completion-base-size | 4286 | (setq completion-base-size |
| 4290 | (save-excursion | 4287 | (with-current-buffer mainbuf |
| 4291 | (set-buffer mainbuf) | 4288 | (save-excursion |
| 4292 | (goto-char (point-max)) | 4289 | (goto-char (point-max)) |
| 4293 | (skip-chars-backward "^/") | 4290 | (skip-chars-backward "^/") |
| 4294 | (- (point) (minibuffer-prompt-end)))) | 4291 | (- (point) (minibuffer-prompt-end))))) |
| 4295 | ;; Otherwise, in minibuffer, the whole input is being completed. | 4292 | ;; Otherwise, in minibuffer, the whole input is being completed. |
| 4296 | (save-match-data | 4293 | (if (minibufferp mainbuf) |
| 4297 | (if (minibufferp mainbuf) | 4294 | (setq completion-base-size 0))) |
| 4298 | (setq completion-base-size 0)))) | 4295 | ;; Put faces on first uncommon characters and common parts. |
| 4299 | ;; Put faces on first uncommon characters and common parts. | ||
| 4300 | (when completion-base-size | 4296 | (when completion-base-size |
| 4301 | (let* ((common-string-length (length | 4297 | (let* ((common-string-length |
| 4302 | (substring mbuf-contents | 4298 | (- (length mbuf-contents) completion-base-size)) |
| 4303 | completion-base-size))) | ||
| 4304 | (element-start (next-single-property-change | 4299 | (element-start (next-single-property-change |
| 4305 | (point-min) | 4300 | (point-min) |
| 4306 | 'mouse-face)) | 4301 | 'mouse-face)) |
| 4307 | (element-common-end (+ element-start common-string-length)) | 4302 | (element-common-end |
| 4303 | (+ (or element-start nil) common-string-length)) | ||
| 4308 | (maxp (point-max))) | 4304 | (maxp (point-max))) |
| 4309 | (while (and element-start (< element-common-end maxp)) | 4305 | (while (and element-start (< element-common-end maxp)) |
| 4310 | (when (and (get-char-property element-start 'mouse-face) | 4306 | (when (and (get-char-property element-start 'mouse-face) |
| @@ -4768,5 +4764,5 @@ works by saving the value of `buffer-invisibility-spec' and setting it to nil." | |||
| 4768 | 4764 | ||
| 4769 | (provide 'simple) | 4765 | (provide 'simple) |
| 4770 | 4766 | ||
| 4771 | ;;; arch-tag: 24af67c0-2a49-44f6-b3b1-312d8b570dfd | 4767 | ;; arch-tag: 24af67c0-2a49-44f6-b3b1-312d8b570dfd |
| 4772 | ;;; simple.el ends here | 4768 | ;;; simple.el ends here |