all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stephen Berman <stephen.berman@gmx.net>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Sebastian Wiesner <lunaryorn@gmail.com>, 14974@debbugs.gnu.org
Subject: bug#14974: 24.3.50; adaptive-wrap 0.3 calls potentially void function easy-menu-add-item
Date: Tue, 30 Jul 2013 10:54:09 +0200	[thread overview]
Message-ID: <87r4egh1hq.fsf@rosalinde.fritz.box> (raw)
In-Reply-To: <jwvhafcc0wg.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Mon, 29 Jul 2013 21:08:48 -0400")

On Mon, 29 Jul 2013 21:08:48 -0400 Stefan Monnier <monnier@iro.umontreal.ca> wrote:

>> You mean (lambda () (interactive) (adaptive-wrap-prefix-mode 'toggle))?
>
> No, I mean `adaptive-wrap-prefix-mode', which will already do the same.

Got it, finally.  Sorry for the denseness.

>> Then the check box remains in the menu after unloading adaptive-wrap.el,
>
> Big deal.  Don't waste code on such a non-issue that will only affect
> maybe 10 people in the next century, 9 of whom won't even notice it
> because they won't look at the menu.
>
>> but it becomes a noop.  Making visibility depend on whether the
>> feature is present is, AFAICS, a way of avoiding a separate
>> adaptive-wrap-unload-function.  Or am I wrong about this, or do you
>> mean something else?
>
> As I said, unloading a package is largely broken, so some left-over
> entries in a menu are the least of your worries in this respect.

I honestly don't see having the feature check as a waste of code, but no
matter.  I assume, then, that adaptive-wrap-unload-function is also
dispensable; so is the following patch ok to check in?

Steve Berman

=== modified file 'packages/adaptive-wrap/adaptive-wrap.el'
*** packages/adaptive-wrap/adaptive-wrap.el	2013-07-29 11:56:03 +0000
--- packages/adaptive-wrap/adaptive-wrap.el	2013-07-30 08:15:54 +0000
***************
*** 4,10 ****
  
  ;; Author: Stephen Berman <stephen.berman@gmx.net>
  ;;         Stefan Monnier <monnier@iro.umontreal.ca>
! ;; Version: 0.4
  
  ;; This program is free software; you can redistribute it and/or modify
  ;; it under the terms of the GNU General Public License as published by
--- 4,10 ----
  
  ;; Author: Stephen Berman <stephen.berman@gmx.net>
  ;;         Stefan Monnier <monnier@iro.umontreal.ca>
! ;; Version: 0.5
  
  ;; This program is free software; you can redistribute it and/or modify
  ;; it under the terms of the GNU General Public License as published by
***************
*** 103,127 ****
          (widen)
          (remove-text-properties (point-min) (point-max) '(wrap-prefix nil))))))
  
! ;;;###autoload
! (easy-menu-add-item menu-bar-options-menu
!                     '("Line Wrapping in This Buffer")
!                     ["Adaptive Wrap"
!                      (lambda ()
!                        (interactive)
! 		       (if adaptive-wrap-prefix-mode
! 			   (adaptive-wrap-prefix-mode -1)
! 			 (adaptive-wrap-prefix-mode 1)))
!                      :visible (menu-bar-menu-frame-live-and-visible-p)
!                      :help "Show wrapped long lines with an adjustable prefix"
!                      :style toggle
!                      :selected adaptive-wrap-prefix-mode])
! 
! (defun adaptive-wrap-unload-function ()
!   "Cleanup adaptive-wrap package."
!   (easy-menu-remove-item menu-bar-options-menu
!                          '("Line Wrapping in This Buffer")
!                          "Adaptive Wrap"))
  
  (provide 'adaptive-wrap)
  ;;; adaptive-wrap.el ends here
--- 103,116 ----
          (widen)
          (remove-text-properties (point-min) (point-max) '(wrap-prefix nil))))))
  
! (define-key-after (lookup-key menu-bar-options-menu [line-wrapping])
!   [adaptive-wrap]
!   '(menu-item "Adaptive Wrap" adaptive-wrap-prefix-mode
! 	      :enable t
! 	      :visible (menu-bar-menu-frame-live-and-visible-p)
! 	      :help "Show wrapped long lines with an adjustable prefix"
! 	      :button (:toggle . (bound-and-true-p adaptive-wrap-prefix-mode)))
!   word-wrap)
  
  (provide 'adaptive-wrap)
  ;;; adaptive-wrap.el ends here






  reply	other threads:[~2013-07-30  8:54 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-28 13:32 bug#14974: 24.3.50; adaptive-wrap 0.3 calls potentially void function easy-menu-add-item Sebastian Wiesner
2013-07-29 11:59 ` Stephen Berman
2013-07-29 15:24   ` Stefan Monnier
2013-07-29 15:32     ` Sebastian Wiesner
2013-07-29 16:40       ` Stefan Monnier
2013-07-29 21:35         ` Stephen Berman
2013-07-29 22:15           ` Stefan Monnier
2013-07-29 23:30             ` Stephen Berman
2013-07-30  1:08               ` Stefan Monnier
2013-07-30  8:54                 ` Stephen Berman [this message]
2013-07-30 14:14                   ` Stefan Monnier

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

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

  git send-email \
    --in-reply-to=87r4egh1hq.fsf@rosalinde.fritz.box \
    --to=stephen.berman@gmx.net \
    --cc=14974@debbugs.gnu.org \
    --cc=lunaryorn@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    /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 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.