diff options
| author | Stefan Monnier | 2007-11-16 18:07:14 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2007-11-16 18:07:14 +0000 |
| commit | e85c6b7cee2c5a0cb523ab09ee069043a10c4e41 (patch) | |
| tree | 57507ed21369f1f872da9f7bfeea429363ca0fd7 | |
| parent | da99b369e96db10411bb9f5c7d578582b5f514de (diff) | |
| download | emacs-e85c6b7cee2c5a0cb523ab09ee069043a10c4e41.tar.gz emacs-e85c6b7cee2c5a0cb523ab09ee069043a10c4e41.zip | |
(pc-select-shifted-mark): Remove.
(pc-select-ensure-mark): Set mark-active to a special value instead.
Rename from ensure-mark. Update call callers.
(pc-select-maybe-deactivate-mark): Rename from maybe-deactivate-mark.
Rewrite. Update all callers.
(pc-selection-mode): Remove redundant var declaration.
| -rw-r--r-- | lisp/ChangeLog | 13 | ||||
| -rw-r--r-- | lisp/emulation/pc-select.el | 105 |
2 files changed, 53 insertions, 65 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9da728cd8be..b806ac23302 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,7 +1,16 @@ | |||
| 1 | 2007-11-16 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * emulation/pc-select.el (pc-select-shifted-mark): Remove. | ||
| 4 | (pc-select-ensure-mark): Set mark-active to a special value instead. | ||
| 5 | Rename from ensure-mark. Update call callers. | ||
| 6 | (pc-select-maybe-deactivate-mark): Rename from maybe-deactivate-mark. | ||
| 7 | Rewrite. Update all callers. | ||
| 8 | (pc-selection-mode): Remove redundant var declaration. | ||
| 9 | |||
| 1 | 2007-11-16 Tassilo Horn <tassilo@member.fsf.org> | 10 | 2007-11-16 Tassilo Horn <tassilo@member.fsf.org> |
| 2 | 11 | ||
| 3 | * doc-view.el (doc-view-search-backward, doc-view-search): Fix | 12 | * doc-view.el (doc-view-search-backward, doc-view-search): |
| 4 | assignment to free variable bug. | 13 | Fix assignment to free variable bug. |
| 5 | 14 | ||
| 6 | 2007-11-16 Martin Pohlack <mp26@os.inf.tu-dresden.de> (tiny change) | 15 | 2007-11-16 Martin Pohlack <mp26@os.inf.tu-dresden.de> (tiny change) |
| 7 | 16 | ||
diff --git a/lisp/emulation/pc-select.el b/lisp/emulation/pc-select.el index b9a3d3017d6..c35044b70ec 100644 --- a/lisp/emulation/pc-select.el +++ b/lisp/emulation/pc-select.el | |||
| @@ -254,10 +254,6 @@ This variable holds the value associated with [M-delete] in the | |||
| 254 | `function-key-map' before PC Selection mode had changed that | 254 | `function-key-map' before PC Selection mode had changed that |
| 255 | association.") | 255 | association.") |
| 256 | 256 | ||
| 257 | (defvar pc-select-shifted-mark nil | ||
| 258 | "Holds whether we ourselves did activate the mark. Only then | ||
| 259 | should we deactivate if later on.") | ||
| 260 | |||
| 261 | ;;;; | 257 | ;;;; |
| 262 | ;; misc | 258 | ;; misc |
| 263 | ;;;; | 259 | ;;;; |
| @@ -285,18 +281,17 @@ and `transient-mark-mode'." | |||
| 285 | ;;;; | 281 | ;;;; |
| 286 | ;; non-interactive | 282 | ;; non-interactive |
| 287 | ;;;; | 283 | ;;;; |
| 288 | (defun ensure-mark() | 284 | (defun pc-select-ensure-mark () |
| 289 | ;; make sure mark is active | 285 | ;; make sure mark is active |
| 290 | ;; test if it is active, if it isn't, set it and activate it | 286 | ;; test if it is active, if it isn't, set it and activate it |
| 291 | (or mark-active (set-mark-command nil)) | 287 | (or mark-active (set-mark-command nil)) |
| 292 | (setq pc-select-shifted-mark t)) | 288 | ;; Remember who activated the mark. |
| 289 | (setq mark-active 'pc-select)) | ||
| 293 | 290 | ||
| 294 | (defun maybe-deactivate-mark() | 291 | (defun pc-select-maybe-deactivate-mark () |
| 295 | ;; maybe switch off mark (only if *we* switched it on) | 292 | ;; maybe switch off mark (only if *we* switched it on) |
| 296 | (if pc-select-shifted-mark | 293 | (when (eq mark-active 'pc-select) |
| 297 | (progn | 294 | (deactivate-mark))) |
| 298 | (setq mark-active nil) | ||
| 299 | (setq pc-select-shifted-mark nil)))) | ||
| 300 | 295 | ||
| 301 | ;;;;;;;;;;;;;;;;;;;;;;;;;;; | 296 | ;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 302 | ;;;;; forward and mark | 297 | ;;;;; forward and mark |
| @@ -306,7 +301,7 @@ and `transient-mark-mode'." | |||
| 306 | "Ensure mark is active; move point right ARG characters (left if ARG negative). | 301 | "Ensure mark is active; move point right ARG characters (left if ARG negative). |
| 307 | On reaching end of buffer, stop and signal error." | 302 | On reaching end of buffer, stop and signal error." |
| 308 | (interactive "p") | 303 | (interactive "p") |
| 309 | (ensure-mark) | 304 | (pc-select-ensure-mark) |
| 310 | (forward-char arg)) | 305 | (forward-char arg)) |
| 311 | 306 | ||
| 312 | (defun forward-word-mark (&optional arg) | 307 | (defun forward-word-mark (&optional arg) |
| @@ -315,13 +310,13 @@ Normally returns t. | |||
| 315 | If an edge of the buffer is reached, point is left there | 310 | If an edge of the buffer is reached, point is left there |
| 316 | and nil is returned." | 311 | and nil is returned." |
| 317 | (interactive "p") | 312 | (interactive "p") |
| 318 | (ensure-mark) | 313 | (pc-select-ensure-mark) |
| 319 | (forward-word arg)) | 314 | (forward-word arg)) |
| 320 | 315 | ||
| 321 | (defun forward-line-mark (&optional arg) | 316 | (defun forward-line-mark (&optional arg) |
| 322 | "Ensure mark is active; move cursor vertically down ARG lines." | 317 | "Ensure mark is active; move cursor vertically down ARG lines." |
| 323 | (interactive "p") | 318 | (interactive "p") |
| 324 | (ensure-mark) | 319 | (pc-select-ensure-mark) |
| 325 | (forward-line arg) | 320 | (forward-line arg) |
| 326 | (setq this-command 'forward-line) | 321 | (setq this-command 'forward-line) |
| 327 | ) | 322 | ) |
| @@ -331,7 +326,7 @@ and nil is returned." | |||
| 331 | With argument, do it that many times. Negative arg -N means | 326 | With argument, do it that many times. Negative arg -N means |
| 332 | move backward across N balanced expressions." | 327 | move backward across N balanced expressions." |
| 333 | (interactive "p") | 328 | (interactive "p") |
| 334 | (ensure-mark) | 329 | (pc-select-ensure-mark) |
| 335 | (forward-sexp arg)) | 330 | (forward-sexp arg)) |
| 336 | 331 | ||
| 337 | (defun forward-paragraph-mark (&optional arg) | 332 | (defun forward-paragraph-mark (&optional arg) |
| @@ -343,7 +338,7 @@ A line which `paragraph-start' matches either separates paragraphs | |||
| 343 | A paragraph end is the beginning of a line which is not part of the paragraph | 338 | A paragraph end is the beginning of a line which is not part of the paragraph |
| 344 | to which the end of the previous line belongs, or the end of the buffer." | 339 | to which the end of the previous line belongs, or the end of the buffer." |
| 345 | (interactive "p") | 340 | (interactive "p") |
| 346 | (ensure-mark) | 341 | (pc-select-ensure-mark) |
| 347 | (forward-paragraph arg)) | 342 | (forward-paragraph arg)) |
| 348 | 343 | ||
| 349 | (defun next-line-mark (&optional arg) | 344 | (defun next-line-mark (&optional arg) |
| @@ -362,7 +357,7 @@ a semipermanent goal column to which this command always moves. | |||
| 362 | Then it does not try to move vertically. This goal column is stored | 357 | Then it does not try to move vertically. This goal column is stored |
| 363 | in `goal-column', which is nil when there is none." | 358 | in `goal-column', which is nil when there is none." |
| 364 | (interactive "p") | 359 | (interactive "p") |
| 365 | (ensure-mark) | 360 | (pc-select-ensure-mark) |
| 366 | (with-no-warnings (next-line arg)) | 361 | (with-no-warnings (next-line arg)) |
| 367 | (setq this-command 'next-line)) | 362 | (setq this-command 'next-line)) |
| 368 | 363 | ||
| @@ -371,14 +366,14 @@ in `goal-column', which is nil when there is none." | |||
| 371 | With argument ARG not nil or 1, move forward ARG - 1 lines first. | 366 | With argument ARG not nil or 1, move forward ARG - 1 lines first. |
| 372 | If scan reaches end of buffer, stop there without error." | 367 | If scan reaches end of buffer, stop there without error." |
| 373 | (interactive "p") | 368 | (interactive "p") |
| 374 | (ensure-mark) | 369 | (pc-select-ensure-mark) |
| 375 | (end-of-line arg) | 370 | (end-of-line arg) |
| 376 | (setq this-command 'end-of-line)) | 371 | (setq this-command 'end-of-line)) |
| 377 | 372 | ||
| 378 | (defun backward-line-mark (&optional arg) | 373 | (defun backward-line-mark (&optional arg) |
| 379 | "Ensure mark is active; move cursor vertically up ARG lines." | 374 | "Ensure mark is active; move cursor vertically up ARG lines." |
| 380 | (interactive "p") | 375 | (interactive "p") |
| 381 | (ensure-mark) | 376 | (pc-select-ensure-mark) |
| 382 | (if (null arg) | 377 | (if (null arg) |
| 383 | (setq arg 1)) | 378 | (setq arg 1)) |
| 384 | (forward-line (- arg)) | 379 | (forward-line (- arg)) |
| @@ -391,7 +386,7 @@ A near full screen is `next-screen-context-lines' less than a full screen. | |||
| 391 | Negative ARG means scroll upward. | 386 | Negative ARG means scroll upward. |
| 392 | When calling from a program, supply a number as argument or nil." | 387 | When calling from a program, supply a number as argument or nil." |
| 393 | (interactive "P") | 388 | (interactive "P") |
| 394 | (ensure-mark) | 389 | (pc-select-ensure-mark) |
| 395 | (cond (pc-select-override-scroll-error | 390 | (cond (pc-select-override-scroll-error |
| 396 | (condition-case nil (scroll-down arg) | 391 | (condition-case nil (scroll-down arg) |
| 397 | (beginning-of-buffer (goto-char (point-min))))) | 392 | (beginning-of-buffer (goto-char (point-min))))) |
| @@ -407,7 +402,7 @@ of the accessible part of the buffer. | |||
| 407 | Don't use this command in Lisp programs! | 402 | Don't use this command in Lisp programs! |
| 408 | \(goto-char \(point-max)) is faster and avoids clobbering the mark." | 403 | \(goto-char \(point-max)) is faster and avoids clobbering the mark." |
| 409 | (interactive "P") | 404 | (interactive "P") |
| 410 | (ensure-mark) | 405 | (pc-select-ensure-mark) |
| 411 | (let ((size (- (point-max) (point-min)))) | 406 | (let ((size (- (point-max) (point-min)))) |
| 412 | (goto-char (if arg | 407 | (goto-char (if arg |
| 413 | (- (point-max) | 408 | (- (point-max) |
| @@ -439,7 +434,7 @@ Don't use this command in Lisp programs! | |||
| 439 | "Deactivate mark; move point right ARG characters \(left if ARG negative). | 434 | "Deactivate mark; move point right ARG characters \(left if ARG negative). |
| 440 | On reaching end of buffer, stop and signal error." | 435 | On reaching end of buffer, stop and signal error." |
| 441 | (interactive "p") | 436 | (interactive "p") |
| 442 | (maybe-deactivate-mark) | 437 | (pc-select-maybe-deactivate-mark) |
| 443 | (forward-char arg)) | 438 | (forward-char arg)) |
| 444 | 439 | ||
| 445 | (defun forward-word-nomark (&optional arg) | 440 | (defun forward-word-nomark (&optional arg) |
| @@ -448,13 +443,13 @@ Normally returns t. | |||
| 448 | If an edge of the buffer is reached, point is left there | 443 | If an edge of the buffer is reached, point is left there |
| 449 | and nil is returned." | 444 | and nil is returned." |
| 450 | (interactive "p") | 445 | (interactive "p") |
| 451 | (maybe-deactivate-mark) | 446 | (pc-select-maybe-deactivate-mark) |
| 452 | (forward-word arg)) | 447 | (forward-word arg)) |
| 453 | 448 | ||
| 454 | (defun forward-line-nomark (&optional arg) | 449 | (defun forward-line-nomark (&optional arg) |
| 455 | "Deactivate mark; move cursor vertically down ARG lines." | 450 | "Deactivate mark; move cursor vertically down ARG lines." |
| 456 | (interactive "p") | 451 | (interactive "p") |
| 457 | (maybe-deactivate-mark) | 452 | (pc-select-maybe-deactivate-mark) |
| 458 | (forward-line arg) | 453 | (forward-line arg) |
| 459 | (setq this-command 'forward-line) | 454 | (setq this-command 'forward-line) |
| 460 | ) | 455 | ) |
| @@ -464,7 +459,7 @@ and nil is returned." | |||
| 464 | With argument, do it that many times. Negative arg -N means | 459 | With argument, do it that many times. Negative arg -N means |
| 465 | move backward across N balanced expressions." | 460 | move backward across N balanced expressions." |
| 466 | (interactive "p") | 461 | (interactive "p") |
| 467 | (maybe-deactivate-mark) | 462 | (pc-select-maybe-deactivate-mark) |
| 468 | (forward-sexp arg)) | 463 | (forward-sexp arg)) |
| 469 | 464 | ||
| 470 | (defun forward-paragraph-nomark (&optional arg) | 465 | (defun forward-paragraph-nomark (&optional arg) |
| @@ -476,7 +471,7 @@ A line which `paragraph-start' matches either separates paragraphs | |||
| 476 | A paragraph end is the beginning of a line which is not part of the paragraph | 471 | A paragraph end is the beginning of a line which is not part of the paragraph |
| 477 | to which the end of the previous line belongs, or the end of the buffer." | 472 | to which the end of the previous line belongs, or the end of the buffer." |
| 478 | (interactive "p") | 473 | (interactive "p") |
| 479 | (maybe-deactivate-mark) | 474 | (pc-select-maybe-deactivate-mark) |
| 480 | (forward-paragraph arg)) | 475 | (forward-paragraph arg)) |
| 481 | 476 | ||
| 482 | (defun next-line-nomark (&optional arg) | 477 | (defun next-line-nomark (&optional arg) |
| @@ -495,7 +490,7 @@ a semipermanent goal column to which this command always moves. | |||
| 495 | Then it does not try to move vertically. This goal column is stored | 490 | Then it does not try to move vertically. This goal column is stored |
| 496 | in `goal-column', which is nil when there is none." | 491 | in `goal-column', which is nil when there is none." |
| 497 | (interactive "p") | 492 | (interactive "p") |
| 498 | (maybe-deactivate-mark) | 493 | (pc-select-maybe-deactivate-mark) |
| 499 | (with-no-warnings (next-line arg)) | 494 | (with-no-warnings (next-line arg)) |
| 500 | (setq this-command 'next-line)) | 495 | (setq this-command 'next-line)) |
| 501 | 496 | ||
| @@ -504,14 +499,14 @@ in `goal-column', which is nil when there is none." | |||
| 504 | With argument ARG not nil or 1, move forward ARG - 1 lines first. | 499 | With argument ARG not nil or 1, move forward ARG - 1 lines first. |
| 505 | If scan reaches end of buffer, stop there without error." | 500 | If scan reaches end of buffer, stop there without error." |
| 506 | (interactive "p") | 501 | (interactive "p") |
| 507 | (maybe-deactivate-mark) | 502 | (pc-select-maybe-deactivate-mark) |
| 508 | (end-of-line arg) | 503 | (end-of-line arg) |
| 509 | (setq this-command 'end-of-line)) | 504 | (setq this-command 'end-of-line)) |
| 510 | 505 | ||
| 511 | (defun backward-line-nomark (&optional arg) | 506 | (defun backward-line-nomark (&optional arg) |
| 512 | "Deactivate mark; move cursor vertically up ARG lines." | 507 | "Deactivate mark; move cursor vertically up ARG lines." |
| 513 | (interactive "p") | 508 | (interactive "p") |
| 514 | (maybe-deactivate-mark) | 509 | (pc-select-maybe-deactivate-mark) |
| 515 | (if (null arg) | 510 | (if (null arg) |
| 516 | (setq arg 1)) | 511 | (setq arg 1)) |
| 517 | (forward-line (- arg)) | 512 | (forward-line (- arg)) |
| @@ -524,7 +519,7 @@ A near full screen is `next-screen-context-lines' less than a full screen. | |||
| 524 | Negative ARG means scroll upward. | 519 | Negative ARG means scroll upward. |
| 525 | When calling from a program, supply a number as argument or nil." | 520 | When calling from a program, supply a number as argument or nil." |
| 526 | (interactive "P") | 521 | (interactive "P") |
| 527 | (maybe-deactivate-mark) | 522 | (pc-select-maybe-deactivate-mark) |
| 528 | (cond (pc-select-override-scroll-error | 523 | (cond (pc-select-override-scroll-error |
| 529 | (condition-case nil (scroll-down arg) | 524 | (condition-case nil (scroll-down arg) |
| 530 | (beginning-of-buffer (goto-char (point-min))))) | 525 | (beginning-of-buffer (goto-char (point-min))))) |
| @@ -540,7 +535,7 @@ of the accessible part of the buffer. | |||
| 540 | Don't use this command in Lisp programs! | 535 | Don't use this command in Lisp programs! |
| 541 | \(goto-char (point-max)) is faster and avoids clobbering the mark." | 536 | \(goto-char (point-max)) is faster and avoids clobbering the mark." |
| 542 | (interactive "P") | 537 | (interactive "P") |
| 543 | (maybe-deactivate-mark) | 538 | (pc-select-maybe-deactivate-mark) |
| 544 | (let ((size (- (point-max) (point-min)))) | 539 | (let ((size (- (point-max) (point-min)))) |
| 545 | (goto-char (if arg | 540 | (goto-char (if arg |
| 546 | (- (point-max) | 541 | (- (point-max) |
| @@ -573,14 +568,14 @@ Don't use this command in Lisp programs! | |||
| 573 | "Ensure mark is active; move point left ARG characters (right if ARG negative). | 568 | "Ensure mark is active; move point left ARG characters (right if ARG negative). |
| 574 | On attempt to pass beginning or end of buffer, stop and signal error." | 569 | On attempt to pass beginning or end of buffer, stop and signal error." |
| 575 | (interactive "p") | 570 | (interactive "p") |
| 576 | (ensure-mark) | 571 | (pc-select-ensure-mark) |
| 577 | (backward-char arg)) | 572 | (backward-char arg)) |
| 578 | 573 | ||
| 579 | (defun backward-word-mark (&optional arg) | 574 | (defun backward-word-mark (&optional arg) |
| 580 | "Ensure mark is active; move backward until encountering the end of a word. | 575 | "Ensure mark is active; move backward until encountering the end of a word. |
| 581 | With argument, do this that many times." | 576 | With argument, do this that many times." |
| 582 | (interactive "p") | 577 | (interactive "p") |
| 583 | (ensure-mark) | 578 | (pc-select-ensure-mark) |
| 584 | (backward-word arg)) | 579 | (backward-word arg)) |
| 585 | 580 | ||
| 586 | (defun backward-sexp-mark (&optional arg) | 581 | (defun backward-sexp-mark (&optional arg) |
| @@ -588,7 +583,7 @@ With argument, do this that many times." | |||
| 588 | With argument, do it that many times. Negative arg -N means | 583 | With argument, do it that many times. Negative arg -N means |
| 589 | move forward across N balanced expressions." | 584 | move forward across N balanced expressions." |
| 590 | (interactive "p") | 585 | (interactive "p") |
| 591 | (ensure-mark) | 586 | (pc-select-ensure-mark) |
| 592 | (backward-sexp arg)) | 587 | (backward-sexp arg)) |
| 593 | 588 | ||
| 594 | (defun backward-paragraph-mark (&optional arg) | 589 | (defun backward-paragraph-mark (&optional arg) |
| @@ -603,7 +598,7 @@ blank line. | |||
| 603 | 598 | ||
| 604 | See `forward-paragraph' for more information." | 599 | See `forward-paragraph' for more information." |
| 605 | (interactive "p") | 600 | (interactive "p") |
| 606 | (ensure-mark) | 601 | (pc-select-ensure-mark) |
| 607 | (backward-paragraph arg)) | 602 | (backward-paragraph arg)) |
| 608 | 603 | ||
| 609 | (defun previous-line-mark (&optional arg) | 604 | (defun previous-line-mark (&optional arg) |
| @@ -620,7 +615,7 @@ If you are thinking of using this in a Lisp program, consider using | |||
| 620 | `forward-line' with a negative argument instead. It is usually easier | 615 | `forward-line' with a negative argument instead. It is usually easier |
| 621 | to use and more reliable (no dependence on goal column, etc.)." | 616 | to use and more reliable (no dependence on goal column, etc.)." |
| 622 | (interactive "p") | 617 | (interactive "p") |
| 623 | (ensure-mark) | 618 | (pc-select-ensure-mark) |
| 624 | (with-no-warnings (previous-line arg)) | 619 | (with-no-warnings (previous-line arg)) |
| 625 | (setq this-command 'previous-line)) | 620 | (setq this-command 'previous-line)) |
| 626 | 621 | ||
| @@ -629,7 +624,7 @@ to use and more reliable (no dependence on goal column, etc.)." | |||
| 629 | With argument ARG not nil or 1, move forward ARG - 1 lines first. | 624 | With argument ARG not nil or 1, move forward ARG - 1 lines first. |
| 630 | If scan reaches end of buffer, stop there without error." | 625 | If scan reaches end of buffer, stop there without error." |
| 631 | (interactive "p") | 626 | (interactive "p") |
| 632 | (ensure-mark) | 627 | (pc-select-ensure-mark) |
| 633 | (beginning-of-line arg)) | 628 | (beginning-of-line arg)) |
| 634 | 629 | ||
| 635 | 630 | ||
| @@ -639,7 +634,7 @@ A near full screen is `next-screen-context-lines' less than a full screen. | |||
| 639 | Negative ARG means scroll downward. | 634 | Negative ARG means scroll downward. |
| 640 | When calling from a program, supply a number as argument or nil." | 635 | When calling from a program, supply a number as argument or nil." |
| 641 | (interactive "P") | 636 | (interactive "P") |
| 642 | (ensure-mark) | 637 | (pc-select-ensure-mark) |
| 643 | (cond (pc-select-override-scroll-error | 638 | (cond (pc-select-override-scroll-error |
| 644 | (condition-case nil (scroll-up arg) | 639 | (condition-case nil (scroll-up arg) |
| 645 | (end-of-buffer (goto-char (point-max))))) | 640 | (end-of-buffer (goto-char (point-max))))) |
| @@ -655,7 +650,7 @@ of the accessible part of the buffer. | |||
| 655 | Don't use this command in Lisp programs! | 650 | Don't use this command in Lisp programs! |
| 656 | \(goto-char (p\oint-min)) is faster and avoids clobbering the mark." | 651 | \(goto-char (p\oint-min)) is faster and avoids clobbering the mark." |
| 657 | (interactive "P") | 652 | (interactive "P") |
| 658 | (ensure-mark) | 653 | (pc-select-ensure-mark) |
| 659 | (let ((size (- (point-max) (point-min)))) | 654 | (let ((size (- (point-max) (point-min)))) |
| 660 | (goto-char (if arg | 655 | (goto-char (if arg |
| 661 | (+ (point-min) | 656 | (+ (point-min) |
| @@ -675,14 +670,14 @@ Don't use this command in Lisp programs! | |||
| 675 | "Deactivate mark; move point left ARG characters (right if ARG negative). | 670 | "Deactivate mark; move point left ARG characters (right if ARG negative). |
| 676 | On attempt to pass beginning or end of buffer, stop and signal error." | 671 | On attempt to pass beginning or end of buffer, stop and signal error." |
| 677 | (interactive "p") | 672 | (interactive "p") |
| 678 | (maybe-deactivate-mark) | 673 | (pc-select-maybe-deactivate-mark) |
| 679 | (backward-char arg)) | 674 | (backward-char arg)) |
| 680 | 675 | ||
| 681 | (defun backward-word-nomark (&optional arg) | 676 | (defun backward-word-nomark (&optional arg) |
| 682 | "Deactivate mark; move backward until encountering the end of a word. | 677 | "Deactivate mark; move backward until encountering the end of a word. |
| 683 | With argument, do this that many times." | 678 | With argument, do this that many times." |
| 684 | (interactive "p") | 679 | (interactive "p") |
| 685 | (maybe-deactivate-mark) | 680 | (pc-select-maybe-deactivate-mark) |
| 686 | (backward-word arg)) | 681 | (backward-word arg)) |
| 687 | 682 | ||
| 688 | (defun backward-sexp-nomark (&optional arg) | 683 | (defun backward-sexp-nomark (&optional arg) |
| @@ -690,7 +685,7 @@ With argument, do this that many times." | |||
| 690 | With argument, do it that many times. Negative arg -N means | 685 | With argument, do it that many times. Negative arg -N means |
| 691 | move forward across N balanced expressions." | 686 | move forward across N balanced expressions." |
| 692 | (interactive "p") | 687 | (interactive "p") |
| 693 | (maybe-deactivate-mark) | 688 | (pc-select-maybe-deactivate-mark) |
| 694 | (backward-sexp arg)) | 689 | (backward-sexp arg)) |
| 695 | 690 | ||
| 696 | (defun backward-paragraph-nomark (&optional arg) | 691 | (defun backward-paragraph-nomark (&optional arg) |
| @@ -705,7 +700,7 @@ blank line. | |||
| 705 | 700 | ||
| 706 | See `forward-paragraph' for more information." | 701 | See `forward-paragraph' for more information." |
| 707 | (interactive "p") | 702 | (interactive "p") |
| 708 | (maybe-deactivate-mark) | 703 | (pc-select-maybe-deactivate-mark) |
| 709 | (backward-paragraph arg)) | 704 | (backward-paragraph arg)) |
| 710 | 705 | ||
| 711 | (defun previous-line-nomark (&optional arg) | 706 | (defun previous-line-nomark (&optional arg) |
| @@ -718,7 +713,7 @@ The command \\[set-goal-column] can be used to create | |||
| 718 | a semipermanent goal column to which this command always moves. | 713 | a semipermanent goal column to which this command always moves. |
| 719 | Then it does not try to move vertically." | 714 | Then it does not try to move vertically." |
| 720 | (interactive "p") | 715 | (interactive "p") |
| 721 | (maybe-deactivate-mark) | 716 | (pc-select-maybe-deactivate-mark) |
| 722 | (with-no-warnings (previous-line arg)) | 717 | (with-no-warnings (previous-line arg)) |
| 723 | (setq this-command 'previous-line)) | 718 | (setq this-command 'previous-line)) |
| 724 | 719 | ||
| @@ -727,7 +722,7 @@ Then it does not try to move vertically." | |||
| 727 | With argument ARG not nil or 1, move forward ARG - 1 lines first. | 722 | With argument ARG not nil or 1, move forward ARG - 1 lines first. |
| 728 | If scan reaches end of buffer, stop there without error." | 723 | If scan reaches end of buffer, stop there without error." |
| 729 | (interactive "p") | 724 | (interactive "p") |
| 730 | (maybe-deactivate-mark) | 725 | (pc-select-maybe-deactivate-mark) |
| 731 | (beginning-of-line arg)) | 726 | (beginning-of-line arg)) |
| 732 | 727 | ||
| 733 | (defun scroll-up-nomark (&optional arg) | 728 | (defun scroll-up-nomark (&optional arg) |
| @@ -736,7 +731,7 @@ A near full screen is `next-screen-context-lines' less than a full screen. | |||
| 736 | Negative ARG means scroll downward. | 731 | Negative ARG means scroll downward. |
| 737 | When calling from a program, supply a number as argument or nil." | 732 | When calling from a program, supply a number as argument or nil." |
| 738 | (interactive "P") | 733 | (interactive "P") |
| 739 | (maybe-deactivate-mark) | 734 | (pc-select-maybe-deactivate-mark) |
| 740 | (cond (pc-select-override-scroll-error | 735 | (cond (pc-select-override-scroll-error |
| 741 | (condition-case nil (scroll-up arg) | 736 | (condition-case nil (scroll-up arg) |
| 742 | (end-of-buffer (goto-char (point-max))))) | 737 | (end-of-buffer (goto-char (point-max))))) |
| @@ -752,7 +747,7 @@ of the accessible part of the buffer. | |||
| 752 | Don't use this command in Lisp programs! | 747 | Don't use this command in Lisp programs! |
| 753 | \(goto-char (point-min)) is faster and avoids clobbering the mark." | 748 | \(goto-char (point-min)) is faster and avoids clobbering the mark." |
| 754 | (interactive "P") | 749 | (interactive "P") |
| 755 | (maybe-deactivate-mark) | 750 | (pc-select-maybe-deactivate-mark) |
| 756 | (let ((size (- (point-max) (point-min)))) | 751 | (let ((size (- (point-max) (point-min)))) |
| 757 | (goto-char (if arg | 752 | (goto-char (if arg |
| 758 | (+ (point-min) | 753 | (+ (point-min) |
| @@ -980,21 +975,5 @@ but before calling PC Selection mode): | |||
| 980 | (setq pc-select-key-bindings-alist nil | 975 | (setq pc-select-key-bindings-alist nil |
| 981 | pc-select-saved-settings-alist nil)))) | 976 | pc-select-saved-settings-alist nil)))) |
| 982 | 977 | ||
| 983 | |||
| 984 | ;;;###autoload | ||
| 985 | (defcustom pc-selection-mode nil | ||
| 986 | "Toggle PC Selection mode. | ||
| 987 | Change mark behavior to emulate Motif, MAC or MS-Windows cut and paste style, | ||
| 988 | and cursor movement commands. | ||
| 989 | This mode enables Delete Selection mode and Transient Mark mode. | ||
| 990 | Setting this variable directly does not take effect; | ||
| 991 | you must modify it using \\[customize] or \\[pc-selection-mode]." | ||
| 992 | :set (lambda (symbol value) | ||
| 993 | (pc-selection-mode (if value 1 -1))) | ||
| 994 | :initialize 'custom-initialize-default | ||
| 995 | :type 'boolean | ||
| 996 | :group 'pc-select | ||
| 997 | :require 'pc-select) | ||
| 998 | |||
| 999 | ;; arch-tag: 10697b70-ae07-4f3e-ad23-7814a3f418c2 | 978 | ;; arch-tag: 10697b70-ae07-4f3e-ad23-7814a3f418c2 |
| 1000 | ;;; pc-select.el ends here | 979 | ;;; pc-select.el ends here |