unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#14464: 24.3; require sets deactivate-mark causing problems with some plugins
@ 2013-05-24 18:07 Donald Curtis
  2013-05-24 21:02 ` Glenn Morris
  0 siblings, 1 reply; 6+ messages in thread
From: Donald Curtis @ 2013-05-24 18:07 UTC (permalink / raw)
  To: 14464

This bug report will be sent to the Bug-GNU-Emacs mailing list
and the GNU bug tracker at debbugs.gnu.org.  Please check that
the From: line contains a valid email address.  After a delay of up
to one day, you should receive an acknowledgment at that address.

Please write in English if possible, as the Emacs maintainers
usually do not have translators for other languages.

Please describe exactly what actions triggered the bug, and
the precise symptoms of the bug.  If you can, give a recipe
starting from `emacs -Q':

I am using the `multiple-cursors` package through `package.el` which
sets up some autoloads that rely on the currently selected region. When
I call the function---through a keybinding---the current region
deactivates. The problem is that subsequent calls to the function
require that the region stay active.

It appears that somewhere during the call to `require`,
`deactivate-mark` is being set to `t` and thus the mark gets deactivated.

The only solution that I have been able to come up with is to advise
around `require` and create a local instance of `deactivate-mark` while
saving the excursion.

(defadvice require (around require-advice (feature &optional filename noerror) activate)
  (save-excursion
    (let (deactivate-mark)
      ad-do-it)))

It seems like there should be a way to avoid this behavior more elegantly.


If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
    `bt full' and `xbacktrace'.
For information about debugging Emacs, please read the file
/usr/local/Cellar/emacs/24.3/share/emacs/24.3/etc/DEBUG.


In GNU Emacs 24.3.1 (x86_64-apple-darwin12.3.0, NS apple-appkit-1187.37)
of 2013-05-24 on charlie.local
Windowing system distributor `Apple', version 10.3.1187
Configured using:
`configure '--prefix=/usr/local/Cellar/emacs/24.3' '--without-dbus'
'--enable-locallisppath=/usr/local/share/emacs/site-lisp'
'--infodir=/usr/local/Cellar/emacs/24.3/share/info/emacs' '--with-ns'
'--disable-ns-self-contained' 'CC=cc''

Important settings:
  locale-coding-system: utf-8
  default enable-multibyte-characters: t

Major mode: Emacs-Lisp

Minor modes in effect:
  paredit-mode: t
  yas-minor-mode: t
  rainbow-delimiters-mode: t
  whitespace-mode: t
  global-undo-tree-mode: t
  undo-tree-mode: t
  ido-ubiquitous-mode: t
  ido-everywhere: t
  which-function-mode: t
  delete-selection-mode: t
  global-subword-mode: t
  subword-mode: t
  winner-mode: t
  show-paren-mode: t
  savehist-mode: t
  shell-dirtrack-mode: t
  global-auto-revert-mode: t
  recentf-mode: t
  checkdoc-minor-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
C-x b t e s t <return> C-= C-> C-g C-n C-n C-n C-n 
C-n C-n C-n C-n C-p C-p C-p C-p C-p C-p C-p C-p C-p 
C-p C-p C-= C-> C-> C-g C-g C-x b i n i C-g C-n C-n 
C-n C-n C-n C-n C-n C-n C-n C-p C-SPC C-n C-n C-n C-n 
C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n 
C-n C-n M-w C-x RET e m a c s b u <return> M-p M-p 
M-p M-p <return> C-y C-c C-c y C-x C-g C-x RET <return> 
M-p M-p <return> C-y C-c C-c y C-x RET <return>

Recent messages:
Checking 87 files in /usr/local/Cellar/emacs/24.3/share/emacs/24.3/lisp/calc...
Checking 77 files in /usr/local/Cellar/emacs/24.3/share/emacs/24.3/lisp/obsolete...
Checking 1 files in /usr/local/Cellar/emacs/24.3/share/emacs/24.3/leim...
Checking for load-path shadows...done
Mark set [2 times]
Send this bug report to the Emacs maintainers? (y or n)  y
Sending...
Mark set [2 times]
Sending via mail...
Sending...done

