unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: master 45a1653: ; Fix last change to bibtex.el
       [not found] ` <20201116233110.4E83E209DE@vcs0.savannah.gnu.org>
@ 2020-11-18  1:42   ` Glenn Morris
  2020-11-18  4:19     ` Roland Winkler
  2020-11-18 11:47     ` Basil L. Contovounesios
  0 siblings, 2 replies; 20+ messages in thread
From: Glenn Morris @ 2020-11-18  1:42 UTC (permalink / raw)
  To: emacs-devel; +Cc: Basil L. Contovounesios


> commit 45a1653afa8eb0032908bc94b5466604f84805d5

> diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el
> index b69d715..d53cfa0 100644
> --- a/lisp/textmodes/bibtex.el
> +++ b/lisp/textmodes/bibtex.el

[...]

> -		 (function :tag "Conversion function")))
> -(make-variable-buffer-local 'bibtex-unify-case-convert)
> +                 (function :tag "Conversion function"))
> +  :local t)

After this change:

bibtex-unify-case-convert:
  Its value is nil
  Original value was ‘identity’

The "nil" value causes a test failure: https://hydra.nixos.org/build/130666989

(Perhaps defcustom's recently added :local feature, of which this is the
only user, is broken.)



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

* Re: master 45a1653: ; Fix last change to bibtex.el
  2020-11-18  1:42   ` master 45a1653: ; Fix last change to bibtex.el Glenn Morris
@ 2020-11-18  4:19     ` Roland Winkler
  2020-11-18 12:30       ` Basil L. Contovounesios
  2020-11-18 11:47     ` Basil L. Contovounesios
  1 sibling, 1 reply; 20+ messages in thread
From: Roland Winkler @ 2020-11-18  4:19 UTC (permalink / raw)
  To: Glenn Morris; +Cc: Basil L. Contovounesios, emacs-devel

On Tue, Nov 17 2020, Glenn Morris wrote:
>> -		 (function :tag "Conversion function")))
>> -(make-variable-buffer-local 'bibtex-unify-case-convert)
>> +                 (function :tag "Conversion function"))
>> +  :local t)
>
> After this change:
>
> bibtex-unify-case-convert:
>   Its value is nil
>   Original value was ‘identity’
>
> The "nil" value causes a test failure: https://hydra.nixos.org/build/130666989
>
> (Perhaps defcustom's recently added :local feature, of which this is the
> only user, is broken.)

Why local at all by default?  All other BibTeX customizations by default
apply to all BibTeX buffers.



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

* Re: master 45a1653: ; Fix last change to bibtex.el
  2020-11-18  1:42   ` master 45a1653: ; Fix last change to bibtex.el Glenn Morris
  2020-11-18  4:19     ` Roland Winkler
@ 2020-11-18 11:47     ` Basil L. Contovounesios
  2020-11-18 16:18       ` Basil L. Contovounesios
  1 sibling, 1 reply; 20+ messages in thread
From: Basil L. Contovounesios @ 2020-11-18 11:47 UTC (permalink / raw)
  To: Glenn Morris; +Cc: emacs-devel

Glenn Morris <rgm@gnu.org> writes:

>> commit 45a1653afa8eb0032908bc94b5466604f84805d5
>
>> diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el
>> index b69d715..d53cfa0 100644
>> --- a/lisp/textmodes/bibtex.el
>> +++ b/lisp/textmodes/bibtex.el
>
> [...]
>
>> -		 (function :tag "Conversion function")))
>> -(make-variable-buffer-local 'bibtex-unify-case-convert)
>> +                 (function :tag "Conversion function"))
>> +  :local t)
>
> After this change:
>
> bibtex-unify-case-convert:
>   Its value is nil
>   Original value was ‘identity’
>
> The "nil" value causes a test failure: https://hydra.nixos.org/build/130666989
>
> (Perhaps defcustom's recently added :local feature, of which this is the
> only user, is broken.)

Right.  I'll remove the :local for now, as per Roland's suggestion, and
see if I can get the tag working as intended later.

Thanks,

-- 
Basil



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

* Re: master 45a1653: ; Fix last change to bibtex.el
  2020-11-18  4:19     ` Roland Winkler
@ 2020-11-18 12:30       ` Basil L. Contovounesios
  2020-11-18 14:13         ` Roland Winkler
  0 siblings, 1 reply; 20+ messages in thread
From: Basil L. Contovounesios @ 2020-11-18 12:30 UTC (permalink / raw)
  To: Roland Winkler; +Cc: Glenn Morris, Francesco Potortì, emacs-devel

Roland Winkler <winkler@gnu.org> writes:

> On Tue, Nov 17 2020, Glenn Morris wrote:
>>> -		 (function :tag "Conversion function")))
>>> -(make-variable-buffer-local 'bibtex-unify-case-convert)
>>> +                 (function :tag "Conversion function"))
>>> +  :local t)
>>
>> After this change:
>>
>> bibtex-unify-case-convert:
>>   Its value is nil
>>   Original value was ‘identity’
>>
>> The "nil" value causes a test failure: https://hydra.nixos.org/build/130666989
>>
>> (Perhaps defcustom's recently added :local feature, of which this is the
>> only user, is broken.)
>
> Why local at all by default?  All other BibTeX customizations by default
> apply to all BibTeX buffers.

Good point.  I've now reverted it.

Don't make bibtex-unify-case-convert buffer-local
88d5b1d325 2020-11-18 11:47:54 +0000
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=88d5b1d3253728bd314de36544996aa15345bd29

Thanks,

-- 
Basil



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

* Re: master 45a1653: ; Fix last change to bibtex.el
  2020-11-18 12:30       ` Basil L. Contovounesios
@ 2020-11-18 14:13         ` Roland Winkler
  2020-11-18 14:36           ` Roland Winkler
  2020-11-18 16:35           ` Basil L. Contovounesios
  0 siblings, 2 replies; 20+ messages in thread
From: Roland Winkler @ 2020-11-18 14:13 UTC (permalink / raw)
  To: Basil L. Contovounesios
  Cc: Glenn Morris, Francesco Potort�=AC, emacs-devel

On Wed Nov 18 2020 Basil L. Contovounesios wrote:
> > Why local at all by default?  All other BibTeX customizations by
> > default apply to all BibTeX buffers.
> 
> Good point.  I've now reverted it.

Thinking once more about this I am not sure this is the best
approach in the first place.  The way bibtex-unify-case-convert is
defined now as a function, it should get a :rsiky tag, it should not
be used as a file-local variable.  On the other hand, the most
common scenario I can think of for situations, where one wants to
have buffer-local values for bibtex-unify-case-convert is via
file-local settings.  So I think it makes more sense that
bibtex-unify-case-convert should be one of the symbols identity,
downcase, capitalize or upcase.  And these symbols are allowed as
buffer-local variables.  (I cannot think of a useful scenario beyond
this that would justify a user-defined function.  Am I missing
something?)

From a different perspective, if bibtex-unify-case-convert was a
variable holding a function name, the variable name should be
something like bibtex-unify-case-convert-function.



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

* Re: master 45a1653: ; Fix last change to bibtex.el
  2020-11-18 14:13         ` Roland Winkler
