unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Karl Fogel <kfogel@red-bean.com>
To: emacs-devel@gnu.org
Cc: 5975@debbugs.gnu.org, Thierry Volpiatto <thierry.volpiatto@gmail.com>
Subject: Base patch for bug #5975 (bookmarking from Gnus Article buffer).
Date: Tue, 13 Jul 2010 17:31:40 -0400	[thread overview]
Message-ID: <87k4ozdq6b.fsf_-_@red-bean.com> (raw)
In-Reply-To: <87eifpegqx.fsf@tux.homenetwork> (Thierry Volpiatto's message of "Tue, 29 Jun 2010 22:16:54 +0200")

I have a branch that prepares the way for setting bookmarks in Gnus
Article buffers, based on Thierry's patch in bug #5975.

I'm not sure where to apply this.  Is pushing changes to trunk is okay
right now?  Starting from [1] and [2], I didn't find any notice that we
are in feature freeze, but I'm pretty sure last time I pushed it turned
out to be a mistake and that I should not have pushed to trunk.

Independently of the above, Thierry, note I made some changes to your
patch.  You used (or kept) parameter names `point-only' and `read-only';
I changed those to `no-file' and `no-context', to describe what they are
actually doing (whether the buffer is read-only or not is irrelevant to
whether one wants the front/rear context strings in bookmark record).  I
also fixed up the doc string to mention your new POSN parameter, which I
moved to the end of the parameter list.  (Don't worry, I will adjust the
gnus-sum.el patch as needed when the time comes.)

I have not (yet) included your changes to gnus/gnus-art.el and
gnus/gnus-sum.el, which finish the new functionality.  Two reasons:

  1. You said in the bug that you fixed C-w later.  Could you provide
     that patch, please?

  2. I'm not sure whether it's okay to commit significant code changes
     under gnus/, since the master is maintained outside the Emacs tree. 
     If it is okay, then I am happy to apply your change (plus the C-w
     fix).  I did test it, and it worked, except for C-w of course.

Anyone who has comments or answers re the above, please chime in.

Just for reference, the current (preparatory) patch is below.  I will
follow up separately with the gnus/* patch, so it's in the archives.

Thanks for the patch, Thierry.  We're getting close.

-Karl

[1] http://www.gnu.org/software/emacs/
[2] http://savannah.gnu.org/projects/emacs

=== modified file 'lisp/ChangeLog'
--- lisp/ChangeLog	2010-07-13 10:41:49 +0000
+++ lisp/ChangeLog	2010-07-13 21:19:42 +0000
@@ -1,3 +1,26 @@
+2010-07-13  Karl Fogel  <kfogel@red-bean.com>
+
+	Prepare the way for setting bookmarks in Gnus article buffers.
+
+	* lisp/bookmark.el (bookmark-make-record-default): Allow unneeded
+	information to be omitted from the record.  Based on part of a
+	patch by Thierry Volpiatto (Bug#5975).
+
+	Adjust declarations and calls:
+
+	* info.el (bookmark-make-record-default): Adjust declaration.
+	(Info-bookmark-make-record): Adjust call.
+
+	* woman.el (bookmark-make-record-default): Adjust declaration.
+	(woman-bookmark-make-record): Adjust call.
+
+	* man.el (bookmark-make-record-default): Adjust declaration.
+	(Man-bookmark-make-record): Adjust call.
+
+	* image-mode.el (bookmark-make-record-default): Adjust declaration.
+
+	* doc-view.el (bookmark-make-record-default): Adjust declaration.
+
 2010-07-13  Adrian Robert  <Adrian.B.Robert@gmail.com>
 
 	* term/ns-win.el: Bind M-~ to 'ns-prev-frame (due to Matthew

=== modified file 'lisp/bookmark.el'
--- lisp/bookmark.el	2010-07-10 18:52:53 +0000
+++ lisp/bookmark.el	2010-07-13 21:19:42 +0000
@@ -528,26 +528,36 @@
     (setq bookmark-current-bookmark stripped-name)
     (bookmark-bmenu-surreptitiously-rebuild-list)))
 
-(defun bookmark-make-record-default (&optional point-only)
+(defun bookmark-make-record-default (&optional no-file no-context posn)
   "Return the record describing the location of a new bookmark.
-Must be at the correct position in the buffer in which the bookmark is
-being set.
-If POINT-ONLY is non-nil, then only return the subset of the
-record that pertains to the location within the buffer."
-  `(,@(unless point-only `((filename . ,(bookmark-buffer-file-name))))
-    (front-context-string
-     . ,(if (>= (- (point-max) (point)) bookmark-search-size)
-            (buffer-substring-no-properties
-             (point)
-             (+ (point) bookmark-search-size))
-          nil))
-    (rear-context-string
-     . ,(if (>= (- (point) (point-min)) bookmark-search-size)
-            (buffer-substring-no-properties
-             (point)
-             (- (point) bookmark-search-size))
-          nil))
-    (position . ,(point))))
+Point should be at the buffer in which the bookmark is being set,
+and normally should be at the position where the bookmark is desired,
+but see the optional arguments for other possibilities.
+
+If NO-FILE is non-nil, then only return the subset of the
+record that pertains to the location within the buffer, leaving off
+the part that records the filename.
+
+If NO-CONTEXT is non-nil, do not include the front- and rear-context
+strings in the record -- the position is enough.
+
+If POSN is non-nil, record POSN as the point instead of `(point)'."
+  `(,@(unless no-file `((filename . ,(bookmark-buffer-file-name))))
+    ,@(unless no-context `((front-context-string
+                           . ,(if (>= (- (point-max) (point))
+                                      bookmark-search-size)
+                                  (buffer-substring-no-properties
+                                   (point)
+                                   (+ (point) bookmark-search-size))
+                                  nil))))
+    ,@(unless no-context `((rear-context-string
+                           . ,(if (>= (- (point) (point-min))
+                                      bookmark-search-size)
+                                  (buffer-substring-no-properties
+                                   (point)
+                                   (- (point) bookmark-search-size))
+                                  nil))))
+    (position . ,(or posn (point)))))
 
 \f
 ;;; File format stuff

=== modified file 'lisp/doc-view.el'
--- lisp/doc-view.el	2010-02-16 14:35:45 +0000
+++ lisp/doc-view.el	2010-07-13 21:19:42 +0000
@@ -1349,8 +1349,8 @@
 
 ;;;; Bookmark integration
 
-(declare-function bookmark-make-record-default "bookmark"
-                  (&optional point-only))
+(declare-function bookmark-make-record-default
+                  "bookmark" (&optional no-file no-context posn))
 (declare-function bookmark-prop-get "bookmark" (bookmark prop))
 (declare-function bookmark-default-handler "bookmark" (bmk))
 

=== modified file 'lisp/gnus/ChangeLog'
--- lisp/gnus/ChangeLog	2010-06-22 16:48:53 +0000
+++ lisp/gnus/ChangeLog	2010-07-13 21:19:42 +0000
@@ -1,3 +1,8 @@
+2010-07-13  Karl Fogel  <kfogel@red-bean.com>
+
+	* gnus/gnus-sum.el (bookmark-make-record-default): Adjust
+	declaration, based on changes in bookmark.el.
+
 2010-06-22  Mark A. Hershberger  <mah@everybody.org>
 
 	* mm-url.el (mm-url-encode-multipart-form-data): New function to handle

=== modified file 'lisp/gnus/gnus-sum.el'
--- lisp/gnus/gnus-sum.el	2010-06-10 00:30:13 +0000
+++ lisp/gnus/gnus-sum.el	2010-07-13 21:19:42 +0000
@@ -12621,7 +12621,8 @@
     (gnus-summary-position-point)))
 
 ;;; Bookmark support for Gnus.
-(declare-function bookmark-make-record-default "bookmark" (&optional pos-only))
+(declare-function bookmark-make-record-default
+                  "bookmark" (&optional no-file no-context posn))
 (declare-function bookmark-prop-get "bookmark" (bookmark prop))
 (declare-function bookmark-default-handler "bookmark" (bmk))
 (declare-function bookmark-get-bookmark-record "bookmark" (bmk))

=== modified file 'lisp/image-mode.el'
--- lisp/image-mode.el	2010-06-14 03:19:46 +0000
+++ lisp/image-mode.el	2010-07-13 21:19:42 +0000
@@ -516,8 +516,8 @@
 
 \f
 ;;; Support for bookmark.el
-(declare-function bookmark-make-record-default "bookmark"
-                  (&optional point-only))
+(declare-function bookmark-make-record-default
+                  "bookmark" (&optional no-file no-context posn))
 (declare-function bookmark-prop-get "bookmark" (bookmark prop))
 (declare-function bookmark-default-handler "bookmark" (bmk))
 

=== modified file 'lisp/info.el'
--- lisp/info.el	2010-06-17 20:56:17 +0000
+++ lisp/info.el	2010-07-13 21:19:42 +0000
@@ -4901,7 +4901,8 @@
 	     '(Info-mode . Info-restore-desktop-buffer))
 
 ;;;; Bookmark support
-(declare-function bookmark-make-record-default "bookmark" (&optional pos-only))
+(declare-function bookmark-make-record-default
+                  "bookmark" (&optional no-file no-context posn))
 (declare-function bookmark-prop-get "bookmark" (bookmark prop))
 (declare-function bookmark-default-handler "bookmark" (bmk))
 (declare-function bookmark-get-bookmark-record "bookmark" (bmk))
@@ -4910,7 +4911,7 @@
   "This implements the `bookmark-make-record-function' type (which see)
 for Info nodes."
   `(,Info-current-node
-    ,@(bookmark-make-record-default 'point-only)
+    ,@(bookmark-make-record-default 'no-file)
     (filename . ,Info-current-file)
     (info-node . ,Info-current-node)
     (handler . Info-bookmark-jump)))

=== modified file 'lisp/man.el'
--- lisp/man.el	2010-06-01 02:34:49 +0000
+++ lisp/man.el	2010-07-13 21:19:42 +0000
@@ -1674,7 +1674,8 @@
     complete-path))
 
 ;;; Bookmark Man Support
-(declare-function bookmark-make-record-default "bookmark" (&optional pos-only))
+(declare-function bookmark-make-record-default
+                  "bookmark" (&optional no-file no-context posn))
 (declare-function bookmark-prop-get "bookmark" (bookmark prop))
 (declare-function bookmark-default-handler "bookmark" (bmk))
 (declare-function bookmark-get-bookmark-record "bookmark" (bmk))
@@ -1691,7 +1692,7 @@
 (defun Man-bookmark-make-record ()
   "Make a bookmark entry for a Man buffer."
   `(,(Man-default-bookmark-title)
-    ,@(bookmark-make-record-default 'point-only)
+    ,@(bookmark-make-record-default 'no-file)
     (location . ,(concat "man " Man-arguments))
     (man-args . ,Man-arguments)
     (handler . Man-bookmark-jump)))

=== modified file 'lisp/woman.el'
--- lisp/woman.el	2010-05-25 02:11:08 +0000
+++ lisp/woman.el	2010-07-13 21:19:42 +0000
@@ -4521,7 +4521,8 @@
   nil)					; for woman-file-readable-p etc.
 
 ;;; Bookmark Woman support.
-(declare-function bookmark-make-record-default "bookmark" (&optional pos-only))
+(declare-function bookmark-make-record-default
+                  "bookmark" (&optional no-file no-context posn))
 (declare-function bookmark-prop-get "bookmark" (bookmark prop))
 (declare-function bookmark-default-handler "bookmark" (bmk))
 (declare-function bookmark-get-bookmark-record "bookmark" (bmk))
@@ -4532,7 +4533,7 @@
 (defun woman-bookmark-make-record ()
   "Make a bookmark entry for a Woman buffer."
   `(,(Man-default-bookmark-title)
-    ,@(bookmark-make-record-default 'point-only)
+    ,@(bookmark-make-record-default 'no-file)
     (location . ,(concat "woman " woman-last-file-name))
     ;; Use the same form as man's bookmarks, as much as possible.
     (man-args . ,woman-last-file-name)




  reply	other threads:[~2010-07-13 21:31 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-29 12:43 No answer on bugs Thierry Volpiatto
2010-06-29 13:12 ` Lennart Borgman
2010-06-29 13:54 ` Karl Fogel
2010-06-29 14:14   ` Thierry Volpiatto
2010-06-29 19:26   ` Tassilo Horn
2010-06-29 19:57     ` Thierry Volpiatto
2010-06-29 20:10       ` Tassilo Horn
2010-06-29 20:16         ` Thierry Volpiatto
2010-07-13 21:31           ` Karl Fogel [this message]
2010-07-13 21:41             ` Base patch for bug #5975 (bookmarking from Gnus Article buffer) Karl Fogel
2010-07-14  8:29               ` Thierry Volpiatto
2010-07-14  8:37                 ` Eli Zaretskii
2010-07-14  9:06                   ` Thierry Volpiatto
2010-07-14  9:42                     ` Eli Zaretskii
2010-07-14 10:07                       ` Thierry Volpiatto
2010-07-14 10:18                         ` Eli Zaretskii
2010-07-14 10:57                           ` Thierry Volpiatto
2010-07-14 15:32                 ` Karl Fogel
2010-07-13 23:30             ` Glenn Morris
2010-07-14  0:33               ` Karl Fogel
2010-07-14  8:55               ` Andreas Schwab
2010-07-14 15:29                 ` Karl Fogel
2010-07-14  5:03             ` Thierry Volpiatto
2010-07-14 16:06               ` Karl Fogel
2010-07-14 16:55                 ` Karl Fogel
2010-06-30 18:16 ` No answer on bugs Ted Zlatanov
2010-06-30 18:36   ` Thierry Volpiatto
2010-06-30 19:23     ` more on anything.el inclusion (was: No answer on bugs) Ted Zlatanov
2010-06-30 20:10       ` more on anything.el inclusion Thierry Volpiatto
2010-06-30 22:59         ` Dan Nicolaescu
2010-07-01  5:53           ` Thierry Volpiatto
2010-07-01  6:48             ` Dan Nicolaescu
2010-07-01  7:50               ` Thierry Volpiatto
2010-07-01  8:36                 ` Dan Nicolaescu
2010-07-01  8:53                   ` Thierry Volpiatto
2010-07-01 16:02                     ` Dan Nicolaescu
2010-07-01 16:33                       ` Harald Hanche-Olsen
2010-07-01 16:43                         ` Ted Zlatanov
2010-07-01 17:18                       ` Thierry Volpiatto
2010-07-01 17:43                         ` Dan Nicolaescu
2010-07-01 18:14                           ` Thierry Volpiatto
2010-07-01 18:48                           ` Ted Zlatanov
2010-07-01 18:57                           ` Wojciech Meyer
2010-07-01 17:36                       ` Harald Hanche-Olsen
2010-07-01 15:20                   ` Anything Use Case (was: more on anything.el inclusion) Memnon Anon
2010-07-01 13:18                 ` more on anything.el inclusion Ted Zlatanov
2010-07-01 14:15                   ` Thierry Volpiatto
2010-07-01 14:48                     ` Lennart Borgman
2010-07-01 15:55                     ` Ted Zlatanov
2010-07-01 16:43                       ` Lennart Borgman
2010-07-01 18:55                         ` Ted Zlatanov
2010-07-01 22:08                           ` Lennart Borgman
2010-07-09 14:46                       ` Thierry Volpiatto
2010-07-17 13:37                   ` rubikitch
2010-07-17 15:16                     ` Thierry Volpiatto
2010-07-04 22:02               ` Stefan Monnier
2010-07-07 16:47                 ` Ted Zlatanov
2010-07-23 15:35                   ` Stefan Monnier
2010-07-23 21:49                     ` rubikitch
2010-08-12 23:02                       ` Ted Zlatanov
2010-08-24 19:24                         ` rubikitch
2010-08-25 13:51                           ` Juri Linkov
2010-09-11 12:02                             ` Thierry Volpiatto
2010-09-11 11:59                           ` Thierry Volpiatto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k4ozdq6b.fsf_-_@red-bean.com \
    --to=kfogel@red-bean.com \
    --cc=5975@debbugs.gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=thierry.volpiatto@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).