all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#20177: 24.4: bookmark.el: show all annotations does not display in proper order (FIX INCLUDED)
@ 2015-03-23 10:21 Boruch Baum
  2015-03-26  1:56 ` Stefan Monnier
  0 siblings, 1 reply; 8+ messages in thread
From: Boruch Baum @ 2015-03-23 10:21 UTC (permalink / raw)
  To: 20177


[-- Attachment #1.1: Type: text/plain, Size: 532 bytes --]

When `bookmark-sort-flag' is set, the bmenu list displays in sorted
order, but the function `bookmark-show-all-annotations' (keybinding
`A'), does not.

The first attached patch file, `simple.patch', is just that.

The second attached patch file, `fancy.patch', adds an option to display
the list of all annotations as a pre-formatted org-mode buffer, based
upon the setting of a new variable,
`bookmark-show-all-annotations-in-org-mode'.

-- 
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: simple.patch --]
[-- Type: text/x-patch; name="simple.patch", Size: 539 bytes --]

--- bookmark.el	2015-03-23 04:52:30.503739608 -0400
+++ bookmark-new.el	2015-03-23 05:15:50.763694210 -0400
@@ -1756,7 +1756,7 @@
   (save-selected-window
     (pop-to-buffer (get-buffer-create "*Bookmark Annotation*") t)
     (delete-region (point-min) (point-max))
-    (dolist (full-record bookmark-alist)
+    (dolist (full-record (bookmark-maybe-sort-alist))
       (let* ((name (bookmark-name-from-full-record full-record))
              (ann  (bookmark-get-annotation full-record)))
         (insert (concat name ":\n"))

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.3: fancy.patch --]
[-- Type: text/x-patch; name="fancy.patch", Size: 1996 bytes --]

--- bookmark.el	2015-03-23 04:52:30.503739608 -0400
+++ bookmark-new.el	2015-03-23 06:08:22.399592029 -0400
@@ -1751,15 +1751,30 @@
           (switch-to-buffer-other-window old-buf))))))
 
 
+
+(defvar bookmark-show-all-annotations-in-org-mode nil
+"When not `nil', the command `bookmark-show-all-annotations' will
+format its display as an org-mode buffer")
+
 (defun bookmark-show-all-annotations ()
   "Display the annotations for all bookmarks in a buffer."
   (save-selected-window
     (pop-to-buffer (get-buffer-create "*Bookmark Annotation*") t)
     (delete-region (point-min) (point-max))
-    (dolist (full-record bookmark-alist)
+    (unless (null bookmark-show-all-annotations-in-org-mode)
+      (org-mode))
+    (let* ((heading-text "Bookmark annotations for ALL bookmarks")
+           (heading (if (null bookmark-show-all-annotations-in-org-mode)
+                      (concat "# " heading-text "\n----------------------------------------\n")
+                     (concat "* " heading-text "\n")))
+           (prefix (unless (null bookmark-show-all-annotations-in-org-mode)
+                     "** ")))
+      (insert heading)
+
+    (dolist (full-record (bookmark-maybe-sort-alist))
       (let* ((name (bookmark-name-from-full-record full-record))
              (ann  (bookmark-get-annotation full-record)))
-        (insert (concat name ":\n"))
+        (insert (concat prefix name ":\n"))
         (if (and ann (not (string-equal ann "")))
             ;; insert the annotation, indented by 4 spaces.
             (progn
@@ -1769,10 +1784,9 @@
                 (beginning-of-line)     ; paranoia
                 (insert "    ")
                 (forward-line)
-                (end-of-line))))))
+                (end-of-line)))))))
     (goto-char (point-min))))
 
