all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* What can cause downcasing in Emacs Lisp code?
@ 2021-05-20 16:49 Jean Louis
  2021-05-20 17:21 ` Eduardo Ochs
  0 siblings, 1 reply; 9+ messages in thread
From: Jean Louis @ 2021-05-20 16:49 UTC (permalink / raw)
  To: Help GNU Emacs

I have noticed few times in last months, including today, that I find
some strings in Emacs Lisp code downcased. I cannot know what is
happening, as it is maybe something I press by mistake, but I cannot
find what. I don't mark things and don't use `downcase-region'

As usually all of the Emacs Lisp is anyway downcased, I can only
observe strings within quotes to be downcased, but maybe some 

Then I can observe instead of this:

(defun hlink-yank-note (&optional id)
  "Kill the note and yanks into the other window"
  (interactive)
  (when-tabulated-id "hlinks" id
    (hyperscope-ring id)
    (hlink-yank-note-1 id)))

I can observe following "kill" instead of "Kill"

(defun hlink-yank-note (&optional id)
  "kill the note and yanks into the other window"
  (interactive)
  (when-tabulated-id "hlinks" id
    (hyperscope-ring id)
    (hlink-yank-note-1 id)))

And that downcasing makes me again edit so much more. I do not know
how I invoke that.

Maybe somebody knows?



Jean



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

* Re: What can cause downcasing in Emacs Lisp code?
  2021-05-20 16:49 What can cause downcasing in Emacs Lisp code? Jean Louis
@ 2021-05-20 17:21 ` Eduardo Ochs
  2021-05-21  5:54   ` Jean Louis
  0 siblings, 1 reply; 9+ messages in thread
From: Eduardo Ochs @ 2021-05-20 17:21 UTC (permalink / raw)
  To: Jean Louis; +Cc: Help GNU Emacs

Do you type `M-l', a.k.a., `downcase-word', by accident often? I do =/...

On Thu, 20 May 2021 at 13:50, Jean Louis <bugs@gnu.support> wrote:
>
> I have noticed few times in last months, including today, that I find
> some strings in Emacs Lisp code downcased. I cannot know what is
> happening, as it is maybe something I press by mistake, but I cannot
> find what. I don't mark things and don't use `downcase-region'
>
> As usually all of the Emacs Lisp is anyway downcased, I can only
> observe strings within quotes to be downcased, but maybe some
>
> Then I can observe instead of this:
>
> (defun hlink-yank-note (&optional id)
>   "Kill the note and yanks into the other window"
>   (interactive)
>   (when-tabulated-id "hlinks" id
>     (hyperscope-ring id)
>     (hlink-yank-note-1 id)))
>
> I can observe following "kill" instead of "Kill"
>
> (defun hlink-yank-note (&optional id)
>   "kill the note and yanks into the other window"
>   (interactive)
>   (when-tabulated-id "hlinks" id
>     (hyperscope-ring id)
>     (hlink-yank-note-1 id)))
>
> And that downcasing makes me again edit so much more. I do not know
> how I invoke that.
>
> Maybe somebody knows?
>
>
>
> Jean
>



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

* Re: What can cause downcasing in Emacs Lisp code?
  2021-05-20 17:21 ` Eduardo Ochs
@ 2021-05-21  5:54   ` Jean Louis
  2021-05-21 15:20     ` [External] : " Drew Adams
  0 siblings, 1 reply; 9+ messages in thread
From: Jean Louis @ 2021-05-21  5:54 UTC (permalink / raw)
  To: Eduardo Ochs; +Cc: Help GNU Emacs

* Eduardo Ochs <eduardoochs@gmail.com> [2021-05-20 20:22]:
> Do you type `M-l', a.k.a., `downcase-word', by accident often? I do
> =/...

Maybe, could be, I never use it, but I use M-n so maybe when I work
long and start sleeping on keyboard... that could be it.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