Load-path shadows:
/Users/dcurtis/.emacs.d/elpa/multiple-cursors-20130518.816/rectangular-region-mode hides ~/src/multiple-cursors.el/rectangular-region-mode
/Users/dcurtis/.emacs.d/elpa/multiple-cursors-20130518.816/multiple-cursors hides ~/src/multiple-cursors.el/multiple-cursors
/Users/dcurtis/.emacs.d/elpa/multiple-cursors-20130518.816/multiple-cursors-pkg hides ~/src/multiple-cursors.el/multiple-cursors-pkg
/Users/dcurtis/.emacs.d/elpa/multiple-cursors-20130518.816/multiple-cursors-core hides ~/src/multiple-cursors.el/multiple-cursors-core
/Users/dcurtis/.emacs.d/elpa/multiple-cursors-20130518.816/mc-separate-operations hides ~/src/multiple-cursors.el/mc-separate-operations
/Users/dcurtis/.emacs.d/elpa/multiple-cursors-20130518.816/mc-mark-more hides ~/src/multiple-cursors.el/mc-mark-more
/Users/dcurtis/.emacs.d/elpa/multiple-cursors-20130518.816/mc-edit-lines hides ~/src/multiple-cursors.el/mc-edit-lines
/Users/dcurtis/.emacs.d/elpa/multiple-cursors-20130518.816/mc-cycle-cursors hides ~/src/multiple-cursors.el/mc-cycle-cursors
/Users/dcurtis/.emacs.d/elpa/magit-20130523.125/.dir-locals hides /usr/local/Cellar/emacs/24.3/share/emacs/24.3/lisp/gnus/.dir-locals

Features:
(mailalias mailclient browse-url shadow sort mail-extr emacsbug message
cl-macs gv rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse
rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045
ietf-drums mail-utils mc-mark-more multiple-cursors-core rect
expand-region text-mode-expansions er-basic-expansions
expand-region-custom expand-region-core add-log paredit yasnippet cl
rainbow-delimiters whitespace rx undo-tree diff smex ido-ubiquitous ido
diminish which-func imenu delsel subword winner paren savehist
tramp-cache tramp-sh tramp tramp-compat auth-source gnus-util mm-util
mail-prsvr password-cache tramp-loaddefs shell pcomplete comint
ansi-color ring format-spec autorevert edmacro kmacro server uniquify
warnings advice help-fns cl-lib advice-preload saveplace recentf
tree-widget wid-edit misc midnight checkdoc thingatpt help-mode easymenu
ace-jump-mode-autoloads ag-autoloads browse-kill-ring-autoloads
clojure-mode-autoloads deft-autoloads diminish-autoloads
dired+-autoloads dropdown-list-autoloads expand-region-autoloads
gist-autoloads gh-autoloads eieio byte-opt bytecomp byte-compile cconv
git-commit-mode-autoloads ido-ubiquitous-autoloads
iy-go-to-char-autoloads logito-autoloads magit-autoloads
markdown-mode+-autoloads markdown-mode-autoloads
multiple-cursors-autoloads naquadah-theme-autoloads paredit-autoloads
pcache-autoloads rainbow-delimiters-autoloads smex-autoloads
soothe-theme-autoloads finder-inf undo-tree-autoloads
yasnippet-autoloads package time-date tooltip ediff-hook vc-hooks
lisp-float-type mwheel ns-win tool-bar dnd fontset image regexp-opt
fringe tabulated-list newcomment lisp-mode register page menu-bar
rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax
facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak
czech european ethiopic indian cyrillic chinese case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces
cus-face macroexp files text-properties overlay sha1 md5 base64 format
env code-pages mule custom widget hashtable-print-readable backquote
make-network-process ns multi-tty emacs)





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

* bug#14464: 24.3; require sets deactivate-mark causing problems with some plugins
  2013-05-24 18:07 bug#14464: 24.3; require sets deactivate-mark causing problems with some plugins Donald Curtis
@ 2013-05-24 21:02 ` Glenn Morris
       [not found]   ` <CANJd5Qv4hLV=aKeM=N9392gsSM4TPnpup+kqcCdJ=Ko+OHyUiQ@mail.gmail.com>
  0 siblings, 1 reply; 6+ messages in thread
