unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Spencer Baugh <sbaugh@janestreet.com>
Cc: 66614@debbugs.gnu.org
Subject: bug#66614: 29.1.50; Support not capitalizing words inside symbols
Date: Thu, 19 Oct 2023 07:35:33 +0300	[thread overview]
Message-ID: <83zg0fmdpm.fsf@gnu.org> (raw)
In-Reply-To: <ierfs274t6t.fsf@janestreet.com> (message from Spencer Baugh on Wed, 18 Oct 2023 15:38:34 -0400)

> From: Spencer Baugh <sbaugh@janestreet.com>
> Cc: 66614@debbugs.gnu.org
> Date: Wed, 18 Oct 2023 15:38:34 -0400
> 
> >> +  DEFVAR_BOOL ("case-symbols-as-words", case_symbols_as_words,
> >> +	       doc: /* If non-nil, case functions treat symbol syntax as part of words.
> >> +
> >> +Functions such as `upcase-initials' and `replace-match' check or modify
> >> +the case pattern of sequences of characters.  Normally, these operate on
> >> +sequences of characters whose syntax is word constituent.  If this
> >> +variable is non-nil, then they operate on sequences of characters who
> >> +syntax is either word constituent or symbol constituent.
> >> +
> >> +This is useful for programming styles which wish to capitalize the
> >> +beginning of symbols, but not capitalize individual words in a symbol.*/);
> >
> > Similar comments about this doc string.
> 
> Fixed.
> 
> > Also, shouldn't this variable be buffer-local?  You want certain major
> > modes to set it, right?
> 
> Yes, I want certain major modes to set it, although it's also possible
> that some users will want to set it globally.
> 
> Are you suggesting it should be a DEFVAR_PER_BUFFER?  I can do that, but
> I didn't think it was worth putting another slot into struct buffer.

You don't have to add it to the buffer structure, you could call
Fmake_variable_buffer_local instead.  We already do that for some
variables.

> Plus DEFVAR_PER_BUFFER has bad performance (O(#buffers)) when you
> let-bind it, which I expect users might want to do sometimes.

That is a separate problem, and adding one more buffer-local variable
will hardly change the fact that let-binding and/or temporarily
switching buffers is expensive.  We should think about correctness
before we think about performance.  And correctness requires that this
variable be buffer-local, as making it global makes no sense IMO.





  reply	other threads:[~2023-10-19  4:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-18 16:32 bug#66614: 29.1.50; Support not capitalizing words inside symbols Spencer Baugh
2023-10-18 17:01 ` Spencer Baugh
2023-10-18 18:24   ` Eli Zaretskii
2023-10-18 18:55     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-18 18:34   ` Eli Zaretskii
2023-10-18 19:38     ` Spencer Baugh
2023-10-19  4:35       ` Eli Zaretskii [this message]
2023-10-21 15:11         ` sbaugh
2023-10-29 11:42           ` Eli Zaretskii
2023-10-19 10:54       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-21 15:13         ` sbaugh

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=83zg0fmdpm.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=66614@debbugs.gnu.org \
    --cc=sbaugh@janestreet.com \
    /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 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).