Couldn't make condition-case workHow to condition-case Lisp nesting exceeds `max-lisp-eval-depth'?What is the difference between the error handler in condition-case and the error functionOn Windows 8.1, in Emacs Ghostscript doesn't work, while on commandline it doesHow Can I Prevent make-process from failing if the default-directory doesn't exist?

Swapping "Good" and "Bad"

Using Open with a filename that contains :

The three greedy pirates

Reverse dots and boxes

Why does the Antonov AN-225 not have any winglets?

Why does every calorie tracking app give a different target calorie count for the same goals?

How do native German speakers usually express skepticism (using even) about a premise?

Matrix with arrows and comments

Data Encryption by Application vs Data Encryption in Database

"was fiction" vs "were fictions"

Is it possible to split a vertex?

Backspace functionality in normal mode

Couldn't make condition-case work

Can I play a mimic PC?

Is there any reason why MCU changed the Snap to Blip

What are the indigenous English words for a prostitute?

Yet another hash table in C

What are the original Russian words for a prostitute?

Are there any sports for which the world's best player is female?

Addressing unnecessary daily meetings with manager?

What do three diagonal dots above a letter mean in the "Misal rico de Cisneros" (Spain, 1518)?

When I press the space bar it deletes the letters in front of it

What is /bin/red

The joke office



Couldn't make condition-case work


