all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#14238: [PATCH] Help page for character description forgets the character
@ 2013-04-21 11:38 Kelly Dean
  2013-04-22 14:26 ` Stefan Monnier
  0 siblings, 1 reply; 4+ messages in thread
From: Kelly Dean @ 2013-04-21 11:38 UTC (permalink / raw)
  To: 14238

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

On 24.3, emacs -Q
Type the letters AB, then put point on A. Do describe-char, then put point on B, and do describe-char again.
Change the A to C, the press [back] in *Help*.
The help page is now for C, not for A. It should be for A; you never did describe-char on C.
The attached descharbug.patch fixes it.

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

--- emacs-24.3/lisp/descr-text.el
+++ emacs-24.3/lisp/descr-text.el
@@ -670,8 +670,11 @@
                                             (if (cadr x) (length (car x)) 0))
                                           item-list)))
       (set-buffer src-buf)
-      (help-setup-xref (list 'describe-char pos buffer)
-                       (called-interactively-p 'interactive))
+      (describe-char-make-help multibyte-p max-width item-list overlays char-description disp-vector composition component-chars eight-bit-p char text-props-desc (called-interactively-p 'interactive)))))
+
+(defun describe-char-make-help (multibyte-p max-width item-list overlays char-description disp-vector composition component-chars eight-bit-p char text-props-desc interactive-p)
+      (help-setup-xref (list 'describe-char-make-help multibyte-p max-width item-list overlays char-description disp-vector composition component-chars eight-bit-p char text-props-desc nil)
+                       interactive-p)
       (with-help-window (help-buffer)
         (with-current-buffer standard-output
           (set-buffer-multibyte multibyte-p)
@@ -804,7 +807,7 @@
                             (format "  %s: %s\n" elt val)))))))
 
           (if text-props-desc (insert text-props-desc))
-          (setq buffer-read-only t))))))
+          (setq buffer-read-only t))))
 
 (define-obsolete-function-alias 'describe-char-after 'describe-char "22.1")
 

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

* bug#14238: [PATCH] Help page for character description forgets the character
  2013-04-21 11:38 bug#14238: [PATCH] Help page for character description forgets the character Kelly Dean
@ 2013-04-22 14:26 ` Stefan Monnier
  2013-04-26 21:01   ` Kelly Dean
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2013-04-22 14:26 UTC (permalink / raw)
  To: Kelly Dean; +Cc: 14238

> On 24.3, emacs -Q
> Type the letters AB, then put point on A. Do describe-char, then put point
> on B, and do describe-char again.
> Change the A to C, the press [back] in *Help*.
> The help page is now for C, not for A. It should be for A; you never did describe-char on C.

Not sure if it is really a bug: while the name is "describe-char" what
it does is more like "describe-pos" (and indeed it receives a position
rather than a char as argument).

So when you "back" you ask to redisplay the info about the pos where
A used to be (and where C is now instead).

The data stored with `help-setup-xref' is also used for `revert-buffer'
which lets you refresh the description after the buffer was modified.


        Stefan





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

* bug#14238: [PATCH] Help page for character description forgets the character
  2013-04-22 14:26 ` Stefan Monnier
@ 2013-04-26 21:01   ` Kelly Dean
  2013-04-27  4:19     ` Stefan Monnier
  0 siblings, 1 reply; 4+ messages in thread
From: Kelly Dean @ 2013-04-26 21:01 UTC (permalink / raw)
  To: 14238

--- On Mon, 4/22/13, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
> Not sure if it is really a bug: while the name is
> "describe-char" what
> it does is more like "describe-pos" (and indeed it receives
> a position
> rather than a char as argument).
> 
> So when you "back" you ask to redisplay the info about the
> pos where
> A used to be (and where C is now instead).
> 
> The data stored with `help-setup-xref' is also used for
> `revert-buffer'
> which lets you refresh the description after the buffer was
> modified.

Put point on a function name, and do C-h f RET, then again on another function name. Then delete the first function name and type a new one, and do back in the help buffer. The documentation for the original first function name is displayed, not for the new one. Surely Emacs's behavior in this case is correct. Why then is it correct for describe-char to follow changes in the source buffer, if describe-function doesn't? I don't see how it's a useful feature. All it does it cause problems: one, after browsing a series of help pages, you go back to review the character description you looked at, and it's gone; two, there's an unexpected character description in your history, and you're left futilely trying to remember why you looked up the description for that character.






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

* bug#14238: [PATCH] Help page for character description forgets the character
  2013-04-26 21:01   ` Kelly Dean
@ 2013-04-27  4:19     ` Stefan Monnier
  0 siblings, 0 replies; 4+ messages in thread
From: Stefan Monnier @ 2013-04-27  4:19 UTC (permalink / raw)
  To: Kelly Dean; +Cc: 14238

> this case is correct. Why then is it correct for describe-char to follow
> changes in the source buffer, if describe-function doesn't?

That's the wrong comparison.  As mentioned `describe-char' is the wrong
name, since what the function does is `describe-pos'.  In contrast
`describe-function' really describes a function and not just "the
function at point" (although the function at point is the one that's
provided as default in the minibuffer).

> I don't see how it's a useful feature.

I've used it to monitor changes to the position's overlays and
text-properties.


        Stefan





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

end of thread, other threads:[~2013-04-27  4:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-21 11:38 bug#14238: [PATCH] Help page for character description forgets the character Kelly Dean
2013-04-22 14:26 ` Stefan Monnier
2013-04-26 21:01   ` Kelly Dean
2013-04-27  4:19     ` Stefan Monnier

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.