diff options
| author | Richard M. Stallman | 1997-05-30 00:58:54 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-05-30 00:58:54 +0000 |
| commit | 50be475d120ff32d4ff3ab3d3497d4156cf7d480 (patch) | |
| tree | 11161b514b98e64d36e8a625b8c046174c739d52 | |
| parent | 25ac13b5bd3d9226964793f68bceaba91184ce33 (diff) | |
| download | emacs-50be475d120ff32d4ff3ab3d3497d4156cf7d480.tar.gz emacs-50be475d120ff32d4ff3ab3d3497d4156cf7d480.zip | |
(line-move): If moving into intangible text,
try to move to the end of the intangible segment if it's on that line.
(completion-setup-function): Do set completion-base-size.
(do-auto-fill): Don't give fill-context-prefix a third arg.
| -rw-r--r-- | lisp/simple.el | 37 |
1 files changed, 29 insertions, 8 deletions
diff --git a/lisp/simple.el b/lisp/simple.el index 74280ab8f93..c26e7dcc8fa 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -1943,11 +1943,26 @@ Outline mode sets this." | |||
| 1943 | (setq arg (1+ arg)))) | 1943 | (setq arg (1+ arg)))) |
| 1944 | (let ((buffer-invisibility-spec nil)) | 1944 | (let ((buffer-invisibility-spec nil)) |
| 1945 | (move-to-column (or goal-column temporary-goal-column)))) | 1945 | (move-to-column (or goal-column temporary-goal-column)))) |
| 1946 | (setq new (point)) | ||
| 1947 | ;; If we are moving into some intangible text, | ||
| 1948 | ;; look for following text on the same line which isn't intangible | ||
| 1949 | ;; and move there. | ||
| 1950 | (let ((after (and (< new (point-max)) | ||
| 1951 | (get-char-property new 'intangible))) | ||
| 1952 | (before (and (> new (point-min)) | ||
| 1953 | (get-char-property (1- new) 'intangible))) | ||
| 1954 | line-end) | ||
| 1955 | (when (and before (eq before after)) | ||
| 1956 | (setq line-end (save-excursion (end-of-line) (point))) | ||
| 1957 | (goto-char (point-min)) | ||
| 1958 | (let ((inhibit-point-motion-hooks nil)) | ||
| 1959 | (goto-char new)) | ||
| 1960 | (if (<= new line-end) | ||
| 1961 | (setq new (point))))) | ||
| 1946 | ;; Remember where we moved to, go back home, | 1962 | ;; Remember where we moved to, go back home, |
| 1947 | ;; then do the motion over again | 1963 | ;; then do the motion over again |
| 1948 | ;; in just one step, with intangibility and point-motion hooks | 1964 | ;; in just one step, with intangibility and point-motion hooks |
| 1949 | ;; enabled this time. | 1965 | ;; enabled this time. |
| 1950 | (setq new (point)) | ||
| 1951 | (goto-char opoint) | 1966 | (goto-char opoint) |
| 1952 | (setq inhibit-point-motion-hooks nil) | 1967 | (setq inhibit-point-motion-hooks nil) |
| 1953 | (goto-char new))) | 1968 | (goto-char new))) |
| @@ -2556,10 +2571,7 @@ Setting this variable automatically makes it local to the current buffer." | |||
| 2556 | (let ((prefix | 2571 | (let ((prefix |
| 2557 | (fill-context-prefix | 2572 | (fill-context-prefix |
| 2558 | (save-excursion (backward-paragraph 1) (point)) | 2573 | (save-excursion (backward-paragraph 1) (point)) |
| 2559 | (save-excursion (forward-paragraph 1) (point)) | 2574 | (save-excursion (forward-paragraph 1) (point))))) |
| 2560 | ;; Don't accept a non-whitespace fill prefix | ||
| 2561 | ;; from the first line of a paragraph. | ||
| 2562 | "^[ \t]*$"))) | ||
| 2563 | (and prefix (not (equal prefix "")) | 2575 | (and prefix (not (equal prefix "")) |
| 2564 | (setq fill-prefix prefix)))) | 2576 | (setq fill-prefix prefix)))) |
| 2565 | 2577 | ||
| @@ -3400,9 +3412,18 @@ If this function moves point, it can alter the end of that completion.") | |||
| 3400 | (completion-list-mode) | 3412 | (completion-list-mode) |
| 3401 | (make-local-variable 'completion-reference-buffer) | 3413 | (make-local-variable 'completion-reference-buffer) |
| 3402 | (setq completion-reference-buffer mainbuf) | 3414 | (setq completion-reference-buffer mainbuf) |
| 3403 | ;;; The value 0 is right in most cases, but not for file name completion. | 3415 | (if (eq minibuffer-completion-table 'read-file-name-internal) |
| 3404 | ;;; so this has to be turned off. | 3416 | ;; For file name completion, |
| 3405 | ;;; (setq completion-base-size 0) | 3417 | ;; use the number of chars before the start of the |
| 3418 | ;; last file name component. | ||
| 3419 | (setq completion-base-size | ||
| 3420 | (save-excursion | ||
| 3421 | (set-buffer mainbuf) | ||
| 3422 | (goto-char (point-max)) | ||
| 3423 | (skip-chars-backward (format "^%c" directory-sep-char)) | ||
| 3424 | (- (point) (point-min)))) | ||
| 3425 | ;; Otherwise, the whole input is the text being completed. | ||
| 3426 | (setq completion-base-size 0)) | ||
| 3406 | (goto-char (point-min)) | 3427 | (goto-char (point-min)) |
| 3407 | (if window-system | 3428 | (if window-system |
| 3408 | (insert (substitute-command-keys | 3429 | (insert (substitute-command-keys |