texts:
Since several years I've been using this snippet to insert a date into buffer:

# -*- coding: utf-8 -*-
# name: date
# key: date
# --
`(insert (format-time-string "%Y-%m-%d"))`$0

However nowadays I get this annoying warning:

Warning (yasnippet): `date' modified buffer in a backquote expression.
To hide this warning, add (yasnippet backquote-change) to `warning-suppress-types'.

This is clearly related to this question, but it is not clear what is the proper way to fix the snippet (rather then just suppress the message).


texts:
I've searched all over internet, but couldn't find how can I invoke make from spacemacs with a keybinding (not in shell window).

All I found was this:
@agriffis on gitter said the following

  Aron Griffis
  @agriffis
  Nov 03 2016 22:07

  I'm editing a Makefile, and spacemacs reports GNUMakefile as the major mode. That's great, but there's no auto-indentation. I have to tab in every line after hitting enter. Anybody familiar with that?

And then:

  Aron Griffis
  @agriffis
  Nov 03 2016 22:35

  Hmm, seems like the emacs-provided make-mode.el is just weak. Nobody cares about browser mode or electric keys. It even says in its own todo list:

  ;; * Eliminate electric stuff entirely.

  ;; * Consider removing browser mode.  It seems useless.

  On the other hand, it would be really nice if it did something sensible with indentation, which everybody cares about. sigh.

Does anybody have any updates on this? I use golang and Makefiles are really handy.


texts: automatically include subfolder of org files?

texts:
My team is using a big single org-mode file to manage our research notes but some people are complaining that the file is getting too big too manage and the git conflicts are becoming a pain.

The docs say to use links to manage multiple .org files, like a wiki, but that also suffers from the git conflict problem (now when two people add a file, their link suffers the conflict) plus it's a massive pain to maintain the links.

Is there a way to automatically include a subfolder of .org files in a main file, or (as a fallback) automatically generate the table of files to include? Order is not important but I suppose lexicographic ordering of the filenames would be useful.

Ideally, I'd like to be able to compile out the entire document to one readable HTML page so links out to separate documents is very much sub-optimal.


texts: Customize list bullets in orgmode (emacs)

texts: I was actually looking for how to add other symbols besides -, +, 1., and so on. Has this been addressed somewhere? Thanks!


texts: "no org-babel-execute function for c" and "no-org-babel-execute function for c++"

texts:
my emacs version is 24.3.1.

i understand i have to put the ob-C.el (available from here) in a path where Emacs can read it.

i first copy-pasted the code from that .el file to my .emacs file and restarted emacs. then i went to a C code block (within an org file) and tried to execute it (using C-c C-c). the minibuffer said 'no org-babel-execute function for C'. the same story played out with trying to execute a C++ code block. note that R and python evaluate perfectly from within my org files. the problems seems to be only with these compiled languages.

i then tried putting this ob-C.el inside the ~/.emacs.d directory to see if that helped matters. restarted emacs and checked. it didn't work.

then i tried putting it into a directory ~/.emacs.d/lisp and added the following lines to my .emacs file