Sign an open letter in support of Richard M. Stallman
https://stallmansupport.org/
https://rms-support-letter.github.io/




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

* RE: [External] : Re: What can cause downcasing in Emacs Lisp code?
  2021-05-21  5:54   ` Jean Louis
@ 2021-05-21 15:20     ` Drew Adams
  2021-05-21 15:45       ` Jean Louis
  0 siblings, 1 reply; 9+ messages in thread
From: Drew Adams @ 2021-05-21 15:20 UTC (permalink / raw)
  To: Jean Louis, Eduardo Ochs; +Cc: Help GNU Emacs

> > Do you type `M-l', a.k.a., `downcase-word', by accident often? I do
> > =/...
> 
> Maybe, could be, I never use it, but I use M-n so maybe when I work
> long and start sleeping on keyboard... that could be it.

Ask Emacs.

,----
| open-dribble-file is an interactive built-in function in ‘C source
| code’.
| 
| (open-dribble-file FILE)
| 
| Start writing all keyboard characters to a dribble file called FILE.
| If FILE is nil, close any open dribble file.
| The file will be closed when Emacs exits.
| 
| Be aware that this records ALL characters you type!
| This may include sensitive information such as passwords.
`----

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

* Re: [External] : Re: What can cause downcasing in Emacs Lisp code?
  2021-05-21 15:20     ` [External] : " Drew Adams
@ 2021-05-21 15:45       ` Jean Louis
  2021-05-21 16:01         ` Drew Adams
  0 siblings, 1 reply; 9+ messages in thread
From: Jean Louis @ 2021-05-21 15:45 UTC (permalink / raw)
  To: Drew Adams; +Cc: Help GNU Emacs, Eduardo Ochs

* Drew Adams <drew.adams@oracle.com> [2021-05-21 18:20]:
> > > Do you type `M-l', a.k.a., `downcase-word', by accident often? I do
> > > =/...
> > 
> > Maybe, could be, I never use it, but I use M-n so maybe when I work
> > long and start sleeping on keyboard... that could be it.
> 
> Ask Emacs.
> 
> ,----
> | open-dribble-file is an interactive built-in function in ‘C source
> | code’.
> | 
> | (open-dribble-file FILE)

Is there M-x dribble-analyze-file? ☻ As if not, that becomes
mysterious too...

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

Sign an open letter in support of Richard M. Stallman
https://stallmansupport.org/
https://rms-support-letter.github.io/




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

* RE: [External] : Re: What can cause downcasing in Emacs Lisp code?
  2021-05-21 15:45       ` Jean Louis
@ 2021-05-21 16:01         ` Drew Adams
  2021-05-21 20:05           ` Jean Louis
  0 siblings, 1 reply; 9+ messages in thread
From: Drew Adams @ 2021-05-21 16:01 UTC (permalink / raw)
  To: Jean Louis; +Cc: Help GNU Emacs, Eduardo Ochs

> > (open-dribble-file FILE)
> 
> Is there M-x dribble-analyze-file? ☻ As if not, that becomes
> mysterious too...

It's waiting for you to write it.  Only you know what
you want "analyze" to mean for it.

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

* Re: [External] : Re: What can cause downcasing in Emacs Lisp code?
  2021-05-21 16:01         ` Drew Adams
@ 2021-05-21 20:05           ` Jean Louis
  2021-05-21 20:42             ` Drew Adams
  0 siblings, 1 reply; 9+ messages in thread
From: Jean Louis @ 2021-05-21 20:05 UTC (permalink / raw)
  To: Drew Adams; +Cc: Help GNU Emacs, Eduardo Ochs

* Drew Adams <drew.adams@oracle.com> [2021-05-21 19:01]:
> > > (open-dribble-file FILE)
> > 
> > Is there M-x dribble-analyze-file? ☻ As if not, that becomes
> > mysterious too...
> 
> It's waiting for you to write it.  Only you know what
> you want "analyze" to mean for it.

