GNU bug report logs - #47279
28.0.50; hideif wrong-type-argument in org src block

Previous Next

Package: emacs;

Reported by: Zhiwei Chen <condy0919 <at> gmail.com>

Date: Sat, 20 Mar 2021 11:11:02 UTC

Severity: normal

Tags: fixed

Found in version 28.0.50

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 47279 in the body.
You can then email your comments to 47279 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#47279; Package emacs. (Sat, 20 Mar 2021 11:11:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Zhiwei Chen <condy0919 <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 20 Mar 2021 11:11:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Zhiwei Chen <condy0919 <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.0.50; hideif wrong-type-argument in org src block
Date: Sat, 20 Mar 2021 19:10:21 +0800
How to reproduce:
    emacs -Q --eval '(progn
(require (quote org))
(require (quote hideif))
(add-hook (quote c-mode-hook) (quote hide-ifdef-mode))
(setq hide-ifdef-initially t)
(setq hide-ifdef-shadow t))'

Then edit an org file that contains a src block for C.

#+begin_src C
  void foo() { }
#+end_src

C-c ' on that src block will echo an error message:

    Initialization fails with: "Wrong type argument: stringp, nil"

Since C-c ' opens a special buffer that hasn't a file related, the
`buffer-file-name' will return `nil'. It's the second parameter of
`string-match' in `hide-ifdef-gets'.

The definition of `hide-ifdef-guts` follows.

(defun hide-ifdef-guts ()
  "Does most of the work of `hide-ifdefs'.
It does not do the work that's pointless to redo on a recursive entry."
  ;; (message "hide-ifdef-guts")
  (save-excursion
    (let* ((case-fold-search t) ; Ignore case for `hide-ifdef-header-regexp'
           (expand-header (and hide-ifdef-expand-reinclusion-protection
                               (string-match hide-ifdef-header-regexp
                                             (buffer-file-name))
                               (zerop hif-recurse-level)))
           (case-fold-search nil)
           min max)
      (goto-char (point-min))
      (setf min (point))
      (cl-loop do
               (setf max (hif-find-any-ifX))
               (hif-add-new-defines min max)
               (if max
                   (hif-possibly-hide expand-header))
               (setf min (point))
               while max))))

-- 
Zhiwei Chen




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47279; Package emacs. (Sun, 21 Mar 2021 03:27:01 GMT) Full text and rfc822 format available.

Message #8 received at 47279 <at> debbugs.gnu.org (full text, mbox):

From: Zhiwei Chen <chenzhiwei03 <at> kuaishou.com>
To: "47279 <at> debbugs.gnu.org" <47279 <at> debbugs.gnu.org>
Cc: "condy0919 <at> gmail.com" <condy0919 <at> gmail.com>
Subject: 28.0.50; hideif wrong-type-argument in org src block
Date: Sun, 21 Mar 2021 03:25:50 +0000
[Message part 1 (text/plain, inline)]
a trivial patch


--
Zhiwei Chen


[Message part 2 (text/html, inline)]
[0001-Fix-hide-if-wrong-type-argument-in-org-src-block-bug.patch (application/octet-stream, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47279; Package emacs. (Sun, 21 Mar 2021 07:11:02 GMT) Full text and rfc822 format available.

Message #11 received at 47279 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Zhiwei Chen <chenzhiwei03 <at> kuaishou.com>
Cc: "condy0919 <at> gmail.com" <condy0919 <at> gmail.com>,
 "47279 <at> debbugs.gnu.org" <47279 <at> debbugs.gnu.org>
Subject: Re: bug#47279: 28.0.50; hideif wrong-type-argument in org src block
Date: Sun, 21 Mar 2021 08:09:52 +0100
Zhiwei Chen <chenzhiwei03 <at> kuaishou.com> writes:

> a trivial patch  

Thanks; applied to Emacs 28 (with some minor changes).

This change was small enough to apply without assigning copyright to the
FSF, but for future patches you want to submit, it might make sense to
get the paperwork started now, so that subsequent patches can be applied
speedily. Would you be willing to sign such paperwork?

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




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 21 Mar 2021 07:11:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.1, send any further explanations to 47279 <at> debbugs.gnu.org and Zhiwei Chen <condy0919 <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 21 Mar 2021 07:11:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 18 Apr 2021 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 59 days ago.

Previous Next


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