(add-to-list 'load-path "~/.emacs.d/lisp/")
(load "ob-C.el")
(require 'ob-C)

after restarting emacs, evaluating the C or C++ code blocks from within an org file still doesn't work. i keep getting the same error "no org-babel-execute function for C" or "no org-babel-execute function for C++".

Update

i upgraded my emacs version to 24.5, deleted all the previous elpa and melpa subdirectories in my ~/.emacs.d directory. suspecting that it had to do with the order in which i placed my

(custom-set-variables

'(org-babel-load-languages
(quote
((emacs-lisp . t)
 (C . t)
 (css . t)
 (sh . t)
 (awk . t)
 (R . t))))

and

;; load the pathnames to custom lisp files
(add-to-list 'load-path "~/.emacs.d/lisp/")
(load "ob-C.el")
(require 'ob-C)

code blocks, i put the load "ob-C.el" before the org-babel-load-languages thing. i then executed the c++ code block multiple times. no luck.

then i removed everything (cleaned out the custom-set-variables block in the .emacs file) and now my .emacs file looks like

;; load the pathnames to custom lisp files
(add-to-list 'load-path "~/.emacs.d/lisp/")
(load "ob-C.el")
(require 'ob-C)

;; load the languages that are needed
(org-babel-do-load-languages
'org-babel-load-languages '((C . t)))

Its still not working.

The code that i am trying to evaluate in an orgmode buffer is :

#+BEGIN_SRC c
printf("Hello world");
#+END_SRC

My Messages buffer looks like this after restarting emacs and attempting to execute the above code block :

Loading /home/taeten/.emacs.d/lisp/ob-C.el (source)...done
Wrote /home/taeten/.emacs.d/.emacs.desktop.lock
Desktop: 1 frame, 0 buffers restored.
For information about GNU Emacs and the GNU system, type C-h C-a.
Quit [2 times]
Making completion list... [3 times]
org-babel-execute-src-block: No org-babel-execute function for c! [5
times]
Ignoring unknown mode `elisp-mode'
File local-variables error: (void-function elisp-mode)
byte-code: Beginning of buffer [6 times]
byte-code: Beginning of buffer


texts: url-retrieve-synchronously: How to retrieve Github gist list

texts:
Q:  How to retrieve a list of Github gists using url-retrieve-synchronously?

I am able to visit my gist list in a web browser:

https://api.github.com/users/lawlist/gists

When I try evaluating:

(url-retrieve-synchronously "https://api.github.com/users/lawlist/gists")

I get this:

Debugger entered--Lisp error: (error "Could not create connection to api.github.com:443")
signal(error ("Could not create connection to api.github.com:443"))
error("Could not create connection to %s:%d" "api.github.com" 443)
url-http(#s(url :type "https" :user nil :password nil :host "api.github.com" :portspec nil :filename "/users/lawlist/gists" :target nil :attributes nil :fullness t :silent nil :use-cookies t :asynchronous nil) #f(compiled-function (&rest ignored) #<bytecode 0x40e4195f>) (nil) nil tls)
url-https(#s(url :type "https" :user nil :password nil :host "api.github.com" :portspec nil :filename "/users/lawlist/gists" :target nil :attributes nil :fullness t :silent nil :use-cookies t :asynchronous nil) #f(compiled-function (&rest ignored) #<bytecode 0x40e4195f>) (nil))
url-retrieve-internal("https://api.github.com/users/lawlist/gists" #f(compiled-function (&rest ignored) #<bytecode 0x40e4195f>) (nil) nil nil)
url-retrieve("https://api.github.com/users/lawlist/gists" #f(compiled-function (&rest ignored) #<bytecode 0x40e4195f>) nil nil nil)
url-retrieve-synchronously("https://api.github.com/users/lawlist/gists")
eval((url-retrieve-synchronously "https://api.github.com/users/lawlist/gists") nil)
eval-expression((url-retrieve-synchronously "https://api.github.com/users/lawlist/gists") nil nil 127)
funcall-interactively(eval-expression (url-retrieve-synchronously "https://api.github.com/users/lawlist/gists") nil nil 127)
call-interactively(eval-expression nil nil)
command-execute(eval-expression)

Emacs Version:  This is GNU Emacs 26.1 (build 1, x86_64-apple-darwin10.8.0, NS appkit-1038.36 Version 10.6.8 (Build 10K549))
 of 2018-05-30

I have tried adding a username/password, but the result was similar:

(url-retrieve-synchronously "https://USERNAME:PASSWORD@api.github.com/users/lawlist/gists")


texts:
Q: how does one determine how much memory an arbitrary lisp object is consuming?

Example use case: I've got a hash table holding lists of strings.  I'm curious about how much memory it's using.


texts:
The icons in speedbar are old-fashioned, I'm trying to replace them, but cannot locate any png files in /home/user/.emacs.d, are they pictures? If they are, where to find them?

And how can I replace them by specifying new image in emacs init file not actually replace them on disk.

Update:
It works after adopting the answer in the solution, and it is also easy to switch to a png format picture. To load a new picture other than the original ones, first put a png pic in .emacs.d, and then add the following lines to the init file:

 (require 'speedbar)
 (defezimage ezimage-directory-plus-new
    ((:type png :file "~/.emacs.d/dir-plus-new.png" :ascent center))
    "Image used for empty directories.")

  (setq speedbar-expand-image-button-alist
        '(("<+>" . ezimage-directory-plus-new))

Now my speedbar looks like:


texts:
I am trying to export an org file to PDF via LaTeX but in German.
I set #+LATEX_HEADER: \usepackage[ngerman]{babel} but when exporting org-mode adds english to the babel options.

That causes all the automatic titles,i.e. references, table of contents, etc., to be in English.

Is there a way to prevent the setting of the english option in babel?


texts: Using GNUS with a large gmail account with lots of folders

texts:
I have a fairly large Gmail account for work (22gb of mail, many folders) which I manage with mu4e on my desktop machine. I'm setting up a laptop for travel and I still want to be able to use my emacs based workflow. However carrying and syncing the whole mail archive seems a little excessive so I thought maybe I should explore gnus as I'll only want to check the last week or two of email in a few of my most active folders.

However my first hurdle seems to be getting the initial list of groups to subscribe to. When gnus logs into Gmail to get the initial list of "groups" it ends up transferring 2gb of data before hanging or failing to list the groups. This seems a little excessive for just getting the list of labels to subscribe to. I thought the workflow for gnus was to only download the most recent headers when you entered a group. I'm not sure what it is downloading during the initial sync but it must be more than that.

So how can I manage this sort of setup in gnus? Is it possible to only sync the groups names for the first instance so I can setup my subscription preferences?

As a bonus follow-up is it possible to limit the downloading of headers in a group by age rather than a number limit (i.e. last 200 headers)?


texts: Proper way to provide a default optional parameter

texts:
I like doing PR reviews with Magit's diff, thus calling magit-diff-visit-file pretty often, providing a universal argument for the optional other-window parameter. To optimize the process instead of pressing C-- <Ret> i'd prefer just to use <Ret> key. What's the proper way to define such a behaviour?

I've seen people using defalias here and there, but not sure how's it going to work in terms of itself. I guess i can get away with defining a stub function and forward the call to magit-diff-visit-file, but i was thinking if there's a better way?


texts: Incorrect filling of Python docstrings in pep257 mode

texts:
I have python-fill-docstring-style set to pep-257 (default) and I'm trying to fill docstring paragraphs. However, python mode does not count """ towards the number of characters, nor does it consider indentation, resulting in:

def function(self):
    """a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
    a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
    a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
    """

and

class A:
    def function(self):
        """a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
        a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
        a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
        """

Note the incorrectly filled first row. How can I fix this?


texts:
I'm trying to write an ido-completing-read-powered backend for projectile-find-tag.

However, for really big TAG files, this is ridiculously slow when the user starts typing because there are so many completion options.

How can I stop ido from trying to offer suggestions until the user has entered X many characters?

(I'm using flx-ido if that matters)


texts: Tramp FTP cant connect. tramp-file-name-handler: Host name must not match method "ftp"

texts:
I am trying to connect ftp using tramp I am using

C-x C-f

/ftp:username@subdomain.hostname.com

I get an error message in the mini buffer:
tramp-file-name-handler: Host name must not match method "ftp"


texts: How can I turn on support package automatically

texts:
As I said in title, when you load a major mode like matlab-mode, I need company-mode as well. It's so easy to turn on the package, but is there any way to load automatically? through .emacs or .init ?

When I try to load 'matlab-shell', 'company-mode' is loaded without extra action for example.

I have no idea about LISP.


texts:
Bookmarks in the bookmarks file appear to be saved using absolute paths. This creates conflicts resolving bookmarks in a file that is synced across different computers:

Absolute path computer 1: /user/sync/file_with_bookmark

Absolute path computer 2: C:\sync\file_with_bookmark

The absolute path of either file is used when writing to the emacs bookmarks file, which is also synced across both computers. Is there a way to save the bookmark in a way that would work on either computer? For example, perhaps the synced path for each computer could be expanded when resolving the bookmark?

Emacs 25.1


texts: Limiting the number of lines of org babel result

texts:
Is there an easy method to limit the number of lines in org-babel results?
For example: I have the following org-babel block:
#+begin_src js :exports both :results output
for (let i = 1; i <= 100; i++) {
  if (i % 3 === 0 && i % 5 === 0) {
    console.log("FizzBuzz");
  } else if (i % 3 === 0) {
    console.log("Fizz");
  } else if (i % 5 === 0){
    console.log("Buzz");
  } else {
    console.log(i);
  }
}
#+end_src

This creates the following output:
#+RESULTS:
#+begin_example
1
2
Fizz
4
Buzz
Fizz
7
8
Fizz
Buzz
11
Fizz
13
14
FizzBuzz
16
17
Fizz
19
Buzz
Fizz
22
23
Fizz
Buzz
26
Fizz
28
29
FizzBuzz
31
32
Fizz
34
Buzz
Fizz
37
38
Fizz
Buzz
41
Fizz
43
44
FizzBuzz
46
47
Fizz
49
Buzz
Fizz
52
53
Fizz
Buzz
56
Fizz
58
59
FizzBuzz
61
62
Fizz
64
Buzz
Fizz
67
68
Fizz
Buzz
71
Fizz
73
74
FizzBuzz
76
77
Fizz
79
Buzz
Fizz
82
83
Fizz
Buzz
86
Fizz
88
89
FizzBuzz
91
92
Fizz
94
Buzz
Fizz
97
98
Fizz
Buzz
#+end_example

Is there an easy way to limit this long output to just 10 lines and add "..." at the end? Thanks.


texts: How to navigate quickly to my installed packages?

texts:
When I'm in the package manager (M-x package-list-packages), I'd like to quickly navigate to my installed packages.

There are literally thousands of packages marked as available, installed, or built-in, but all of the navigation appears to be line-by-line.  Is this an oversight with the package manager or am I overlooking something obvious (aside from basic string search, of course)?


texts: Tell Emacs to use always the same browser

texts:
In my experience xhtml-mode's browse-url-of-buffer command uses different browsers depending, I guess, on the different desktop environments (or on their absence sometimes).

My question, how can I tell Emacs to use always the same browser, desktop environment notwithstanding?

Bonus points :-) for the details of the Emacs-environment interaction that leads to browse-url-of-buffer calling a specific browser...

tia


texts: Replace existent link in org-mode with org-stored link

texts:
Assume that I have a hyperlink to a file in org-mode
- [[file:~/Documents/one_document.txt][this is a link to one file]]

And then for some reason I want to update the linked file to some other file using org-store-link.
After using C-c l, I move back to my org file(pre-existent link), I hit C-c C-l and would hope that UP, DOWN or M-p would show me stored links--but it doesn't! Even if I delete the pre-existent link I never get to see the *Org links* buffer.
From reading the documentation it seems that I should be able to see the stored links. If so, does anyone knows why I can't? Thank you in advance.


texts: Whenever I use helm-grep, helm-ag, or helm-ack, some results show up faster than others. In some cases the search completes after several minutes. Is it because I have to create some sort of index? If yes, how do I do it?


texts:
I have several agenda files which have the same filename (but are from different directories).  This is because I'm using a uniform template for all my projects, which include, e.g., a $PRJHOME/README.org file.

Currently, when I do C-c a a, this leads to all entries from any of the projects' README.org files to have the "label" README.

How can I set the individual README.org's "label" inside the README.org file?  There must be some property to do this, but I couldn't find anything ...


texts: What are the best resources to learn Emacs?

texts:
I have learned Emacs mostly using it's own documentation and the late emacs-starter-kit. Talking with people interested in learning Emacs, I found that my approach is not appealing to them.

What are the best resources around to learn Emacs from scratch ?

Are there resources dedicated for people migrating from other editors (vim/sublime) to Emacs?


texts: Find all entries in active state without DEADLINE or SCHEDULED

texts:
I would like to define a sparse tree search in Org mode which returns all TODO s which are in an active state and do not have either a DEADLINE or SCHEDULE assigned.

I tried C-c / m and then entering
DEADLINE=|SCHEDULED=/!

but that does not work. /! correctly works in returning only action items in an active state but I do not know how to further reduce those which have no DEADLINE or no SCHEDULED date set.


texts: What is this error? "Symbol's value as variable is void: nxml-mode-map"

texts:
I want to  create a command and a keybind to scan with tidy a full buffer. The keybinding has to be active only when editing XML files.

In my ~/.emacs.d/init.el file I've added the following lines:

(defun tidy-xml ()
  "Tidies the XML content in the buffer using `tidy'"
  (interactive)
  (shell-command-on-region
    (point-min) (point-max)
    "tidy -i -w 72 -q -xml"
    (current-buffer)
    t
    "*Error*"
    t))

(define-key nxml-mode-map "\C-c t" 'tidy-xml)

But when I open Emacs it returns the following warning:

Warning (initialization): An error occurred while loading ‘/home/jim/.emacs.d/init.el’:

Symbol's value as variable is void: nxml-mode-map

I'm not able to see where the error is. Can you give me a hand?


texts:
This question was originally asked at https://stackoverflow.com/questions/15895313/let-emacs-move-the-cursor-off-screen, but all the answers I got more or less said "it can't be done", which with emacs I just don't accept.

Is it possible to let Emacs have the cursor be moved off-screen, like most GUI text editors work? This is one of the biggest things that bothers me when I use Emacs over any GUI editor. When I scroll down, the cursor is "pushed forward" by the top of the buffer.

I had previously thought that this was completely impossible, because this is hard-wired into the architecture of Emacs, but then I saw multiple-cursors, which does exactly this for the secondary cursors (assuming you prevent the scrolling functions from acting on the secondary cursors). Is it maybe possible to use multiple-cursors to have the main cursor in some hidden buffer, and the effective cursor being what I actually edit with? Or maybe some other clever trick? Or maybe my Googling has failed me and this is really already possible without any magic?

I use the terminal emacs, so it should work there.


texts:
I'm writing a major mode for a language that uses (* ... *) as comments.

I'm trying to match multi-line comments. e.g.

(*
foo
bar
*)

I was initially doing "(\\*.*\\*)", however, . doesn't match newline.

I then tried what the wiki on multi-line regex said: "(\\*[\0-\377[:nonascii:]]*\\*)". However, this leads to matching that I wasn't expecting. For instance, if I have the following:

(* comment 1*)
code block 1

(* comment 2*)
code block 2

(* comment 3*)
code block 3

It highlights everything from comment 1 to comment 3 as a big comment, including code block 1 and code block 2.

How can I get it to match (* to the first closing *) rather than the last one?


texts:
I have been creating a lot of markdown documents on VS Code due to the live preview, so headings, formatting and especially LaTeX math code are instantly rendered. This is an indispensable tool when you create documents. I know that you can convert Org documents to various different formats, but live preview is totally different.
So, how can I have this functionality when creating Org files? I have searched but haven't found an adequate solution. It is difficult to believe that something so important doesn't exist, especially since for markdown documents most editors provide it easily and sometimes out of the box.


texts: Org babel invoke shell snippet once for each line in input table

texts:
Is there a way to get a shell source block to be invoked once for each line in
a table? Take for example the following input table:

#+tblname: instances-tbl
| Instance | Topic               |
|----------+---------------------|
| i-fi     | arn:aws:sns:...:fa  |
| i-fa     | arn:aws:sns:...:fum |

Currently I do this:

#+BEGIN_SRC sh :var instances=instances-tbl :results output
  foo () {
      instance=$1
      topic=$2

      echo aws cloudwatch put-metric-alarm [...] --dimensions "'Name=InstanceId,Value=$instance'" --alarm-actions $topic
  }

  echo "$instances" | while read line; do
      foo $line
  done
#+END_SRC

Which produces:

aws cloudwatch put-metric-alarm [...] --dimensions 'Name=InstanceId,Value=i-fi' --alarm-actions arn:aws:sns:...:fa
aws cloudwatch put-metric-alarm [...] --dimensions 'Name=InstanceId,Value=i-fa' --alarm-actions arn:aws:sns:...:fum

So it sort of works, but it is full of code not really related to what I
want to do and it is fragile. (Spaces in the column values will break it.)
Ideally I would like the column names of the table bound to the values of each
row in turn, something like:

#+BEGIN_SRC sh :vars-from=instances-tbl :results output
echo aws cloudwatch put-metric-alarm [...] --dimensions "'Name=InstanceId,Value=$Instance'" --alarm-actions $Topic
#+END_SRC

Is something like this possible today?

Alternatively, can I do it with emacs-lisp / python rather than shell snippets? I'm even happy with do it more or less the way I now do, if I could at least cut down some of the boilerplate somehow... Suggestions welcome!


texts:
Is there Emacs mode for exploring/managing pgp/gpg keys?
Like starting from gpg --list-keys find individual info about key, refresh it, see web of trust, etc


texts:
Reading the Magit user manual, there is an entry on pushing the current branch to its upstream branch, by pressing P P. This is not working for me, as I get P isn't bound to any action on the second P press. Same issue for F F as well. Anyone else having the same issue?

(magit-version): Magit 20151208.1407, Git 2.6.3, Emacs 24.5.1

Emacs installed via homebrew on OS X El'Capitan: brew install emacs --with-cocoa


texts: Pass an expression to an org babel code block

texts:
Consider the followig python code block

#+name: whatever
#+header: :var x="2*np.pi"
#+BEGIN_SRC python
import numpy as np
1+x
#+END_SRC
# .

The code will break, because x is passed to the interpreter as a string and then added together with an integer which is not legal (the trick would work in Maxima for some reason, though). If I remove the quotes ("), then Org complains that it can't find a reference (or, something such). So, how to insert an expression such as 2*np.pi to a code block?


texts: Connect to running Python pdb from code buffer

texts:
How can I connect the standard Emacs programming debugger (is this GUD? I don't know) to the running Python application's debugger?

When developing large Python applications, the Python pdb debugger is invoked by running the full application in debug mode. This also allows a remote connection.

How can I tell Emacs that there's a running instance of the application, it allows debugging via pdb, here's the PIN to authenticate, and please sync the code buffers and let me set breakpoints, step through, etc. using Emacs-provided debugging tools?


texts: Emacs Bookmarks follow-functionality: how to make bookmarks show content automatically in another window?

texts:
I use Emacs Bookmarks, and I miss a follow functionality for showing the file content of the bookmarks. So, when I move the cursor up or down the lines in the bookmark list window, a new window should open vertically to show the content of the file the current bookmark is associated to.

Can such a follow mode be made?

Can a similar follow mode be made, that show the bookmarks annotations instead of the bookmarks file content?


texts: How to find/grep in Python virtualenv with projectile/helm easier?

texts: How I can customize helm/projectile behaviour to find files and grep in $VIRTUALENV dir easier? Or maybe I can write some function(s) to find/grep in virtualenv of current project?


texts:
Today I suddenly started getting the above error whenever I try to save a file in emacs 24.5 on Windows 10.

Here is my full list of messages:

Loading c:/Users/Psalm3_3/GDrive/Tools/Emacs-24.5/site-lisp/flymake.el (source)...done
Loading c:/Users/Psalm3_3/GDrive/Tools/Emacs-24.5/site-lisp/csharp-mode.el (source)...
Loading c:/Users/Psalm3_3/GDrive/Tools/Emacs-24.5/site-lisp/csharp-mode.el
../site-lisp/csharp-mode.el: `flet' is an obsolete macro (as of 24.3); use either `cl-flet' or `cl-letf'. [2 times]
../site-lisp/csharp-mode.el: (lambda (item) ...) quoted with ' rather than with #'
Done loading c:/Users/Psalm3_3/GDrive/Tools/Emacs-24.5/site-lisp/csharp-mode.el
Loading c:/Users/Psalm3_3/GDrive/Tools/Emacs-24.5/site-lisp/csharp-mode.el (source)...done
Loading c:/Users/Psalm3_3/GDrive/Tools/Emacs-24.5/site-lisp/desktop.el (source)...
Eager macro-expansion failure: (error "(alist-get (quote display) filtered) is not a valid place expression")
Loading c:/Users/Psalm3_3/GDrive/Tools/Emacs-24.5/site-lisp/desktop.el (source)...done
Loading c:/Users/Psalm3_3/GDrive/Tools/Emacs-24.5/site-lisp/session.el (source)...done
Loading c:/Users/Psalm3_3/GDrive/Tools/Emacs-24.5/site-lisp/xah-math-input.el (source)...done
Loading c:/Users/Psalm3_3/GDrive/Tools/Emacs-24.5/site-lisp/unicode-fonts.el (source)...done
Loading c:/Users/Psalm3_3/GDrive/Tools/Emacs-24.5/site-lisp/php-mode.el (source)...done
zlib library not found
notes.txt has auto save data; consider M-x recover-this-file
Desktop: File "c:/c" no longer exists.
Can't guess python-indent-offset, using defaults: 4 [39 times]
Wrote c:/Users/Psalm3_3/.emacs.d/.emacs.desktop.lock
Desktop: 1 frame, 55 buffers restored, 1 failed to restore.
For information about GNU Emacs and the GNU system, type C-h C-a.
Saving file c:/Users/Psalm3_3/GDrive/Resources/Courses/StanMachLrn/notes.txt...
find-coding-systems-region: Loading charset map: no such file or directory, KOI8-T

Why would emacs suddenly want to use Cyrillic text?  Does anyone have any suggestions?  TIA.

UPDATE:

Started running from an older emacs setup that didn't have AUCTEX installed, which doesn't give me the error, so it appears to be a problem with this:  https://www.gnu.org/software/auctex/


texts:
While Jedi works in python mode, it does not in ein (jupyter-notebook). If I run jedi:setup manually, both of jedi and auto-complete get listed among minor modes.

I use emacs 25.1.1 on Debian.
I use melpa.
Jedi 20160426.456 is installed.

Steps to reproduce the problem:

calling emacs: emacs
run jupyter notebook: M-x ein:run
open test notebook: click on test.ipynb
setup jedi: M-x jedi:setup
type any simple object, dot, tab, jedi does not function (e.g. if I try to type something for completion, e.g. a string with a dot, like "testobject". then string functions of testobject will not be listed for selection.)


texts: How could `(package-initialize)` affect the behavior of `org-open-at-point`?

texts:
Up until this afternoon, I was able to run org-open-at-point on something like

[[file:/Users/apc/Desktop/test%20paper.pdf]]

and open the file named "test paper.pdf" in my Desktop. But I'm no longer able to, at least not with my current set up. (The problem is not limited to that particular file, but it does seem to have something to do with the space on the file name---see below.)

If I run emacs -q and run org-open-at-point on that link, I am able to open it as usual. If I then open the *Messages* buffer, I see

Running open /Users/apc/Desktop/test\ paper.pdf

But if instead I run emacs -q --load with the path of a file containing only the following two lines:

(require 'package)
(package-initialize)

I cannot get things to work as they used to. If I try to run org-open-at-point on that same link, I get

user-error: No such file: /Users/apc/Desktop/test%20paper.pdf

The problem seems to be caused by the space in the name of the file. Running org-open-at-point on

[[file:/Users/apc/Desktop/test.pdf]]

opens test.pdf as expected.

In case this matters: replacing %20 with \ doesn't help. Running org-at-point over

[[file:/Users/apc/test\ paper.pdf]]

yields

user-error: No such file: /Users/apc/Desktop/test\ paper.pdf

And just to double check, running dired on ~/Desktop does show the files I'm trying to open:

  /Users/apc/Desktop:
  total used in directory 304 available 9223372036852159103
  drwx------@  8 apc  staff    256 Dec 12 22:25 .
  drwxr-xr-x+ 70 apc  staff   2240 Dec 12 22:22 ..
  -rw-r--r--@  1 apc  staff   6148 Dec 12 22:00 .DS_Store
  -rw-r--r--   1 apc  staff      0 Sep 26 14:02 .localized
  -rw-r--r--@  1 apc  staff  67523 Dec 11 09:24 test paper.pdf
  -rw-r--r--   1 apc  staff     71 Dec 12 22:24 test.org
  -rw-r--r--   1 apc  staff     80 Dec 12 22:09 test.org~
  -rw-r--r--@  1 apc  staff  67523 Dec 12 22:08 test.pdf

I'm running Emacs 26.3, installed from https://emacsformacosx.com, on macOS 10.14.6. I haven't recently updated neither Emacs nor macOS.

Update: In case anyone else is running with issues opening links and runs into this: the problem is that there's been a change in the escape link syntax in the latest stable version of org-mode. See here.


texts: BEAMER commands don't work when exporting org-mode to beamer

texts:
I'm trying to produce a minimalistic presentation using org-mode and beamer latex.

But I keep getting a pdf file with only one frame, and "I think" commands starting with BEAMER_ is not working.

Using the following code, I expect to have a presentation with 3 frames with Madrid theme. However, I get a one frame presentation with default beamer theme.

#+AUTHOR: Sameh
#+OPTIONS: H:2 toc:t num:t
#+LATEX_CLASS: beamer
#+LATEX_CLASS_OPTIONS: [presentation]
#+BEAMER_THEME: Madrid
#+COLUMNS: %45ITEM %10BEAMER_ENV(Env) %10BEAMER_ACT(Act) %4BEAMER_COL(Col) %8BEAMER_OPT(Opt)
#+BEAMER_FRAME_LEVEL: 2

** Frame 1
 some text here
*** headings 1
*** headings 2

** Frame 2
some text here
*** headings 1
*** headings 2

** Frame 3
some text here
*** headings 1
*** headings 2

If I change #+BEAMER_THEME: Madrid to #+latex_header: \mode<beamer>{\usetheme{Madrid}}, the theme will work.

I "think" #+BEAMER_FRAME_LEVEL: 2 and #+BEAMER_THEME: Madrid are not recoginsed, and it maybe the thing causing the problem.

I need to know how to make #+BEAMER_THEME: Madrid work? and how to make presentation provide multiple frames?


texts:
I have some sample code like this:

(defun some-function ()
  (interactive)
  (push-mark)
  (goto-char (point-min))
  ; do some stuff
  (pop-mark))

Now I'm expecting pop-mark to get me back to the original location. But that doesn't seem to be happening. Any idea on how to do this properly ?


texts: Defun inside let with lexical binding gives byte-compile warning "the function is not known to be defined"

texts:
I want to get the effect of a static variable by using defun inside of let with lexical binding to create a closure. However, when byte-compiling the file, I get a warning. Am I doing something wrong, or if not, is there a way to suppress this warning?

I've created an MCVE:

;; -*- lexical-binding: t -*-

(let ((count 0))
  (defun increase-count ()
    (interactive)
    (setq count (1+ count))
    (message "Count is: %d" count))

  ;; The warning happens here.
  (increase-count))

The code works as expected: the function increase-count prints out "Count is: n" where n increases each time it is called. However, when byte-compiling this file, I get the following warning:

In end of data:
mcve.el:11:1:Warning: the function ‘increase-count’ is not known to be
    defined.

It seems to me that increase-count should always be defined before it is called at the end of the let-block. Is this not the case?


texts: How to check if a customize group exists in Emacs Lisp code?

texts:
How can I programmatically check if a customize group exists?
Interactively I can use M-x customize-group and use completion to see if a specific group exists or not.  But that's not what I need.
If I evaluate:
(customize-group "some-invalid-non-existing-group" nil)

Emacs will open a *Customize Group* buffer stating that the requested group is missing.
I'm writing code that programmatically opens a *Customize Group* buffer but I'd like to do that only if the group exists. So i'd need to check if a specific group name (held in a string) exists prior to programatically calling the customize-group function.
How to do that?


texts: Hide items with a certain tag in agenda based on time of day

texts:
Is it possible to hide items with a certain tag after at specific time of the day?  For example, I'd like that after 5pm and on weekends, :WORK: items don't appear in the agenda.

EDIT: I am dealing with scheduled items and relying on org-agenda-list function.


texts: Emacs font has extra spaces between letters

texts:
I haven't used my emacs setup for a while and now when I open emacs it looks like this:

The extra spacing between the letters does not disappear when I use emacs -q to load emacs without the config.

Does anyone have any suggestions as to how to fix this?


texts: Using org-lookup-last to look up values in a table

texts:
I have two tables. One table has a column ($2) of unsigned integers (#+NAME: ATTRIBUTES). One table is a lookup table (#+NAME: ATTR-LOOKUP) which takes each value from Column $2 in ATTRIBUTES, and looks it up in Column $1 in ATTR-LOOKUP, and places the corresponding value (a signed integer) back into the original table in column $3.

Sample table and formula I'm using:

#+NAME: ATTR-LOOKUP
|  1 | -5 |
|  3 | -4 |
|  5 | -3 |
...

Here is the main table:

#+NAME: ATTRIBUTES
| Attribute | Value | Mod    | Save | Skills          |    |
|-----------+-------+--------+------+-----------------+----|
| STR       |    13 | #ERROR |      | Athletics       | *  |
|-----------+-------+--------+------+-----------------+----|
| DEX       |    15 | #ERROR | *    | Acrobatics      | *  |
...
#+TBLFM: $3=(org-lookup-last $2 (remote(ATTR-LOOKUP, @1$1..@>$1)) (remote(ATTR-LOOKUP, @1$2..@>$2)) '>=)

Any ideas? I spent four hours last night googling and researching (not very well, clearly.)

So, to the question. With debugging enabled, it looks like the formula fails on the predicate. Can anyone see why it might fail, and what I'm doing wrong?


texts: Using spacemacs cannot get auto-completion for javascript to work

texts:
I am trying to get auto-completion for javascript in spacemacs to work for me. So far, no luck.
I have taken the following steps:

Added relevant layers:

(tern :variables tern-command '("/home/mor3dr3ad/.nvm/versions/node/v15.11.0/bin/tern"))
javascript

installed tern via nvm/npm

Then when I either type javascript in an org-babel source code block or in a separate *.js file, it will give me some syntax highlighting. I was expecting a dropdown list like auto-completion feature, but maybe I got that wrong?


texts: Unnecessary indents when copying some text into a buffer

texts:
When I copy some text into a buffer in Fundamental mode, from some website opened in Firefox, there are always some unnecessary indents.

For example, from https://github.com/hakimel/reveal.js/, I selected and copied some text by Ctrl+c, and pasted it into a buffer in emacs running in a terminal.

PDF Export

Presentations can be exported to PDF via a special print stylesheet. This feature requires that you use Google Chrome. Here's an example of an exported presentation that's been uploaded to SlideShare: http://www.slideshare.net/hakimel/revealjs-300.

    Open your presentation with print-pdf included anywhere in the query string. This triggers the default index HTML to load the PDF print stylesheet (css/print/pdf.css). You can test this with lab.hakim.se/reveal-js?print-pdf.
    Open the in-browser print dialog (CMD+P).
    Change the Destination setting to Save as PDF.
    Change the Layout to Landscape.
    Change the Margins to None.
    Click Save.

The text in the buffer becomes:

PDF Export

Presentations can be exported to PDF via a special print stylesheet. This feature requires that you use Google Chrome. Here's an example of an exported presentation that's been uploaded to SlideShare: http://www.slideshare.net/hakimel/revealjs-300.

    Open your presentation with print-pdf included anywhere in the query string. This triggers the default index HTML to load the PDF print stylesheet (css/print/pdf.css). You can test this with lab.hakim.se/reveal-js?print-pdf.
        Open the in-browser print dialog (CMD+P).
            Change the Destination setting to Save as PDF.
                Change the Layout to Landscape.
                    Change the Margins to None.
                        Click Save.

How can I avoid the unnessary indents? Thanks.

I installed GNU Emacs 24.4.1 from its official site, a few days ago, without having made any change to personal configuration. The mode is Fundamental. I don't know it uses some minor mode.

When I copy from a website opened in Chrome:

Presentations can be exported to PDF via a special print stylesheet. This feature requires that you use Google Chrome. Here's an example of an exported presentation that's been uploaded to SlideShare: http://www.slideshare.net/hakimel/revealjs-300.

Open your presentation with print-pdf included anywhere in the query string. This triggers the default index HTML to load the PDF print stylesheet (css/print/pdf.css). You can test this with lab.hakim.se/reveal-js?print-pdf.

Open the in-browser print dialog (CMD+P).
Change the Destination setting to Save as PDF.
Change the Layout to Landscape.
Change the Margins to None.
Click Save.

I agree the problem is browser dependent (notice how different the selected regions are in the two browsers, see the pictures), but it is also emacs dependent, since emacs can't handle tab without inheriting tabs from previous line.


texts: How to start ediff-ing a file that has git conflict markers in it?

texts:
Following an attempted git merge on the commandline, my file now has standard conflict markers in it which emacs has helpfully reloaded (reverted?) in the buffer.

How do I start some kind of merging mode to resolve the conflict? Can I get seperate buffers showing left/right/merged versions of the file like when I ediff-files?

(emacs-prelude v24.4 on a Mac)


texts: How to prevent gnus from unlocking my GnuPG key

texts:
I'm using Gnus to read newsgroups via nntp.  I am using mu4e to read and send e-mails.  My e-mail server credentials are stored in ~/.authinfo.gpg so that mu4e can access them.

My problem is that whenever I open Gnus for the first time, I get asked the passphrase of the GnuPG key used to encrypt ~/.authinfo.gpg.  It seems that Gnus wants to open that file by default, even though it does not need any credentials to read my nntp sources.

How can disable this automatic opening of ~/.authinfo.gpg whenever I open Gnus?


texts: How can I make column view show a column with the timestamp for when a task was DONE?

texts:
I am using the column view on my org agendas, and I want one of the columns to show the timestamp for when the task was finilize (set to "DONE" state). I tried the following column headings

#+COLUMNS: %DONE
#+COLUMNS: %CLOSED

but neither of them worked. I have not found any special properties for the DONE time (althought I thought CLOSED was exactly that), so I have tried the column heading #+COLUMNS: %TIMESTAMP_IA. However, this will show all type of inactive timestamps, not only timestamps for DONE. Another approach would be to include the timestamp for "DONE" as a property of the task, though I have no idea of how to do that.

So,
1) how can I include a timestamp for DONE as a column in column view?
2) how to make a timestamp for DONA a property of a task?

Thanks in advance for all helpfull suggestions :)


texts: Make Emacs 25 menu bar integrate with Unity

texts:
I recently upgraded to Emacs 25. With Emacs 24, the menu bar never integrated with Unity. Emacs always had its own menu bar – Gnome 2 style. One of the first things I noticed after upgrading to Emacs 25 was that the menu bar integrated with Unity.

However, since then it sometimes integrated with Unity and sometimes doesn't in a seemingly random fashion.

How do I make Emacs's menu bar always integrate with Unity?


texts: compilation-mode and next-error confusion

texts:
I'm going crazy trying to understand why compilation mode and next-error recognize some errors and not others.  It appears as though we're long past the days of simple regexps for recognizing errors but I'm not finding anything that explains what is, or is not used now, much less how to debug it.
Why is this recognized as an error:
/Users/kpixley/projects/src-head/cevo/junos/ui/tests/Makefile.inc:5:0 (41): no match found, expected: ":", [ \t] or [\p{Latin}-_.${}/%0123456789]

While this is not?
/Users/kpixley/projects/src-head/cevo/jdid/jdid-infra/build-files/evo/src/Makefile.inc:14:24 (268): rule include_dir: include


texts: How to bind a key to a specific agenda command/list in org mode

texts:
I've added a custom key for the org agenda to show all unscheduled TODO items following Sacha Chua:

(defun sacha/org-agenda-skip-scheduled ()
  (org-agenda-skip-entry-if 'scheduled 'deadline 'regexp "\n]+>"))

(setq org-agenda-custom-commands
   '(("u" "Unscheduled tasks" alltodo ""
      ((org-agenda-skip-function 'sacha/org-agenda-skip-scheduled)
       (org-agenda-overriding-header "Unscheduled TODO entries: ")))))

I can bring up this list with C-c a u, but I'd rather just bind it to a single key. Currently I have the simple:

(global-set-key (kbd "<f8>") 'org-todo-list)

but I would like this to use the above custom command. I've had a dig through the manual but I can't see how to do it.


texts: How to properly override a function like org-babel-ruby-evaluate

texts:
I'm trying to "override" a function

(defun org-babel-ruby-evaluate (buffer body &optional result-type)

I think it came with org mode, which came with prelude.

As a first step, I paste this unmodified version (found via google)
in to Scratch and eval-buffer

(defun org-babel-ruby-evaluate (buffer body &optional result-type)
  "Pass BODY to the Ruby process in BUFFER.  If RESULT-TYPE equals
'output then return a list of the outputs of the statements in
BODY, if RESULT-TYPE equals 'value then return the value of the
last statement in BODY."
  (if (not session)
      ;; external process evaluation
      (save-window-excursion
        (case result-type
          (output
           (with-temp-buffer
             (insert body)
             ;; (message "buffer=%s" (buffer-string)) ;; debugging
             (shell-command-on-region (point-min) (point-max) "ruby" 'replace)
             (buffer-string)))
          (value
           (let ((tmp-file (make-temp-file "ruby-functional-results")))
             (with-temp-buffer
               (insert (format org-babel-ruby-wrapper-method body tmp-file))
               ;; (message "buffer=%s" (buffer-string)) ;; debugging
               (shell-command-on-region (point-min) (point-max) "ruby"))
             (with-temp-buffer (insert-file-contents tmp-file) (buffer-string))))))
    ;; comint session evaluation
    (message "session evaluation")
    (let* ((full-body (mapconcat #'org-babel-chomp
                                 (list body org-babel-ruby-last-value-eval org-babel-ruby-eoe-indicator) "\n"))
           (raw (org-babel-comint-with-output buffer org-babel-ruby-eoe-indicator t
                  (insert full-body) (comint-send-input nil t)))
           (results (cdr (member org-babel-ruby-eoe-indicator
                                 (reverse (mapcar #'org-babel-ruby-read-string
                                                  (mapcar #'org-babel-trim raw)))))))
      (case result-type
        (output (mapconcat #'identity (reverse (cdr results)) "\n"))
        (value (car results))))))

But I don't think it worked for me, I got

Eager macro-expansion failure: (wrong-type-argument listp buffer)

in minibufffer.


texts: Why is exec-path different in emacsclient / emacsserver than in emacs?

texts:
I am trying to run an identical emacsserver setup as the emacs I normally use.

I am having issues because the emacsserver has a different exec-path variable when it starts than when normal emacs does.

To start emacsserver I am using:
/usr/bin/emacs --daemon in a systemd script.  To start emacs normally I just type emacs

emacsserver (which I connect to by typing emacsclient) has the following value forexec-path`:

    exec-path is a variable defined in `C source code'.
    Its value is
    ("PATH" "/usr/local/sbin" "/usr/local/bin" "/usr/sbin" "/usr/bin" "/sbin" "/bin" "/usr/lib/emacs/24.5/x86_64-linux-gnu")

Whereas "normal" emacs has the full path I normally use:

exec-path is a variable defined in `C source code'.
Its value is
("/usr/local/sbin" "/usr/local/bin" "/usr/sbin" "/usr/bin" "/sbin" "/bin" "/usr/games" "/usr/local/games" "/snap/bin" "/bin" "/usr/local/bin" "/sbin" "/usr/bin" "/usr/local/sbin" "/opt/node-v4.2.1-linux-x64/bin" "/opt/node-v4.2.1-li\
nux-x64/bin/node" "/home/optonox/.npm-global/bin" "/usr/local/mongodb/bin" "/snap/bin" "/bin" "/usr/local/bin" "/sbin" "/usr/bin" "/usr/local/sbin" "/opt/node-v4.2.1-linux-x64/bin" "/opt/node-v4.2.1-linux-x64/bin/node" "/home/optono\
x/.npm-global/bin" "/usr/local/mongodb/bin" "/usr/lib/emacs/24.5/x86_64-linux-gnu")

Why is this happening / can I start it normally somehow?


texts: When exiting an org-src block, it always marks the buffer as edited

texts:
When I'm editing source code contained in an org file, I use C-c ' to call #'org-edit-special, which opens up a new buffer to edit that block in.

In this block, I'll often save (with C-x C-s), which will both move the changes to the original org file, and save that file. At this point, the org file is not marked as edited.

But when I exit that new buffer (C-c ' again), the original org buffer is marked as edited, even though I saved it right before exiting the org-edit-special buffer. How can I make it not do this?


texts: How to create a initial collapsed/hidden block in org exported HTML?

texts:
I'd like to create a collapsible block (examples, quotes, codes, ...) when exporting an org file to HTML. Also I'd like to have a way to show the block(button? keystroks?). How can I do this?
Thanks!


texts: Robust way of applying line-height everywhere

texts:
I'd like to apply a line-height property to all text in all buffers to add space above each line (so line-spacing doesn't work, I think).

I've added a function to 'buffer-list-update-hook to create and propertize an overlay that spans the entire buffer (also set to grow with text on either end). This works, but feels like a big hack for something this simple. Is there no better way of doing this?

(defvar fov-line-height-overlay nil
  "Overlay used to manage line-height across the buffer")
(make-variable-buffer-local 'fov-line-height-overlay)

(defun fov-update-line-height-overlays ()
  "Run through the list of buffers and ensure they have an overlay for line-height."
  (dolist (buf (buffer-list))
    (with-current-buffer buf
      (unless fov-line-height-overlay
        (setq fov-line-height-overlay (make-overlay (point-min) (point-max) nil nil t))
        (overlay-put fov-line-height-overlay 'line-height 1.2)))))

(add-hook 'buffer-list-update-hook 'fov-update-line-height-overlays)

PS: The reason I'm doing this is I've set the hl-line face to have a box with :line-width -1 (to avoid jitter while moving) but now I need more space for the text.


texts:
I'd like use org-refile and select the heading with helm with an interface like helm-org-in-buffer-headings.

I know I can use helm-org-in-buffer-headings to do this using f2, but is there a way to have org-refile do specifically this?


texts: How to do font-lock of double quotes in AUCTeX?

texts:
I had a hard time typing with Rt-to-Lt language and using quotes in LaTeX while keeping the font-locking of quotes. I use csquotes package latest version (Version 5.1d -- 2011) for many advantages like toggling between different variants in a style. To make a long story short (see: https://tex.stackexchange.com/q/226097/26295) I want to have font-locking of text between two "s.

How to do achieve this?

I want to have font-lock for the first line, i.e. between the two " marks, using the same color of default quotes seen in the second line.

Code

\documentclass[twoside=semi]{scrbook}
\usepackage{polyglossia}
\setmainlanguage[numerals=mashriq,abjadjimnotail=true]{arabic}
\newfontfamily\arabicfont[Script=Arabic,Ligatures=TeX]{Simplified Arabic}

\usepackage[style=arabic,arabic=quotes]{csquotes} % this is a custom style -- but it is not important for this font-lock question I think.
\MakeOuterQuote{"}
\begin{document}

هذا نص باللغة العربية  "داخل علامتي الافتباس".

هذا نص باللغة العربية  ``داخل علامتي الافتباس''.

هذا نص باللغة العربية \enquote{داخل علامتي الاقتباس}.

\end{document}

%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End:

Notes

font-latex-quote variable was set to auto
face: font-latex-string face: foreground LightSalmon

Trial Code

The comments of lawlist has put me on the right track but there is still the problem of that single " in the preamble of \MakeOuterQuote{"} as it interferes with the regexp code. The below code in the .init gives the desired effect if that single unmatched " in the preamble were not there:

(font-lock-add-keywords 'latex-mode (list (list "\\(\"\\)\\(\\(.\\|\n\\)+?\\)\\(\"\\)" '(1 'font-latex-string-face t) '(2 'font-latex-string-face t) '(3 'font-latex-string-face t) '(4 'font-latex-string-face t))))

Trial to avoid it
I used this regexp to avoid that single " and that increased number of potential groups from 4 to 5.

\\(:?[^{]\\) in front of the previous regexp

So I put in in .init:

(font-lock-add-keywords 'latex-mode (list (list "\\(:?[^{]\\)\\(\"\\)\\(\\(.\\|\n\\)+?\\)\\(\"\\)" '(2 'font-latex-string-face t) '(3 'font-latex-string-face t) '(4 'font-latex-string-face t) '(5 'font-latex-string-face t))))

M-x re-builder

So re-builder for regexp confirms that the regexp is avoiding that single unmatched " (not shown) and shows that there are now 5 regexp groups (1 blue, 2 green, 3 red, 4 blue, 5 green), but I want to font-lock all except group 1 which is the avoid group. However, the current problem is that font-lock won't take effect unless I hit enter of the quote line; as I write quoted text there is no font-lock until I hit enter then and only then it will take the effect. So am I missing something? is it because of the avoid group it doesn't font-lock immediately?

Suggestion as a workaround
Is it possible to enter that single " as a unicode in the preamble to avoid being detected by the regexp?


texts:
Quitting my Emacs takes a really long time.

Is there a good way to track what's happening while quitting Emacs?

(So far I'm turning to git blame to figure out what changes I have made to cause this problem.)


texts:
I'd like to set in my dot-emacs a function to detect if an Emacs instance is already running, possibly exiting Emacs informing user.

To do this I should query the OS for running processes. However

(list-processes)

does not return OS processes,  but only those started by Emacs.
How can I achieve the intended objective?


texts: helm-semantic-imenu doesn't identify pointers and references in C++ code

texts:
With semantic-mode enabled and reading a C++ source file in cc-mode, running helm-semantic-or-imenu correctly shows all the classes, variables and functions defined in that file. However, all the descriptions have the characters & and * missing. So, by simply looking at the entries shown in the helm semantic/imenu buffer, I can't tell the correct signatures. For example, a member variable defined as const char* fileName shows up as const char fileName. Is there some variable which would change this display behaviour?

EDIT : More information thanks to @TuDo - Both semantic-ia-show-summary and helm-semantic-or-imenu use semantic-format-tag-summarize to parse the tag info. However, the latter correctly outputs const char* fileName.


texts: Howto define TAB and S-TAB in keymap of custom mode

texts:
I'm trying to bind the TAB and shift TAB keys to a custom readonly buffer mode. The skeleton of the mode looks like this:

;; 8< --- exmode.el -------

(defun exmode-i ()
  (interactive)
  (message "Pressed i"))

(defun exmode-tab ()
  (interactive)
  (message "Pressed tab"))

(defun exmode-s-tab ()
  (interactive)
  (message "Pressed shift-tab"))

(defvar ex-mode-map
  (let ((map (make-keymap))) ;;
    (suppress-keymap map t)
    (define-key map  "i"       'exmode-i)
    (define-key map  [tab]     'exmode-tab)
    (define-key map  [S-tab]   'exmode-s-tab)
    map)
  "keymap `ex-mode'.")

(define-derived-mode ex-mode special-mode "ex-mode"
  "Example mode"
  :group 'ex-mode
  (buffer-disable-undo)
  (setq truncate-lines t)
  (setq buffer-read-only t)
  )

(defun setup-exmode-buffer ()
  (interactive)
  (let* ((buffer (generate-new-buffer "*exmode*")))
    (with-current-buffer buffer
      (funcall 'ex-mode)
      (display-buffer buffer))
    ))

(provide 'exmode)
;; 8< --- exmode.el -------

When I (require 'exmode) and M-x setup-exmode-buffer I get a buffer where the i is correcly bound, however the tab and s-tab bindings are strange:

Doing a C-h k + key shows:

When running in term mode (-nw) running under KDE Konsole terminal emulator:

press tab : bound to <tab>, runs (indent-for-tab-command &optional ARG)
press s-tab : bound to <backtab>, <backtab> not defined.

When running in GUI mode :

press tab : bound to <tab>, runs 'exmode-tab, which is the behaviour I want
press s-tab : bound to <backtab>,   <backtab> not defined.

How can I make exmode-tab and exmode-s-tab to be called when pressing tab and s-tab in both term and GUI mode?
I'm running Emacs 27.0.50.


texts:
I'm looking for an easy way to highlight a chunk of text inside a Babel source block (not the entire block) and execute that inside the current session (creating the new session buffer if necessary).  In my case, it's almost always R code, but theoretically I guess it should sense the language of the block the same way Ctrl-c does.

I don't need the results inserted back in the org buffer, I'm only executing for side effects like defining variables, etc., similar to hitting Cmd-Return in RStudio.


texts: How to set imenu to a list of errors in compilation mode

texts: I would like to use helm-imenu to see and navigate on a list of errors/warnings in compilation buffer.  How can I do that? E.g., by setting imenu-generic-expression to some value?


texts:
I am following this tutorial

When having enabled company-node upon typing for instance std::vec I get error message in the mini buffer saying:

clang failed with error 1:
/usr/bin/clang -fsyntax-only -Xclang -code-completion-macros -x c++ -Xclang -code-completion-at=-:8:14 -

However when I type just vec and then hit tab, I get a correct completion to std::vector<Class> var(10, Class());

Any idea what might be going wrong with clang here?


texts: How do I enable hlint for haskell linting?

texts:
I am trying to select hlint and use it as the default for haskell-mode. I recall accidentally finding the option for this once, but haven't been able to find it again.
I am new to Emacs and do not know what to look for.


texts: Org mode open directory link in Terminal

texts:
Similar to this Org-mode-link-to-open-directory-in-dired, however open the link in either:

new terminal window (e.g. gnome-terminal, or konsole) or
built-in-shell-emulator-inside-emacs-buffer

I often need to run additional shell commands to run calculations or view jupyter notebooks and afaik thits is impossible from dired.
A small workaround is to open the link in dired and run M-x shell (SPC ' in spacemacs), but obviously this requires an additional step I would like to avoid.


texts: How to open multiple files from desktop in the same emacs session?

texts:
I use Pop OS 20.04 on my desktop. When I start Emacs on login, I run the command (server-start). So when I open a file using the command emacsclient <filename> it opens it in the currently running emacs session. I love this.
However, when I double click text files in the native file explorer a new Emacs session is started. How do I force all files to open in the same Emacs session?


texts: Moving clocked time from child to parent

texts:
Suppose we're located at the Child header below:

  ** Parent
  :LOGBOOK:
  CLOCK: [2018-02-01 Thu 15:16]--[2018-02-01 Thu 15:19] =>  0:03
  :END:
  *** Child
  :LOGBOOK:
  CLOCK: [2018-02-01 Thu 15:16]--[2018-02-01 Thu 15:19] =>  0:03
  :END:

Question: How can one programmatically move the clocked time from the child to the parent, as below:

  ** Parent
  :LOGBOOK:
  CLOCK: [2018-02-01 Thu 15:16]--[2018-02-01 Thu 15:19] =>  0:03
  CLOCK: [2018-02-01 Thu 15:16]--[2018-02-01 Thu 15:19] =>  0:03
  :END:
  *** Child

?


texts:
My emacs daemon for ocaml (I use more than one emacs daemon) starts in a tuareg scratch buffer.  I am aware of initial-major-mode but this hasn't worked: the scratch is started before (setqinitial-major-mode 'tuareg-mode)` is evaluated.

Since I keep the initial-buffer-choice to scratch, I just run (tuareg-mode) and my scratch mode is modified as I want.

But now, when I kill the scratch, new scratch buffers are not in tuareg mode, so I added a little hack found on stackexchange:

(defun prepare-scratch-for-kill ()
  (save-excursion
    (set-buffer (get-buffer-create "*scratch*"))
    (tuareg-mode)
    (add-hook 'kill-buffer-query-functions 'kill-scratch-buffer t)))

(defun kill-scratch-buffer ()
  (let (kill-buffer-query-functions)
    (kill-buffer (current-buffer)))
  ;; no way, *scratch* shall live
  (prepare-scratch-for-kill)
  ;; Since we "killed" it, don't let caller try too
  nil)

(prepare-scratch-for-kill)

It works, but now I don't see my magnificent initial-scratch-message.
I have tried to (setq initial-major-mode 'tuareg-mode), which normally modifies the scratch major mode.  But it doesn't, even if I start a new scratch.

I would like to do it the proper way, emacs embeded way, but what I have tried doesn't work.


texts: how best to set the `projectile-regenerate-tags` command

texts:
I have a fortran project I'm working on and I cannot figure out the right way to use .dir-locals to set the projectile-tags-command
here is my dir-locals.el file:
(
 (f90-mode
  (projectile-tags-command . "make -C ~/path/to/src etags")
  )
 (projectile-global-mode
  (projectile-tags-command . "make -C ~/path/to/src etags")
  )
 (projectile-mode
  (projectile-tags-command . "make -C ~/path/to/src etags")
  )
 )

as far as I can tell, the f90-mode entry is the only one that has an impact.  If I don't have that there, the others do not touch the projectile-command variable when I am editing a fortran file, and I can't get anything to work when I'm in anything other than a fortran file buffer.
I thought that the projectile-mode entry should do the trick, but I don't understand why it isn't and I'm wondering how I can achieve this, namely that whenever I'm in a buffer relevant to that .dir-locals I set the tags command for projectile


texts: use-package org-mode :hook is being ignored

texts:
I'm currently running this version of Emacs:

GNU Emacs 26.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.7) of 2019-04-11, modified by Debian

I'm attempting to use use-package to configure the latest version of org-mode, and not the one that comes with Emacs. My initial attempt at configuration used :hook directive (commented out in the elisp code below) does not work, as the resulting value of org-mode-hook does not have my-org-mode-hook at all (the actual value is shown later on):

;; Define org and melpa as package sources, and install `use-package' if it's
;; not already there. Origination:
;; https://www.reddit.com/r/emacs/comments/5sx7j0/how_do_i_get_usepackage_to_ignore_the_bundled/
;; Here, I *DO* actually desire automatic updating of the latest packages in this
;; case (specifically org-mode which receives frequent updates.
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(add-to-list 'package-archives '("org" . "https://orgmode.org/elpa/") t)
;; Ensure that "org" and "melpa" are found first in this order (higher numbers are higher priority):
(when (>= emacs-major-version 25) (setq package-archive-priorities '(("org" . 3)
                                 ("melpa" . 2)
                                 ("gnu" . 1))))
;; This is the key!! --> " The symbol ‘all’ says to load the latest installed
;; versions of all packages not specified by other elements." and for org-mode,
;; this means always get that latest version.
(setq package-load-list '(all))
(package-initialize)
;; Not sure why we need this:
(setq package-enable-at-startup nil)
;; Install use-package:
(unless (package-installed-p 'use-package)
  (package-refresh-contents)
  (package-install 'use-package))
(eval-when-compile
  (require 'use-package))
;; Load org mode early to ensure that the orgmode ELPA version gets picked up, not the
;; shipped version.
;;
;;   Reference https://github.com/jwiegley/use-package#package-installation
;;
(require 'use-package-ensure)
(setq use-package-always-ensure t)
;;
;; Now the configuration for org-mode:
;;
(use-package org
  ;; Install both org and "contrib"-uted org-related packages:
  :ensure org-plus-contrib
  :pin org
  ;;
  ;; This seems to be correct way to add my hook function to org-mode-hook, but
  ;; it does not show up in the value of org-mode-hook, so I commented it out in
  ;; favor of the forced use of add-hook inside :config, later:
  ;;
  ;;    :hook #'my-org-mode-hook
  ;;
  :config
  ;;
  ;; This seems to be the only way to get my hook function to be added, as the
  ;; :hook directive is ignored or obliterated by something else:
  ;;
  (add-hook 'org-mode-hook 'my-org-mode-hook))

When try to use :hook that is commented out above (and of course also commenting out the call to add-hook), I get this for the final value after opening up a .org file:

org-mode-hook is a variable defined in ‘org.el’.
Its value is shown below.

  This variable may be risky if used as a file-local variable.

Documentation:
Mode hook for Org mode, run after the mode was turned on.

You can customize this variable.

Value:
(#f(compiled-function
()
#<bytecode 0x1684c2d>)
   #f(compiled-function
  ()
  #<bytecode 0x1ab413d>)
   org-babel-result-hide-spec org-babel-hide-all-hashes #f(compiled-function
                           ()
                           #<bytecode 0x1ae75e1>)
   org-eldoc-load)
Original value was nil

As seen above, the my-org-mode-hook function is not in the value. My understanding is that use-package should add it there (per use-package Hooks section) but does not, and I have to force it with the explicit call to add-hook.

What am I doing wrong here?


texts:
I am a mendeley user trying to sync org-ref with my local biliography (bibtex format).

I'm having some trouble to run the function org-ref-open-pdf-at-point.
 Running this function while the cursor is on some citation emacs returns the
 message "no pdf found for CITATION".

Let me try to explain my previous attempts:

First, each of my bibtex entries is fomatted as the following example (this is done automatically by mendeley)

@misc{Rockafeller1970,
author = {Rockafeller, Ralph Tyrell},
doi = {10.1515/9781400873173},
file = {:home/ariel/coisas/matematicasdavida/Livros/Rockafeller - 1970 - Convex Analysis.pdf:pdf},
isbn = {0-691-08069-0},
pages = {468},
title = {{Convex Analysis}},
year = {1970}
}

My first attempt was to set the variable bibtex-completion-pdf-field to file, but with no success. I also looked up the Documentation and noticed that there is guidance for this sort of problem, but I also couldn't make their suggestions work.

Can someone help with this issue?


texts: how to sort tasks in agenda using todo-state-up?

texts:
I defined 4 TODO keywords. Two are in the TODO state and two others (DONE and CNCL) belong to the DONE state:

(setq org-todo-keywords
      '((sequence "TODO" "WAIT" "|" "DONE" "CNCL" )))

I defined a sort strategy:

(setq org-agenda-sorting-strategy
      '((agenda habit-down time-up todo-state-down priority-down category-keep)
       (todo priority-down category-keep)
       (tags priority-down category-keep)
       (search category-keep)))

Strangely, todo-state-down puts tasks in the following order:

xxx: Scheduled: WAIT waiting for info
xxx: Scheduled: TODO still need to do
xxx: Scheduled: CNCL won't be doing this one
xxx: Scheduled: DONE put this at the bottom

I see that the TODO states are on top and the DONE states are on the bottom. But, within each state, the WAIT appears before TODO, and CNCL before DONE.

That is unexpected. I thought I'd get tasks in the order that I defined the todo-keywords: TODO, WAIT, DONE and finally CNCL.

Any suggestions?


texts: Is possible to ignore buffers by major mode?

texts:
Currently I'm ignore these buffers:

(setf helm-boring-buffer-regexp-list '("\\` " "\\*helm" "\\*helm-mode"
                                       "\\*Echo Area" "\\*Minibuf" "\\*monky-cmd-process\\*"
                                       "\\*epc con" "\\*Compile-Log\\*" "\\*monky-process\\*"
                                       "\\*CEDET CScope\\*" "\\*Messages\\*" "\\*Flycheck error"
                                       "\\*.+(.+)" "elpa/.+" "tramp/.+"
                                       "\\*Gofmt Errors\\*" "\\*autopep8"
                                       "\\*magit-process:" "\\*magit-diff:" "\\*anaconda-mode\\*"))

Ok. I started using Circe for IRC and all that, but it annoys me seeing the buffer of each channel and the buffer of the server in the Helm buffer every time I hit C-x b, I feel that my buffer list is cluttered. I'm on the way of using helm-circe to manage those buffers alone.

So, I was wondering if it where even possible to tell Helm to ignore those buffers that have certain major mode activated, in this particular case, circe-mode.


texts: Read a sentence with completion for words from a collection

texts:
Suppose we have a collection of descriptions like this:

("procedural" "functional" "high-level" "low-level" "statically-scoped" "dynamically-scoped")

Suppose that we have a database of programming languages and would like to enable the user to enter queries like this:

(or (and procedural high-level) dynamically-scoped)

with completion aid for the words from the collection. I have looked at (ido-)completing-read, but it seems to match the whole input string instead of individual words. With what tool can I achieve the desired behavior?


texts: make-frame-on-display & emacsclient fail w/ exported display while other apps are fine

texts:
I am connecting to my office GNU/Linux box from a windows laptop through a putty ssh tunnel.

I have also on the laptop the java WeirdX X11 server, that is declared in putty to use the localhost:2 (default) display, while the "enable X11 forwarding" is enabled.

Once connected on my Linux, the X11 export seems correctly configured by putty with DISPLAY=localhost:10.0 as I can start xlogo, xeyes or even Firefox.

But when invoking emacsclient -c I get the following error:

Waiting for Emacs...
*ERROR*: Display localhost:10.0 can't be opened

For what I understand, emacsclient finds the running Emacs (confirmed if I use emacsclient -nw: I can get my running emacs session) but Emacs cannot use my distant display.

And when I join my session with emacsclient -nw then M-x make-frame-on-display RET localhost:10.0 I get the same

  Display localhost:10.0 can't be opened

Do you have some tip that can help?


texts: Automatically archive "DONE" entries regardless of keyword?

texts:
I want to archive an entry automatically when its todo state gets marked as done.

The problem is that you can set up lots of different states that mean done.  So a function like this will only work if the done state is literally called DONE:

(defun channing/archive-when-done ()
    (when (equal (org-get-todo-state) "DONE") (org-archive-subtree-default)))
(add-hook 'org-after-todo-state-change-hook
    'channing/archive-when-done)

How can I detect if an entry is in the done state, regardless of the particular keyword?


texts: How do I make org-agenda-fortnight-view the default in custom block agenda?

texts:
I've got the following configuration set up for displaying my current agenda and tagged todo items:

  (setq org-agenda-custom-commands
        '(("g" "Plan today"
           ((agenda "")
            (tags-todo "Computer")
            (tags-todo "Online")
            ...
            )
           )))

When called with C-c a g this shows the agenda for the current week. I can switch to the current fortnight using v t which is org-agenda-fortnight-view, but when calling the agenda again, it switches back to week view.

What should I do to make the fortnight-view the default?


texts: How to make Emacs not intercept Command-Ctrl-Space, used for Special Characters on macOS?

texts:
On macOS the CommandCtrlSpace shortcut opens an Emoji picker which can be expanded into a Special Characters picker.

But when I type this shortcut on Emacs in order to input a character, instead of seeing the picker, I see the message

<C-s-268632064> is undefined

How can I make it show the picker instead?


texts:
Q: how can I get to the source code of R packages using ESS?

When I'm working with elisp, I can access the source code for any
package easily with find-library or by following the links in
find-function or find-variable.

I'd like to be able to do the same thing with R
via Emacs Speaks Statistics (ess).
How can I get ess to send me to the source code of a given
function/package?


texts:
I wrote an elisp function for myself at the weekend:

(defun rr-occur ()
  "Run occur using the `word-at-point'."
  (interactive)
  (let ((term (thing-at-point 'word t)))
    (occur term)))

This seems such an obvious use-case, I am now wondering if this duplicates a "standard" function.


texts: copy from shell and paste in terminal-emacs

texts:
How can I copy from the command line and paste in Emacs in terminal mode?

If I select the text with the mouse and paste it from the clipboard with the third button (the wheel) it is OK.

But if I try to run:

$ emacs -nw file_name.sh (for example)

emacs opens the file which I start editing, then I C-z to go back to the terminal.

$ recall a command from the history

go to the beginning of the line and press C-k to kill it

$ fg

go back to Emacs and try to paste it with C-y doesn't work.


texts: add-hook unable to reassign a mode-specific keybinding

texts:
I'm attempting to override a mode-specific keybinding, but my attempt so far hasn't been able to reassign it.

I use the M-j,k,i,l to navigate instead of the regular C-n, C-p etc. I find it to be a lot faster.

However, M-j is bound automatically to c-indent-new-comment-line when editing in any C-like language. I'd like for M-j to be bound to backward-char.

Here are my attempt so far to rebind this function:

(add-hook 'c-mode-common-hook t
          ;; rebind key
          (lambda () (global-set-key (kbd "M-j") 'backward-char)))

Does anyone know what I'm doing wrong?


texts: Is there a way to align a two-dimensional list?

texts:
I have a list, like:
'((xxx xx xxx)
  (xx xxxxxxxxxxx xxxxxxxxxxx)
  (xxx xxx xxxxx)
  (xxx xxxxxxxxxxxxx xxxxxxxxxxxxx)
  (xxxxxxxxxxxxx xxx xxxxxxxxxxxxx))

I'd like to reshape it to
'((xxx           xx            xxx)
  (xx            xxxxxxxxxxx   xxxxxxxxxxx)
  (xxx           xxx           xxxxx)
  (xxx           xxxxxxxxxxxxx xxxxxxxxxxxxx)
  (xxxxxxxxxxxxx xxx           xxxxxxxxxxxxx))

How can I do this?


texts: How to not display environment variable in org-babel src block?

texts:
I want the effect of this:
#+BEGIN_SRC shell :dir src
CC=gcc-9 make
#+END_SRC

But I don't want CC=gcc-9 to show up in the output.
Is there a way to somehow include the environment variable in the BEGIN_SRC header?
I tried this but it did not work:
#+BEGIN_SRC shell :dir src :env "CC=gcc-9"
make
#+END_SRC


texts: When searching, how to always ensure that a few lines after the highlighted word are visible?

texts:
When performing search/isearch in a text, sometimes it would be desirable to see a few lines after the highlighted searched string, it other words to avoid that the highlighted word to be at the  bottom of the window.

For example if we have the following text in a buffer, try to search the last word that you are able to see. For me it is the word principles (as I have maximized the frame). The highlighted word (in my situation the word principles) is at the bottom of the screen. I would like to see always  few lines (if possible) after the word principles after searching.

Surrounded
occasional
pianoforte
alteration
unaffected
impossible
Perceived
knowledge
certainly
Although
moreover
mistaken
kindness
horrible
distance
marriage
country
demesne
Bachelor
domestic
extended
doubtful
Greatly
Improved
provided
Dwelling
speedily
ignorant
steepest
Admiration
instrument
affronting
invitation
reasonably
ecstatic
wondered
disposal
curiosity
shameless
explained.
sincerity
extremity
additions
principles
Carriage
Remainder
household
direction
zealously
Sufficient
motionless
compliment
stimulated
assistance


texts:
A custom multi-section agenda view can get quite long.  Is there a built-in mechanism to fold or collapse sections like the standard outline view of org files to help with readability?

I'm interested in minimally being able to collapse individual sections of a multi-section agenda.


texts: org agenda: only show immediate subtask for task with dependencies

texts:
Let's say I have a project with three subtasks:

* TODO project [1/3]
  :PROPERTIES:
  :ORDERED:  t
  :END:
** DONE subtask1
   CLOSED: [2020-04-05 Sun 15:12]
** TODO subtask2
** TODO subtask3

I have set the first item to DONE, and the progress entry shows [1/3] so it seems like org mode recognized the dependency. In the agenda todo view I now only want to see subtask2, because I cannot start working on subtask3 before it's done. However I now see both subtask2 and subtask3 in agenda todo. Is it possible to configure so that I only see subtask2 there?


texts: How to get values of :var arguments in ob-shell assigned when tangling?

texts:
When I run the code bellow directly in orgmode it outputs the correct result

#+begin_src sh :var value=1234 :tangle a.sh
echo "value  = " $value
#+end_src

  value = 1234

But when tangled, it generates file a.sh with only

  echo "value  = " $value

How do I get the assignment "value=1234" in a.sh ?


texts: Set startup screen to *About GNU Emacs* page

texts: When I start Emacs, it shows me the GNU Emacs buffer. I want to set it to the page one gets with the C-h C-a command with the nice Emacs logo instead. How can I do this.


texts:
My buffer slips to the right while editing a file. Whenever I press a button, left margin area grows one character. This isn't happening for all files. My buffer normally looks like this:

line with text
another line with text

After I push a buttons, the screen slips to the right, left margin area grows and the buffer looks like this:

<this area got wider> line with text
<this area got wider> another line with text

This problem did not occur for all files; but it isn't resolved with restarting the Emacs.


texts: how to mantain one current working directory for each window config in eyebrowse mode?

texts:
I'm using eyebrowse-mode and I want to mantain a separte current-working directory for each eyebrowse-window-config.

I would like that window-config-1 had it's own current working directory, so that, for example, if I M-x find-file in slot-1 then dired starts at the directory tied to slot-1. if I M-x find-file in slot-2, then dired starts at the directory tied to slot-2. So on and so forth.

thanks in advance.


texts: Evaluating all elisp org source blocks in buffer

texts:
Is there a way to evaluate all elisp org source blocks in the current
buffer?  The best I have now is: save to file, and do:

(org-babel-load-file buffer-file-name)

Is there a more direct way?


texts:
I installed geiser, set my default scheme to guile, and enabled scheme support but I can't seem to get it to work. I am getting this output and am not sure what to make of it.
#+begin_src scheme :results output
(define test (lambda (v) v))
(test 'test)
#+end_src

#+RESULTS:
: Unknown meta command: geiser-eval
: $2 = #f
: $3 = test
: While compiling expression:
: Syntax error:
: unknown location: unexpected syntax in form ()
: scheme@(guile-user) [3]>


texts: TLS connection to Melpa.org hanging on prelude

texts:
I've enabled some new packages in bbatsov's prelude and when I restart the emacs daemon, it hangs endlessly starting up showing this:

Prelude is powering up... Be patient, Master g!
Loading personal configuration files in /Users/g/.emacs.d/personal/preload...
Loading Prelude's core...
Loading /Users/g/.emacs.d/savefile/recentf...
Loading /Users/g/.emacs.d/savefile/recentf...done
Loading Prelude's modules...
Loading /Users/g/.emacs.d/prelude-modules.el (source)...
Contacting host: melpa.org:443
Opening TLS connection to `melpa.org'...
Opening TLS connection with `gnutls-cli --insecure -p 443 melpa.org'...

What's the problem exactly? I can access https://melpa.org/ without any problems.

Any workarounds?

Cheers,


texts: Archive DONE tasks that are at least month after completion

texts:
I use org-archive-subtree to clean my org files.
Most of my tasks lie under * Tasks header so I run the function on it using prefix (C-u C-c C-x C-s). I noticed that the function only asks for confirmation when it encounters a DONE task.

Would it be possible to change its behavior to:

1) Ask only when the item has DONE state and it has a CLOSED timestamp that's at least month old (or does not have this timestamp at all but is still in DONE). I like to review my last week seeing what I did so archiving too young tasks breaks this option for me.

2) Do the above checks but archive without asking if the conditions are met.


texts:
I have a function that opens a buffer in order to extract some information from it, then switches back to the original buffer and inserts some text:

(save-excursion
  (find-file ThisFile)
  (setq results some-function))
(insert results)

The brief flash when emacs switches to the new buffer is disconcerting. Is it possible to suppress the buffer -- I guess, keep it at the bottom of the buffer stack?


texts:
I am using org-confluence-export-as-confluence.  Confluence (when importing markup) seems to treat every newline as a "hard break".

So, I'd like to have the output of org-confluence-export-as-confluence output paragraphs without newlines.

I think setting fill-column to a large value would make that happen, but I can't figure out how to make org-export-as use that.

I tried

(let ((old-fill (default-value 'fill-column))
    (setq-default fill-column 100000)
    (org-export-to-buffer 'confluence "*org CONFLUENCE Export*"
  async subtreep visible-only body-only ext-plist (lambda () (text-mode)))
  (setq-default fill-column old-fill))

but had no luck.


texts: How to set project-specific javscript indentation using js2-mode

texts:
I have several Javascript projects, where some projects use 2 spaces for indentation and other projects use 4 spaces for indentation. Is there a project-specific way to set the indentation?

I am able to manually resolve this issue for each project by running (js2-basic-offset 2) or (js2-basic-offset 4), but can I configure this setting on a per-project basis?

Perhaps there is a dot-file that I can add to my project's root folder where I can configure settings?

I use js2-mode with tern-js if that helps. And for the record, I love it! But I would love to be able to customize this minor detail.


texts: When using `lisp-state`, how can we repeat an action like slurp, and bind a key to easily perform the repeat?

texts:
In vim, I frequently used the "." shortcut for repeating the last command. I found this extremely useful especially when working with clojure tools to do things like slurp-ing and barf-ing to refactor code.

In Spacemacs, the clojure layer provides a special state called lisp-state that allows for things like slurp and barf. See here.

What I'm trying to do is find a key, like ., that I can bind to some command that would allow me to repeat an action like a slurp.

By default, in evil-mode the . is bound to evil-repeat. However, doing that creates odd behavior. For example, a common scenario in which I use the repeat is when editing lisp files. Let's say I slurp a text like so using Ctrl + k, s:

() + a b => (+) a b

In vim, I would hit the "." key to continue moving the paren to the right. With the setting above in Emacs (Spacemacs), I got a behavior I did not understand. If I hit ., the slurp is not repeated. Instead, I see the following at the bottom of the screen:

state: lisp -> normal

I also tried to remap the . key to the repeat command instead of evil-repeat, but I get the same behavior.

It appears that the repeat key somehow first interacts with the lisp-state, perhaps returning the browser to normal state. So my question is what is the right way to repeat an action like slurp in lisp-state, and can this method be bound to a key?


texts: Bash command to see a list of all open buffers

texts:
I am in bash and emacsclient is running. I would like to run a bash command to display a list of all open emacs buffers. The output of buffer-menu is fine.  These commands do not work:

emacsclient -e "buffer-list"

ERROR: Symbol's value as variable is void: buffer-list

emacsclient -e "buffer-menu"

ERROR: Symbol's value as variable is void: buffer-menu


texts:
I use org-mode to translate, with source text lines on level 2 headlines and target text lines on level 3 headlines.

However, the text of any headline that is exported is bold and italicised. I can go through the exported document and manually remove this formatting but I was wondering if there was a way to remove this formatting in export? I can see org-export-filter-bold-functions, but no matter how I try to use it I can't make it un-bold etc. the exported text.

Do any of you fine souls know how to go about achieving this? I'm totally stuck!


texts:
When I do a commit, magit popups the diff in a separate wm window. I'd like it to show the diff in the same wm window and just split into a different wm window.
I've tried this answer, but it hasn't worked.
magit 20200805.1104
emacs 26.3


texts: What is the difference between Workflow states vs Types in org-mode?

texts:
In org-mode, what is the difference between TODO workflow states and TODO types? They looks and seems the same.
Here's a simple workflow states:
     (setq org-todo-keywords
           '((sequence "TODO" "FEEDBACK" "VERIFY" "|" "DONE" "DELEGATED")))

And here's a TODO type:
     (setq org-todo-keywords '((type "Fred" "Sara" "Lucy" "|" "DONE")))

But for me, they both look and function the same.


texts:
Good day,
I created the following script in order to run emacs 27.1 in cmd without gui:
$ cd \Users\xxxxxx\emacs-27.1-x86_64\bin
$ emacs-27.1.exe -nw %1

An elementary script which I named demacs. Emacs runs in cmd and divides the buffer in two sides. In the left sides there is the source file, in the right side the preview.
I have installed latex-preview-pane and it works correctly, but using this script no. The right side is not able to read the pdf and shows only strange characters.
Where is the problem?


texts: Having trouble using auto-complete in emacs

texts:
I've installed auto-complete inside emacs using elpa and have used M-x auto-complete-mode to check that it is enabled. However when I write the following short C code in emacs and put my cursor in front of the v and press the TAB key nothing happens.

Is this not the correct key or is there something wrong with my setup?

int main(void){
  varA = 5;
  varB = 7;

 v

 return 0;

}

The contents of my .emacs.d/elpa/ directory are:

archives
auto-complete-20160329.2321
popup-20160409.2133

And my emacs.d/init.el contains

(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(inhibit-startup-screen t))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )
(require 'package) ;; You might already have this line
(add-to-list 'package-archives
             '("melpa" . "https://melpa.org/packages/"))
(when (< emacs-major-version 24)
  ;; For important compatibility libraries like cl-lib
  (add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))
(package-initialize) ;; You might already have this line

(require 'auto-complete)
(global-auto-complete-mode t)

(require 'auto-complete-config)
(ac-config-default)


texts:
I try to do a shell command in frame-title-format.

(setq frame-title-format
      (list (format "%s" (shell-command-to-string (concat "ls -1 %f")))))

  ls: cannot access filename: No such file or directory

is shown up on the frame-title.

Is it due to the white space?  How can I fix this?

-Ben


texts: How to tell Emacs/TRAMP to use the local shell, instead the shell of remote machine?

texts:
I have the following function defined in my dot-Emacs:

(defun call-shell-refresh-browser ()
  ;; When pressing 'sf', save the content and refresh the browser
  (interactive)
    (save-buffer)
    (shell-command "python ~/Dropbox/Sys/Linux/chrome-refresh-back-emacs.py")))

It saves the buffer in Emacs, then switching to Chrome, reload the webpage and gets back to Emacs. This worked like a charm.

Until now, I use TRAMP to edit files on a remote machine. When I save it, and call the function call-shell-refresh-browser, it looks in the remote shell for the script chrome-refresh-back-emacs.py which don't exists on the remote machine.

How could I tell Emacs/Tramp to switch to the local shell on my machine, when editing a remote file? This is without terminating the current TRAMP session.


texts: Removed Homebrew now the jpeg and png images don't display

texts:
Recently I removed the Homebrew completely on my OS X 10.7.4 (because the only reason I was using it was the OpenSSL package and I installed it from scratch into /usr/localand it worked perfectly so there was no need to keep a large /usr/local/Cellar folder)

Then when I started Emacs-25.2.1 (as a precompiled app in /Applications/Emacs-25.2.app) it gave

Dyld Error Message:
  Library not loaded: /usr/local/lib/libMagickWand-6.Q16.1.dylib
  Referenced from: /Applications/Emacs-25.2.app/Contents/MacOS/Emacs
  Reason: image not found

and the Emacs windows didn't come up.

I've noticed one of the dependencies of Emacs /usr/local/lib/libMagickWand-6.Q16.1.dylib was symlinking to /usr/local/Cellar/imagemagick/6.8.7-7/libd/libMagickCore-6.Q16.1.dylib So I've installed ImageMagick-7.0.8-60 from scratch and rearranged the symlink into this new one and repeated the same for the other Dyld Error causing MagickCore and finally Emacs started to come up and work fine but it wasn't displaying the jpg and png images.

I've checked the libjpeg dependency path and it is /usr/local/lib/libjpeg.8.dylib (compatibility version 12.0.0, current version 12.0.0) But the libjpeg.8.dylib was already available at /usr/local/lib so I've installed the libjpeg-8c, 8d, 9c and retried but it didn't display any jpeg images. I guess I got stuck at this point.

How to fix this problem? Thanks.

Attachment:

$ otool -L /Applications/Emacs-25.2.app/Contents/MacOS/Emacs
/Applications/Emacs-25.2.app/Contents/MacOS/Emacs:
    /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 1138.47.0)
    /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
    /usr/local/lib/libjpeg.8.dylib (compatibility version 12.0.0, current version 12.0.0)
    /usr/local/lib/libMagickWand-6.Q16.1.dylib (compatibility version 2.0.0, current version 2.0.0)
    /usr/local/lib/libMagickCore-6.Q16.1.dylib (compatibility version 2.0.0, current version 2.0.0)
    /usr/lib/libxml2.2.dylib (compatibility version 10.0.0, current version 10.3.0)
    /usr/local/lib/libncurses.5.dylib (compatibility version 5.0.0, current version 5.0.0)
    /usr/local/lib/libgnutls.30.dylib (compatibility version 37.0.0, current version 37.1.0)
    /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)
    /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 635.21.0)
    /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 41.0.0)
    /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
    /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 833.25.0)


texts: Create shortcut for interactive compile command

texts:
I know that we can start compile interactively using C-u M-x compile. Is there a way to start this whenever I run M-x compile? If that cannot be done, how do I create a shortcut to C-u M-x compile?

My current shortcut for M-x compile is:

(global-set-key (kbd "<f5>") 'compile)

This would execute normal compile (not interactive). Ideally, I would like to create a separate shortcut for interactive compile (for program that requires a lot of user inputs).

Please let me know and thanks for your help

Edit:  I forgot the mention that my compile command is also customized based on mode hook.  For example, below is how I customize it for C++ mode hook and Fortran mode hook:

(add-hook 'c++-mode-hook
        (lambda ()
        (set (make-local-variable 'compile-command)
            (concat "g++ -g -Wall -lm " buffer-file-name " && ./a.out"  ) )))

(add-hook 'fortran-mode-hook
        (lambda ()
        (set (make-local-variable 'compile-command)
            (concat "gfortran " buffer-file-name " && ./a.out"  ) )))


texts: Is there a way to create an org-mode link that opens help?

texts:
For example:
* Purpose
Keep some notes to elisp functions.

[[link:elisp-func][elisp-func help]]

I want to open the link via C-c C-o which would show a buffer with help as though I had ran instead:
C-h f elisp-func RET.
I'm not sure what the right format for the link would be though.  I'm suspecting it might be elisp itself, but haven't found the right way to do it.


texts: "error in process sentinel" whenever using %>% in an ESS R buffer

texts:
Whenever I include a pipe (%>%) in a ESS R buffer, I start getting the following error repeatedly, with lags that make editing almost impossible:

error in process sentinel: Not enough arguments for format string

Here is a simple example. If I create a buffer with only this function:

f <- function(x) {
    x %>% sqrt
}

I get the following error backtrace when doing any edit that buffer (that's after doing M-x toggle-debug-on-error):

Debugger entered--Lisp error: (error "Not enough arguments for format string")
  format-message(" Error in cat(\"@@warning: @@\", e) : \n  argument 2 (type 'list') cannot be handled by 'cat'\nCalls: esslint ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous> -> cat\nIn addition: Warning message:\nIn file(con, \"r\") : cannot open file 'f <- function(x) {\n    x %>% sqrt \n}': No such file or directory\nExecution halted\n")
  apply(format-message " Error in cat(\"@@warning: @@\", e) : \n  argument 2 (type 'list') cannot be handled by 'cat'\nCalls: esslint ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous> -> cat\nIn addition: Warning message:\nIn file(con, \"r\") : cannot open file 'f <- function(x) {\n    x %>% sqrt \n}': No such file or directory\nExecution halted\n" nil)
  flymake--log-1(:warning ess-r-flymake " Error in cat(\"@@warning: @@\", e) : \n  argument 2 (type 'list') cannot be handled by 'cat'\nCalls: esslint ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous> -> cat\nIn addition: Warning message:\nIn file(con, \"r\") : cannot open file 'f <- function(x) {\n    x %>% sqrt \n}': No such file or directory\nExecution halted\n")
  ess-r--flymake-check-errors()
  ess-r--flymake-parse-output(#<buffer  *ess-r-flymake*> #<buffer dummy.R> #f(compiled-function (&rest args) #<bytecode 0x45e4a775>))
  #f(compiled-function (proc event) #<bytecode 0x4307fddd>)(#<process ess-r-flymake> "exited abnormally with code 1\n")

It looks like the whole function is interpreted as a filename. Is this a bug in ESS? It seems unlikely, as this error is annoying enough that others would have reported it. Any idea on how to investigate this further?


texts: How to prevent the active region from setting the primary selection?

texts:
After switching to 24.5.11 from some ancient version, Emacs started to spam my primary selection: Whenever I mark a region, or even move the point using e.g. arrow keys when the mark is active, a new entry appears in my Parcellite history. This makes it unusable.

I want Emacs changing the primary selection when I mark some text using the mouse.
I don't care about what happens when using keyboard (pressing M-w is easy).
But there must be only a single such entry in the history.

Maybe it's not Emacs' thing at all and it's Parcellite capturing every selection? No idea, but it used to work on Ubuntu 10.04 (now I'm on 16.04).

1 x86_64-pc-linux-gnu, GTK+ Version 3.18.9) of 2016-04-17 on lgw01-04, modified by Debian


texts: Emacs vs subversion with passtype gpg-agent

texts:
I'm currently setting up a new Ubuntu box for myself at work. I generally have my work related stuff under subversion.

The default method for subversion to store passwords in Ubuntu seems to be passtype = gpg-agent. This works fine with svn on the command line. But if I want to commit from Emacs, it fails.

Ubuntu 18.04 LTS is using Emacs 25.2.2, if I run M-x vc-print-log I get an error similar to

svn: Unable to connect to a repository at URL https://svn....
svn: No more credentials or we tried too many times

If I use an account where the svn passtype is set to simple (aka plaintext password), Emacs has no issues.

Also, if I run svn log file first and then right after run M-x vc-print-log Emacs has no issues.

Any idea what is going on here, and how to fix it?

From looking at the sources (vc-svn.el) the default --non-interactive option, seems to be the problem. At least if I either change it to --force-interactive then it works. This that removing it also might be an option, will have to wait untill the last use is timed out.

Deleting the option does not solve the problem. But --force-interactive does.


texts: Migrate php-mode configuration to web-mode

texts:
I currently have my php-mode configuration like so:

(require 'php-mode)
(add-hook 'php-mode-hook
          (lambda ()
             (require 'ac-php-company)
             (company-mode t)
             (setq c-syntactic-indentation nil)
             (setq indent-tabs-mode t)
             (setq tab-width 4)
             (setq c-basic-indent 4)
             (c-set-offset 'topmost-intro 4)
             (c-set-offset 'cpp-macro -4)
             (add-to-list 'company-backends 'company-ac-php-backend)))

I would like to use this configuration to start using web-mode and have php in web-mode use this configuration, however I can't seem to figure out how to configure php in web-mode.

How would I use this configuration for php in web-mode?

EDIT

I should probably clarify a little better what I am trying to achieve for the PHP portion of web-mode.

One thing I do in php-mode is have it configured to indent my PHP code inside the <?php block like so:

<?php

    echo "hello world";
    do_some_func();

This is one of the main things I would like to do in web-mode, along with use company as my auto-complete engine.

Would anyone be able to provide me with examples or point me in the direction of solving this problem?

EDIT 2

Thanks to the comment by phils I was able to get my indentation set up correctly, however I still can't figure out how to set up company php in web mode, and googling doesn't seem to provide me with any answers. Any help would be much appreciated.

Sorry for not being as clear originally.


texts: Prevent magit-status from closing hunk preview window when magit-status buffer close

texts:
I configured magit-status to open selected buffer change hunk in other window rather then in the same window with:

    (setq magit-display-file-buffer-function
      (lambda (buffer)
        (setq current-prefix-arg t)
        (magit-display-file-buffer-traditional buffer)))

Now when I close status buffer the other window is closed as well and I assume window state is bring back to the one before magit-status was opened.

How can I keep this window and buffer open after closing magit-status window. The solution would be to prevent magit from restoring windows status before magit-status was opened.