From: Glenn Morris @ 2013-05-24 21:02 UTC (permalink / raw)
  To: Donald Curtis; +Cc: 14464

Donald Curtis wrote:

> I am using the `multiple-cursors` package through `package.el` which
> sets up some autoloads that rely on the currently selected region. When
> I call the function---through a keybinding---the current region
> deactivates. The problem is that subsequent calls to the function
> require that the region stay active.
>
> It appears that somewhere during the call to `require`,
> `deactivate-mark` is being set to `t` and thus the mark gets deactivated.
>
> The only solution that I have been able to come up with is to advise
> around `require` and create a local instance of `deactivate-mark` while
> saving the excursion.

I think it's unlikely that require itself messes with the mark.
The thing that you are requiring can of course do anything at all.
Sounds like this could be a problem in "multiple-cursors", which isn't
part of Emacs.





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

* bug#14464: 24.3; require sets deactivate-mark causing problems with some plugins
       [not found]   ` <CANJd5Qv4hLV=aKeM=N9392gsSM4TPnpup+kqcCdJ=Ko+OHyUiQ@mail.gmail.com>
@ 2013-05-25 18:06     ` Glenn Morris
  2021-09-06 10:25       ` Lars Ingebrigtsen
  0 siblings, 1 reply; 6+ messages in thread
From: Glenn Morris @ 2013-05-25 18:06 UTC (permalink / raw)
  To: Donald Ephraim Curtis; +Cc: 14464

[-- Attachment #1: message body text --]
[-- Type: text/plain, Size: 1160 bytes --]


Please keep the debbugs address cc'd.
I am resending your comments so that they are visible to others.


Date: Fri, 24 May 2013 17:47:31 -0500
From: Donald Curtis <dcurtis@milkbox.net>
Subject: Re: bug#14464: 24.3; require sets deactivate-mark causing problems
 with some plugins

Yes, this is what my initial intuition was. I have traced this error down
to something much more obscure. I don't understand why it's happening. But
let me give you some code to reproduce the odd behavior without concern for
`multiple-cursors`.

Make sure both files are in the same directory.

# Working Correctly

1. open `sample.el` with: emacs -Q sample.el
2. eval just the `progn` portion of the provided code.
3. transient mark something
4. hit C-.

the active-mark is still there. now exit emacs and start again,

# Odd Behavior

1. open `sample.el` with: emacs -Q sample.el
2. eval the `defadvice`
3. eval the `progn` portion of the provided code.
4. transient mark something
5. hit C-.

now the active-mark disappears.

AND what is even weirder is that if you remove the `compile` option from
the `defadvice` then there is no issue. but there is something weird here!


[-- Attachment #2: sample.el --]
[-- Type: application/octet-stream, Size: 367 bytes --]

;; scratch.el file

(defadvice kill-line (after kill-line-cleanup-whitespace activate compile)
  "Cleanup whitespace on `kill-line'."
  (if (not (bolp))
      (delete-region (point) (progn (skip-chars-forward " \t") (point)))))