@ 2020-11-18 14:36           ` Roland Winkler
  2020-11-18 16:35           ` Basil L. Contovounesios
  1 sibling, 0 replies; 20+ messages in thread
From: Roland Winkler @ 2020-11-18 14:36 UTC (permalink / raw)
  To: Basil L. Contovounesios, Francesco Potort�=AC,
	Glenn Morris, emacs-devel

On Wed Nov 18 2020 Roland Winkler wrote:
> From a different perspective, if bibtex-unify-case-convert was a
> variable holding a function name, the variable name should be
> something like bibtex-unify-case-convert-function.

...and `bibtex-unify-case-convert-...' is tautologous.
I vote for bibtex-unify-case-...'



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

* Re: master 45a1653: ; Fix last change to bibtex.el
  2020-11-18 11:47     ` Basil L. Contovounesios
@ 2020-11-18 16:18       ` Basil L. Contovounesios
  2020-11-24  6:31         ` Lars Ingebrigtsen
  0 siblings, 1 reply; 20+ messages in thread
From: Basil L. Contovounesios @ 2020-11-18 16:18 UTC (permalink / raw)
  To: Glenn Morris; +Cc: emacs-devel

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

"Basil L. Contovounesios" <contovob@tcd.ie> writes:

> Glenn Morris <rgm@gnu.org> writes:
>
>>> commit 45a1653afa8eb0032908bc94b5466604f84805d5
>>
>>> diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el
>>> index b69d715..d53cfa0 100644
>>> --- a/lisp/textmodes/bibtex.el
>>> +++ b/lisp/textmodes/bibtex.el
>>
>> [...]
>>
>>> -		 (function :tag "Conversion function")))
>>> -(make-variable-buffer-local 'bibtex-unify-case-convert)
>>> +                 (function :tag "Conversion function"))
>>> +  :local t)
>>
>> After this change:
>>
>> bibtex-unify-case-convert:
>>   Its value is nil
>>   Original value was ‘identity’
>>
>> The "nil" value causes a test failure: https://hydra.nixos.org/build/130666989
>>
>> (Perhaps defcustom's recently added :local feature, of which this is the
>> only user, is broken.)
>
> Right.  I'll remove the :local for now, as per Roland's suggestion, and
> see if I can get the tag working as intended later.

How's the attached fix?

Eli, Lars: since :local is new in Emacs 27, can this patch be applied to
emacs-27?

Thanks,

-- 
Basil


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-handling-of-defcustom-local-tag.patch --]
[-- Type: text/x-diff, Size: 4252 bytes --]

From b7dc7517bdef46a080b3ca9b7ac8c2f34065da3d Mon Sep 17 00:00:00 2001
From: "Basil L. Contovounesios" <contovob@tcd.ie>
Date: Wed, 18 Nov 2020 12:53:03 +0000
Subject: [PATCH] Fix handling of defcustom :local tag

For discussion, see the following emacs-devel thread:
https://lists.gnu.org/r/emacs-devel/2020-11/msg00734.html

* lisp/custom.el (custom-declare-variable): Delay call to
make-variable-buffer-local until after user option has been
initialized with a value.  Otherwise the user option may be
initialized to nil.
* test/lisp/custom-tests.el (custom--test-local-option)
(custom--test-permanent-option): New :local user options.
(custom-test-local-option): New test for defcustom :local keyword.
---
 lisp/custom.el            | 10 +++++++---
 test/lisp/custom-tests.el | 38 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 45 insertions(+), 3 deletions(-)