How to condition-case Lisp nesting exceeds `max-lisp-eval-depth'?What is the difference between the error handler in condition-case and the error functionOn Windows 8.1, in Emacs Ghostscript doesn't work, while on commandline it doesHow Can I Prevent make-process from failing if the default-directory doesn't exist?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















Hello fellow Emacs Lisp enthusiasts!



I've encountered problem that I am even embarrassed to describe. It is very clear how to use condition-case from all the docs and examples that I can find online, but still even the simplest example won't work for me.



Here is a minimal code snippet:



(defun foo ()
(signal 'test-signal '(1 2 3)))

(condition-case nil
(foo)
(test-signal nil))


I use Emacs 26.1, but encounter the same behaviour on other versions as well.



Thank you for any help!










share|improve this question







New contributor



Valeriy Savchenko is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

























    1















    Hello fellow Emacs Lisp enthusiasts!



    I've encountered problem that I am even embarrassed to describe. It is very clear how to use condition-case from all the docs and examples that I can find online, but still even the simplest example won't work for me.



    Here is a minimal code snippet:



    (defun foo ()
    (signal 'test-signal '(1 2 3)))

    (condition-case nil
    (foo)
    (test-signal nil))


    I use Emacs 26.1, but encounter the same behaviour on other versions as well.



    Thank you for any help!










    share|improve this question







    New contributor



    Valeriy Savchenko is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.





















      1












      1








      1








      Hello fellow Emacs Lisp enthusiasts!



      I've encountered problem that I am even embarrassed to describe. It is very clear how to use condition-case from all the docs and examples that I can find online, but still even the simplest example won't work for me.



      Here is a minimal code snippet:



      (defun foo ()
      (signal 'test-signal '(1 2 3)))

      (condition-case nil
      (foo)
      (test-signal nil))


      I use Emacs 26.1, but encounter the same behaviour on other versions as well.



      Thank you for any help!










      share|improve this question







      New contributor



      Valeriy Savchenko is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      Hello fellow Emacs Lisp enthusiasts!



      I've encountered problem that I am even embarrassed to describe. It is very clear how to use condition-case from all the docs and examples that I can find online, but still even the simplest example won't work for me.



      Here is a minimal code snippet:



      (defun foo ()
      (signal 'test-signal '(1 2 3)))

      (condition-case nil
      (foo)
      (test-signal nil))


      I use Emacs 26.1, but encounter the same behaviour on other versions as well.



      Thank you for any help!







      error-handling






      share|improve this question







      New contributor



      Valeriy Savchenko is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.










      share|improve this question







      New contributor



      Valeriy Savchenko is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      share|improve this question




      share|improve this question






      New contributor



      Valeriy Savchenko is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      asked 10 hours ago









      Valeriy SavchenkoValeriy Savchenko

      1083 bronze badges




      1083 bronze badges




      New contributor



      Valeriy Savchenko is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




      New contributor




      Valeriy Savchenko is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          2 Answers
          2






          active

          oldest

          votes


















          2














          Your error symbol test-signal is not defined. C-h f signal says:




          An error symbol is a symbol with an error-conditions property
          that is a list of condition names.




          Let's check this for some standard error symbols and the test-signal



          (get 'error 'error-conditions)
          ;; => (error)

          (get 'args-out-of-range 'error-conditions)
          ;; => (args-out-of-range error)

          (get 'test-signal 'error-conditions)
          ;; => nil


          To define an error symbol, use define-error, e.g.,



          (define-error 'test-signal "My error for testing")


          then you can handle the error in condition-case, e.g.,



          (condition-case err
          (signal 'test-signal '(1 2 3))
          (test-signal (error-message-string err)))
          ;; => "My error for testing: 1, 2, 3"





          share|improve this answer























          • Thanks a lot! That was the problem. I was checkin eieio code, but their error (invalid-slot-type ) doesn't seem to be defined like this.

            – Valeriy Savchenko
            9 hours ago











          • @ValeriySavchenko The invalid-slot-type error symbol is defined with define-error since Emacs 25.1. In early versions, it is defined with put. By the way, define-error is added in Emacs 24.4.

            – xuchunyang
            9 hours ago



















          1














          You need to define a symbol as an error to get Emacs to recognize it:



          (define-error 'test-signal
          "Test signal" 'error)

          (defun foo ()
          (signal 'test-signal '(1 2 3)))

          (condition-case nil
          (foo)
          (error nil))


          From (elisp) Error Symbols:




          -- Function: define-error name message &optional parent

          In order for a symbol to be an error symbol, it must be defined
          with define-error which takes a parent condition (defaults to
          error). This parent defines the conditions that this kind of
          error belongs to. The transitive set of parents always includes
          the error symbol itself, and the symbol error. Because quitting
          is not considered an error, the set of parents of quit is just
          (quit).







          share|improve this answer























          • Thanks a lot! It helped!

            – Valeriy Savchenko
            9 hours ago













          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "583"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );






          Valeriy Savchenko is a new contributor. Be nice, and check out our Code of Conduct.









          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2femacs.stackexchange.com%2fquestions%2f51488%2fcouldnt-make-condition-case-work%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          2














          Your error symbol test-signal is not defined. C-h f signal says:




          An error symbol is a symbol with an error-conditions property
          that is a list of condition names.




          Let's check this for some standard error symbols and the test-signal



          (get 'error 'error-conditions)
          ;; => (error)

          (get 'args-out-of-range 'error-conditions)
          ;; => (args-out-of-range error)

          (get 'test-signal 'error-conditions)
          ;; => nil


          To define an error symbol, use define-error, e.g.,



          (define-error 'test-signal "My error for testing")


          then you can handle the error in condition-case, e.g.,



          (condition-case err
          (signal 'test-signal '(1 2 3))
          (test-signal (error-message-string err)))
          ;; => "My error for testing: 1, 2, 3"





          share|improve this answer























          • Thanks a lot! That was the problem. I was checkin eieio code, but their error (invalid-slot-type ) doesn't seem to be defined like this.

            – Valeriy Savchenko
            9 hours ago











          • @ValeriySavchenko The invalid-slot-type error symbol is defined with define-error since Emacs 25.1. In early versions, it is defined with put. By the way, define-error is added in Emacs 24.4.

            – xuchunyang
            9 hours ago
















          2














          Your error symbol test-signal is not defined. C-h f signal says:




          An error symbol is a symbol with an error-conditions property
          that is a list of condition names.




          Let's check this for some standard error symbols and the test-signal



          (get 'error 'error-conditions)
          ;; => (error)

          (get 'args-out-of-range 'error-conditions)
          ;; => (args-out-of-range error)

          (get 'test-signal 'error-conditions)
          ;; => nil


          To define an error symbol, use define-error, e.g.,



          (define-error 'test-signal "My error for testing")


          then you can handle the error in condition-case, e.g.,



          (condition-case err
          (signal 'test-signal '(1 2 3))
          (test-signal (error-message-string err)))
          ;; => "My error for testing: 1, 2, 3"





          share|improve this answer























          • Thanks a lot! That was the problem. I was checkin eieio code, but their error (invalid-slot-type ) doesn't seem to be defined like this.

            – Valeriy Savchenko
            9 hours ago











          • @ValeriySavchenko The invalid-slot-type error symbol is defined with define-error since Emacs 25.1. In early versions, it is defined with put. By the way, define-error is added in Emacs 24.4.

            – xuchunyang
            9 hours ago














          2












          2








          2







          Your error symbol test-signal is not defined. C-h f signal says:




          An error symbol is a symbol with an error-conditions property
          that is a list of condition names.




          Let's check this for some standard error symbols and the test-signal



          (get 'error 'error-conditions)
          ;; => (error)

          (get 'args-out-of-range 'error-conditions)
          ;; => (args-out-of-range error)

          (get 'test-signal 'error-conditions)
          ;; => nil


          To define an error symbol, use define-error, e.g.,



          (define-error 'test-signal "My error for testing")


          then you can handle the error in condition-case, e.g.,



          (condition-case err
          (signal 'test-signal '(1 2 3))
          (test-signal (error-message-string err)))
          ;; => "My error for testing: 1, 2, 3"





          share|improve this answer













          Your error symbol test-signal is not defined. C-h f signal says:




          An error symbol is a symbol with an error-conditions property
          that is a list of condition names.




          Let's check this for some standard error symbols and the test-signal



          (get 'error 'error-conditions)
          ;; => (error)

          (get 'args-out-of-range 'error-conditions)
          ;; => (args-out-of-range error)

          (get 'test-signal 'error-conditions)
          ;; => nil


          To define an error symbol, use define-error, e.g.,



          (define-error 'test-signal "My error for testing")


          then you can handle the error in condition-case, e.g.,



          (condition-case err
          (signal 'test-signal '(1 2 3))
          (test-signal (error-message-string err)))
          ;; => "My error for testing: 1, 2, 3"






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 10 hours ago









          xuchunyangxuchunyang

          9,6571 gold badge9 silver badges27 bronze badges




          9,6571 gold badge9 silver badges27 bronze badges












          • Thanks a lot! That was the problem. I was checkin eieio code, but their error (invalid-slot-type ) doesn't seem to be defined like this.

            – Valeriy Savchenko
            9 hours ago











          • @ValeriySavchenko The invalid-slot-type error symbol is defined with define-error since Emacs 25.1. In early versions, it is defined with put. By the way, define-error is added in Emacs 24.4.

            – xuchunyang
            9 hours ago


















          • Thanks a lot! That was the problem. I was checkin eieio code, but their error (invalid-slot-type ) doesn't seem to be defined like this.

            – Valeriy Savchenko
            9 hours ago











          • @ValeriySavchenko The invalid-slot-type error symbol is defined with define-error since Emacs 25.1. In early versions, it is defined with put. By the way, define-error is added in Emacs 24.4.

            – xuchunyang
            9 hours ago

















          Thanks a lot! That was the problem. I was checkin eieio code, but their error (invalid-slot-type ) doesn't seem to be defined like this.

          – Valeriy Savchenko
          9 hours ago





          Thanks a lot! That was the problem. I was checkin eieio code, but their error (invalid-slot-type ) doesn't seem to be defined like this.

          – Valeriy Savchenko
          9 hours ago













          @ValeriySavchenko The invalid-slot-type error symbol is defined with define-error since Emacs 25.1. In early versions, it is defined with put. By the way, define-error is added in Emacs 24.4.

          – xuchunyang
          9 hours ago






          @ValeriySavchenko The invalid-slot-type error symbol is defined with define-error since Emacs 25.1. In early versions, it is defined with put. By the way, define-error is added in Emacs 24.4.

          – xuchunyang
          9 hours ago














          1














          You need to define a symbol as an error to get Emacs to recognize it:



          (define-error 'test-signal
          "Test signal" 'error)

          (defun foo ()
          (signal 'test-signal '(1 2 3)))

          (condition-case nil
          (foo)
          (error nil))


          From (elisp) Error Symbols:




          -- Function: define-error name message &optional parent

          In order for a symbol to be an error symbol, it must be defined
          with define-error which takes a parent condition (defaults to
          error). This parent defines the conditions that this kind of
          error belongs to. The transitive set of parents always includes
          the error symbol itself, and the symbol error. Because quitting
          is not considered an error, the set of parents of quit is just
          (quit).







          share|improve this answer























          • Thanks a lot! It helped!

            – Valeriy Savchenko
            9 hours ago















          1














          You need to define a symbol as an error to get Emacs to recognize it:



          (define-error 'test-signal
          "Test signal" 'error)

          (defun foo ()
          (signal 'test-signal '(1 2 3)))

          (condition-case nil
          (foo)
          (error nil))


          From (elisp) Error Symbols:




          -- Function: define-error name message &optional parent

          In order for a symbol to be an error symbol, it must be defined
          with define-error which takes a parent condition (defaults to
          error). This parent defines the conditions that this kind of
          error belongs to. The transitive set of parents always includes
          the error symbol itself, and the symbol error. Because quitting
          is not considered an error, the set of parents of quit is just
          (quit).







          share|improve this answer























          • Thanks a lot! It helped!

            – Valeriy Savchenko
            9 hours ago













          1












          1








          1







          You need to define a symbol as an error to get Emacs to recognize it:



          (define-error 'test-signal
          "Test signal" 'error)

          (defun foo ()
          (signal 'test-signal '(1 2 3)))

          (condition-case nil
          (foo)
          (error nil))


          From (elisp) Error Symbols:




          -- Function: define-error name message &optional parent

          In order for a symbol to be an error symbol, it must be defined
          with define-error which takes a parent condition (defaults to
          error). This parent defines the conditions that this kind of
          error belongs to. The transitive set of parents always includes
          the error symbol itself, and the symbol error. Because quitting
          is not considered an error, the set of parents of quit is just
          (quit).







          share|improve this answer













          You need to define a symbol as an error to get Emacs to recognize it:



          (define-error 'test-signal
          "Test signal" 'error)

          (defun foo ()
          (signal 'test-signal '(1 2 3)))

          (condition-case nil
          (foo)
          (error nil))


          From (elisp) Error Symbols:




          -- Function: define-error name message &optional parent

          In order for a symbol to be an error symbol, it must be defined
          with define-error which takes a parent condition (defaults to
          error). This parent defines the conditions that this kind of
          error belongs to. The transitive set of parents always includes
          the error symbol itself, and the symbol error. Because quitting
          is not considered an error, the set of parents of quit is just
          (quit).








          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 10 hours ago









          DoMiNeLa10DoMiNeLa10

          2,0991 gold badge7 silver badges24 bronze badges




          2,0991 gold badge7 silver badges24 bronze badges












          • Thanks a lot! It helped!

            – Valeriy Savchenko
            9 hours ago

















          • Thanks a lot! It helped!

            – Valeriy Savchenko
            9 hours ago
















          Thanks a lot! It helped!

          – Valeriy Savchenko
          9 hours ago





          Thanks a lot! It helped!

          – Valeriy Savchenko
          9 hours ago










          Valeriy Savchenko is a new contributor. Be nice, and check out our Code of Conduct.









          draft saved

          draft discarded


















          Valeriy Savchenko is a new contributor. Be nice, and check out our Code of Conduct.












          Valeriy Savchenko is a new contributor. Be nice, and check out our Code of Conduct.











          Valeriy Savchenko is a new contributor. Be nice, and check out our Code of Conduct.














          Thanks for contributing an answer to Emacs Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2femacs.stackexchange.com%2fquestions%2f51488%2fcouldnt-make-condition-case-work%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Canceling a color specificationRandomly assigning color to Graphics3D objects?Default color for Filling in Mathematica 9Coloring specific elements of sets with a prime modified order in an array plotHow to pick a color differing significantly from the colors already in a given color list?Detection of the text colorColor numbers based on their valueCan color schemes for use with ColorData include opacity specification?My dynamic color schemes

          Invision Community Contents History See also References External links Navigation menuProprietaryinvisioncommunity.comIPS Community ForumsIPS Community Forumsthis blog entry"License Changes, IP.Board 3.4, and the Future""Interview -- Matt Mecham of Ibforums""CEO Invision Power Board, Matt Mecham Is a Liar, Thief!"IPB License Explanation 1.3, 1.3.1, 2.0, and 2.1ArchivedSecurity Fixes, Updates And Enhancements For IPB 1.3.1Archived"New Demo Accounts - Invision Power Services"the original"New Default Skin"the original"Invision Power Board 3.0.0 and Applications Released"the original"Archived copy"the original"Perpetual licenses being done away with""Release Notes - Invision Power Services""Introducing: IPS Community Suite 4!"Invision Community Release Notes

          199年 目錄 大件事 到箇年出世嗰人 到箇年死嗰人 節慶、風俗習慣 導覽選單