(progn (add-to-list 'load-path ".")
       (autoload 'testtest "autoloadme" "\(fn)" t nil)
       (global-set-key (kbd "C-.") 'testtest))

[-- Attachment #3: autoloadme.el --]
[-- Type: application/octet-stream, Size: 304 bytes --]

;;;###autoload

(defun testtest (arg)
  (interactive "p")
  (message "deactivate-mark: %s   arg: %s" deactivate-mark arg))

(defadvice read-char (around test-read-char activate)
  (message "read-char %s" deactivate-mark)
  ad-do-it)

(message "deactivate-mark: %s" deactivate-mark)
(provide 'autoloadme)

[-- Attachment #4: message body text --]
[-- Type: text/plain, Size: 294 bytes --]


On Fri, May 24, 2013 at 4:02 PM, Glenn Morris <rgm@gnu.org> wrote:

> I think it's unlikely that require itself messes with the mark.
> The thing that you are requiring can of course do anything at all.
> Sounds like this could be a problem in "multiple-cursors", which isn't
> part of Emacs.

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

* bug#14464: 24.3; require sets deactivate-mark causing problems with some plugins
  2013-05-25 18:06     ` Glenn Morris
@ 2021-09-06 10:25       ` Lars Ingebrigtsen
  2021-09-21  0:37         ` Donald Curtis
  0 siblings, 1 reply; 6+ messages in thread
From: Lars Ingebrigtsen @ 2021-09-06 10:25 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 14464, Donald Ephraim Curtis

Donald Curtis <dcurtis@milkbox.net> writes:

> # Odd Behavior
>
> 1. open `sample.el` with: emacs -Q sample.el
> 2. eval the `defadvice`
> 3. eval the `progn` portion of the provided code.
> 4. transient mark something
> 5. hit C-.
>
> now the active-mark disappears.
>
> AND what is even weirder is that if you remove the `compile` option from
> the `defadvice` then there is no issue. but there is something weird here!

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

I tried reproducing this problem with Emacs 25.1 (and Emacs 28), but I
was unable to -- the active region didn't disappear.

Are you still seeing this issue in recent Emacs versions?

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





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

* bug#14464: 24.3; require sets deactivate-mark causing problems with some plugins
  2021-09-06 10:25       ` Lars Ingebrigtsen
@ 2021-09-21  0:37         ` Donald Curtis
  2021-09-21  4:01           ` Lars Ingebrigtsen
  0 siblings, 1 reply; 6+ messages in thread
From: Donald Curtis @ 2021-09-21  0:37 UTC (permalink / raw)
  To: Lars Ingebrigtsen, Glenn Morris; +Cc: 14464

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

I am not able to reproduce either. Given that this was submitted 4 years ago, I cannot recall exactly what I saw before but things seems fine based on my repro steps. Thanks!

On Mon, Sep 6, 2021, at 05:25, Lars Ingebrigtsen wrote:
> Donald Curtis <dcurtis@milkbox.net> writes:
> 
> > # Odd Behavior
> >
> > 1. open `sample.el` with: emacs -Q sample.el
> > 2. eval the `defadvice`
> > 3. eval the `progn` portion of the provided code.
> > 4. transient mark something
> > 5. hit C-.
> >
> > now the active-mark disappears.
> >
> > AND what is even weirder is that if you remove the `compile` option from
> > the `defadvice` then there is no issue. but there is something weird here!
> 
> (I'm going through old bug reports that unfortunately weren't resolved
> at the time.)
> 
> I tried reproducing this problem with Emacs 25.1 (and Emacs 28), but I
> was unable to -- the active region didn't disappear.
> 
> Are you still seeing this issue in recent Emacs versions?
> 
> -- 
> (domestic pets only, the antidote for overdose, milk.)
>    bloggy blog: http://lars.ingebrigtsen.no
> 

[-- Attachment #2: Type: text/html, Size: 1795 bytes --]

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

* bug#14464: 24.3; require sets deactivate-mark causing problems with some plugins
  2021-09-21  0:37         ` Donald Curtis
@ 2021-09-21  4:01           ` Lars Ingebrigtsen
  0 siblings, 0 replies; 6+ messages in thread
From: Lars Ingebrigtsen @ 2021-09-21  4:01 UTC (permalink / raw)
  To: Donald Curtis; +Cc: Glenn Morris, 14464

"Donald Curtis" <dcurtis@milkbox.net> writes:

> I am not able to reproduce either. Given that this was submitted 4 years ago,
> I cannot recall exactly what I saw before but things seems fine based on my
> repro steps. Thanks!

Thanks for checking.  I'm closing this bug report, then.

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





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

end of thread, other threads:[~2021-09-21  4:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-24 18:07 bug#14464: 24.3; require sets deactivate-mark causing problems with some plugins Donald Curtis
2013-05-24 21:02 ` Glenn Morris
     [not found]   ` <CANJd5Qv4hLV=aKeM=N9392gsSM4TPnpup+kqcCdJ=Ko+OHyUiQ@mail.gmail.com>
2013-05-25 18:06     ` Glenn Morris
2021-09-06 10:25       ` Lars Ingebrigtsen
2021-09-21  0:37         ` Donald Curtis
2021-09-21  4:01           ` Lars Ingebrigtsen

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