GNU bug report logs - #66614
29.1.50; Support not capitalizing words inside symbols

Previous Next

Package: emacs;

Reported by: Spencer Baugh <sbaugh <at> janestreet.com>

Date: Wed, 18 Oct 2023 16:33:02 UTC

Severity: normal

Found in version 29.1.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Spencer Baugh <sbaugh <at> janestreet.com>
Cc: 66614 <at> debbugs.gnu.org
Subject: bug#66614: 29.1.50; Support not capitalizing words inside symbols
Date: Thu, 19 Oct 2023 07:35:33 +0300
> From: Spencer Baugh <sbaugh <at> janestreet.com>
> Cc: 66614 <at> 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.




This bug report was last modified 1 year and 206 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.