diff options
| author | Thierry Volpiatto | 2010-07-14 12:41:40 -0400 |
|---|---|---|
| committer | Karl Fogel | 2010-07-14 12:41:40 -0400 |
| commit | 8f2eaa8abd8630a6707a0e1d9bca9293497ef915 (patch) | |
| tree | dda84519d1449e9e160bf69ca664684656901894 | |
| parent | 33b4848367ec5383a8dd35113c454c85fb3f0ef5 (diff) | |
| download | emacs-8f2eaa8abd8630a6707a0e1d9bca9293497ef915.tar.gz emacs-8f2eaa8abd8630a6707a0e1d9bca9293497ef915.zip | |
Allow C-w when setting a bookmark in a Gnus Article buffer (Bug#5975).
* lisp/bookmark.el (bookmark-set): Don't set `bookmark-yank-point' and
`bookmark-current-buffer' if they have been already set in another
buffer (e.g gnus-art).
* lisp/gnus/gnus-sum.el (gnus-summary-bookmark-make-record): Set
`bookmark-yank-point' and `bookmark-current-buffer' to allow C-w.
| -rw-r--r-- | lisp/ChangeLog | 9 | ||||
| -rw-r--r-- | lisp/bookmark.el | 49 | ||||
| -rw-r--r-- | lisp/gnus/ChangeLog | 8 | ||||
| -rw-r--r-- | lisp/gnus/gnus-sum.el | 6 |
4 files changed, 49 insertions, 23 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a24f7083b72..fcd4bc7ff66 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2010-07-13 Thierry Volpiatto <thierry.volpiatto@gmail.com> | ||
| 2 | |||
| 3 | Allow C-w when setting a bookmark in a Gnus Article buffer (Bug#5975). | ||
| 4 | Patch applied by Karl Fogel. | ||
| 5 | |||
| 6 | * bookmark.el (bookmark-set): Don't set `bookmark-yank-point' | ||
| 7 | and `bookmark-current-buffer' if they have been already set in | ||
| 8 | another buffer (e.g gnus-art). | ||
| 9 | |||
| 1 | 2010-07-13 Karl Fogel <kfogel@red-bean.com> | 10 | 2010-07-13 Karl Fogel <kfogel@red-bean.com> |
| 2 | Thierry Volpiatto <thierry.volpiatto@gmail.com> | 11 | Thierry Volpiatto <thierry.volpiatto@gmail.com> |
| 3 | 12 | ||
diff --git a/lisp/bookmark.el b/lisp/bookmark.el index c9e7f824ee3..958997ccfcd 100644 --- a/lisp/bookmark.el +++ b/lisp/bookmark.el | |||
| @@ -783,27 +783,34 @@ Use \\[bookmark-delete] to remove bookmarks (you give it a name and | |||
| 783 | it removes only the first instance of a bookmark with that name from | 783 | it removes only the first instance of a bookmark with that name from |
| 784 | the list of bookmarks.)" | 784 | the list of bookmarks.)" |
| 785 | (interactive (list nil current-prefix-arg)) | 785 | (interactive (list nil current-prefix-arg)) |
| 786 | (let* ((record (bookmark-make-record)) | 786 | (unwind-protect |
| 787 | (default (car record))) | 787 | (let* ((record (bookmark-make-record)) |
| 788 | 788 | (default (car record))) | |
| 789 | (bookmark-maybe-load-default-file) | 789 | |
| 790 | 790 | (bookmark-maybe-load-default-file) | |
| 791 | (setq bookmark-yank-point (point)) | 791 | ;; Don't set `bookmark-yank-point' and `bookmark-current-buffer' |
| 792 | (setq bookmark-current-buffer (current-buffer)) | 792 | ;; if they have been already set in another buffer. (e.g gnus-art). |
| 793 | 793 | (unless (and bookmark-yank-point | |
| 794 | (let ((str | 794 | bookmark-current-buffer) |
| 795 | (or name | 795 | (setq bookmark-yank-point (point)) |
| 796 | (read-from-minibuffer | 796 | (setq bookmark-current-buffer (current-buffer))) |
| 797 | (format "Set bookmark (%s): " default) | 797 | |
| 798 | nil | 798 | (let ((str |
| 799 | bookmark-minibuffer-read-name-map | 799 | (or name |
| 800 | nil nil default)))) | 800 | (read-from-minibuffer |
| 801 | (and (string-equal str "") (setq str default)) | 801 | (format "Set bookmark (%s): " default) |
| 802 | (bookmark-store str (cdr record) no-overwrite) | 802 | nil |
| 803 | 803 | bookmark-minibuffer-read-name-map | |
| 804 | ;; Ask for an annotation buffer for this bookmark | 804 | nil nil default)))) |
| 805 | (when bookmark-use-annotations | 805 | (and (string-equal str "") (setq str default)) |
| 806 | (bookmark-edit-annotation str))))) | 806 | (bookmark-store str (cdr record) no-overwrite) |
| 807 | |||
| 808 | ;; Ask for an annotation buffer for this bookmark | ||
| 809 | (when bookmark-use-annotations | ||
| 810 | (bookmark-edit-annotation str)))) | ||
| 811 | (setq bookmark-yank-point nil) | ||
| 812 | (setq bookmark-current-buffer nil))) | ||
| 813 | |||
| 807 | 814 | ||
| 808 | (defun bookmark-kill-line (&optional newline-too) | 815 | (defun bookmark-kill-line (&optional newline-too) |
| 809 | "Kill from point to end of line. | 816 | "Kill from point to end of line. |
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index cc2a891ab82..dc3d28ec44d 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2010-07-13 Thierry Volpiatto <thierry.volpiatto@gmail.com> | ||
| 2 | |||
| 3 | Allow C-w when setting a bookmark in a Gnus Article buffer (Bug#5975). | ||
| 4 | Patch applied by Karl Fogel. | ||
| 5 | |||
| 6 | * gnus-sum.el (gnus-summary-bookmark-make-record): Set | ||
| 7 | `bookmark-yank-point' and `bookmark-current-buffer' to allow C-w. | ||
| 8 | |||
| 1 | 2010-07-13 Thierry Volpiatto <thierry.volpiatto@gmail.com> | 9 | 2010-07-13 Thierry Volpiatto <thierry.volpiatto@gmail.com> |
| 2 | 10 | ||
| 3 | Allow bookmarks to be set from Gnus Article buffers (Bug #5975). | 11 | Allow bookmarks to be set from Gnus Article buffers (Bug #5975). |
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 2b18221b502..0d3559227b6 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el | |||
| @@ -12631,10 +12631,12 @@ If ALL is a number, fetch this number of articles." | |||
| 12631 | "Make a bookmark entry for a Gnus summary buffer." | 12631 | "Make a bookmark entry for a Gnus summary buffer." |
| 12632 | (let (pos buf) | 12632 | (let (pos buf) |
| 12633 | (unless (and (derived-mode-p 'gnus-summary-mode) gnus-article-current) | 12633 | (unless (and (derived-mode-p 'gnus-summary-mode) gnus-article-current) |
| 12634 | (save-restriction ; FIXME is it necessary to widen? | 12634 | (save-restriction ; FIXME is it necessary to widen? |
| 12635 | (widen) (setq pos (point))) ; Set position in gnus-article buffer. | 12635 | (widen) (setq pos (point))) ; Set position in gnus-article buffer. |
| 12636 | (setq buf "art") ; We are recording bookmark from article buffer. | 12636 | (setq buf "art") ; We are recording bookmark from article buffer. |
| 12637 | (gnus-article-show-summary)) ; Go back in summary buffer. | 12637 | (setq bookmark-yank-point (point)) |
| 12638 | (setq bookmark-current-buffer (current-buffer)) | ||
| 12639 | (gnus-article-show-summary)) ; Go back in summary buffer. | ||
| 12638 | ;; We are now recording bookmark from summary buffer. | 12640 | ;; We are now recording bookmark from summary buffer. |
| 12639 | (unless buf (setq buf "sum")) | 12641 | (unless buf (setq buf "sum")) |
| 12640 | (let* ((subject (elt (gnus-summary-article-header) 1)) | 12642 | (let* ((subject (elt (gnus-summary-article-header) 1)) |