-
 (defun bookmark-bmenu-mark ()
   "Mark bookmark on this line to be displayed by \\<bookmark-bmenu-mode-map>\\[bookmark-bmenu-select]."
   (interactive)

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#20177: 24.4: bookmark.el: show all annotations does not display in proper order (FIX INCLUDED)
  2015-03-23 10:21 bug#20177: 24.4: bookmark.el: show all annotations does not display in proper order (FIX INCLUDED) Boruch Baum
@ 2015-03-26  1:56 ` Stefan Monnier
  2019-06-25 17:35   ` Lars Ingebrigtsen
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Monnier @ 2015-03-26  1:56 UTC (permalink / raw)
  To: Boruch Baum; +Cc: 20177

> When `bookmark-sort-flag' is set, the bmenu list displays in sorted
> order, but the function `bookmark-show-all-annotations' (keybinding
> `A'), does not.

> The first attached patch file, `simple.patch', is just that.

Thanks, attached.

> The second attached patch file, `fancy.patch', adds an option to display
> the list of all annotations as a pre-formatted org-mode buffer, based
> upon the setting of a new variable,
> `bookmark-show-all-annotations-in-org-mode'.

I'd tend to think that this buffer should be read-only and using a major
mode that derives from special-mode, which seems incompatible with
org-mode.  It could still use the Org syntax, of course, maybe with an
outline-minor-mode.

> +(defvar bookmark-show-all-annotations-in-org-mode nil
> +"When not `nil', the command `bookmark-show-all-annotations' will
> +format its display as an org-mode buffer")

I think we can just change the format without introducing an option to
recover the old format.


        Stefan





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#20177: 24.4: bookmark.el: show all annotations does not display in proper order (FIX INCLUDED)
  2015-03-26  1:56 ` Stefan Monnier
@ 2019-06-25 17:35   ` Lars Ingebrigtsen
  2019-06-25 19:43     ` Boruch Baum
  0 siblings, 1 reply; 8+ messages in thread
From: Lars Ingebrigtsen @ 2019-06-25 17:35 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 20177, Boruch Baum

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> The second attached patch file, `fancy.patch', adds an option to display
>> the list of all annotations as a pre-formatted org-mode buffer, based
>> upon the setting of a new variable,
>> `bookmark-show-all-annotations-in-org-mode'.
>
> I'd tend to think that this buffer should be read-only and using a major
> mode that derives from special-mode, which seems incompatible with
> org-mode.  It could still use the Org syntax, of course, maybe with an
> outline-minor-mode.
>
>> +(defvar bookmark-show-all-annotations-in-org-mode nil
>> +"When not `nil', the command `bookmark-show-all-annotations' will
>> +format its display as an org-mode buffer")
>
> I think we can just change the format without introducing an option to
> recover the old format.

I think so too.  Boruch, did you do any further work on this?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#20177: 24.4: bookmark.el: show all annotations does not display in proper order (FIX INCLUDED)
  2019-06-25 17:35   ` Lars Ingebrigtsen
@ 2019-06-25 19:43     ` Boruch Baum
  2019-06-26 13:55       ` Lars Ingebrigtsen
  0 siblings, 1 reply; 8+ messages in thread
From: Boruch Baum @ 2019-06-25 19:43 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 20177, Stefan Monnier

On 2019-06-25 19:35, Lars Ingebrigtsen wrote:
> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>
> >> The second attached patch file, `fancy.patch', adds an option to display
> >> the list of all annotations as a pre-formatted org-mode buffer, based
> >> upon the setting of a new variable,
> >> `bookmark-show-all-annotations-in-org-mode'.
> >
> > I'd tend to think that this buffer should be read-only and using a major
> > mode that derives from special-mode, which seems incompatible with
> > org-mode.  It could still use the Org syntax, of course, maybe with an
> > outline-minor-mode.
> >
> >> +(defvar bookmark-show-all-annotations-in-org-mode nil
> >> +"When not `nil', the command `bookmark-show-all-annotations' will
> >> +format its display as an org-mode buffer")
> >
> > I think we can just change the format without introducing an option to
> > recover the old format.
>
> I think so too.  Boruch, did you do any further work on this?

No. ( ... year 2015 ... Thanks for the memories ... )

--
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#20177: 24.4: bookmark.el: show all annotations does not display in proper order (FIX INCLUDED)
  2019-06-25 19:43     ` Boruch Baum
@ 2019-06-26 13:55       ` Lars Ingebrigtsen
  2019-06-26 14:45         ` Boruch Baum
  0 siblings, 1 reply; 8+ messages in thread
From: Lars Ingebrigtsen @ 2019-06-26 13:55 UTC (permalink / raw)
  To: Boruch Baum; +Cc: 20177, Stefan Monnier

Boruch Baum <boruch_baum@gmx.com> writes:

>> I think so too.  Boruch, did you do any further work on this?
>
> No. ( ... year 2015 ... Thanks for the memories ... )

In that case it seems unlikely that we'd be able to proceed with this
bug report and I'm closing it.  Please reopen if further progress can be
made.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#20177: 24.4: bookmark.el: show all annotations does not display in proper order (FIX INCLUDED)
  2019-06-26 13:55       ` Lars Ingebrigtsen
@ 2019-06-26 14:45         ` Boruch Baum
  2019-06-26 14:47           ` Lars Ingebrigtsen
  0 siblings, 1 reply; 8+ messages in thread
From: Boruch Baum @ 2019-06-26 14:45 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 20177, Stefan Monnier

On 2019-06-26 15:55, Lars Ingebrigtsen wrote:
> Boruch Baum <boruch_baum@gmx.com> writes:
>
> >> I think so too.  Boruch, did you do any further work on this?
> >
> > No. ( ... year 2015 ... Thanks for the memories ... )
>
> In that case it seems unlikely that we'd be able to proceed with this
> bug report and I'm closing it.  Please reopen if further progress can be
> made.

I submitted two versions of patch, so if the objections are to the
'fancy' one, which added features that aren't good enough,
why not accept the 'simple' patch that addresses the reported bug?

--
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#20177: 24.4: bookmark.el: show all annotations does not display in proper order (FIX INCLUDED)
  2019-06-26 14:45         ` Boruch Baum
@ 2019-06-26 14:47           ` Lars Ingebrigtsen
  2019-06-26 14:50             ` Lars Ingebrigtsen
  0 siblings, 1 reply; 8+ messages in thread
From: Lars Ingebrigtsen @ 2019-06-26 14:47 UTC (permalink / raw)
  To: Boruch Baum; +Cc: 20177, Stefan Monnier

Boruch Baum <boruch_baum@gmx.com> writes:

> On 2019-06-26 15:55, Lars Ingebrigtsen wrote:
>> Boruch Baum <boruch_baum@gmx.com> writes:
>>
>> >> I think so too.  Boruch, did you do any further work on this?
>> >
>> > No. ( ... year 2015 ... Thanks for the memories ... )
>>
>> In that case it seems unlikely that we'd be able to proceed with this
>> bug report and I'm closing it.  Please reopen if further progress can be
>> made.
>
> I submitted two versions of patch, so if the objections are to the
> 'fancy' one, which added features that aren't good enough,
> why not accept the 'simple' patch that addresses the reported bug?

Stefan did apply that one at the time...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#20177: 24.4: bookmark.el: show all annotations does not display in proper order (FIX INCLUDED)
  2019-06-26 14:47           ` Lars Ingebrigtsen
@ 2019-06-26 14:50             ` Lars Ingebrigtsen
  0 siblings, 0 replies; 8+ messages in thread
From: Lars Ingebrigtsen @ 2019-06-26 14:50 UTC (permalink / raw)
  To: Boruch Baum; +Cc: 20177, Stefan Monnier

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Boruch Baum <boruch_baum@gmx.com> writes:
>
>> On 2019-06-26 15:55, Lars Ingebrigtsen wrote:
>>> Boruch Baum <boruch_baum@gmx.com> writes:
>>>
>>> >> I think so too.  Boruch, did you do any further work on this?
>>> >
>>> > No. ( ... year 2015 ... Thanks for the memories ... )
>>>
>>> In that case it seems unlikely that we'd be able to proceed with this
>>> bug report and I'm closing it.  Please reopen if further progress can be
>>> made.
>>
>> I submitted two versions of patch, so if the objections are to the
>> 'fancy' one, which added features that aren't good enough,
>> why not accept the 'simple' patch that addresses the reported bug?
>
> Stefan did apply that one at the time...

(But he said "Thanks, attached" instead of "applied", which may explain
the confustion.  :-))

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-06-26 14:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-23 10:21 bug#20177: 24.4: bookmark.el: show all annotations does not display in proper order (FIX INCLUDED) Boruch Baum
2015-03-26  1:56 ` Stefan Monnier
2019-06-25 17:35   ` Lars Ingebrigtsen
2019-06-25 19:43     ` Boruch Baum
2019-06-26 13:55       ` Lars Ingebrigtsen
2019-06-26 14:45         ` Boruch Baum
2019-06-26 14:47           ` Lars Ingebrigtsen
2019-06-26 14:50             ` Lars Ingebrigtsen

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.