As I have no idea, I was thinking maybe other people experience the
same thing. During few months I found my sources downcased partially,
but if 30% downcased it seem as region was downcased, I just don't
remember marking that much of region.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

Sign an open letter in support of Richard M. Stallman
https://stallmansupport.org/



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

* RE: [External] : Re: What can cause downcasing in Emacs Lisp code?
  2021-05-21 20:05           ` Jean Louis
@ 2021-05-21 20:42             ` Drew Adams
  2021-05-21 21:00               ` Jean Louis
  0 siblings, 1 reply; 9+ messages in thread
From: Drew Adams @ 2021-05-21 20:42 UTC (permalink / raw)
  To: Jean Louis; +Cc: Help GNU Emacs, Eduardo Ochs

> During few months I found my sources downcased partially,
> but if 30% downcased it seem as region was downcased, I 
> just don't remember marking that much of region.

OK, here's the thing...

`downcase-region' and some other commands that act on the
region are _very old_.  They predate even the existence of
`transient-mark-mode', let alone the turning ON of that
mode by default.

This and similar commands act on the region _regardless
of whether it is active_.  That's just the way things are.

And yes, you pretty much always have a nonempty region to
act on.  And yes, users who expect commands that act on
the region text to do so only when the region is active
can be bitten by such (now exceptional) behavior.

Usually someone who uses such a command notices the effect
immediately, in which case, a quick `undo' takes care of
it.  But with a command such as `downcase-region' when the
region is mostly already in the resulting state (in this
case, already lowercase), a user might not notice that
some things were changed (e.g. a few chars, even possibly
off-screen).

Now that I think about it, it might make sense for Emacs
to change the default behavior of such commands, so that
they would do something "safer".

For example, when invoked interactively, if the region is
not active and if `transient-mark-mode' is turned on, do
something like:

* be a no-op
* raise an error
* prompt for confirmation first

Those conditions are important: There'd be no change when
invoked from code, or when t-m-mode is off.  Oldbies who
leave that mode off would see no change in behavior, and
the same for existing Lisp code.

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

* Re: [External] : Re: What can cause downcasing in Emacs Lisp code?
  2021-05-21 20:42             ` Drew Adams
@ 2021-05-21 21:00               ` Jean Louis
  0 siblings, 0 replies; 9+ messages in thread
From: Jean Louis @ 2021-05-21 21:00 UTC (permalink / raw)
  To: Drew Adams; +Cc: Help GNU Emacs, Eduardo Ochs

* Drew Adams <drew.adams@oracle.com> [2021-05-21 23:43]:
> > During few months I found my sources downcased partially,
> > but if 30% downcased it seem as region was downcased, I 
> > just don't remember marking that much of region.
> 
> OK, here's the thing...
> 
> `downcase-region' and some other commands that act on the
> region are _very old_.  They predate even the existence of
> `transient-mark-mode', let alone the turning ON of that
> mode by default.

Could be. I have some key binding like C-c l and maybe I make mistake
and press C-x C-l -- but hooo. when I pressed it on this line without
region all line was downcased.

"when used as a command, the text between point and the mark is
operated on." -- which means my mark could be anywhere in the file,
and if i press c-x c-l anywhere down, without marked region, all the
text would be marked. That is what makes it invisible.

So that could be that, thank you Sherlock.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

Sign an open letter in support of Richard M. Stallman
https://stallmansupport.org/



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

end of thread, other threads:[~2021-05-21 21:00 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-20 16:49 What can cause downcasing in Emacs Lisp code? Jean Louis
2021-05-20 17:21 ` Eduardo Ochs
2021-05-21  5:54   ` Jean Louis
2021-05-21 15:20     ` [External] : " Drew Adams
2021-05-21 15:45       ` Jean Louis
2021-05-21 16:01         ` Drew Adams
2021-05-21 20:05           ` Jean Louis
2021-05-21 20:42             ` Drew Adams
2021-05-21 21:00               ` Jean Louis

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.