diff --git a/lisp/custom.el b/lisp/custom.el
index 885c486c5e..cdfd221216 100644
--- a/lisp/custom.el
+++ b/lisp/custom.el
@@ -157,7 +157,9 @@ custom-declare-variable
   (if (keywordp doc)
       (error "Doc string is missing"))
   (let ((initialize #'custom-initialize-reset)
-	(requests nil))
+        (requests nil)
+        ;; Whether automatically buffer-local.
+        buffer-local)
     (unless (memq :group args)
       (custom-add-to-group (custom-current-group) symbol 'custom-variable))
     (while args
@@ -183,7 +185,7 @@ custom-declare-variable
 		 (put symbol 'safe-local-variable value))
                 ((eq keyword :local)
                  (when (memq value '(t permanent))
-                   (make-variable-buffer-local symbol))
+                   (setq buffer-local t))
                  (when (eq value 'permanent)
                    (put symbol 'permanent-local t)))
 		((eq keyword :type)
@@ -205,7 +207,9 @@ custom-declare-variable
     (put symbol 'custom-requests requests)
     ;; Do the actual initialization.
     (unless custom-dont-initialize
-      (funcall initialize symbol default)))
+      (funcall initialize symbol default))
+    (when buffer-local
+      (make-variable-buffer-local symbol)))
   (run-hooks 'custom-define-hook)
   symbol)
 
diff --git a/test/lisp/custom-tests.el b/test/lisp/custom-tests.el
index 766e484498..e71b7913f0 100644
--- a/test/lisp/custom-tests.el
+++ b/test/lisp/custom-tests.el
@@ -151,4 +151,42 @@ custom-test-show-comment-preserves-changes
                                (widget-apply field :value-to-internal origvalue)
                                "bar"))))))
 
+(defcustom custom--test-local-option 'initial
+  "Buffer-local user option for testing."
+  :group 'emacs
+  :type '(choice (const initial) (const changed))
+  :local t)
+
+(defcustom custom--test-permanent-option 'initial
+  "Permanently local user option for testing."
+  :group 'emacs
+  :type '(choice (const initial) (const changed))
+  :local 'permanent)
+
+(ert-deftest custom-test-local-option ()
+  "Test :local user options."
+  ;; Initial default values.
+  (should (eq custom--test-local-option 'initial))
+  (should (eq custom--test-permanent-option 'initial))
+  (should (eq (default-value 'custom--test-local-option) 'initial))
+  (should (eq (default-value 'custom--test-permanent-option) 'initial))
+  (let ((obuf (current-buffer)))
+    (with-temp-buffer
+      ;; Changed buffer-local values.
+      (setq custom--test-local-option 'changed)
+      (setq custom--test-permanent-option 'changed)
+      (should (eq custom--test-local-option 'changed))
+      (should (eq custom--test-permanent-option 'changed))
+      (should (eq (default-value 'custom--test-local-option) 'initial))
+      (should (eq (default-value 'custom--test-permanent-option) 'initial))
+      (with-current-buffer obuf
+        (should (eq custom--test-local-option 'initial))
+        (should (eq custom--test-permanent-option 'initial)))
+      ;; Permanent variable remains unchanged.
+      (kill-all-local-variables)
+      (should (eq custom--test-local-option 'initial))
+      (should (eq custom--test-permanent-option 'changed))
+      (should (eq (default-value 'custom--test-local-option) 'initial))
+      (should (eq (default-value 'custom--test-permanent-option) 'initial)))))
+
 ;;; custom-tests.el ends here
-- 
2.29.2


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

* Re: master 45a1653: ; Fix last change to bibtex.el
  2020-11-18 14:13         ` Roland Winkler
  2020-11-18 14:36           ` Roland Winkler
@ 2020-11-18 16:35           ` Basil L. Contovounesios
  2020-11-18 17:11             ` Roland Winkler
  1 sibling, 1 reply; 20+ messages in thread
From: Basil L. Contovounesios @ 2020-11-18 16:35 UTC (permalink / raw)
  To: Roland Winkler; +Cc: Glenn Morris, Francesco Potortì, emacs-devel

"Roland Winkler" <winkler@gnu.org> writes:

> Thinking once more about this I am not sure this is the best
> approach in the first place.  The way bibtex-unify-case-convert is
> defined now as a function, it should get a :rsiky tag, it should not
> be used as a file-local variable.  On the other hand, the most
> common scenario I can think of for situations, where one wants to
> have buffer-local values for bibtex-unify-case-convert is via
> file-local settings.  So I think it makes more sense that
> bibtex-unify-case-convert should be one of the symbols identity,
> downcase, capitalize or upcase.  And these symbols are allowed as
> buffer-local variables.  (I cannot think of a useful scenario beyond
> this that would justify a user-defined function.  Am I missing
> something?)
>
> From a different perspective, if bibtex-unify-case-convert was a
> variable holding a function name, the variable name should be
> something like bibtex-unify-case-convert-function.

Instead of marking the user option as :risky, why not give it a :safe
predicate that checks whether it's one of the predefined values?

That way it can safely be set to identity, downcase, etc. whilst
disallowing arbitrary functions in a file-local context.  Or am I
misunderstanding something?

Thanks,

-- 
Basil



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

* Re: master 45a1653: ; Fix last change to bibtex.el
  2020-11-18 16:35           ` Basil L. Contovounesios
@ 2020-11-18 17:11             ` Roland Winkler
  2020-11-18 21:31               ` Stefan Monnier
  2020-11-19  5:23               ` Richard Stallman
  0 siblings, 2 replies; 20+ messages in thread
From: Roland Winkler @ 2020-11-18 17:11 UTC (permalink / raw)
  To: Basil L. Contovounesios
  Cc: Glenn Morris, Francesco Potort�=AC, emacs-devel

On Wed Nov 18 2020 Basil L. Contovounesios wrote:
> > From a different perspective, if bibtex-unify-case-convert was a
> > variable holding a function name, the variable name should be
> > something like bibtex-unify-case-convert-function.
> 
> Instead of marking the user option as :risky, why not give it a :safe
> predicate that checks whether it's one of the predefined values?

I believe the philosophy is "better safe than sorry".
See the elisp section on file-local variables:

  In addition, any variable whose name ends in any of
  ‘-command’, ‘-frame-alist’, ‘-function’, ‘-functions’, ‘-hook’,
  ‘-hooks’, ‘-form’, ‘-forms’, ‘-map’, ‘-map-alist’, ‘-mode-alist’,
  ‘-program’, or ‘-predicate’ is automatically considered risky.

The problem is really about allowing user-defined functions.  If one
excludes user-defined functions and allows only predefined
functions, the entire 'funcall ...-function' thing is not needed,
that is, the variable can hold a symbol that triggers a hard-coded call
of a predefined function.



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

* Re: master 45a1653: ; Fix last change to bibtex.el
  2020-11-18 17:11             ` Roland Winkler
@ 2020-11-18 21:31               ` Stefan Monnier
  2020-11-18 21:56                 ` Roland Winkler
  2020-11-19  5:23               ` Richard Stallman
  1 sibling, 1 reply; 20+ messages in thread
From: Stefan Monnier @ 2020-11-18 21:31 UTC (permalink / raw)
  To: Roland Winkler
  Cc: Basil L. Contovounesios, Glenn Morris, Francesco Potort=AC,
	emacs-devel

> The problem is really about allowing user-defined functions.  If one
> excludes user-defined functions and allows only predefined
> functions, the entire 'funcall ...-function' thing is not needed,
> that is, the variable can hold a symbol that triggers a hard-coded call
> of a predefined function.

I don't understand the "the entire ...".  AFAICT the replacement would
be bigger.  So the use of (funcall ...-function) is really a way to make
the code simpler, and it just happens to come with the side benefit of
being also more flexible.

And indeed with the :safe keyword you can specify a number of value that
can be assumed to be safe, while any other value will be raise alarms.


        Stefan




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

* Re: master 45a1653: ; Fix last change to bibtex.el
  2020-11-18 21:31               ` Stefan Monnier
@ 2020-11-18 21:56                 ` Roland Winkler
  2020-11-28 22:32                   ` Roland Winkler
  0 siblings, 1 reply; 20+ messages in thread
From: Roland Winkler @ 2020-11-18 21:56 UTC (permalink / raw)
  To: Stefan Monnier
  Cc: Basil L. Contovounesios, Glenn Morris, Francesco Potort=AC,
	emacs-devel

On Wed Nov 18 2020 Stefan Monnier wrote:
> And indeed with the :safe keyword you can specify a number of
> value that can be assumed to be safe, while any other value will
> be raise alarms.

Thanks, I am always happy to learn new things.  I'll try it out and
send a patch.



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

* Re: master 45a1653: ; Fix last change to bibtex.el
  2020-11-18 17:11             ` Roland Winkler
  2020-11-18 21:31               ` Stefan Monnier
@ 2020-11-19  5:23               ` Richard Stallman
  2020-11-19  8:25                 ` Roland Winkler
  1 sibling, 1 reply; 20+ messages in thread
From: Richard Stallman @ 2020-11-19  5:23 UTC (permalink / raw)
  To: Roland Winkler; +Cc: contovob, rgm, pot, emacs-devel

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > The problem is really about allowing user-defined functions.  If one
  > excludes user-defined functions and allows only predefined
  > functions,

Does "predefined functions" mean "functions standardly defined in Emacs Lisp",
"functions already defined in Emacs Lisp," or "specific functions expected
to be used this way"?

-- 
Dr Richard Stallman
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)





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

* Re: master 45a1653: ; Fix last change to bibtex.el
  2020-11-19  5:23               ` Richard Stallman
@ 2020-11-19  8:25                 ` Roland Winkler
  0 siblings, 0 replies; 20+ messages in thread
From: Roland Winkler @ 2020-11-19  8:25 UTC (permalink / raw)
  To: rms; +Cc: contovob, rgm, pot, emacs-devel

On Thu Nov 19 2020 Richard Stallman wrote:
>   > The problem is really about allowing user-defined functions.  If one
>   > excludes user-defined functions and allows only predefined
>   > functions,
> 
> Does "predefined functions" mean "functions standardly defined in Emacs Lisp",
> "functions already defined in Emacs Lisp," or "specific functions expected
> to be used this way"?

I wanted to refer to "functions standardly defined in Emacs Lisp"
(available via emacs -q).  In the context of customizing bibtex-mode
via file-local variables, to the best of my knowledge these functions
can be assumed to be safe.



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

* Re: master 45a1653: ; Fix last change to bibtex.el
  2020-11-18 16:18       ` Basil L. Contovounesios
@ 2020-11-24  6:31         ` Lars Ingebrigtsen
  2020-11-24 15:35           ` Eli Zaretskii
  0 siblings, 1 reply; 20+ messages in thread
From: Lars Ingebrigtsen @ 2020-11-24  6:31 UTC (permalink / raw)
  To: Basil L. Contovounesios; +Cc: Glenn Morris, emacs-devel

"Basil L. Contovounesios" <contovob@tcd.ie> writes:

> Eli, Lars: since :local is new in Emacs 27, can this patch be applied to
> emacs-27?

Yes, looks good to me (especially since there's no usages of :local in
Emacs 27, I think?)

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



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

* Re: master 45a1653: ; Fix last change to bibtex.el
  2020-11-24  6:31         ` Lars Ingebrigtsen
@ 2020-11-24 15:35           ` Eli Zaretskii
  2020-11-24 19:26             ` Basil L. Contovounesios
  0 siblings, 1 reply; 20+ messages in thread
From: Eli Zaretskii @ 2020-11-24 15:35 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: contovob, rgm, emacs-devel

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Date: Tue, 24 Nov 2020 07:31:12 +0100
> Cc: Glenn Morris <rgm@gnu.org>, emacs-devel@gnu.org
> 
> "Basil L. Contovounesios" <contovob@tcd.ie> writes:
> 
> > Eli, Lars: since :local is new in Emacs 27, can this patch be applied to
> > emacs-27?
> 
> Yes, looks good to me (especially since there's no usages of :local in
> Emacs 27, I think?)

Sorry for failing to respond in time: I'm also okay with this change.

Thanks.



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

* Re: master 45a1653: ; Fix last change to bibtex.el
  2020-11-24 15:35           ` Eli Zaretskii
@ 2020-11-24 19:26             ` Basil L. Contovounesios
  2020-11-24 19:58               ` Eli Zaretskii
  0 siblings, 1 reply; 20+ messages in thread
From: Basil L. Contovounesios @ 2020-11-24 19:26 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: rgm, Lars Ingebrigtsen, emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Lars Ingebrigtsen <larsi@gnus.org>
>> Date: Tue, 24 Nov 2020 07:31:12 +0100
>> Cc: Glenn Morris <rgm@gnu.org>, emacs-devel@gnu.org
>> 
>> "Basil L. Contovounesios" <contovob@tcd.ie> writes:
>> 
>> > Eli, Lars: since :local is new in Emacs 27, can this patch be applied to
>> > emacs-27?
>> 
>> Yes, looks good to me (especially since there's no usages of :local in
>> Emacs 27, I think?)
>
> Sorry for failing to respond in time: I'm also okay with this change.

No need to apologise.  (I was going to submit a bug report so this
wouldn't slip through the cracks anyway, but Lars beat me to it.)

Now pushed to emacs-27:

Fix handling of defcustom :local tag
dea3d6aa18 2020-11-24 16:50:37 +0000
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=dea3d6aa18e54f0d8d75cd219b511bac5b3c87b1

Thanks,

-- 
Basil



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

* Re: master 45a1653: ; Fix last change to bibtex.el
  2020-11-24 19:26             ` Basil L. Contovounesios
@ 2020-11-24 19:58               ` Eli Zaretskii
  2020-11-24 20:25                 ` Eli Zaretskii
  0 siblings, 1 reply; 20+ messages in thread
From: Eli Zaretskii @ 2020-11-24 19:58 UTC (permalink / raw)
  To: Basil L. Contovounesios; +Cc: rgm, larsi, emacs-devel

> From: "Basil L. Contovounesios" <contovob@tcd.ie>
> Cc: Lars Ingebrigtsen <larsi@gnus.org>,  rgm@gnu.org,  emacs-devel@gnu.org
> Date: Tue, 24 Nov 2020 19:26:35 +0000
> 
> Now pushed to emacs-27:
> 
> Fix handling of defcustom :local tag
> dea3d6aa18 2020-11-24 16:50:37 +0000
> https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=dea3d6aa18e54f0d8d75cd219b511bac5b3c87b1

Thanks, but this causes a crash when building Emacs.  The command that
crashes is this:

  EMACSLOADPATH= '../src/bootstrap-emacs.exe' -batch --no-site-file --no-site-lisp --eval '(setq load-prefer-newer t)'  \
	  -l bytecomp -f byte-compile-refresh-preloaded \
	  -f batch-byte-compile ../lisp/custom.el

It prints:

  Reloading stale custom.el
  Loading d:/gnu/git/emacs/branch/lisp/custom.el (source)...
  Reloading stale loaddefs.el
  Loading d:/gnu/git/emacs/branch/lisp/loaddefs.el (source)...

and then segfaults inside GC.  Here's the backtrace from the segfault:

  Thread 1 received signal SIGSEGV, Segmentation fault.
  [Switching to Thread 7556.0x26d4]
  0x0130555f in symbol_marked_p (s=0x81ba9ec2) at alloc.c:3792
  3792        : s->u.s.gcmarkbit;
  (gdb) p s
  $1 = (const struct Lisp_Symbol *) 0x81ba9ec2
  (gdb) p *s
  Cannot access memory at address 0x81ba9ec2
  (gdb) bt
  #0  0x0130555f in symbol_marked_p (s=0x81ba9ec2) at alloc.c:3792
  #1  0x0130ac7f in mark_object (arg=XIL(0x80000002)) at alloc.c:6570
  #2  0x01309f92 in mark_vectorlike (header=0x6975158) at alloc.c:6152
  #3  0x0130ac54 in mark_object (arg=XIL(0xa000000006975158)) at alloc.c:6561
  #4  0x01309f92 in mark_vectorlike (header=0x63d5628) at alloc.c:6152
  #5  0x0130a82a in mark_hash_table (ptr=0x63d5628) at alloc.c:6352
  #6  0x0130abdf in mark_object (arg=XIL(0xa0000000063d5628)) at alloc.c:6530
  #7  0x01309f92 in mark_vectorlike (header=0x5ff5c28) at alloc.c:6152
  #8  0x0130ac54 in mark_object (arg=XIL(0xa000000005ff5bf8)) at alloc.c:6561
  #9  0x01306819 in mark_maybe_pointer (p=0x5ff5bf8) at alloc.c:4604
  #10 0x013069e2 in mark_memory (start=0x823678, end=0x82fea4) at alloc.c:4712
  #11 0x01306a28 in mark_stack (bottom=0x82fea4 "≡\376ג",
      end=0x823678 "\230\066ג") at alloc.c:4924
  #12 0x014d955f in mark_one_thread (thread=0x1940000 <main_thread>)
      at thread.c:630
  #13 0x014d9694 in mark_threads_callback (ignore=0x0) at thread.c:661
  #14 0x01306a55 in flush_stack_call_func (
      func=0x14d9616 <mark_threads_callback>, arg=0x0) at alloc.c:4951
  #15 0x014d96c4 in mark_threads () at thread.c:668
  #16 0x01309429 in garbage_collect () at alloc.c:5941
  #17 0x013091b3 in maybe_garbage_collect () at alloc.c:5847
  #18 0x0136930a in maybe_gc () at lisp.h:5065
  #19 0x013770f4 in Ffuncall (nargs=6, args=0x8238b8) at eval.c:2779
  #20 0x0141790b in exec_byte_code (bytestr=XIL(0x8000000006915cc0),
      vector=XIL(0xa000000006974210), maxdepth=make_fixnum(39),
      args_template=make_fixnum(771), nargs=3, args=0x824530) at bytecode.c:633
  #21 0x01378299 in funcall_lambda (fun=XIL(0xa000000006974470), nargs=3,
      arg_vector=0x824518) at eval.c:2990
  #22 0x01377259 in Ffuncall (nargs=4, args=0x824510) at eval.c:2797
  #23 0x0141790b in exec_byte_code (bytestr=XIL(0x8000000006915ca0),
      vector=XIL(0xa000000006a87ad0), maxdepth=make_fixnum(5),
      args_template=make_fixnum(257), nargs=1, args=0x824a80) at bytecode.c:633
  #24 0x01378299 in funcall_lambda (fun=XIL(0xa000000006a87af0), nargs=1,
      arg_vector=0x824a78) at eval.c:2990
  #25 0x01377259 in Ffuncall (nargs=2, args=0x824a70) at eval.c:2797
  #26 0x0137652b in call1 (fn=XIL(0xa000000006a87af0),
      arg1=XIL(0x8000000006a6c7a0)) at eval.c:2655
  #27 0x01395c3d in mapcar1 (leni=2, vals=0x824b40, fn=XIL(0xa000000006a87af0),
      seq=XIL(0xc000000006ee1d70)) at fns.c:2671
  #28 0x013962bc in Fmapcar (function=XIL(0xa000000006a87af0),
      sequence=XIL(0xc000000006ee1d70)) at fns.c:2727
  #29 0x013777a4 in funcall_subr (subr=0x1949720 <Smapcar>, numargs=2,
      args=0x824dd0) at eval.c:2870
  #30 0x013771ff in Ffuncall (nargs=3, args=0x824dc8) at eval.c:2795
  #31 0x0141790b in exec_byte_code (bytestr=XIL(0x8000000006915c90),
      vector=XIL(0xa0000000069734a8), maxdepth=make_fixnum(13),
      args_template=make_fixnum(1028), nargs=4, args=0x825440) at bytecode.c:633
  #32 0x01378299 in funcall_lambda (fun=XIL(0xa000000006973538), nargs=4,
      arg_vector=0x825420) at eval.c:2990
  #33 0x01377259 in Ffuncall (nargs=5, args=0x825418) at eval.c:2797
  #34 0x0141790b in exec_byte_code (bytestr=XIL(0x80000000069157a0),
      vector=XIL(0xa0000000069732f8), maxdepth=make_fixnum(23),
      args_template=make_fixnum(1284), nargs=5, args=0x825b70) at bytecode.c:633
  #35 0x01378299 in funcall_lambda (fun=XIL(0xa000000006973368), nargs=5,
      arg_vector=0x825b48) at eval.c:2990
  #36 0x01377259 in Ffuncall (nargs=6, args=0x825b40) at eval.c:2797
  #37 0x0141790b in exec_byte_code (bytestr=XIL(0x8000000006915cc0),
      vector=XIL(0xa000000006974210), maxdepth=make_fixnum(39),
      args_template=make_fixnum(771), nargs=3, args=0x826750) at bytecode.c:633
  #38 0x01378299 in funcall_lambda (fun=XIL(0xa000000006974470), nargs=3,
      arg_vector=0x826738) at eval.c:2990
  #39 0x01377259 in Ffuncall (nargs=4, args=0x826730) at eval.c:2797
  #40 0x0141790b in exec_byte_code (bytestr=XIL(0x8000000006915e50),
      vector=XIL(0xa000000006a879b0), maxdepth=make_fixnum(5),
      args_template=make_fixnum(257), nargs=1, args=0x826ca0) at bytecode.c:633
  #41 0x01378299 in funcall_lambda (fun=XIL(0xa000000006a879d0), nargs=1,
      arg_vector=0x826c98) at eval.c:2990
  #42 0x01377259 in Ffuncall (nargs=2, args=0x826c90) at eval.c:2797
  #43 0x0137652b in call1 (fn=XIL(0xa000000006a879d0),
      arg1=XIL(0xc000000006ee1dd0)) at eval.c:2655
  #44 0x01395c3d in mapcar1 (leni=2, vals=0x826d60, fn=XIL(0xa000000006a879d0),
      seq=XIL(0xc000000006ee1df0)) at fns.c:2671
  #45 0x013962bc in Fmapcar (function=XIL(0xa000000006a879d0),
      sequence=XIL(0xc000000006ee1df0)) at fns.c:2727
  #46 0x013777a4 in funcall_subr (subr=0x1949720 <Smapcar>, numargs=2,
      args=0x826fe8) at eval.c:2870
  #47 0x013771ff in Ffuncall (nargs=3, args=0x826fe0) at eval.c:2795
  #48 0x0141790b in exec_byte_code (bytestr=XIL(0x8000000006915e40),
      vector=XIL(0xa0000000069738b8), maxdepth=make_fixnum(13),
      args_template=make_fixnum(1028), nargs=4, args=0x827608) at bytecode.c:633
  #49 0x01378299 in funcall_lambda (fun=XIL(0xa000000006973908), nargs=4,
      arg_vector=0x8275e8) at eval.c:2990
  #50 0x01377259 in Ffuncall (nargs=5, args=0x8275e0) at eval.c:2797
  #51 0x0141790b in exec_byte_code (bytestr=XIL(0x8000000006915cc0),
      vector=XIL(0xa000000006974210), maxdepth=make_fixnum(39),
      args_template=make_fixnum(771), nargs=3, args=0x828230) at bytecode.c:633
  #52 0x01378299 in funcall_lambda (fun=XIL(0xa000000006974470), nargs=3,
      arg_vector=0x828218) at eval.c:2990
  #53 0x01377259 in Ffuncall (nargs=4, args=0x828210) at eval.c:2797
  #54 0x0141790b in exec_byte_code (bytestr=XIL(0x8000000006915e50),
      vector=XIL(0xa000000006a878e0), maxdepth=make_fixnum(5),
      args_template=make_fixnum(257), nargs=1, args=0x828780) at bytecode.c:633
  #55 0x01378299 in funcall_lambda (fun=XIL(0xa000000006a87900), nargs=1,
      arg_vector=0x828778) at eval.c:2990
  #56 0x01377259 in Ffuncall (nargs=2, args=0x828770) at eval.c:2797
  #57 0x0137652b in call1 (fn=XIL(0xa000000006a87900),
      arg1=XIL(0xc000000006ee1e00)) at eval.c:2655
  #58 0x01395c3d in mapcar1 (leni=2, vals=0x828840, fn=XIL(0xa000000006a87900),
      seq=XIL(0xc000000006ee1e80)) at fns.c:2671
  #59 0x013962bc in Fmapcar (function=XIL(0xa000000006a87900),
      sequence=XIL(0xc000000006ee1e80)) at fns.c:2727
  #60 0x013777a4 in funcall_subr (subr=0x1949720 <Smapcar>, numargs=2,
      args=0x828ac8) at eval.c:2870
  #61 0x013771ff in Ffuncall (nargs=3, args=0x828ac0) at eval.c:2795
  #62 0x0141790b in exec_byte_code (bytestr=XIL(0x8000000006915e40),
      vector=XIL(0xa0000000069738b8), maxdepth=make_fixnum(13),
      args_template=make_fixnum(1028), nargs=4, args=0x8290e8) at bytecode.c:633
  #63 0x01378299 in funcall_lambda (fun=XIL(0xa000000006973908), nargs=4,
      arg_vector=0x8290c8) at eval.c:2990
  #64 0x01377259 in Ffuncall (nargs=5, args=0x8290c0) at eval.c:2797
  #65 0x0141790b in exec_byte_code (bytestr=XIL(0x8000000006915cc0),
      vector=XIL(0xa000000006974210), maxdepth=make_fixnum(39),
      args_template=make_fixnum(771), nargs=3, args=0x829d10) at bytecode.c:633
  #66 0x01378299 in funcall_lambda (fun=XIL(0xa000000006974470), nargs=3,
      arg_vector=0x829cf8) at eval.c:2990
  #67 0x01377259 in Ffuncall (nargs=4, args=0x829cf0) at eval.c:2797
  #68 0x0141790b in exec_byte_code (bytestr=XIL(0x8000000006915660),
      vector=XIL(0xa000000006973070), maxdepth=make_fixnum(5),
      args_template=make_fixnum(257), nargs=1, args=0x82a288) at bytecode.c:633
  #69 0x01378299 in funcall_lambda (fun=XIL(0xa0000000069730f8), nargs=1,
      arg_vector=0x82a280) at eval.c:2990
  #70 0x01377259 in Ffuncall (nargs=2, args=0x82a278) at eval.c:2797
  #71 0x0141790b in exec_byte_code (bytestr=XIL(0x8000000006a5bfa0),
      vector=XIL(0xa000000006979ae8), maxdepth=make_fixnum(5),
      args_template=make_fixnum(513), nargs=2, args=0x82a810) at bytecode.c:633
  #72 0x01378299 in funcall_lambda (fun=XIL(0xa000000006979b28), nargs=2,
      arg_vector=0x82a800) at eval.c:2990
  #73 0x01377259 in Ffuncall (nargs=3, args=0x82a7f8) at eval.c:2797
  #74 0x0141790b in exec_byte_code (bytestr=XIL(0x8000000006a5bfc0),
      vector=XIL(0xa000000006979b58), maxdepth=make_fixnum(5),
      args_template=make_fixnum(257), nargs=1, args=0x82ad78) at bytecode.c:633
  #75 0x01378299 in funcall_lambda (fun=XIL(0xa000000006979b88), nargs=1,
      arg_vector=0x82ad70) at eval.c:2990
  #76 0x01377259 in Ffuncall (nargs=2, args=0x82ad68) at eval.c:2797
  #77 0x0141790b in exec_byte_code (bytestr=XIL(0x80000000069170d8),
      vector=XIL(0xa000000006975a48), maxdepth=make_fixnum(10),
      args_template=make_fixnum(514), nargs=2, args=0x82b328) at bytecode.c:633
  #78 0x01378299 in funcall_lambda (fun=XIL(0xa000000006975ab8), nargs=2,
      arg_vector=0x82b318) at eval.c:2990
  #79 0x01377259 in Ffuncall (nargs=3, args=0x82b310) at eval.c:2797
  #80 0x0141790b in exec_byte_code (bytestr=XIL(0x8000000006a5bfb0),
      vector=XIL(0xa000000006979bb8), maxdepth=make_fixnum(4),
      args_template=make_fixnum(257), nargs=1, args=0x82b890) at bytecode.c:633
  #81 0x01378299 in funcall_lambda (fun=XIL(0xa000000006979bd8), nargs=1,
      arg_vector=0x82b888) at eval.c:2990
  #82 0x01377259 in Ffuncall (nargs=2, args=0x82b880) at eval.c:2797
  #83 0x0141790b in exec_byte_code (bytestr=XIL(0x8000000006a5bb88),
      vector=XIL(0xa000000006979168), maxdepth=make_fixnum(7),
      args_template=make_fixnum(257), nargs=1, args=0x82be60) at bytecode.c:633
  #84 0x01378299 in funcall_lambda (fun=XIL(0xa000000006979218), nargs=1,
      arg_vector=0x82be58) at eval.c:2990
  #85 0x01377259 in Ffuncall (nargs=2, args=0x82be50) at eval.c:2797
  #86 0x0141790b in exec_byte_code (bytestr=XIL(0x8000000006a5bb58),
      vector=XIL(0xa000000006979248), maxdepth=make_fixnum(17),
      args_template=make_fixnum(257), nargs=1, args=0x82c548) at bytecode.c:633
  #87 0x01378299 in funcall_lambda (fun=XIL(0xa000000006979418), nargs=1,
      arg_vector=0x82c540) at eval.c:2990
  #88 0x01377259 in Ffuncall (nargs=2, args=0x82c538) at eval.c:2797
  #89 0x0141790b in exec_byte_code (bytestr=XIL(0x8000000006a5b9a8),
      vector=XIL(0xa000000006978c20), maxdepth=make_fixnum(18),
      args_template=make_fixnum(513), nargs=1, args=0x82ccd0) at bytecode.c:633
  #90 0x01378299 in funcall_lambda (fun=XIL(0xa000000006978f60), nargs=1,
      arg_vector=0x82ccc8) at eval.c:2990
  #91 0x01377259 in Ffuncall (nargs=2, args=0x82ccc0) at eval.c:2797
  #92 0x0141790b in exec_byte_code (bytestr=XIL(0x8000000006a5fd40),
      vector=XIL(0xa000000006a73540), maxdepth=make_fixnum(8),
      args_template=make_fixnum(257), nargs=1, args=0x82d2b8) at bytecode.c:633
  #93 0x01378299 in funcall_lambda (fun=XIL(0xa000000006a735c0), nargs=1,
      arg_vector=0x82d2b0) at eval.c:2990
  #94 0x01377259 in Ffuncall (nargs=2, args=0x82d2a8) at eval.c:2797
  #95 0x0141790b in exec_byte_code (bytestr=XIL(0x8000000006a5f8f0),
      vector=XIL(0xa000000006a71b80), maxdepth=make_fixnum(10),
      args_template=make_fixnum(256), nargs=0, args=0x82d938) at bytecode.c:633
  #96 0x01378299 in funcall_lambda (fun=XIL(0xa000000006a72c08), nargs=0,
      arg_vector=0x82d938) at eval.c:2990
  #97 0x01377259 in Ffuncall (nargs=1, args=0x82d930) at eval.c:2797
  #98 0x0141790b in exec_byte_code (bytestr=XIL(0x8000000006277c30),
      vector=XIL(0xa000000006276b48), maxdepth=make_fixnum(25),
      args_template=make_fixnum(257), nargs=1, args=0x82e358) at bytecode.c:633
  #99 0x01378299 in funcall_lambda (fun=XIL(0xa000000006276b18), nargs=1,
      arg_vector=0x82e350) at eval.c:2990
  #100 0x01377259 in Ffuncall (nargs=2, args=0x82e348) at eval.c:2797
  #101 0x0141790b in exec_byte_code (bytestr=XIL(0x800000000627b4c0),
      vector=XIL(0xa000000006277ea0), maxdepth=make_fixnum(14),
      args_template=make_fixnum(0), nargs=0, args=0x82ef78) at bytecode.c:633
  #102 0x01378299 in funcall_lambda (fun=XIL(0xa000000006277e70), nargs=0,
      arg_vector=0x82ef78) at eval.c:2990
  #103 0x01377259 in Ffuncall (nargs=1, args=0x82ef70) at eval.c:2797
  #104 0x0141790b in exec_byte_code (bytestr=XIL(0x800000000627bed0),
      vector=XIL(0xa00000000627b660), maxdepth=make_fixnum(12),
      args_template=make_fixnum(0), nargs=0, args=0x82f650) at bytecode.c:633
  #105 0x01378299 in funcall_lambda (fun=XIL(0xa00000000627b630), nargs=0,
      arg_vector=0x82f650) at eval.c:2990
  #106 0x01377df1 in apply_lambda (fun=XIL(0xa00000000627b630), args=XIL(0),
      count=4) at eval.c:2927
  #107 0x013752e9 in eval_sub (form=XIL(0xc0000000063c47a8)) at eval.c:2319
  #108 0x013741c9 in Feval (form=XIL(0xc0000000063c47a8), lexical=XIL(0))
      at eval.c:2103
  #109 0x011d9d25 in top_level_2 () at keyboard.c:1100
  #110 0x013717f9 in internal_condition_case (bfun=0x11d9cf2 <top_level_2>,
      handlers=XIL(0x90), hfun=0x11d94a3 <cmd_error>) at eval.c:1356
  #111 0x011d9d9f in top_level_1 (ignore=XIL(0)) at keyboard.c:1108
  #112 0x01370a06 in internal_catch (tag=XIL(0xdfb0),
      func=0x11d9d2b <top_level_1>, arg=XIL(0)) at eval.c:1117
  #113 0x011d9bf7 in command_loop () at keyboard.c:1069
  #114 0x011d8f33 in recursive_edit_1 () at keyboard.c:714
  #115 0x011d91a1 in Frecursive_edit () at keyboard.c:786
  #116 0x011cded9 in main (argc=13, argv=0xa44460) at emacs.c:2066

  Lisp Backtrace:
  "Automatic GC" (0x0)
  "make-byte-code" (0x8238c0)
  "cconv-convert" (0x824518)
  0x6a87af0 PVEC_COMPILED
  "mapcar" (0x824dd0)
  "cconv--convert-funcbody" (0x825420)
  "cconv--convert-function" (0x825b48)
  "cconv-convert" (0x826738)
  0x6a879d0 PVEC_COMPILED
  "mapcar" (0x826fe8)
  0x6973908 PVEC_COMPILED
  "cconv-convert" (0x828218)
  0x6a87900 PVEC_COMPILED
  "mapcar" (0x828ac8)
  0x6973908 PVEC_COMPILED
  "cconv-convert" (0x829cf8)
  "cconv-closure-convert" (0x82a280)
  "byte-compile-preprocess" (0x82a800)
  0x6979b88 PVEC_COMPILED
  "byte-compile-recurse-toplevel" (0x82b318)
  "byte-compile-toplevel-file-form" (0x82b888)
  0x6979218 PVEC_COMPILED
  "byte-compile-from-buffer" (0x82c540)
  "byte-compile-file" (0x82ccc8)
  "batch-byte-compile-file" (0x82d2b0)
  "batch-byte-compile" (0x82d938)
  "command-line-1" (0x82e350)
  "command-line" (0x82ef78)
  "normal-top-level" (0x82f650)
  (gdb)

Let me know if I can help you debug this.



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

* Re: master 45a1653: ; Fix last change to bibtex.el
  2020-11-24 19:58               ` Eli Zaretskii
@ 2020-11-24 20:25                 ` Eli Zaretskii
  2020-11-24 21:01                   ` Eli Zaretskii
  0 siblings, 1 reply; 20+ messages in thread
From: Eli Zaretskii @ 2020-11-24 20:25 UTC (permalink / raw)
  To: contovob; +Cc: rgm, larsi, emacs-devel

> Date: Tue, 24 Nov 2020 21:58:38 +0200
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: rgm@gnu.org, larsi@gnus.org, emacs-devel@gnu.org
> 
>   Thread 1 received signal SIGSEGV, Segmentation fault.
>   [Switching to Thread 7556.0x26d4]
>   0x0130555f in symbol_marked_p (s=0x81ba9ec2) at alloc.c:3792
>   3792        : s->u.s.gcmarkbit;
>   (gdb) p s
>   $1 = (const struct Lisp_Symbol *) 0x81ba9ec2
>   (gdb) p *s
>   Cannot access memory at address 0x81ba9ec2
>   (gdb) bt
>   #0  0x0130555f in symbol_marked_p (s=0x81ba9ec2) at alloc.c:3792
>   #1  0x0130ac7f in mark_object (arg=XIL(0x80000002)) at alloc.c:6570
>   #2  0x01309f92 in mark_vectorlike (header=0x6975158) at alloc.c:6152

Looks like some snafu with stack marking, perhaps specific to 32-bit
builds --with-wide-int.  It could be unrelated to the change which
triggers this, but the net result is that I cannot build the branch,
which is ... bad.



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

* Re: master 45a1653: ; Fix last change to bibtex.el
  2020-11-24 20:25                 ` Eli Zaretskii
@ 2020-11-24 21:01                   ` Eli Zaretskii
  0 siblings, 0 replies; 20+ messages in thread
From: Eli Zaretskii @ 2020-11-24 21:01 UTC (permalink / raw)
  To: contovob; +Cc: rgm, larsi, emacs-devel

> Date: Tue, 24 Nov 2020 22:25:08 +0200
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: rgm@gnu.org, larsi@gnus.org, emacs-devel@gnu.org
> 
> >   Thread 1 received signal SIGSEGV, Segmentation fault.
> >   [Switching to Thread 7556.0x26d4]
> >   0x0130555f in symbol_marked_p (s=0x81ba9ec2) at alloc.c:3792
> >   3792        : s->u.s.gcmarkbit;
> >   (gdb) p s
> >   $1 = (const struct Lisp_Symbol *) 0x81ba9ec2
> >   (gdb) p *s
> >   Cannot access memory at address 0x81ba9ec2
> >   (gdb) bt
> >   #0  0x0130555f in symbol_marked_p (s=0x81ba9ec2) at alloc.c:3792
> >   #1  0x0130ac7f in mark_object (arg=XIL(0x80000002)) at alloc.c:6570
> >   #2  0x01309f92 in mark_vectorlike (header=0x6975158) at alloc.c:6152
> 
> Looks like some snafu with stack marking, perhaps specific to 32-bit
> builds --with-wide-int.  It could be unrelated to the change which
> triggers this, but the net result is that I cannot build the branch,
> which is ... bad.

Reverting the last commit didn't help, so I forced a rebuild of
bootstrap-emacs and emacs, and the problem went away.  So let's forget
this for now.

Sorry for the noise.



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

* Re: master 45a1653: ; Fix last change to bibtex.el
  2020-11-18 21:56                 ` Roland Winkler
@ 2020-11-28 22:32                   ` Roland Winkler
  0 siblings, 0 replies; 20+ messages in thread
From: Roland Winkler @ 2020-11-28 22:32 UTC (permalink / raw)
  To: Stefan Monnier
  Cc: Basil L. Contovounesios, Glenn Morris, Francesco Potort=AC,
	emacs-devel

On Wed, Nov 18 2020, Roland Winkler wrote:
> On Wed Nov 18 2020 Stefan Monnier wrote:
>> And indeed with the :safe keyword you can specify a number of
>> value that can be assumed to be safe, while any other value will
>> be raise alarms.
>
> Thanks, I am always happy to learn new things.  I'll try it out and
> send a patch.

Unless anyone complains I'll apply the following patch.


diff --git a/etc/NEWS b/etc/NEWS
index 2fb33e3..7b4c767 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1349,7 +1349,7 @@ completions with more information in completion prefix and suffix.
 *** User option 'completions-format' supports a new value 'one-column'.
 
 ---
-*** New user option 'bibtex-unify-case-convert'.
+*** New user option 'bibtex-unify-case-function'.
 This new option allows the user to customize how case is converted
 when unifying entries.
 
diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el
index c9e21e5..001941f 100644
--- a/lisp/textmodes/bibtex.el
+++ b/lisp/textmodes/bibtex.el
@@ -88,16 +88,6 @@ bibtex-include-OPTkey
                  (const :tag "Default" t))
   :risky t)
 
-(defcustom bibtex-unify-case-convert #'identity
-  "Function called when unifying case on entry and field names.
-It is called with one argument, the entry or field name."
-  :version "28.1"
-  :type '(choice (const :tag "Same case as in `bibtex-field-alist'" identity)
-		 (const :tag "Downcase" downcase)
-		 (const :tag "Capitalize" capitalize)
-		 (const :tag "Upcase" upcase)
-                 (function :tag "Conversion function")))
-
 (defcustom bibtex-user-optional-fields
   '(("annote" "Personal annotation (ignored)"))
   "List of optional fields the user wants to have always present.
@@ -133,7 +123,7 @@ bibtex-entry-format
 delimiters          Change delimiters according to variables
                       `bibtex-field-delimiters' and `bibtex-entry-delimiters'.
 unify-case          Change case of entry and field names according to
-                      `bibtex-unify-case-convert'.
+                      `bibtex-unify-case-function'.
 braces              Enclose parts of field entries by braces according to
                       `bibtex-field-braces-alist'.
 strings             Replace parts of field entries by string constants
@@ -193,6 +183,17 @@ bibtex-field-strings-alist
                        (regexp :tag "From regexp")
                        (regexp :tag "To string constant"))))
 
+(defcustom bibtex-unify-case-function #'identity
+  "Function for unifying case of entry and field names.
+It is called with one argument, the entry or field name."
+  :version "28.1"
+  :type '(choice (const :tag "Same case as in `bibtex-field-alist'" identity)
+		 (const :tag "Downcase" downcase)
+		 (const :tag "Capitalize" capitalize)
+		 (const :tag "Upcase" upcase)
+                 (function :tag "Conversion function"))
+  :safe (lambda (x) (memq x '(upcase downcase capitalize identity))))
+
 (defcustom bibtex-clean-entry-hook nil
   "List of functions to call when entry has been cleaned.
 Functions are called with point inside the cleaned entry, and the buffer
@@ -2357,7 +2358,7 @@ bibtex-format-entry
                 ;; unify case of entry type
                 (when (memq 'unify-case format)
                   (delete-region beg-type end-type)
-                  (insert (funcall bibtex-unify-case-convert (car entry-list))))
+                  (insert (funcall bibtex-unify-case-function (car entry-list))))
 
                 ;; update left entry delimiter
                 (when (memq 'delimiters format)
@@ -2566,7 +2567,7 @@ bibtex-format-entry
 			    (curname (buffer-substring beg-name end-name)))
 			(delete-region beg-name end-name)
 			(goto-char beg-name)
-			(insert (funcall bibtex-unify-case-convert
+			(insert (funcall bibtex-unify-case-function
 					 (or fname curname)))))
 
                     ;; update point



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

end of thread, other threads:[~2020-11-28 22:32 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20201116233108.21940.22514@vcs0.savannah.gnu.org>
     [not found] ` <20201116233110.4E83E209DE@vcs0.savannah.gnu.org>
2020-11-18  1:42   ` master 45a1653: ; Fix last change to bibtex.el Glenn Morris
2020-11-18  4:19     ` Roland Winkler
2020-11-18 12:30       ` Basil L. Contovounesios
2020-11-18 14:13         ` Roland Winkler
2020-11-18 14:36           ` Roland Winkler
2020-11-18 16:35           ` Basil L. Contovounesios
2020-11-18 17:11             ` Roland Winkler
2020-11-18 21:31               ` Stefan Monnier
2020-11-18 21:56                 ` Roland Winkler
2020-11-28 22:32                   ` Roland Winkler
2020-11-19  5:23               ` Richard Stallman
2020-11-19  8:25                 ` Roland Winkler
2020-11-18 11:47     ` Basil L. Contovounesios
2020-11-18 16:18       ` Basil L. Contovounesios
2020-11-24  6:31         ` Lars Ingebrigtsen
2020-11-24 15:35           ` Eli Zaretskii
2020-11-24 19:26             ` Basil L. Contovounesios
2020-11-24 19:58               ` Eli Zaretskii
2020-11-24 20:25                 ` Eli Zaretskii
2020-11-24 21:01                   ` Eli Zaretskii

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