unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#57082: 29.0.50; emacs-news-view-mode breakage
@ 2022-08-09 16:18 Stephen Berman
  2022-08-09 18:23 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 20+ messages in thread
From: Stephen Berman @ 2022-08-09 16:18 UTC (permalink / raw)
  To: 57082

[-- Attachment #1: Type: text/plain, Size: 2663 bytes --]

0. emacs -Q

1. Type `C-h n'
=> The NEWS buffer is displayed without icons on the header lines,
although the value of `outline-minor-mode-use-buttons' is `(derived-mode
. special-mode)'.

2. Type `C-c C-n' to move point to the first NEWS header "* Installation
Changes in Emacs 29.1" and then type TAB
=> Now there is an outline-close icon (emoji) at the beginning of the
header, the header has lost its first-level fontification and the NEWS
buffer is flagged as modified in the mode line. But instead of hiding
the current header line's body as per outline-cycle, there is no other
change in the buffer.

3. Type TAB again
=> forward-button is executed instead of outline-cycle, indicating that
the line with the icon is now not being treated as an outline header
line.  And typing `M-< C-c C-n' now puts point on the first second level
header below the line with the icon.

4. Move point back to the icon and type RET
=> The icon changes to outline-open but there is otherwise no change in
the outline structure, and the message "Before first heading" is
displayed.

5. Type `C-c @ C-q' (outline-hide-sublevels)
=> The outline-close icon is inserted at the start of the second-level
header below the current line and after the icon only "..."  is
displayed, i.e. all remaing text in the buffer has vanished.
Repeatedly typing RET toggles the icon between outline-open and
outline-close and displays the message "Before first heading" but the
text remains hidden.  (Typing `C-c @ C-a' unhides the text.)


The attached patch appears to fix the problems described above, but the
only buffer using outline-minor-mode beside NEWS that I've tested it on
is *Help* showing the output of describe-bindings, and the seems to work
as expected with the patch (and due to the patch is not flagged as
modified, though that isn't important for *Help*.)


In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.17.6)
 of 2022-08-09 built on strobelfs2
Repository revision: f1f1912658556e2f2a39cdae0da7ea2b8564d861
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101003
System Description: Linux From Scratch r11.0-165

Configured using:
 'configure --with-xinput2 --with-xwidgets 'CFLAGS=-Og -g3'
 PKG_CONFIG_PATH=/opt/qt5/lib/pkgconfig'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBSYSTEMD LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG RSVG
SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS WEBP X11 XDBE XIM
XINPUT2 XPM XWIDGETS GTK3 ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: NEWS + outline patch --]
[-- Type: text/x-patch, Size: 4457 bytes --]

diff --git a/lisp/outline.el b/lisp/outline.el
index 7750f9a75d..35524a79a9 100644
--- a/lisp/outline.el
+++ b/lisp/outline.el
@@ -435,7 +435,7 @@ outline-minor-mode-highlight-buffer
                          (goto-char (match-beginning 0))
                          (not (get-text-property (point) 'face))))
             (overlay-put overlay 'face (outline-font-lock-face)))
-          (when (outline--use-buttons-p)
+          (when (and (outline--use-buttons-p) (outline-on-heading-p))
             (outline--insert-open-button)))
         (goto-char (match-end 0))))))

@@ -452,11 +452,10 @@ outline-minor-mode
   (if outline-minor-mode
       (progn
         (when outline-minor-mode-highlight
-          (if (and global-font-lock-mode (font-lock-specified-p major-mode))
-              (progn
-                (font-lock-add-keywords nil outline-font-lock-keywords t)
-                (font-lock-flush))
-            (outline-minor-mode-highlight-buffer)))
+          (when (and global-font-lock-mode (font-lock-specified-p major-mode))
+            (font-lock-add-keywords nil outline-font-lock-keywords t)
+            (font-lock-flush))
+          (outline-minor-mode-highlight-buffer))
 	;; Turn off this mode if we change major modes.
 	(add-hook 'change-major-mode-hook
 		  (lambda () (outline-minor-mode -1))
@@ -1011,32 +1010,34 @@ outline--make-button-overlay
     o))

 (defun outline--insert-open-button ()
-  (save-excursion
-    (beginning-of-line)
-    (when (derived-mode-p 'special-mode)
-      (let ((inhibit-read-only t))
-        (insert "  ")
-        (beginning-of-line)))
-    (let ((o (outline--make-button-overlay 'open)))
-      (overlay-put o 'help-echo "Click to hide")
-      (overlay-put o 'keymap
-                   (define-keymap
-                     "RET" #'outline-hide-subtree
-                     "<mouse-2>" #'outline-hide-subtree)))))
+  (with-silent-modifications
+    (save-excursion
+        (beginning-of-line)
+        (when (derived-mode-p 'special-mode)
+          (let ((inhibit-read-only t))
+            (insert "  ")
+            (beginning-of-line)))
+        (let ((o (outline--make-button-overlay 'open)))
+          (overlay-put o 'help-echo "Click to hide")
+          (overlay-put o 'keymap
+                       (define-keymap
+                         "RET" #'outline-hide-subtree
+                         "<mouse-2>" #'outline-hide-subtree))))))

 (defun outline--insert-close-button ()
-  (save-excursion
-    (beginning-of-line)
-    (when (derived-mode-p 'special-mode)
-      (let ((inhibit-read-only t))
-        (insert "  ")
-        (beginning-of-line)))
-    (let ((o (outline--make-button-overlay 'close)))
-      (overlay-put o 'help-echo "Click to show")
-      (overlay-put o 'keymap
-                   (define-keymap
-                     "RET" #'outline-show-subtree
-                     "<mouse-2>" #'outline-show-subtree)))))
+  (with-silent-modifications
+    (save-excursion
+        (beginning-of-line)
+        (when (derived-mode-p 'special-mode)
+          (let ((inhibit-read-only t))
+            (insert "  ")
+            (beginning-of-line)))
+        (let ((o (outline--make-button-overlay 'close)))
+          (overlay-put o 'help-echo "Click to show")
+          (overlay-put o 'keymap
+                       (define-keymap
+                         "RET" #'outline-show-subtree
+                         "<mouse-2>" #'outline-show-subtree))))))

 (defun outline--fix-up-all-buttons (&optional from to)
   (when from
diff --git a/lisp/textmodes/emacs-news-mode.el b/lisp/textmodes/emacs-news-mode.el
index c7fa9fa2b2..e6e1f03728 100644
--- a/lisp/textmodes/emacs-news-mode.el
+++ b/lisp/textmodes/emacs-news-mode.el
@@ -69,11 +69,9 @@ emacs-news-mode-font-lock-keywords

 (defun emacs-news--mode-common ()
   (setq-local font-lock-defaults '(emacs-news-mode-font-lock-keywords t))
-  (setq-local outline-regexp "\\*+ "
+  (setq-local outline-regexp "\\(:? +\\)?\\(\\*+\\) "
               outline-minor-mode-cycle t
-              ;; We subtract one from the level, because we have a
-              ;; space after the asterisks.
-              outline-level (lambda () (1- (length (match-string 0))))
+              outline-level (lambda () (length (match-string 2)))
               outline-minor-mode-highlight 'append)
   (outline-minor-mode))


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

* bug#57082: 29.0.50; emacs-news-view-mode breakage
  2022-08-09 16:18 bug#57082: 29.0.50; emacs-news-view-mode breakage Stephen Berman
@ 2022-08-09 18:23 ` Lars Ingebrigtsen
  2022-08-09 19:18   ` Juri Linkov
  0 siblings, 1 reply; 20+ messages in thread
From: Lars Ingebrigtsen @ 2022-08-09 18:23 UTC (permalink / raw)
  To: Stephen Berman; +Cc: 57082

Stephen Berman <stephen.berman@gmx.net> writes:

> The attached patch appears to fix the problems described above, but the
> only buffer using outline-minor-mode beside NEWS that I've tested it on
> is *Help* showing the output of describe-bindings, and the seems to work
> as expected with the patch (and due to the patch is not flagged as
> modified, though that isn't important for *Help*.)

Thanks; patch applied to Emacs 29.

The outline button stuff is still a work in progress, as you've found
out.  I'm not quite sure whether it should be switched on by default in
NEWS buffers -- it doesn't seem to bring much value there.  (As opposed
to in `describe-bindings', where it seems very helpful (since we're
starting out with some parts already folded.)

So I'm pondering whether to add an additional mechanism to say whether a
mode is "opting in" to the buttons or not, but I'm not sure what that
should look like.





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

* bug#57082: 29.0.50; emacs-news-view-mode breakage
  2022-08-09 18:23 ` Lars Ingebrigtsen
@ 2022-08-09 19:18   ` Juri Linkov
  2022-08-09 20:18     ` Stephen Berman
  0 siblings, 1 reply; 20+ messages in thread
From: Juri Linkov @ 2022-08-09 19:18 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Stephen Berman, 57082

>> The attached patch appears to fix the problems described above, but the
>> only buffer using outline-minor-mode beside NEWS that I've tested it on
>> is *Help* showing the output of describe-bindings, and the seems to work
>> as expected with the patch (and due to the patch is not flagged as
>> modified, though that isn't important for *Help*.)
>
> Thanks; patch applied to Emacs 29.

I noticed more problems: arrow directions are inverted - when an outline
is hidden the arrow direction is open; when it's shown then the button has
the closed state.

S-TAB (outline-cycle-buffer) is very slow: takes ~3 seconds on a small
NEWS buffer.

Also don't understand why is this change:

         (when outline-minor-mode-highlight
-          (if (and global-font-lock-mode (font-lock-specified-p major-mode))
-              (progn
-                (font-lock-add-keywords nil outline-font-lock-keywords t)
-                (font-lock-flush))
-            (outline-minor-mode-highlight-buffer)))
+          (when (and global-font-lock-mode (font-lock-specified-p major-mode))
+            (font-lock-add-keywords nil outline-font-lock-keywords t)
+            (font-lock-flush))
+          (outline-minor-mode-highlight-buffer))

`outline-minor-mode-highlight-buffer' is intended only for buffers
that don't support font-lock highlighting.

> The outline button stuff is still a work in progress, as you've found
> out.  I'm not quite sure whether it should be switched on by default in
> NEWS buffers -- it doesn't seem to bring much value there.  (As opposed
> to in `describe-bindings', where it seems very helpful (since we're
> starting out with some parts already folded.)

It would be nicer if the color of the button depended on the outline's color,
e.g. blue for the top-level blue outline face, etc.

> So I'm pondering whether to add an additional mechanism to say whether a
> mode is "opting in" to the buttons or not, but I'm not sure what that
> should look like.

Since outline-minor-mode-use-buttons uses buffer-match-p, it can have
any condition, including a condition to exclude etc/NEWS, for example.





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

* bug#57082: 29.0.50; emacs-news-view-mode breakage
  2022-08-09 19:18   ` Juri Linkov
@ 2022-08-09 20:18     ` Stephen Berman
  2022-08-10  0:03       ` Jim Porter
  2022-08-10  7:36       ` Juri Linkov
  0 siblings, 2 replies; 20+ messages in thread
From: Stephen Berman @ 2022-08-09 20:18 UTC (permalink / raw)
  To: Juri Linkov; +Cc: Lars Ingebrigtsen, 57082

On Tue, 09 Aug 2022 22:18:21 +0300 Juri Linkov <juri@linkov.net> wrote:

>>> The attached patch appears to fix the problems described above, but the
>>> only buffer using outline-minor-mode beside NEWS that I've tested it on
>>> is *Help* showing the output of describe-bindings, and the seems to work
>>> as expected with the patch (and due to the patch is not flagged as
>>> modified, though that isn't important for *Help*.)
>>
>> Thanks; patch applied to Emacs 29.

Thanks Lars.

> I noticed more problems: arrow directions are inverted - when an outline
> is hidden the arrow direction is open; when it's shown then the button has
> the closed state.

The arrows behave the same as in *Help* with describe-bindings:
outline-close (downward-pointing) when the body is hidden, outline-open
(leftward-pointing) when the body is shown.  Is that wrong?

> S-TAB (outline-cycle-buffer) is very slow: takes ~3 seconds on a small
> NEWS buffer.
>
> Also don't understand why is this change:
>
>          (when outline-minor-mode-highlight
> -          (if (and global-font-lock-mode (font-lock-specified-p major-mode))
> -              (progn
> -                (font-lock-add-keywords nil outline-font-lock-keywords t)
> -                (font-lock-flush))
> -            (outline-minor-mode-highlight-buffer)))
> +          (when (and global-font-lock-mode (font-lock-specified-p major-mode))
> +            (font-lock-add-keywords nil outline-font-lock-keywords t)
> +            (font-lock-flush))
> +          (outline-minor-mode-highlight-buffer))
>
> `outline-minor-mode-highlight-buffer' is intended only for buffers
> that don't support font-lock highlighting.

Yes, but with that change, arrows are displayed on first visiting the
NEWS buffer; without it, they only appear when typing TAB on an outline
heading.

>> The outline button stuff is still a work in progress, as you've found
>> out.  I'm not quite sure whether it should be switched on by default in
>> NEWS buffers -- it doesn't seem to bring much value there.  (As opposed
>> to in `describe-bindings', where it seems very helpful (since we're
>> starting out with some parts already folded.)
>
> It would be nicer if the color of the button depended on the outline's color,
> e.g. blue for the top-level blue outline face, etc.

I guess that would require using suitable images rather than emojis.

Steve Berman





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

* bug#57082: 29.0.50; emacs-news-view-mode breakage
  2022-08-09 20:18     ` Stephen Berman
@ 2022-08-10  0:03       ` Jim Porter
  2022-08-10  7:39         ` Juri Linkov
                           ` (2 more replies)
  2022-08-10  7:36       ` Juri Linkov
  1 sibling, 3 replies; 20+ messages in thread
From: Jim Porter @ 2022-08-10  0:03 UTC (permalink / raw)
  To: Stephen Berman, Juri Linkov; +Cc: Lars Ingebrigtsen, 57082

On 8/9/2022 1:18 PM, Stephen Berman wrote:
> On Tue, 09 Aug 2022 22:18:21 +0300 Juri Linkov <juri@linkov.net> wrote:
> 
>> I noticed more problems: arrow directions are inverted - when an outline
>> is hidden the arrow direction is open; when it's shown then the button has
>> the closed state.
> 
> The arrows behave the same as in *Help* with describe-bindings:
> outline-close (downward-pointing) when the body is hidden, outline-open
> (leftward-pointing) when the body is shown.  Is that wrong?

I think that's wrong, yes. Every GUI I'm familiar with does it the other 
way:

   > Closed Item
   v Open Item
     > Closed Sub Item

This is the visual style used in GNOME (at least, the theme I'm using), 
MS Windows, macOS, Firefox/Thunderbird, and probably others. More 
importantly, it's also the style Emacs already uses elsewhere: see the 
Customize UI.

The only other style I've seen is "-" for open items and "+" for closed 
(because clicking "+" will *add* the children to the UI and "-" will 
*remove* them). Emacs does that in the speedbar, for example.

>> It would be nicer if the color of the button depended on the outline's color,
>> e.g. blue for the top-level blue outline face, etc.
> 
> I guess that would require using suitable images rather than emojis.

Images would be nice; Emacs already has some for the Customize UI that 
could be reused.

For the NEWS file though (and especially programming modes). I still 
think it'd be great to put the buttons in the fringe. That way the 
buttons would never disrupt the contents of the file, e.g. by changing 
how the indentation looks.

However, describe-bindings probably wants the buttons in the body, so 
this would be yet another option, which adds complexity/maintenance 
burden...





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

* bug#57082: 29.0.50; emacs-news-view-mode breakage
  2022-08-09 20:18     ` Stephen Berman
  2022-08-10  0:03       ` Jim Porter
@ 2022-08-10  7:36       ` Juri Linkov
  2022-08-10  8:19         ` Stephen Berman
  1 sibling, 1 reply; 20+ messages in thread
From: Juri Linkov @ 2022-08-10  7:36 UTC (permalink / raw)
  To: Stephen Berman; +Cc: Lars Ingebrigtsen, 57082

>> Also don't understand why is this change:
>>
>>          (when outline-minor-mode-highlight
>> -          (if (and global-font-lock-mode (font-lock-specified-p major-mode))
>> -              (progn
>> -                (font-lock-add-keywords nil outline-font-lock-keywords t)
>> -                (font-lock-flush))
>> -            (outline-minor-mode-highlight-buffer)))
>> +          (when (and global-font-lock-mode (font-lock-specified-p major-mode))
>> +            (font-lock-add-keywords nil outline-font-lock-keywords t)
>> +            (font-lock-flush))
>> +          (outline-minor-mode-highlight-buffer))
>>
>> `outline-minor-mode-highlight-buffer' is intended only for buffers
>> that don't support font-lock highlighting.
>
> Yes, but with that change, arrows are displayed on first visiting the
> NEWS buffer; without it, they only appear when typing TAB on an outline
> heading.

This change broke fontification e.g. in diff buffers that now
add outline faces on diff hunks.  So we need another solution.
Maybe on first visiting the NEWS buffer better to call
refontification with font-lock-ensure?





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

* bug#57082: 29.0.50; emacs-news-view-mode breakage
  2022-08-10  0:03       ` Jim Porter
@ 2022-08-10  7:39         ` Juri Linkov
  2022-08-10  8:08           ` Gregory Heytings
  2022-08-10  7:55         ` Stephen Berman
  2022-08-12 12:51         ` Lars Ingebrigtsen
  2 siblings, 1 reply; 20+ messages in thread
From: Juri Linkov @ 2022-08-10  7:39 UTC (permalink / raw)
  To: Jim Porter; +Cc: Lars Ingebrigtsen, Stephen Berman, 57082

>>> It would be nicer if the color of the button depended on the outline's color,
>>> e.g. blue for the top-level blue outline face, etc.
>> I guess that would require using suitable images rather than emojis.
>
> Images would be nice; Emacs already has some for the Customize UI that
> could be reused.

Instead of preparing a lot of different images, maybe it would be
possible to specify a background/foreground color for SVG images.

OTOH, maybe easier would be just to use Unicode arrow characters
instead of emojis?

> For the NEWS file though (and especially programming modes). I still think
> it'd be great to put the buttons in the fringe. That way the buttons would
> never disrupt the contents of the file, e.g. by changing how the
> indentation looks.

Agreed, the clickable buttons in the fringe would be great,
and it's easy to implement.

> However, describe-bindings probably wants the buttons in the body, so this
> would be yet another option, which adds complexity/maintenance burden...

describe-bindings could override the default when necessary.





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

* bug#57082: 29.0.50; emacs-news-view-mode breakage
  2022-08-10  0:03       ` Jim Porter
  2022-08-10  7:39         ` Juri Linkov
@ 2022-08-10  7:55         ` Stephen Berman
  2022-08-10  8:07           ` Juri Linkov
  2022-08-12 12:49           ` Lars Ingebrigtsen
  2022-08-12 12:51         ` Lars Ingebrigtsen
  2 siblings, 2 replies; 20+ messages in thread
From: Stephen Berman @ 2022-08-10  7:55 UTC (permalink / raw)
  To: Jim Porter; +Cc: Lars Ingebrigtsen, 57082, Juri Linkov

[-- Attachment #1: Type: text/plain, Size: 1072 bytes --]

On Tue, 9 Aug 2022 17:03:25 -0700 Jim Porter <jporterbugs@gmail.com> wrote:

> On 8/9/2022 1:18 PM, Stephen Berman wrote:
>> On Tue, 09 Aug 2022 22:18:21 +0300 Juri Linkov <juri@linkov.net> wrote:
>>
>>> I noticed more problems: arrow directions are inverted - when an outline
>>> is hidden the arrow direction is open; when it's shown then the button has
>>> the closed state.
>> The arrows behave the same as in *Help* with describe-bindings:
>> outline-close (downward-pointing) when the body is hidden, outline-open
>> (leftward-pointing) when the body is shown.  Is that wrong?
    ^^^^
    right (oops)

> I think that's wrong, yes. Every GUI I'm familiar with does it the other way:
>
>   > Closed Item
>   v Open Item
>     > Closed Sub Item
>
> This is the visual style used in GNOME (at least, the theme I'm using), MS
> Windows, macOS, Firefox/Thunderbird, and probably others. More importantly,
> it's also the style Emacs already uses elsewhere: see the Customize UI.

Ah, of course, I didn't even think to look there (oops again).


[-- Attachment #2: outline icons patch --]
[-- Type: text/x-patch, Size: 726 bytes --]

diff --git a/lisp/outline.el b/lisp/outline.el
index 7750f9a75d..8132043097 100644
--- a/lisp/outline.el
+++ b/lisp/outline.el
@@ -294,16 +294,16 @@ outline-minor-mode-use-buttons
   :version "29.1")
 
 (define-icon outline-open button
-  '((emoji "▶️")
-    (symbol " ⯈ ")
+  '((emoji "🔽")
+    (symbol " ⯆ ")
     (text " open "))
   "Icon used for buttons for opening a section in outline buffers."
   :version "29.1"
   :help-echo "Open this section")
 
 (define-icon outline-close button
-  '((emoji "🔽")
-    (symbol " ⯆ ")
+  '((emoji "▶️")
+    (symbol " ⯈ ")
     (text " close "))
   "Icon used for buttons for closing a section in outline buffers."
   :version "29.1"

[-- Attachment #3: Type: text/plain, Size: 14 bytes --]


Steve Berman

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

* bug#57082: 29.0.50; emacs-news-view-mode breakage
  2022-08-10  7:55         ` Stephen Berman
@ 2022-08-10  8:07           ` Juri Linkov
  2022-08-12 12:50             ` Lars Ingebrigtsen
  2022-08-12 12:49           ` Lars Ingebrigtsen
  1 sibling, 1 reply; 20+ messages in thread
From: Juri Linkov @ 2022-08-10  8:07 UTC (permalink / raw)
  To: Stephen Berman; +Cc: Jim Porter, Lars Ingebrigtsen, 57082

>> I think that's wrong, yes. Every GUI I'm familiar with does it the other way:
>>
>>   > Closed Item
>>   v Open Item
>>     > Closed Sub Item
>>
>> This is the visual style used in GNOME (at least, the theme I'm using), MS
>> Windows, macOS, Firefox/Thunderbird, and probably others. More importantly,
>> it's also the style Emacs already uses elsewhere: see the Customize UI.
>
> Ah, of course, I didn't even think to look there (oops again).
>
> diff --git a/lisp/outline.el b/lisp/outline.el
> index 7750f9a75d..8132043097 100644
> --- a/lisp/outline.el
> +++ b/lisp/outline.el
> @@ -294,16 +294,16 @@ outline-minor-mode-use-buttons
>    :version "29.1")
>  
>  (define-icon outline-open button
> -  '((emoji "▶️")
> -    (symbol " ⯈ ")
> +  '((emoji "🔽")
> +    (symbol " ⯆ ")
>      (text " open "))
>    "Icon used for buttons for opening a section in outline buffers."
>    :version "29.1"
>    :help-echo "Open this section")

It seems the problem is somewhere else - in code that uses these definitions,
because here semantically everything is correct: the outline-open button
for opening a section means that the current state of the button is closed.
This assumes that in "outline-open" the word "open" is a verb.





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

* bug#57082: 29.0.50; emacs-news-view-mode breakage
  2022-08-10  7:39         ` Juri Linkov
@ 2022-08-10  8:08           ` Gregory Heytings
  2022-08-10  8:10             ` Juri Linkov
  0 siblings, 1 reply; 20+ messages in thread
From: Gregory Heytings @ 2022-08-10  8:08 UTC (permalink / raw)
  To: Juri Linkov; +Cc: Jim Porter, Lars Ingebrigtsen, Stephen Berman, 57082


>> For the NEWS file though (and especially programming modes). I still 
>> think it'd be great to put the buttons in the fringe. That way the 
>> buttons would never disrupt the contents of the file, e.g. by changing 
>> how the indentation looks.
>
> Agreed, the clickable buttons in the fringe would be great, and it's 
> easy to implement.
>

Some users disable both fringes, or only the left fringe, though.





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

* bug#57082: 29.0.50; emacs-news-view-mode breakage
  2022-08-10  8:08           ` Gregory Heytings
@ 2022-08-10  8:10             ` Juri Linkov
  2022-08-10  8:24               ` Gregory Heytings
  0 siblings, 1 reply; 20+ messages in thread
From: Juri Linkov @ 2022-08-10  8:10 UTC (permalink / raw)
  To: Gregory Heytings; +Cc: Jim Porter, Lars Ingebrigtsen, Stephen Berman, 57082

>>> For the NEWS file though (and especially programming modes). I still
>>> think it'd be great to put the buttons in the fringe. That way the
>>> buttons would never disrupt the contents of the file, e.g. by changing
>>> how the indentation looks.
>>
>> Agreed, the clickable buttons in the fringe would be great, and it's easy
>> to implement.
>
> Some users disable both fringes, or only the left fringe, though.

Then it should fall back to other methods.





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

* bug#57082: 29.0.50; emacs-news-view-mode breakage
  2022-08-10  7:36       ` Juri Linkov
@ 2022-08-10  8:19         ` Stephen Berman
  2022-08-10 18:45           ` Juri Linkov
  0 siblings, 1 reply; 20+ messages in thread
From: Stephen Berman @ 2022-08-10  8:19 UTC (permalink / raw)
  To: Juri Linkov; +Cc: Lars Ingebrigtsen, 57082

On Wed, 10 Aug 2022 10:36:22 +0300 Juri Linkov <juri@linkov.net> wrote:

>>> Also don't understand why is this change:
>>>
>>>          (when outline-minor-mode-highlight
>>> -          (if (and global-font-lock-mode (font-lock-specified-p major-mode))
>>> -              (progn
>>> -                (font-lock-add-keywords nil outline-font-lock-keywords t)
>>> -                (font-lock-flush))
>>> -            (outline-minor-mode-highlight-buffer)))
>>> +          (when (and global-font-lock-mode (font-lock-specified-p major-mode))
>>> +            (font-lock-add-keywords nil outline-font-lock-keywords t)
>>> +            (font-lock-flush))
>>> +          (outline-minor-mode-highlight-buffer))
>>>
>>> `outline-minor-mode-highlight-buffer' is intended only for buffers
>>> that don't support font-lock highlighting.
>>
>> Yes, but with that change, arrows are displayed on first visiting the
>> NEWS buffer; without it, they only appear when typing TAB on an outline
>> heading.
>
> This change broke fontification e.g. in diff buffers that now
> add outline faces on diff hunks.  So we need another solution.

Oh, dear (as I noted in my OP, I only checked NEWS and *Help* with
describe-binding).  But do you have a recipe to see this?  When I create
a diff with vc-diff I don't see outline faces on the hunks.

Steve Berman





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

* bug#57082: 29.0.50; emacs-news-view-mode breakage
  2022-08-10  8:10             ` Juri Linkov
@ 2022-08-10  8:24               ` Gregory Heytings
  2022-08-10 15:17                 ` Drew Adams
  0 siblings, 1 reply; 20+ messages in thread
From: Gregory Heytings @ 2022-08-10  8:24 UTC (permalink / raw)
  To: Juri Linkov; +Cc: Jim Porter, Lars Ingebrigtsen, Stephen Berman, 57082


>>>> For the NEWS file though (and especially programming modes). I still 
>>>> think it'd be great to put the buttons in the fringe. That way the 
>>>> buttons would never disrupt the contents of the file, e.g. by 
>>>> changing how the indentation looks.
>>>
>>> Agreed, the clickable buttons in the fringe would be great, and it's 
>>> easy to implement.
>>
>> Some users disable both fringes, or only the left fringe, though.
>
> Then it should fall back to other methods.
>

Yes, I mentioned this only to remind that another methods should be 
available.  And if another method is available, perhaps the chosen method 
should also depend on a configuration variable.  Some users may prefer 
in-buffer buttons even if they do not disable the fringes.





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

* bug#57082: 29.0.50; emacs-news-view-mode breakage
  2022-08-10  8:24               ` Gregory Heytings
@ 2022-08-10 15:17                 ` Drew Adams
  0 siblings, 0 replies; 20+ messages in thread
From: Drew Adams @ 2022-08-10 15:17 UTC (permalink / raw)
  To: Gregory Heytings, Juri Linkov
  Cc: Jim Porter, Lars Ingebrigtsen, Stephen Berman,
	57082@debbugs.gnu.org

This may be irrelevant/off-topic; if so, please ignore.

Whenever we have an icon or character (e.g. +, -)
that acts as a button to expand or contract some
hierarchical info by clicking the mouse, would it be
good to also have a mouseover tooltip there, that
lets you know a toggle key that both expands and
contracts (based on point being on that line or
whatever)?

Emacs typically has keyboard keys to toggle things,
and expanding/contracting together toggle.

Presumably there's a toggle key for the display
change involved here (if not, shouldn't there be?),
and it might be good to let someone using a mouse
know that there's an alternative to try.

The mouseover help won't show unless you hesitate
with the mouse over the icon/character, so this
shouldn't be annoying etc.

Just an idea.  (Maybe this is already available?)





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

* bug#57082: 29.0.50; emacs-news-view-mode breakage
  2022-08-10  8:19         ` Stephen Berman
@ 2022-08-10 18:45           ` Juri Linkov
  2022-08-10 18:58             ` Stephen Berman
  0 siblings, 1 reply; 20+ messages in thread
From: Juri Linkov @ 2022-08-10 18:45 UTC (permalink / raw)
  To: Stephen Berman; +Cc: Lars Ingebrigtsen, 57082

>>>> `outline-minor-mode-highlight-buffer' is intended only for buffers
>>>> that don't support font-lock highlighting.
>>>
>>> Yes, but with that change, arrows are displayed on first visiting the
>>> NEWS buffer; without it, they only appear when typing TAB on an outline
>>> heading.
>>
>> This change broke fontification e.g. in diff buffers that now
>> add outline faces on diff hunks.  So we need another solution.
>
> Oh, dear (as I noted in my OP, I only checked NEWS and *Help* with
> describe-binding).  But do you have a recipe to see this?  When I create
> a diff with vc-diff I don't see outline faces on the hunks.

The minimal test case is this:

  (setq-default outline-minor-mode-highlight t)
  (add-hook 'diff-mode-hook 'outline-minor-mode)

Then the first lines of diff is highlighted with blue outline-1 face,
the @@-lines with outline-2 face, etc.

This is because outline-font-lock-keywords and
outline-minor-mode-highlight-buffer have slightly different
interpretations of the values for outline-minor-mode-highlight.

This could be improved, but in any case both these functions
should not be applied at the same time.





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

* bug#57082: 29.0.50; emacs-news-view-mode breakage
  2022-08-10 18:45           ` Juri Linkov
@ 2022-08-10 18:58             ` Stephen Berman
  2022-08-11  6:44               ` Juri Linkov
  0 siblings, 1 reply; 20+ messages in thread
From: Stephen Berman @ 2022-08-10 18:58 UTC (permalink / raw)
  To: Juri Linkov; +Cc: Lars Ingebrigtsen, 57082

On Wed, 10 Aug 2022 21:45:25 +0300 Juri Linkov <juri@linkov.net> wrote:

>>>>> `outline-minor-mode-highlight-buffer' is intended only for buffers
>>>>> that don't support font-lock highlighting.
>>>>
>>>> Yes, but with that change, arrows are displayed on first visiting the
>>>> NEWS buffer; without it, they only appear when typing TAB on an outline
>>>> heading.
>>>
>>> This change broke fontification e.g. in diff buffers that now
>>> add outline faces on diff hunks.  So we need another solution.
>>
>> Oh, dear (as I noted in my OP, I only checked NEWS and *Help* with
>> describe-binding).  But do you have a recipe to see this?  When I create
>> a diff with vc-diff I don't see outline faces on the hunks.
>
> The minimal test case is this:
>
>   (setq-default outline-minor-mode-highlight t)
>   (add-hook 'diff-mode-hook 'outline-minor-mode)
>
> Then the first lines of diff is highlighted with blue outline-1 face,
> the @@-lines with outline-2 face, etc.

Yes, I see it now, thanks.

> This is because outline-font-lock-keywords and
> outline-minor-mode-highlight-buffer have slightly different
> interpretations of the values for outline-minor-mode-highlight.
>
> This could be improved, but in any case both these functions
> should not be applied at the same time.

Ok.  I'm not familiar enough with the intricacies of font-lock to whip
up a quick fix and can't afford to spend a lot of time on it, so I hope
someone better qualified than me will do it.

Steve Berman





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

* bug#57082: 29.0.50; emacs-news-view-mode breakage
  2022-08-10 18:58             ` Stephen Berman
@ 2022-08-11  6:44               ` Juri Linkov
  0 siblings, 0 replies; 20+ messages in thread
From: Juri Linkov @ 2022-08-11  6:44 UTC (permalink / raw)
  To: Stephen Berman; +Cc: Lars Ingebrigtsen, 57082

>> This is because outline-font-lock-keywords and
>> outline-minor-mode-highlight-buffer have slightly different
>> interpretations of the values for outline-minor-mode-highlight.
>>
>> This could be improved, but in any case both these functions
>> should not be applied at the same time.
>
> Ok.  I'm not familiar enough with the intricacies of font-lock to whip
> up a quick fix and can't afford to spend a lot of time on it, so I hope
> someone better qualified than me will do it.

I guess what is needed here is to find the right place to call
outline--fix-up-all-buttons on first visiting the NEWS buffer.





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

* bug#57082: 29.0.50; emacs-news-view-mode breakage
  2022-08-10  7:55         ` Stephen Berman
  2022-08-10  8:07           ` Juri Linkov
@ 2022-08-12 12:49           ` Lars Ingebrigtsen
  1 sibling, 0 replies; 20+ messages in thread
From: Lars Ingebrigtsen @ 2022-08-12 12:49 UTC (permalink / raw)
  To: Stephen Berman; +Cc: Jim Porter, 57082, Juri Linkov

Stephen Berman <stephen.berman@gmx.net> writes:

>> This is the visual style used in GNOME (at least, the theme I'm using), MS
>> Windows, macOS, Firefox/Thunderbird, and probably others. More importantly,
>> it's also the style Emacs already uses elsewhere: see the Customize UI.
>
> Ah, of course, I didn't even think to look there (oops again).

Thanks; pushed to Emacs 29.





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

* bug#57082: 29.0.50; emacs-news-view-mode breakage
  2022-08-10  8:07           ` Juri Linkov
@ 2022-08-12 12:50             ` Lars Ingebrigtsen
  0 siblings, 0 replies; 20+ messages in thread
From: Lars Ingebrigtsen @ 2022-08-12 12:50 UTC (permalink / raw)
  To: Juri Linkov; +Cc: Jim Porter, Stephen Berman, 57082

Juri Linkov <juri@linkov.net> writes:

> It seems the problem is somewhere else - in code that uses these definitions,
> because here semantically everything is correct: the outline-open button
> for opening a section means that the current state of the button is closed.
> This assumes that in "outline-open" the word "open" is a verb.

No, they're nouns.





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

* bug#57082: 29.0.50; emacs-news-view-mode breakage
  2022-08-10  0:03       ` Jim Porter
  2022-08-10  7:39         ` Juri Linkov
  2022-08-10  7:55         ` Stephen Berman
@ 2022-08-12 12:51         ` Lars Ingebrigtsen
  2 siblings, 0 replies; 20+ messages in thread
From: Lars Ingebrigtsen @ 2022-08-12 12:51 UTC (permalink / raw)
  To: Jim Porter; +Cc: Stephen Berman, 57082, Juri Linkov

Jim Porter <jporterbugs@gmail.com> writes:

> For the NEWS file though (and especially programming modes). I still
> think it'd be great to put the buttons in the fringe.

Yes, I agree.  The in-buffer buttons look nice in *Help*, but in a more
text-like buffer like NEWS (and which also opens unfolded by default),
they're distracting.





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

end of thread, other threads:[~2022-08-12 12:51 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-09 16:18 bug#57082: 29.0.50; emacs-news-view-mode breakage Stephen Berman
2022-08-09 18:23 ` Lars Ingebrigtsen
2022-08-09 19:18   ` Juri Linkov
2022-08-09 20:18     ` Stephen Berman
2022-08-10  0:03       ` Jim Porter
2022-08-10  7:39         ` Juri Linkov
2022-08-10  8:08           ` Gregory Heytings
2022-08-10  8:10             ` Juri Linkov
2022-08-10  8:24               ` Gregory Heytings
2022-08-10 15:17                 ` Drew Adams
2022-08-10  7:55         ` Stephen Berman
2022-08-10  8:07           ` Juri Linkov
2022-08-12 12:50             ` Lars Ingebrigtsen
2022-08-12 12:49           ` Lars Ingebrigtsen
2022-08-12 12:51         ` Lars Ingebrigtsen
2022-08-10  7:36       ` Juri Linkov
2022-08-10  8:19         ` Stephen Berman
2022-08-10 18:45           ` Juri Linkov
2022-08-10 18:58             ` Stephen Berman
2022-08-11  6:44               ` Juri Linkov

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).